opj_bio_create:
  114|   695M|{
  115|   695M|    opj_bio_t *bio = (opj_bio_t*)opj_malloc(sizeof(opj_bio_t));
  116|   695M|    return bio;
  117|   695M|}
opj_bio_destroy:
  120|   695M|{
  121|   695M|    if (bio) {
  ------------------
  |  Branch (121:9): [True: 695M, False: 0]
  ------------------
  122|   695M|        opj_free(bio);
  123|   695M|    }
  124|   695M|}
opj_bio_numbytes:
  127|   695M|{
  128|   695M|    return (bio->bp - bio->start);
  129|   695M|}
opj_bio_init_dec:
  141|   695M|{
  142|   695M|    bio->start = bp;
  143|   695M|    bio->end = bp + len;
  144|   695M|    bio->bp = bp;
  145|   695M|    bio->buf = 0;
  146|   695M|    bio->ct = 0;
  147|   695M|}
opj_bio_read:
  170|   702M|{
  171|   702M|    OPJ_INT32 i;
  172|   702M|    OPJ_UINT32 v;
  173|       |
  174|   702M|    assert((n > 0U) /* && (n <= 32U)*/);
  175|       |#ifdef OPJ_UBSAN_BUILD
  176|       |    /* This assert fails for some corrupted images which are gracefully rejected */
  177|       |    /* Add this assert only for ubsan build. */
  178|       |    /* This is the condition for overflow not to occur below which is needed because of OPJ_NOSANITIZE */
  179|       |    assert(n <= 32U);
  180|       |#endif
  181|   702M|    v = 0U;
  182|  1.41G|    for (i = (OPJ_INT32)n - 1; i >= 0; i--) {
  ------------------
  |  Branch (182:32): [True: 714M, False: 702M]
  ------------------
  183|   714M|        v |= opj_bio_getbit(bio) <<
  184|   714M|             i; /* can't overflow, opj_bio_getbit returns 0 or 1 */
  185|   714M|    }
  186|   702M|    return v;
  187|   702M|}
opj_bio_inalign:
  203|   695M|{
  204|   695M|    if ((bio->buf & 0xff) == 0xff) {
  ------------------
  |  Branch (204:9): [True: 58.8k, False: 695M]
  ------------------
  205|  58.8k|        if (! opj_bio_bytein(bio)) {
  ------------------
  |  Branch (205:13): [True: 5, False: 58.8k]
  ------------------
  206|      5|            return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
  207|      5|        }
  208|  58.8k|    }
  209|   695M|    bio->ct = 0;
  210|   695M|    return OPJ_TRUE;
  ------------------
  |  |  117|   695M|#define OPJ_TRUE 1
  ------------------
  211|   695M|}
bio.c:opj_bio_getbit:
   98|   714M|{
   99|   714M|    if (bio->ct == 0) {
  ------------------
  |  Branch (99:9): [True: 697M, False: 16.8M]
  ------------------
  100|   697M|        opj_bio_bytein(
  101|   697M|            bio); /* MSD: why not check the return value of this function ? */
  102|   697M|    }
  103|   714M|    bio->ct--;
  104|   714M|    return (bio->buf >> bio->ct) & 1;
  105|   714M|}
bio.c:opj_bio_bytein:
   87|   697M|{
   88|   697M|    bio->buf = (bio->buf << 8) & 0xffff;
   89|   697M|    bio->ct = bio->buf == 0xff00 ? 7 : 8;
  ------------------
  |  Branch (89:15): [True: 633k, False: 697M]
  ------------------
   90|   697M|    if ((OPJ_SIZE_T)bio->bp >= (OPJ_SIZE_T)bio->end) {
  ------------------
  |  Branch (90:9): [True: 693M, False: 4.06M]
  ------------------
   91|   693M|        return OPJ_FALSE;
  ------------------
  |  |  118|   693M|#define OPJ_FALSE 0
  ------------------
   92|   693M|    }
   93|  4.06M|    bio->buf |= *bio->bp++;
   94|  4.06M|    return OPJ_TRUE;
  ------------------
  |  |  117|  4.06M|#define OPJ_TRUE 1
  ------------------
   95|   697M|}

opj_read_bytes_LE:
   84|  1.84M|{
   85|  1.84M|    OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + p_nb_bytes - 1;
   86|  1.84M|    OPJ_UINT32 i;
   87|       |
   88|  1.84M|    assert(p_nb_bytes > 0 && p_nb_bytes <= sizeof(OPJ_UINT32));
   89|       |
   90|  1.84M|    *p_value = 0;
   91|  5.21M|    for (i = 0; i < p_nb_bytes; ++i) {
  ------------------
  |  Branch (91:17): [True: 3.36M, False: 1.84M]
  ------------------
   92|  3.36M|        *(l_data_ptr--) = *(p_buffer++);
   93|  3.36M|    }
   94|  1.84M|}
opj_read_double_LE:
  119|  1.59k|{
  120|  1.59k|    OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + sizeof(OPJ_FLOAT64) - 1;
  121|  1.59k|    OPJ_UINT32 i;
  122|  14.3k|    for (i = 0; i < sizeof(OPJ_FLOAT64); ++i) {
  ------------------
  |  Branch (122:17): [True: 12.7k, False: 1.59k]
  ------------------
  123|  12.7k|        *(l_data_ptr--) = *(p_buffer++);
  124|  12.7k|    }
  125|  1.59k|}
opj_read_float_LE:
  150|  2.11k|{
  151|  2.11k|    OPJ_BYTE * l_data_ptr = ((OPJ_BYTE *) p_value) + sizeof(OPJ_FLOAT32) - 1;
  152|  2.11k|    OPJ_UINT32 i;
  153|  10.5k|    for (i = 0; i < sizeof(OPJ_FLOAT32); ++i) {
  ------------------
  |  Branch (153:17): [True: 8.46k, False: 2.11k]
  ------------------
  154|  8.46k|        *(l_data_ptr--) = *(p_buffer++);
  155|  8.46k|    }
  156|  2.11k|}
opj_stream_create:
  160|  9.21k|{
  161|  9.21k|    opj_stream_private_t * l_stream = 00;
  162|  9.21k|    l_stream = (opj_stream_private_t*) opj_calloc(1, sizeof(opj_stream_private_t));
  163|  9.21k|    if (! l_stream) {
  ------------------
  |  Branch (163:9): [True: 0, False: 9.21k]
  ------------------
  164|      0|        return 00;
  165|      0|    }
  166|       |
  167|  9.21k|    l_stream->m_buffer_size = p_buffer_size;
  168|  9.21k|    l_stream->m_stored_data = (OPJ_BYTE *) opj_malloc(p_buffer_size);
  169|  9.21k|    if (! l_stream->m_stored_data) {
  ------------------
  |  Branch (169:9): [True: 0, False: 9.21k]
  ------------------
  170|      0|        opj_free(l_stream);
  171|      0|        return 00;
  172|      0|    }
  173|       |
  174|  9.21k|    l_stream->m_current_data = l_stream->m_stored_data;
  175|       |
  176|  9.21k|    if (l_is_input) {
  ------------------
  |  Branch (176:9): [True: 9.21k, False: 0]
  ------------------
  177|  9.21k|        l_stream->m_status |= OPJ_STREAM_STATUS_INPUT;
  ------------------
  |  |   74|  9.21k|#define OPJ_STREAM_STATUS_INPUT   0x2U
  ------------------
  178|  9.21k|        l_stream->m_opj_skip = opj_stream_read_skip;
  179|  9.21k|        l_stream->m_opj_seek = opj_stream_read_seek;
  180|  9.21k|    } else {
  181|      0|        l_stream->m_status |= OPJ_STREAM_STATUS_OUTPUT;
  ------------------
  |  |   73|      0|#define OPJ_STREAM_STATUS_OUTPUT  0x1U
  ------------------
  182|      0|        l_stream->m_opj_skip = opj_stream_write_skip;
  183|      0|        l_stream->m_opj_seek = opj_stream_write_seek;
  184|      0|    }
  185|       |
  186|  9.21k|    l_stream->m_read_fn = opj_stream_default_read;
  187|  9.21k|    l_stream->m_write_fn = opj_stream_default_write;
  188|  9.21k|    l_stream->m_skip_fn = opj_stream_default_skip;
  189|  9.21k|    l_stream->m_seek_fn = opj_stream_default_seek;
  190|       |
  191|  9.21k|    return (opj_stream_t *) l_stream;
  192|  9.21k|}
opj_stream_destroy:
  200|  9.21k|{
  201|  9.21k|    opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
  202|       |
  203|  9.21k|    if (l_stream) {
  ------------------
  |  Branch (203:9): [True: 9.21k, False: 0]
  ------------------
  204|  9.21k|        if (l_stream->m_free_user_data_fn) {
  ------------------
  |  Branch (204:13): [True: 0, False: 9.21k]
  ------------------
  205|      0|            l_stream->m_free_user_data_fn(l_stream->m_user_data);
  206|      0|        }
  207|  9.21k|        opj_free(l_stream->m_stored_data);
  208|  9.21k|        l_stream->m_stored_data = 00;
  209|  9.21k|        opj_free(l_stream);
  210|  9.21k|    }
  211|  9.21k|}
opj_stream_set_read_function:
  215|  9.21k|{
  216|  9.21k|    opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
  217|       |
  218|  9.21k|    if ((!l_stream) || (!(l_stream->m_status & OPJ_STREAM_STATUS_INPUT))) {
  ------------------
  |  |   74|  9.21k|#define OPJ_STREAM_STATUS_INPUT   0x2U
  ------------------
  |  Branch (218:9): [True: 0, False: 9.21k]
  |  Branch (218:24): [True: 0, False: 9.21k]
  ------------------
  219|      0|        return;
  220|      0|    }
  221|       |
  222|  9.21k|    l_stream->m_read_fn = p_function;
  223|  9.21k|}
opj_stream_set_seek_function:
  227|  9.21k|{
  228|  9.21k|    opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
  229|       |
  230|  9.21k|    if (!l_stream) {
  ------------------
  |  Branch (230:9): [True: 0, False: 9.21k]
  ------------------
  231|      0|        return;
  232|      0|    }
  233|  9.21k|    l_stream->m_seek_fn = p_function;
  234|  9.21k|}
opj_stream_set_skip_function:
  250|  9.21k|{
  251|  9.21k|    opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
  252|       |
  253|  9.21k|    if (! l_stream) {
  ------------------
  |  Branch (253:9): [True: 0, False: 9.21k]
  ------------------
  254|      0|        return;
  255|      0|    }
  256|       |
  257|  9.21k|    l_stream->m_skip_fn = p_function;
  258|  9.21k|}
opj_stream_set_user_data:
  262|  9.21k|{
  263|  9.21k|    opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
  264|  9.21k|    if (!l_stream) {
  ------------------
  |  Branch (264:9): [True: 0, False: 9.21k]
  ------------------
  265|      0|        return;
  266|      0|    }
  267|  9.21k|    l_stream->m_user_data = p_data;
  268|  9.21k|    l_stream->m_free_user_data_fn = p_function;
  269|  9.21k|}
opj_stream_set_user_data_length:
  273|  9.21k|{
  274|  9.21k|    opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
  275|  9.21k|    if (!l_stream) {
  ------------------
  |  Branch (275:9): [True: 0, False: 9.21k]
  ------------------
  276|      0|        return;
  277|      0|    }
  278|  9.21k|    l_stream->m_user_data_length = data_length;
  279|  9.21k|}
opj_stream_read_data:
  283|  1.25M|{
  284|  1.25M|    OPJ_SIZE_T l_read_nb_bytes = 0;
  285|  1.25M|    if (p_stream->m_bytes_in_buffer >= p_size) {
  ------------------
  |  Branch (285:9): [True: 1.24M, False: 15.5k]
  ------------------
  286|  1.24M|        memcpy(p_buffer, p_stream->m_current_data, p_size);
  287|  1.24M|        p_stream->m_current_data += p_size;
  288|  1.24M|        p_stream->m_bytes_in_buffer -= p_size;
  289|  1.24M|        l_read_nb_bytes += p_size;
  290|  1.24M|        p_stream->m_byte_offset += (OPJ_OFF_T)p_size;
  291|  1.24M|        return l_read_nb_bytes;
  292|  1.24M|    }
  293|       |
  294|       |    /* we are now in the case when the remaining data if not sufficient */
  295|  15.5k|    if (p_stream->m_status & OPJ_STREAM_STATUS_END) {
  ------------------
  |  |   75|  15.5k|#define OPJ_STREAM_STATUS_END     0x4U
  ------------------
  |  Branch (295:9): [True: 0, False: 15.5k]
  ------------------
  296|      0|        l_read_nb_bytes += p_stream->m_bytes_in_buffer;
  297|      0|        memcpy(p_buffer, p_stream->m_current_data, p_stream->m_bytes_in_buffer);
  298|      0|        p_stream->m_current_data += p_stream->m_bytes_in_buffer;
  299|      0|        p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
  300|      0|        p_stream->m_bytes_in_buffer = 0;
  301|      0|        return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T) - 1;
  ------------------
  |  Branch (301:16): [True: 0, False: 0]
  ------------------
  302|      0|    }
  303|       |
  304|       |    /* the flag is not set, we copy data and then do an actual read on the stream */
  305|  15.5k|    if (p_stream->m_bytes_in_buffer) {
  ------------------
  |  Branch (305:9): [True: 3.06k, False: 12.4k]
  ------------------
  306|  3.06k|        l_read_nb_bytes += p_stream->m_bytes_in_buffer;
  307|  3.06k|        memcpy(p_buffer, p_stream->m_current_data, p_stream->m_bytes_in_buffer);
  308|  3.06k|        p_stream->m_current_data = p_stream->m_stored_data;
  309|  3.06k|        p_buffer += p_stream->m_bytes_in_buffer;
  310|  3.06k|        p_size -= p_stream->m_bytes_in_buffer;
  311|  3.06k|        p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
  312|  3.06k|        p_stream->m_bytes_in_buffer = 0;
  313|  12.4k|    } else {
  314|       |        /* case where we are already at the end of the buffer
  315|       |           so reset the m_current_data to point to the start of the
  316|       |           stored buffer to get ready to read from disk*/
  317|  12.4k|        p_stream->m_current_data = p_stream->m_stored_data;
  318|  12.4k|    }
  319|       |
  320|  15.5k|    for (;;) {
  321|       |        /* we should read less than a chunk -> read a chunk */
  322|  15.5k|        if (p_size < p_stream->m_buffer_size) {
  ------------------
  |  Branch (322:13): [True: 14.5k, False: 993]
  ------------------
  323|       |            /* we should do an actual read on the media */
  324|  14.5k|            p_stream->m_bytes_in_buffer = p_stream->m_read_fn(p_stream->m_stored_data,
  325|  14.5k|                                          p_stream->m_buffer_size, p_stream->m_user_data);
  326|       |
  327|  14.5k|            if (p_stream->m_bytes_in_buffer == (OPJ_SIZE_T) - 1) {
  ------------------
  |  Branch (327:17): [True: 824, False: 13.7k]
  ------------------
  328|       |                /* end of stream */
  329|    824|                opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
  ------------------
  |  |   68|    824|#define EVT_INFO    4   /**< Debug event type */
  ------------------
  330|       |
  331|    824|                p_stream->m_bytes_in_buffer = 0;
  332|    824|                p_stream->m_status |= OPJ_STREAM_STATUS_END;
  ------------------
  |  |   75|    824|#define OPJ_STREAM_STATUS_END     0x4U
  ------------------
  333|       |                /* end of stream */
  334|    824|                return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T) - 1;
  ------------------
  |  Branch (334:24): [True: 363, False: 461]
  ------------------
  335|  13.7k|            } else if (p_stream->m_bytes_in_buffer < p_size) {
  ------------------
  |  Branch (335:24): [True: 17, False: 13.7k]
  ------------------
  336|       |                /* not enough data */
  337|     17|                l_read_nb_bytes += p_stream->m_bytes_in_buffer;
  338|     17|                memcpy(p_buffer, p_stream->m_current_data, p_stream->m_bytes_in_buffer);
  339|     17|                p_stream->m_current_data = p_stream->m_stored_data;
  340|     17|                p_buffer += p_stream->m_bytes_in_buffer;
  341|     17|                p_size -= p_stream->m_bytes_in_buffer;
  342|     17|                p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
  343|     17|                p_stream->m_bytes_in_buffer = 0;
  344|  13.7k|            } else {
  345|  13.7k|                l_read_nb_bytes += p_size;
  346|  13.7k|                memcpy(p_buffer, p_stream->m_current_data, p_size);
  347|  13.7k|                p_stream->m_current_data += p_size;
  348|  13.7k|                p_stream->m_bytes_in_buffer -= p_size;
  349|  13.7k|                p_stream->m_byte_offset += (OPJ_OFF_T)p_size;
  350|  13.7k|                return l_read_nb_bytes;
  351|  13.7k|            }
  352|  14.5k|        } else {
  353|       |            /* direct read on the dest buffer */
  354|    993|            p_stream->m_bytes_in_buffer = p_stream->m_read_fn(p_buffer, p_size,
  355|    993|                                          p_stream->m_user_data);
  356|       |
  357|    993|            if (p_stream->m_bytes_in_buffer == (OPJ_SIZE_T) - 1) {
  ------------------
  |  Branch (357:17): [True: 68, False: 925]
  ------------------
  358|       |                /*  end of stream */
  359|     68|                opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
  ------------------
  |  |   68|     68|#define EVT_INFO    4   /**< Debug event type */
  ------------------
  360|       |
  361|     68|                p_stream->m_bytes_in_buffer = 0;
  362|     68|                p_stream->m_status |= OPJ_STREAM_STATUS_END;
  ------------------
  |  |   75|     68|#define OPJ_STREAM_STATUS_END     0x4U
  ------------------
  363|       |                /* end of stream */
  364|     68|                return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T) - 1;
  ------------------
  |  Branch (364:24): [True: 46, False: 22]
  ------------------
  365|    925|            } else if (p_stream->m_bytes_in_buffer < p_size) {
  ------------------
  |  Branch (365:24): [True: 13, False: 912]
  ------------------
  366|       |                /* not enough data */
  367|     13|                l_read_nb_bytes += p_stream->m_bytes_in_buffer;
  368|     13|                p_stream->m_current_data = p_stream->m_stored_data;
  369|     13|                p_buffer += p_stream->m_bytes_in_buffer;
  370|     13|                p_size -= p_stream->m_bytes_in_buffer;
  371|     13|                p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
  372|     13|                p_stream->m_bytes_in_buffer = 0;
  373|    912|            } else {
  374|       |                /* we have read the exact size */
  375|    912|                l_read_nb_bytes += p_stream->m_bytes_in_buffer;
  376|    912|                p_stream->m_byte_offset += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
  377|    912|                p_stream->m_current_data = p_stream->m_stored_data;
  378|    912|                p_stream->m_bytes_in_buffer = 0;
  379|    912|                return l_read_nb_bytes;
  380|    912|            }
  381|    993|        }
  382|  15.5k|    }
  383|  15.5k|}
opj_stream_read_skip:
  465|  3.48k|{
  466|  3.48k|    OPJ_OFF_T l_skip_nb_bytes = 0;
  467|  3.48k|    OPJ_OFF_T l_current_skip_nb_bytes = 0;
  468|       |
  469|  3.48k|    assert(p_size >= 0);
  470|       |
  471|  3.48k|    if (p_stream->m_bytes_in_buffer >= (OPJ_SIZE_T)p_size) {
  ------------------
  |  Branch (471:9): [True: 2.71k, False: 765]
  ------------------
  472|  2.71k|        p_stream->m_current_data += p_size;
  473|       |        /* it is safe to cast p_size to OPJ_SIZE_T since it is <= m_bytes_in_buffer
  474|       |        which is of type OPJ_SIZE_T */
  475|  2.71k|        p_stream->m_bytes_in_buffer -= (OPJ_SIZE_T)p_size;
  476|  2.71k|        l_skip_nb_bytes += p_size;
  477|  2.71k|        p_stream->m_byte_offset += l_skip_nb_bytes;
  478|  2.71k|        return l_skip_nb_bytes;
  479|  2.71k|    }
  480|       |
  481|       |    /* we are now in the case when the remaining data if not sufficient */
  482|    765|    if (p_stream->m_status & OPJ_STREAM_STATUS_END) {
  ------------------
  |  |   75|    765|#define OPJ_STREAM_STATUS_END     0x4U
  ------------------
  |  Branch (482:9): [True: 0, False: 765]
  ------------------
  483|      0|        l_skip_nb_bytes += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
  484|      0|        p_stream->m_current_data += p_stream->m_bytes_in_buffer;
  485|      0|        p_stream->m_bytes_in_buffer = 0;
  486|      0|        p_stream->m_byte_offset += l_skip_nb_bytes;
  487|      0|        return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) - 1;
  ------------------
  |  Branch (487:16): [True: 0, False: 0]
  ------------------
  488|      0|    }
  489|       |
  490|       |    /* the flag is not set, we copy data and then do an actual skip on the stream */
  491|    765|    if (p_stream->m_bytes_in_buffer) {
  ------------------
  |  Branch (491:9): [True: 735, False: 30]
  ------------------
  492|    735|        l_skip_nb_bytes += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
  493|    735|        p_stream->m_current_data = p_stream->m_stored_data;
  494|    735|        p_size -= (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
  495|    735|        p_stream->m_bytes_in_buffer = 0;
  496|    735|    }
  497|       |
  498|  1.22k|    while (p_size > 0) {
  ------------------
  |  Branch (498:12): [True: 765, False: 458]
  ------------------
  499|       |        /* Check if we are going beyond the end of file. Most skip_fn do not */
  500|       |        /* check that, but we must be careful not to advance m_byte_offset */
  501|       |        /* beyond m_user_data_length, otherwise */
  502|       |        /* opj_stream_get_number_byte_left() will assert. */
  503|    765|        if ((OPJ_UINT64)(p_stream->m_byte_offset + l_skip_nb_bytes + p_size) >
  ------------------
  |  Branch (503:13): [True: 307, False: 458]
  ------------------
  504|    765|                p_stream->m_user_data_length) {
  505|    307|            opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
  ------------------
  |  |   68|    307|#define EVT_INFO    4   /**< Debug event type */
  ------------------
  506|       |
  507|    307|            p_stream->m_byte_offset += l_skip_nb_bytes;
  508|    307|            l_skip_nb_bytes = (OPJ_OFF_T)(p_stream->m_user_data_length -
  509|    307|                                          (OPJ_UINT64)p_stream->m_byte_offset);
  510|       |
  511|    307|            opj_stream_read_seek(p_stream, (OPJ_OFF_T)p_stream->m_user_data_length,
  512|    307|                                 p_event_mgr);
  513|    307|            p_stream->m_status |= OPJ_STREAM_STATUS_END;
  ------------------
  |  |   75|    307|#define OPJ_STREAM_STATUS_END     0x4U
  ------------------
  514|       |
  515|       |            /* end if stream */
  516|    307|            return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) - 1;
  ------------------
  |  Branch (516:20): [True: 42, False: 265]
  ------------------
  517|    307|        }
  518|       |
  519|       |        /* we should do an actual skip on the media */
  520|    458|        l_current_skip_nb_bytes = p_stream->m_skip_fn(p_size, p_stream->m_user_data);
  521|    458|        if (l_current_skip_nb_bytes == (OPJ_OFF_T) - 1) {
  ------------------
  |  Branch (521:13): [True: 0, False: 458]
  ------------------
  522|      0|            opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
  ------------------
  |  |   68|      0|#define EVT_INFO    4   /**< Debug event type */
  ------------------
  523|       |
  524|      0|            p_stream->m_status |= OPJ_STREAM_STATUS_END;
  ------------------
  |  |   75|      0|#define OPJ_STREAM_STATUS_END     0x4U
  ------------------
  525|      0|            p_stream->m_byte_offset += l_skip_nb_bytes;
  526|       |            /* end if stream */
  527|      0|            return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) - 1;
  ------------------
  |  Branch (527:20): [True: 0, False: 0]
  ------------------
  528|      0|        }
  529|    458|        p_size -= l_current_skip_nb_bytes;
  530|    458|        l_skip_nb_bytes += l_current_skip_nb_bytes;
  531|    458|    }
  532|       |
  533|    458|    p_stream->m_byte_offset += l_skip_nb_bytes;
  534|       |
  535|    458|    return l_skip_nb_bytes;
  536|    765|}
opj_stream_tell:
  580|   203k|{
  581|   203k|    return p_stream->m_byte_offset;
  582|   203k|}
opj_stream_get_number_byte_left:
  585|  71.9k|{
  586|  71.9k|    assert(p_stream->m_byte_offset >= 0);
  587|  71.9k|    assert(p_stream->m_user_data_length >= (OPJ_UINT64)p_stream->m_byte_offset);
  588|  71.9k|    return p_stream->m_user_data_length ?
  ------------------
  |  Branch (588:12): [True: 71.9k, False: 0]
  ------------------
  589|  71.9k|           (OPJ_OFF_T)(p_stream->m_user_data_length) - p_stream->m_byte_offset :
  590|  71.9k|           0;
  591|  71.9k|}
opj_stream_skip:
  595|  3.48k|{
  596|  3.48k|    assert(p_size >= 0);
  597|  3.48k|    return p_stream->m_opj_skip(p_stream, p_size, p_event_mgr);
  598|  3.48k|}
opj_stream_read_seek:
  602|  1.01k|{
  603|  1.01k|    OPJ_ARG_NOT_USED(p_event_mgr);
  ------------------
  |  |  142|  1.01k|#define OPJ_ARG_NOT_USED(x) (void)(x)
  ------------------
  604|  1.01k|    p_stream->m_current_data = p_stream->m_stored_data;
  605|  1.01k|    p_stream->m_bytes_in_buffer = 0;
  606|       |
  607|  1.01k|    if (!(p_stream->m_seek_fn(p_size, p_stream->m_user_data))) {
  ------------------
  |  Branch (607:9): [True: 0, False: 1.01k]
  ------------------
  608|      0|        p_stream->m_status |= OPJ_STREAM_STATUS_END;
  ------------------
  |  |   75|      0|#define OPJ_STREAM_STATUS_END     0x4U
  ------------------
  609|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  610|  1.01k|    } else {
  611|       |        /* reset stream status */
  612|  1.01k|        p_stream->m_status &= (~OPJ_STREAM_STATUS_END);
  ------------------
  |  |   75|  1.01k|#define OPJ_STREAM_STATUS_END     0x4U
  ------------------
  613|  1.01k|        p_stream->m_byte_offset = p_size;
  614|       |
  615|  1.01k|    }
  616|       |
  617|  1.01k|    return OPJ_TRUE;
  ------------------
  |  |  117|  1.01k|#define OPJ_TRUE 1
  ------------------
  618|  1.01k|}
opj_stream_seek:
  643|    711|{
  644|    711|    assert(p_size >= 0);
  645|    711|    return p_stream->m_opj_seek(p_stream, p_size, p_event_mgr);
  646|    711|}
opj_stream_has_seek:
  649|    714|{
  650|    714|    return p_stream->m_seek_fn != opj_stream_default_seek;
  651|    714|}

opj_dwt_decode:
 1915|  16.4k|{
 1916|  16.4k|    if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (1916:9): [True: 11.4k, False: 5.03k]
  ------------------
 1917|  11.4k|        return opj_dwt_decode_tile(p_tcd->thread_pool, tilec, numres);
 1918|  11.4k|    } else {
 1919|  5.03k|        return opj_dwt_decode_partial_tile(tilec, numres);
 1920|  5.03k|    }
 1921|  16.4k|}
opj_dwt_decode_real:
 3761|  9.37k|{
 3762|  9.37k|    if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (3762:9): [True: 5.81k, False: 3.56k]
  ------------------
 3763|  5.81k|        return opj_dwt_decode_tile_97(p_tcd->thread_pool, tilec, numres);
 3764|  5.81k|    } else {
 3765|  3.56k|        return opj_dwt_decode_partial_97(tilec, numres);
 3766|  3.56k|    }
 3767|  9.37k|}
dwt.c:opj_dwt_max_resolution:
 1995|  13.8k|{
 1996|  13.8k|    OPJ_UINT32 mr   = 0;
 1997|  13.8k|    OPJ_UINT32 w;
 1998|   163k|    while (--i) {
  ------------------
  |  Branch (1998:12): [True: 149k, False: 13.8k]
  ------------------
 1999|   149k|        ++r;
 2000|   149k|        if (mr < (w = (OPJ_UINT32)(r->x1 - r->x0))) {
  ------------------
  |  Branch (2000:13): [True: 36.3k, False: 113k]
  ------------------
 2001|  36.3k|            mr = w ;
 2002|  36.3k|        }
 2003|   149k|        if (mr < (w = (OPJ_UINT32)(r->y1 - r->y0))) {
  ------------------
  |  Branch (2003:13): [True: 39.4k, False: 110k]
  ------------------
 2004|  39.4k|            mr = w ;
 2005|  39.4k|        }
 2006|   149k|    }
 2007|  13.8k|    return mr ;
 2008|  13.8k|}
dwt.c:opj_dwt_decode_tile:
 2069|  11.4k|{
 2070|  11.4k|    opj_dwt_t h;
 2071|  11.4k|    opj_dwt_t v;
 2072|       |
 2073|  11.4k|    opj_tcd_resolution_t* tr = tilec->resolutions;
 2074|       |
 2075|  11.4k|    OPJ_UINT32 rw = (OPJ_UINT32)(tr->x1 -
 2076|  11.4k|                                 tr->x0);  /* width of the resolution level computed */
 2077|  11.4k|    OPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 -
 2078|  11.4k|                                 tr->y0);  /* height of the resolution level computed */
 2079|       |
 2080|  11.4k|    OPJ_UINT32 w = (OPJ_UINT32)(tilec->resolutions[tilec->minimum_num_resolutions -
 2081|  11.4k|                                                               1].x1 -
 2082|  11.4k|                                tilec->resolutions[tilec->minimum_num_resolutions - 1].x0);
 2083|  11.4k|    OPJ_SIZE_T h_mem_size;
 2084|  11.4k|    int num_threads;
 2085|       |
 2086|  11.4k|    if (numres == 1U) {
  ------------------
  |  Branch (2086:9): [True: 5.73k, False: 5.68k]
  ------------------
 2087|  5.73k|        return OPJ_TRUE;
  ------------------
  |  |  117|  5.73k|#define OPJ_TRUE 1
  ------------------
 2088|  5.73k|    }
 2089|  5.68k|    num_threads = opj_thread_pool_get_thread_count(tp);
 2090|  5.68k|    h_mem_size = opj_dwt_max_resolution(tr, numres);
 2091|       |    /* overflow check */
 2092|  5.68k|    if (h_mem_size > (SIZE_MAX / PARALLEL_COLS_53 / sizeof(OPJ_INT32))) {
  ------------------
  |  |   78|  5.68k|#define PARALLEL_COLS_53     (2*VREG_INT_COUNT)
  |  |  ------------------
  |  |  |  |   74|  5.68k|#define VREG_INT_COUNT       4
  |  |  ------------------
  ------------------
  |  Branch (2092:9): [True: 0, False: 5.68k]
  ------------------
 2093|       |        /* FIXME event manager error callback */
 2094|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2095|      0|    }
 2096|       |    /* We need PARALLEL_COLS_53 times the height of the array, */
 2097|       |    /* since for the vertical pass */
 2098|       |    /* we process PARALLEL_COLS_53 columns at a time */
 2099|  5.68k|    h_mem_size *= PARALLEL_COLS_53 * sizeof(OPJ_INT32);
  ------------------
  |  |   78|  5.68k|#define PARALLEL_COLS_53     (2*VREG_INT_COUNT)
  |  |  ------------------
  |  |  |  |   74|  5.68k|#define VREG_INT_COUNT       4
  |  |  ------------------
  ------------------
 2100|  5.68k|    h.mem = (OPJ_INT32*)opj_aligned_32_malloc(h_mem_size);
 2101|  5.68k|    if (! h.mem) {
  ------------------
  |  Branch (2101:9): [True: 0, False: 5.68k]
  ------------------
 2102|       |        /* FIXME event manager error callback */
 2103|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2104|      0|    }
 2105|       |
 2106|  5.68k|    v.mem = h.mem;
 2107|       |
 2108|  76.4k|    while (--numres) {
  ------------------
  |  Branch (2108:12): [True: 70.8k, False: 5.68k]
  ------------------
 2109|  70.8k|        OPJ_INT32 * OPJ_RESTRICT tiledp = tilec->data;
 2110|  70.8k|        OPJ_UINT32 j;
 2111|       |
 2112|  70.8k|        ++tr;
 2113|  70.8k|        h.sn = (OPJ_INT32)rw;
 2114|  70.8k|        v.sn = (OPJ_INT32)rh;
 2115|       |
 2116|  70.8k|        rw = (OPJ_UINT32)(tr->x1 - tr->x0);
 2117|  70.8k|        rh = (OPJ_UINT32)(tr->y1 - tr->y0);
 2118|       |
 2119|  70.8k|        h.dn = (OPJ_INT32)(rw - (OPJ_UINT32)h.sn);
 2120|  70.8k|        h.cas = tr->x0 % 2;
 2121|       |
 2122|  70.8k|        if (num_threads <= 1 || rh <= 1) {
  ------------------
  |  Branch (2122:13): [True: 70.8k, False: 0]
  |  Branch (2122:33): [True: 0, False: 0]
  ------------------
 2123|   980k|            for (j = 0; j < rh; ++j) {
  ------------------
  |  Branch (2123:25): [True: 909k, False: 70.8k]
  ------------------
 2124|   909k|                opj_idwt53_h(&h, &tiledp[(OPJ_SIZE_T)j * w]);
 2125|   909k|            }
 2126|  70.8k|        } else {
 2127|      0|            OPJ_UINT32 num_jobs = (OPJ_UINT32)num_threads;
 2128|      0|            OPJ_UINT32 step_j;
 2129|       |
 2130|      0|            if (rh < num_jobs) {
  ------------------
  |  Branch (2130:17): [True: 0, False: 0]
  ------------------
 2131|      0|                num_jobs = rh;
 2132|      0|            }
 2133|      0|            step_j = (rh / num_jobs);
 2134|       |
 2135|      0|            for (j = 0; j < num_jobs; j++) {
  ------------------
  |  Branch (2135:25): [True: 0, False: 0]
  ------------------
 2136|      0|                opj_dwt_decode_h_job_t* job;
 2137|       |
 2138|      0|                job = (opj_dwt_decode_h_job_t*) opj_malloc(sizeof(opj_dwt_decode_h_job_t));
 2139|      0|                if (!job) {
  ------------------
  |  Branch (2139:21): [True: 0, False: 0]
  ------------------
 2140|       |                    /* It would be nice to fallback to single thread case, but */
 2141|       |                    /* unfortunately some jobs may be launched and have modified */
 2142|       |                    /* tiledp, so it is not practical to recover from that error */
 2143|       |                    /* FIXME event manager error callback */
 2144|      0|                    opj_thread_pool_wait_completion(tp, 0);
 2145|      0|                    opj_aligned_free(h.mem);
 2146|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2147|      0|                }
 2148|      0|                job->h = h;
 2149|      0|                job->rw = rw;
 2150|      0|                job->w = w;
 2151|      0|                job->tiledp = tiledp;
 2152|      0|                job->min_j = j * step_j;
 2153|      0|                job->max_j = (j + 1U) * step_j; /* this can overflow */
 2154|      0|                if (j == (num_jobs - 1U)) {  /* this will take care of the overflow */
  ------------------
  |  Branch (2154:21): [True: 0, False: 0]
  ------------------
 2155|      0|                    job->max_j = rh;
 2156|      0|                }
 2157|      0|                job->h.mem = (OPJ_INT32*)opj_aligned_32_malloc(h_mem_size);
 2158|      0|                if (!job->h.mem) {
  ------------------
  |  Branch (2158:21): [True: 0, False: 0]
  ------------------
 2159|       |                    /* FIXME event manager error callback */
 2160|      0|                    opj_thread_pool_wait_completion(tp, 0);
 2161|      0|                    opj_free(job);
 2162|      0|                    opj_aligned_free(h.mem);
 2163|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2164|      0|                }
 2165|      0|                opj_thread_pool_submit_job(tp, opj_dwt_decode_h_func, job);
 2166|      0|            }
 2167|      0|            opj_thread_pool_wait_completion(tp, 0);
 2168|      0|        }
 2169|       |
 2170|  70.8k|        v.dn = (OPJ_INT32)(rh - (OPJ_UINT32)v.sn);
 2171|  70.8k|        v.cas = tr->y0 % 2;
 2172|       |
 2173|  70.8k|        if (num_threads <= 1 || rw <= 1) {
  ------------------
  |  Branch (2173:13): [True: 70.8k, False: 0]
  |  Branch (2173:33): [True: 0, False: 0]
  ------------------
 2174|   146k|            for (j = 0; j + PARALLEL_COLS_53 <= rw;
  ------------------
  |  |   78|   146k|#define PARALLEL_COLS_53     (2*VREG_INT_COUNT)
  |  |  ------------------
  |  |  |  |   74|   146k|#define VREG_INT_COUNT       4
  |  |  ------------------
  ------------------
  |  Branch (2174:25): [True: 75.9k, False: 70.8k]
  ------------------
 2175|  75.9k|                    j += PARALLEL_COLS_53) {
  ------------------
  |  |   78|  75.9k|#define PARALLEL_COLS_53     (2*VREG_INT_COUNT)
  |  |  ------------------
  |  |  |  |   74|  75.9k|#define VREG_INT_COUNT       4
  |  |  ------------------
  ------------------
 2176|  75.9k|                opj_idwt53_v(&v, &tiledp[j], (OPJ_SIZE_T)w, PARALLEL_COLS_53);
  ------------------
  |  |   78|  75.9k|#define PARALLEL_COLS_53     (2*VREG_INT_COUNT)
  |  |  ------------------
  |  |  |  |   74|  75.9k|#define VREG_INT_COUNT       4
  |  |  ------------------
  ------------------
 2177|  75.9k|            }
 2178|  70.8k|            if (j < rw) {
  ------------------
  |  Branch (2178:17): [True: 21.5k, False: 49.2k]
  ------------------
 2179|  21.5k|                opj_idwt53_v(&v, &tiledp[j], (OPJ_SIZE_T)w, (OPJ_INT32)(rw - j));
 2180|  21.5k|            }
 2181|  70.8k|        } else {
 2182|      0|            OPJ_UINT32 num_jobs = (OPJ_UINT32)num_threads;
 2183|      0|            OPJ_UINT32 step_j;
 2184|       |
 2185|      0|            if (rw < num_jobs) {
  ------------------
  |  Branch (2185:17): [True: 0, False: 0]
  ------------------
 2186|      0|                num_jobs = rw;
 2187|      0|            }
 2188|      0|            step_j = (rw / num_jobs);
 2189|       |
 2190|      0|            for (j = 0; j < num_jobs; j++) {
  ------------------
  |  Branch (2190:25): [True: 0, False: 0]
  ------------------
 2191|      0|                opj_dwt_decode_v_job_t* job;
 2192|       |
 2193|      0|                job = (opj_dwt_decode_v_job_t*) opj_malloc(sizeof(opj_dwt_decode_v_job_t));
 2194|      0|                if (!job) {
  ------------------
  |  Branch (2194:21): [True: 0, False: 0]
  ------------------
 2195|       |                    /* It would be nice to fallback to single thread case, but */
 2196|       |                    /* unfortunately some jobs may be launched and have modified */
 2197|       |                    /* tiledp, so it is not practical to recover from that error */
 2198|       |                    /* FIXME event manager error callback */
 2199|      0|                    opj_thread_pool_wait_completion(tp, 0);
 2200|      0|                    opj_aligned_free(v.mem);
 2201|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2202|      0|                }
 2203|      0|                job->v = v;
 2204|      0|                job->rh = rh;
 2205|      0|                job->w = w;
 2206|      0|                job->tiledp = tiledp;
 2207|      0|                job->min_j = j * step_j;
 2208|      0|                job->max_j = (j + 1U) * step_j; /* this can overflow */
 2209|      0|                if (j == (num_jobs - 1U)) {  /* this will take care of the overflow */
  ------------------
  |  Branch (2209:21): [True: 0, False: 0]
  ------------------
 2210|      0|                    job->max_j = rw;
 2211|      0|                }
 2212|      0|                job->v.mem = (OPJ_INT32*)opj_aligned_32_malloc(h_mem_size);
 2213|      0|                if (!job->v.mem) {
  ------------------
  |  Branch (2213:21): [True: 0, False: 0]
  ------------------
 2214|       |                    /* FIXME event manager error callback */
 2215|      0|                    opj_thread_pool_wait_completion(tp, 0);
 2216|      0|                    opj_free(job);
 2217|      0|                    opj_aligned_free(v.mem);
 2218|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2219|      0|                }
 2220|      0|                opj_thread_pool_submit_job(tp, opj_dwt_decode_v_func, job);
 2221|      0|            }
 2222|      0|            opj_thread_pool_wait_completion(tp, 0);
 2223|      0|        }
 2224|  70.8k|    }
 2225|  5.68k|    opj_aligned_free(h.mem);
 2226|  5.68k|    return OPJ_TRUE;
  ------------------
  |  |  117|  5.68k|#define OPJ_TRUE 1
  ------------------
 2227|  5.68k|}
dwt.c:opj_idwt53_h:
  482|   909k|{
  483|       |#ifdef STANDARD_SLOW_VERSION
  484|       |    /* For documentation purpose */
  485|       |    opj_dwt_interleave_h(dwt, tiledp);
  486|       |    opj_dwt_decode_1(dwt);
  487|       |    memcpy(tiledp, dwt->mem, (OPJ_UINT32)(dwt->sn + dwt->dn) * sizeof(OPJ_INT32));
  488|       |#else
  489|   909k|    const OPJ_INT32 sn = dwt->sn;
  490|   909k|    const OPJ_INT32 len = sn + dwt->dn;
  491|   909k|    if (dwt->cas == 0) { /* Left-most sample is on even coordinate */
  ------------------
  |  Branch (491:9): [True: 424k, False: 485k]
  ------------------
  492|   424k|        if (len > 1) {
  ------------------
  |  Branch (492:13): [True: 253k, False: 171k]
  ------------------
  493|   253k|            opj_idwt53_h_cas0(dwt->mem, sn, len, tiledp);
  494|   253k|        } else {
  495|       |            /* Unmodified value */
  496|   171k|        }
  497|   485k|    } else { /* Left-most sample is on odd coordinate */
  498|   485k|        if (len == 1) {
  ------------------
  |  Branch (498:13): [True: 18.1k, False: 466k]
  ------------------
  499|  18.1k|            tiledp[0] /= 2;
  500|   466k|        } else if (len == 2) {
  ------------------
  |  Branch (500:20): [True: 3.40k, False: 463k]
  ------------------
  501|  3.40k|            OPJ_INT32* out = dwt->mem;
  502|  3.40k|            const OPJ_INT32* in_even = &tiledp[sn];
  503|  3.40k|            const OPJ_INT32* in_odd = &tiledp[0];
  504|  3.40k|            out[1] = in_odd[0] - ((in_even[0] + 1) >> 1);
  505|  3.40k|            out[0] = in_even[0] + out[1];
  506|  3.40k|            memcpy(tiledp, dwt->mem, (OPJ_UINT32)len * sizeof(OPJ_INT32));
  507|   463k|        } else if (len > 2) {
  ------------------
  |  Branch (507:20): [True: 453k, False: 10.5k]
  ------------------
  508|   453k|            opj_idwt53_h_cas1(dwt->mem, sn, len, tiledp);
  509|   453k|        }
  510|   485k|    }
  511|   909k|#endif
  512|   909k|}
dwt.c:opj_idwt53_h_cas0:
  339|   253k|{
  340|   253k|    OPJ_INT32 i, j;
  341|   253k|    const OPJ_INT32* in_even = &tiledp[0];
  342|   253k|    const OPJ_INT32* in_odd = &tiledp[sn];
  343|       |
  344|       |#ifdef TWO_PASS_VERSION
  345|       |    /* For documentation purpose: performs lifting in two iterations, */
  346|       |    /* but without explicit interleaving */
  347|       |
  348|       |    assert(len > 1);
  349|       |
  350|       |    /* Even */
  351|       |    tmp[0] = in_even[0] - ((in_odd[0] + 1) >> 1);
  352|       |    for (i = 2, j = 0; i <= len - 2; i += 2, j++) {
  353|       |        tmp[i] = in_even[j + 1] - ((in_odd[j] + in_odd[j + 1] + 2) >> 2);
  354|       |    }
  355|       |    if (len & 1) { /* if len is odd */
  356|       |        tmp[len - 1] = in_even[(len - 1) / 2] - ((in_odd[(len - 2) / 2] + 1) >> 1);
  357|       |    }
  358|       |
  359|       |    /* Odd */
  360|       |    for (i = 1, j = 0; i < len - 1; i += 2, j++) {
  361|       |        tmp[i] = in_odd[j] + ((tmp[i - 1] + tmp[i + 1]) >> 1);
  362|       |    }
  363|       |    if (!(len & 1)) { /* if len is even */
  364|       |        tmp[len - 1] = in_odd[(len - 1) / 2] + tmp[len - 2];
  365|       |    }
  366|       |#else
  367|   253k|    OPJ_INT32 d1c, d1n, s1n, s0c, s0n;
  368|       |
  369|   253k|    assert(len > 1);
  370|       |
  371|       |    /* Improved version of the TWO_PASS_VERSION: */
  372|       |    /* Performs lifting in one single iteration. Saves memory */
  373|       |    /* accesses and explicit interleaving. */
  374|   253k|    s1n = in_even[0];
  375|   253k|    d1n = in_odd[0];
  376|   253k|    s0n = s1n - ((d1n + 1) >> 1);
  377|       |
  378|  10.6M|    for (i = 0, j = 1; i < (len - 3); i += 2, j++) {
  ------------------
  |  Branch (378:24): [True: 10.3M, False: 253k]
  ------------------
  379|  10.3M|        d1c = d1n;
  380|  10.3M|        s0c = s0n;
  381|       |
  382|  10.3M|        s1n = in_even[j];
  383|  10.3M|        d1n = in_odd[j];
  384|       |
  385|  10.3M|        s0n = s1n - ((d1c + d1n + 2) >> 2);
  386|       |
  387|  10.3M|        tmp[i  ] = s0c;
  388|  10.3M|        tmp[i + 1] = opj_int_add_no_overflow(d1c, opj_int_add_no_overflow(s0c,
  389|  10.3M|                                             s0n) >> 1);
  390|  10.3M|    }
  391|       |
  392|   253k|    tmp[i] = s0n;
  393|       |
  394|   253k|    if (len & 1) {
  ------------------
  |  Branch (394:9): [True: 45.2k, False: 207k]
  ------------------
  395|  45.2k|        tmp[len - 1] = in_even[(len - 1) / 2] - ((d1n + 1) >> 1);
  396|  45.2k|        tmp[len - 2] = d1n + ((s0n + tmp[len - 1]) >> 1);
  397|   207k|    } else {
  398|   207k|        tmp[len - 1] = d1n + s0n;
  399|   207k|    }
  400|   253k|#endif
  401|   253k|    memcpy(tiledp, tmp, (OPJ_UINT32)len * sizeof(OPJ_INT32));
  402|   253k|}
dwt.c:opj_idwt53_h_cas1:
  408|   453k|{
  409|   453k|    OPJ_INT32 i, j;
  410|   453k|    const OPJ_INT32* in_even = &tiledp[sn];
  411|   453k|    const OPJ_INT32* in_odd = &tiledp[0];
  412|       |
  413|       |#ifdef TWO_PASS_VERSION
  414|       |    /* For documentation purpose: performs lifting in two iterations, */
  415|       |    /* but without explicit interleaving */
  416|       |
  417|       |    assert(len > 2);
  418|       |
  419|       |    /* Odd */
  420|       |    for (i = 1, j = 0; i < len - 1; i += 2, j++) {
  421|       |        tmp[i] = in_odd[j] - ((in_even[j] + in_even[j + 1] + 2) >> 2);
  422|       |    }
  423|       |    if (!(len & 1)) {
  424|       |        tmp[len - 1] = in_odd[len / 2 - 1] - ((in_even[len / 2 - 1] + 1) >> 1);
  425|       |    }
  426|       |
  427|       |    /* Even */
  428|       |    tmp[0] = in_even[0] + tmp[1];
  429|       |    for (i = 2, j = 1; i < len - 1; i += 2, j++) {
  430|       |        tmp[i] = in_even[j] + ((tmp[i + 1] + tmp[i - 1]) >> 1);
  431|       |    }
  432|       |    if (len & 1) {
  433|       |        tmp[len - 1] = in_even[len / 2] + tmp[len - 2];
  434|       |    }
  435|       |#else
  436|   453k|    OPJ_INT32 s1, s2, dc, dn;
  437|       |
  438|   453k|    assert(len > 2);
  439|       |
  440|       |    /* Improved version of the TWO_PASS_VERSION: */
  441|       |    /* Performs lifting in one single iteration. Saves memory */
  442|       |    /* accesses and explicit interleaving. */
  443|       |
  444|   453k|    s1 = in_even[1];
  445|   453k|    dc = in_odd[0] - ((in_even[0] + s1 + 2) >> 2);
  446|   453k|    tmp[0] = in_even[0] + dc;
  447|       |
  448|  17.9M|    for (i = 1, j = 1; i < (len - 2 - !(len & 1)); i += 2, j++) {
  ------------------
  |  Branch (448:24): [True: 17.4M, False: 453k]
  ------------------
  449|       |
  450|  17.4M|        s2 = in_even[j + 1];
  451|       |
  452|  17.4M|        dn = in_odd[j] - ((s1 + s2 + 2) >> 2);
  453|  17.4M|        tmp[i  ] = dc;
  454|  17.4M|        tmp[i + 1] = opj_int_add_no_overflow(s1, opj_int_add_no_overflow(dn, dc) >> 1);
  455|       |
  456|  17.4M|        dc = dn;
  457|  17.4M|        s1 = s2;
  458|  17.4M|    }
  459|       |
  460|   453k|    tmp[i] = dc;
  461|       |
  462|   453k|    if (!(len & 1)) {
  ------------------
  |  Branch (462:9): [True: 164k, False: 288k]
  ------------------
  463|   164k|        dn = in_odd[len / 2 - 1] - ((s1 + 1) >> 1);
  464|   164k|        tmp[len - 2] = s1 + ((dn + dc) >> 1);
  465|   164k|        tmp[len - 1] = dn;
  466|   288k|    } else {
  467|   288k|        tmp[len - 1] = s1 + dc;
  468|   288k|    }
  469|   453k|#endif
  470|   453k|    memcpy(tiledp, tmp, (OPJ_UINT32)len * sizeof(OPJ_INT32));
  471|   453k|}
dwt.c:opj_idwt53_v:
  880|  97.5k|{
  881|       |#ifdef STANDARD_SLOW_VERSION
  882|       |    /* For documentation purpose */
  883|       |    OPJ_INT32 k, c;
  884|       |    for (c = 0; c < nb_cols; c ++) {
  885|       |        opj_dwt_interleave_v(dwt, tiledp_col + c, stride);
  886|       |        opj_dwt_decode_1(dwt);
  887|       |        for (k = 0; k < dwt->sn + dwt->dn; ++k) {
  888|       |            tiledp_col[c + k * stride] = dwt->mem[k];
  889|       |        }
  890|       |    }
  891|       |#else
  892|  97.5k|    const OPJ_INT32 sn = dwt->sn;
  893|  97.5k|    const OPJ_INT32 len = sn + dwt->dn;
  894|  97.5k|    if (dwt->cas == 0) {
  ------------------
  |  Branch (894:9): [True: 64.9k, False: 32.6k]
  ------------------
  895|       |        /* If len == 1, unmodified value */
  896|       |
  897|  64.9k|#if (defined(__SSE2__) || defined(__AVX2__))
  898|  64.9k|        if (len > 1 && nb_cols == PARALLEL_COLS_53) {
  ------------------
  |  |   78|  61.8k|#define PARALLEL_COLS_53     (2*VREG_INT_COUNT)
  |  |  ------------------
  |  |  |  |   74|  61.8k|#define VREG_INT_COUNT       4
  |  |  ------------------
  ------------------
  |  Branch (898:13): [True: 61.8k, False: 3.12k]
  |  Branch (898:24): [True: 53.3k, False: 8.48k]
  ------------------
  899|       |            /* Same as below general case, except that thanks to SSE2/AVX2 */
  900|       |            /* we can efficiently process 8/16 columns in parallel */
  901|  53.3k|            opj_idwt53_v_cas0_mcols_SSE2_OR_AVX2(dwt->mem, sn, len, tiledp_col, stride);
  902|  53.3k|            return;
  903|  53.3k|        }
  904|  11.6k|#endif
  905|  11.6k|        if (len > 1) {
  ------------------
  |  Branch (905:13): [True: 8.48k, False: 3.12k]
  ------------------
  906|  8.48k|            OPJ_INT32 c;
  907|  34.7k|            for (c = 0; c < nb_cols; c++, tiledp_col++) {
  ------------------
  |  Branch (907:25): [True: 26.2k, False: 8.48k]
  ------------------
  908|  26.2k|                opj_idwt3_v_cas0(dwt->mem, sn, len, tiledp_col, stride);
  909|  26.2k|            }
  910|  8.48k|            return;
  911|  8.48k|        }
  912|  32.6k|    } else {
  913|  32.6k|        if (len == 1) {
  ------------------
  |  Branch (913:13): [True: 4.04k, False: 28.5k]
  ------------------
  914|  4.04k|            OPJ_INT32 c;
  915|  24.3k|            for (c = 0; c < nb_cols; c++, tiledp_col++) {
  ------------------
  |  Branch (915:25): [True: 20.3k, False: 4.04k]
  ------------------
  916|  20.3k|                tiledp_col[0] /= 2;
  917|  20.3k|            }
  918|  4.04k|            return;
  919|  4.04k|        }
  920|       |
  921|  28.5k|        if (len == 2) {
  ------------------
  |  Branch (921:13): [True: 1.08k, False: 27.5k]
  ------------------
  922|  1.08k|            OPJ_INT32 c;
  923|  1.08k|            OPJ_INT32* out = dwt->mem;
  924|  6.70k|            for (c = 0; c < nb_cols; c++, tiledp_col++) {
  ------------------
  |  Branch (924:25): [True: 5.62k, False: 1.08k]
  ------------------
  925|  5.62k|                OPJ_INT32 i;
  926|  5.62k|                const OPJ_INT32* in_even = &tiledp_col[(OPJ_SIZE_T)sn * stride];
  927|  5.62k|                const OPJ_INT32* in_odd = &tiledp_col[0];
  928|       |
  929|  5.62k|                out[1] = in_odd[0] - ((in_even[0] + 1) >> 1);
  930|  5.62k|                out[0] = in_even[0] + out[1];
  931|       |
  932|  16.8k|                for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (932:29): [True: 11.2k, False: 5.62k]
  ------------------
  933|  11.2k|                    tiledp_col[(OPJ_SIZE_T)i * stride] = out[i];
  934|  11.2k|                }
  935|  5.62k|            }
  936|       |
  937|  1.08k|            return;
  938|  1.08k|        }
  939|       |
  940|  27.5k|#if (defined(__SSE2__) || defined(__AVX2__))
  941|  27.5k|        if (len > 2 && nb_cols == PARALLEL_COLS_53) {
  ------------------
  |  |   78|  23.9k|#define PARALLEL_COLS_53     (2*VREG_INT_COUNT)
  |  |  ------------------
  |  |  |  |   74|  23.9k|#define VREG_INT_COUNT       4
  |  |  ------------------
  ------------------
  |  Branch (941:13): [True: 23.9k, False: 3.58k]
  |  Branch (941:24): [True: 17.9k, False: 5.95k]
  ------------------
  942|       |            /* Same as below general case, except that thanks to SSE2/AVX2 */
  943|       |            /* we can efficiently process 8/16 columns in parallel */
  944|  17.9k|            opj_idwt53_v_cas1_mcols_SSE2_OR_AVX2(dwt->mem, sn, len, tiledp_col, stride);
  945|  17.9k|            return;
  946|  17.9k|        }
  947|  9.53k|#endif
  948|  9.53k|        if (len > 2) {
  ------------------
  |  Branch (948:13): [True: 5.95k, False: 3.58k]
  ------------------
  949|  5.95k|            OPJ_INT32 c;
  950|  23.0k|            for (c = 0; c < nb_cols; c++, tiledp_col++) {
  ------------------
  |  Branch (950:25): [True: 17.1k, False: 5.95k]
  ------------------
  951|  17.1k|                opj_idwt3_v_cas1(dwt->mem, sn, len, tiledp_col, stride);
  952|  17.1k|            }
  953|  5.95k|            return;
  954|  5.95k|        }
  955|  9.53k|    }
  956|  97.5k|#endif
  957|  97.5k|}
dwt.c:opj_idwt53_v_cas0_mcols_SSE2_OR_AVX2:
  568|  53.3k|{
  569|  53.3k|    const OPJ_INT32* in_even = &tiledp_col[0];
  570|  53.3k|    const OPJ_INT32* in_odd = &tiledp_col[(OPJ_SIZE_T)sn * stride];
  571|       |
  572|  53.3k|    OPJ_INT32 i;
  573|  53.3k|    OPJ_SIZE_T j;
  574|  53.3k|    VREG d1c_0, d1n_0, s1n_0, s0c_0, s0n_0;
  ------------------
  |  |  528|  53.3k|#define VREG        __m128i
  ------------------
  575|  53.3k|    VREG d1c_1, d1n_1, s1n_1, s0c_1, s0n_1;
  ------------------
  |  |  528|  53.3k|#define VREG        __m128i
  ------------------
  576|  53.3k|    const VREG two = LOAD_CST(2);
  ------------------
  |  |  529|  53.3k|#define LOAD_CST(x) _mm_set1_epi32(x)
  ------------------
  577|       |
  578|  53.3k|    assert(len > 1);
  579|       |#if __AVX2__
  580|       |    assert(PARALLEL_COLS_53 == 16);
  581|       |    assert(VREG_INT_COUNT == 8);
  582|       |#else
  583|  53.3k|    assert(PARALLEL_COLS_53 == 8);
  584|  53.3k|    assert(VREG_INT_COUNT == 4);
  585|  53.3k|#endif
  586|       |
  587|       |    /* Note: loads of input even/odd values must be done in a unaligned */
  588|       |    /* fashion. But stores in tmp can be done with aligned store, since */
  589|       |    /* the temporary buffer is properly aligned */
  590|  53.3k|    assert((OPJ_SIZE_T)tmp % (sizeof(OPJ_INT32) * VREG_INT_COUNT) == 0);
  591|       |
  592|  53.3k|    s1n_0 = LOADU(in_even + 0);
  ------------------
  |  |  531|  53.3k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  593|  53.3k|    s1n_1 = LOADU(in_even + VREG_INT_COUNT);
  ------------------
  |  |  531|  53.3k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  594|  53.3k|    d1n_0 = LOADU(in_odd);
  ------------------
  |  |  531|  53.3k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  595|  53.3k|    d1n_1 = LOADU(in_odd + VREG_INT_COUNT);
  ------------------
  |  |  531|  53.3k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  596|       |
  597|       |    /* s0n = s1n - ((d1n + 1) >> 1); <==> */
  598|       |    /* s0n = s1n - ((d1n + d1n + 2) >> 2); */
  599|  53.3k|    s0n_0 = SUB(s1n_0, SAR(ADD3(d1n_0, d1n_0, two), 2));
  ------------------
  |  |  535|  53.3k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  600|  53.3k|    s0n_1 = SUB(s1n_1, SAR(ADD3(d1n_1, d1n_1, two), 2));
  ------------------
  |  |  535|  53.3k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  601|       |
  602|  2.88M|    for (i = 0, j = 1; i < (len - 3); i += 2, j++) {
  ------------------
  |  Branch (602:24): [True: 2.82M, False: 53.3k]
  ------------------
  603|  2.82M|        d1c_0 = d1n_0;
  604|  2.82M|        s0c_0 = s0n_0;
  605|  2.82M|        d1c_1 = d1n_1;
  606|  2.82M|        s0c_1 = s0n_1;
  607|       |
  608|  2.82M|        s1n_0 = LOADU(in_even + j * stride);
  ------------------
  |  |  531|  2.82M|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  609|  2.82M|        s1n_1 = LOADU(in_even + j * stride + VREG_INT_COUNT);
  ------------------
  |  |  531|  2.82M|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  610|  2.82M|        d1n_0 = LOADU(in_odd + j * stride);
  ------------------
  |  |  531|  2.82M|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  611|  2.82M|        d1n_1 = LOADU(in_odd + j * stride + VREG_INT_COUNT);
  ------------------
  |  |  531|  2.82M|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  612|       |
  613|       |        /*s0n = s1n - ((d1c + d1n + 2) >> 2);*/
  614|  2.82M|        s0n_0 = SUB(s1n_0, SAR(ADD3(d1c_0, d1n_0, two), 2));
  ------------------
  |  |  535|  2.82M|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  615|  2.82M|        s0n_1 = SUB(s1n_1, SAR(ADD3(d1c_1, d1n_1, two), 2));
  ------------------
  |  |  535|  2.82M|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  616|       |
  617|  2.82M|        STORE(tmp + PARALLEL_COLS_53 * (i + 0), s0c_0);
  ------------------
  |  |  532|  2.82M|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  618|  2.82M|        STORE(tmp + PARALLEL_COLS_53 * (i + 0) + VREG_INT_COUNT, s0c_1);
  ------------------
  |  |  532|  2.82M|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  619|       |
  620|       |        /* d1c + ((s0c + s0n) >> 1) */
  621|  2.82M|        STORE(tmp + PARALLEL_COLS_53 * (i + 1) + 0,
  ------------------
  |  |  532|  2.82M|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  622|  2.82M|              ADD(d1c_0, SAR(ADD(s0c_0, s0n_0), 1)));
  623|  2.82M|        STORE(tmp + PARALLEL_COLS_53 * (i + 1) + VREG_INT_COUNT,
  ------------------
  |  |  532|  2.82M|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  624|  2.82M|              ADD(d1c_1, SAR(ADD(s0c_1, s0n_1), 1)));
  625|  2.82M|    }
  626|       |
  627|  53.3k|    STORE(tmp + PARALLEL_COLS_53 * (i + 0) + 0, s0n_0);
  ------------------
  |  |  532|  53.3k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  628|  53.3k|    STORE(tmp + PARALLEL_COLS_53 * (i + 0) + VREG_INT_COUNT, s0n_1);
  ------------------
  |  |  532|  53.3k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  629|       |
  630|  53.3k|    if (len & 1) {
  ------------------
  |  Branch (630:9): [True: 27.2k, False: 26.0k]
  ------------------
  631|  27.2k|        VREG tmp_len_minus_1;
  ------------------
  |  |  528|  27.2k|#define VREG        __m128i
  ------------------
  632|  27.2k|        s1n_0 = LOADU(in_even + (OPJ_SIZE_T)((len - 1) / 2) * stride);
  ------------------
  |  |  531|  27.2k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  633|       |        /* tmp_len_minus_1 = s1n - ((d1n + 1) >> 1); */
  634|  27.2k|        tmp_len_minus_1 = SUB(s1n_0, SAR(ADD3(d1n_0, d1n_0, two), 2));
  ------------------
  |  |  535|  27.2k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  635|  27.2k|        STORE(tmp + PARALLEL_COLS_53 * (len - 1), tmp_len_minus_1);
  ------------------
  |  |  532|  27.2k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  636|       |        /* d1n + ((s0n + tmp_len_minus_1) >> 1) */
  637|  27.2k|        STORE(tmp + PARALLEL_COLS_53 * (len - 2),
  ------------------
  |  |  532|  27.2k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  638|  27.2k|              ADD(d1n_0, SAR(ADD(s0n_0, tmp_len_minus_1), 1)));
  639|       |
  640|  27.2k|        s1n_1 = LOADU(in_even + (OPJ_SIZE_T)((len - 1) / 2) * stride + VREG_INT_COUNT);
  ------------------
  |  |  531|  27.2k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  641|       |        /* tmp_len_minus_1 = s1n - ((d1n + 1) >> 1); */
  642|  27.2k|        tmp_len_minus_1 = SUB(s1n_1, SAR(ADD3(d1n_1, d1n_1, two), 2));
  ------------------
  |  |  535|  27.2k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  643|  27.2k|        STORE(tmp + PARALLEL_COLS_53 * (len - 1) + VREG_INT_COUNT,
  ------------------
  |  |  532|  27.2k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  644|  27.2k|              tmp_len_minus_1);
  645|       |        /* d1n + ((s0n + tmp_len_minus_1) >> 1) */
  646|  27.2k|        STORE(tmp + PARALLEL_COLS_53 * (len - 2) + VREG_INT_COUNT,
  ------------------
  |  |  532|  27.2k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  647|  27.2k|              ADD(d1n_1, SAR(ADD(s0n_1, tmp_len_minus_1), 1)));
  648|       |
  649|       |
  650|  27.2k|    } else {
  651|  26.0k|        STORE(tmp + PARALLEL_COLS_53 * (len - 1) + 0,
  ------------------
  |  |  532|  26.0k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  652|  26.0k|              ADD(d1n_0, s0n_0));
  653|  26.0k|        STORE(tmp + PARALLEL_COLS_53 * (len - 1) + VREG_INT_COUNT,
  ------------------
  |  |  532|  26.0k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  654|  26.0k|              ADD(d1n_1, s0n_1));
  655|  26.0k|    }
  656|       |
  657|  53.3k|    opj_idwt53_v_final_memcpy(tiledp_col, tmp, len, stride);
  658|  53.3k|}
dwt.c:opj_idwt53_v_final_memcpy:
  545|  71.2k|{
  546|  71.2k|    OPJ_INT32 i;
  547|  6.99M|    for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (547:17): [True: 6.92M, False: 71.2k]
  ------------------
  548|       |        /* A memcpy(&tiledp_col[i * stride + 0],
  549|       |                    &tmp[PARALLEL_COLS_53 * i + 0],
  550|       |                    PARALLEL_COLS_53 * sizeof(OPJ_INT32))
  551|       |           would do but would be a tiny bit slower.
  552|       |           We can take here advantage of our knowledge of alignment */
  553|  6.92M|        STOREU(&tiledp_col[(OPJ_SIZE_T)i * stride + 0],
  ------------------
  |  |  533|  6.92M|#define STOREU(x,y) _mm_storeu_si128((VREG*)(x),(y))
  ------------------
  554|  6.92M|               LOAD(&tmp[PARALLEL_COLS_53 * i + 0]));
  555|  6.92M|        STOREU(&tiledp_col[(OPJ_SIZE_T)i * stride + VREG_INT_COUNT],
  ------------------
  |  |  533|  6.92M|#define STOREU(x,y) _mm_storeu_si128((VREG*)(x),(y))
  ------------------
  556|  6.92M|               LOAD(&tmp[PARALLEL_COLS_53 * i + VREG_INT_COUNT]));
  557|  6.92M|    }
  558|  71.2k|}
dwt.c:opj_idwt3_v_cas0:
  780|  26.2k|{
  781|  26.2k|    OPJ_INT32 i, j;
  782|  26.2k|    OPJ_INT32 d1c, d1n, s1n, s0c, s0n;
  783|       |
  784|  26.2k|    assert(len > 1);
  785|       |
  786|       |    /* Performs lifting in one single iteration. Saves memory */
  787|       |    /* accesses and explicit interleaving. */
  788|       |
  789|  26.2k|    s1n = tiledp_col[0];
  790|  26.2k|    d1n = tiledp_col[(OPJ_SIZE_T)sn * stride];
  791|  26.2k|    s0n = s1n - ((d1n + 1) >> 1);
  792|       |
  793|   923k|    for (i = 0, j = 0; i < (len - 3); i += 2, j++) {
  ------------------
  |  Branch (793:24): [True: 897k, False: 26.2k]
  ------------------
  794|   897k|        d1c = d1n;
  795|   897k|        s0c = s0n;
  796|       |
  797|   897k|        s1n = tiledp_col[(OPJ_SIZE_T)(j + 1) * stride];
  798|   897k|        d1n = tiledp_col[(OPJ_SIZE_T)(sn + j + 1) * stride];
  799|       |
  800|   897k|        s0n = opj_int_sub_no_overflow(s1n,
  801|   897k|                                      opj_int_add_no_overflow(opj_int_add_no_overflow(d1c, d1n), 2) >> 2);
  802|       |
  803|   897k|        tmp[i  ] = s0c;
  804|   897k|        tmp[i + 1] = opj_int_add_no_overflow(d1c, opj_int_add_no_overflow(s0c,
  805|   897k|                                             s0n) >> 1);
  806|   897k|    }
  807|       |
  808|  26.2k|    tmp[i] = s0n;
  809|       |
  810|  26.2k|    if (len & 1) {
  ------------------
  |  Branch (810:9): [True: 13.2k, False: 12.9k]
  ------------------
  811|  13.2k|        tmp[len - 1] =
  812|  13.2k|            tiledp_col[(OPJ_SIZE_T)((len - 1) / 2) * stride] -
  813|  13.2k|            ((d1n + 1) >> 1);
  814|  13.2k|        tmp[len - 2] = d1n + ((s0n + tmp[len - 1]) >> 1);
  815|  13.2k|    } else {
  816|  12.9k|        tmp[len - 1] = d1n + s0n;
  817|  12.9k|    }
  818|       |
  819|  1.88M|    for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (819:17): [True: 1.86M, False: 26.2k]
  ------------------
  820|  1.86M|        tiledp_col[(OPJ_SIZE_T)i * stride] = tmp[i];
  821|  1.86M|    }
  822|  26.2k|}
dwt.c:opj_idwt53_v_cas1_mcols_SSE2_OR_AVX2:
  669|  17.9k|{
  670|  17.9k|    OPJ_INT32 i;
  671|  17.9k|    OPJ_SIZE_T j;
  672|       |
  673|  17.9k|    VREG s1_0, s2_0, dc_0, dn_0;
  ------------------
  |  |  528|  17.9k|#define VREG        __m128i
  ------------------
  674|  17.9k|    VREG s1_1, s2_1, dc_1, dn_1;
  ------------------
  |  |  528|  17.9k|#define VREG        __m128i
  ------------------
  675|  17.9k|    const VREG two = LOAD_CST(2);
  ------------------
  |  |  529|  17.9k|#define LOAD_CST(x) _mm_set1_epi32(x)
  ------------------
  676|       |
  677|  17.9k|    const OPJ_INT32* in_even = &tiledp_col[(OPJ_SIZE_T)sn * stride];
  678|  17.9k|    const OPJ_INT32* in_odd = &tiledp_col[0];
  679|       |
  680|  17.9k|    assert(len > 2);
  681|       |#if __AVX2__
  682|       |    assert(PARALLEL_COLS_53 == 16);
  683|       |    assert(VREG_INT_COUNT == 8);
  684|       |#else
  685|  17.9k|    assert(PARALLEL_COLS_53 == 8);
  686|  17.9k|    assert(VREG_INT_COUNT == 4);
  687|  17.9k|#endif
  688|       |
  689|       |    /* Note: loads of input even/odd values must be done in a unaligned */
  690|       |    /* fashion. But stores in tmp can be done with aligned store, since */
  691|       |    /* the temporary buffer is properly aligned */
  692|  17.9k|    assert((OPJ_SIZE_T)tmp % (sizeof(OPJ_INT32) * VREG_INT_COUNT) == 0);
  693|       |
  694|  17.9k|    s1_0 = LOADU(in_even + stride);
  ------------------
  |  |  531|  17.9k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  695|       |    /* in_odd[0] - ((in_even[0] + s1 + 2) >> 2); */
  696|  17.9k|    dc_0 = SUB(LOADU(in_odd + 0),
  ------------------
  |  |  535|  17.9k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  697|  17.9k|               SAR(ADD3(LOADU(in_even + 0), s1_0, two), 2));
  698|  17.9k|    STORE(tmp + PARALLEL_COLS_53 * 0, ADD(LOADU(in_even + 0), dc_0));
  ------------------
  |  |  532|  17.9k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  699|       |
  700|  17.9k|    s1_1 = LOADU(in_even + stride + VREG_INT_COUNT);
  ------------------
  |  |  531|  17.9k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  701|       |    /* in_odd[0] - ((in_even[0] + s1 + 2) >> 2); */
  702|  17.9k|    dc_1 = SUB(LOADU(in_odd + VREG_INT_COUNT),
  ------------------
  |  |  535|  17.9k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  703|  17.9k|               SAR(ADD3(LOADU(in_even + VREG_INT_COUNT), s1_1, two), 2));
  704|  17.9k|    STORE(tmp + PARALLEL_COLS_53 * 0 + VREG_INT_COUNT,
  ------------------
  |  |  532|  17.9k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  705|  17.9k|          ADD(LOADU(in_even + VREG_INT_COUNT), dc_1));
  706|       |
  707|   553k|    for (i = 1, j = 1; i < (len - 2 - !(len & 1)); i += 2, j++) {
  ------------------
  |  Branch (707:24): [True: 535k, False: 17.9k]
  ------------------
  708|       |
  709|   535k|        s2_0 = LOADU(in_even + (j + 1) * stride);
  ------------------
  |  |  531|   535k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  710|   535k|        s2_1 = LOADU(in_even + (j + 1) * stride + VREG_INT_COUNT);
  ------------------
  |  |  531|   535k|#define LOADU(x)    _mm_loadu_si128((const VREG*)(x))
  ------------------
  711|       |
  712|       |        /* dn = in_odd[j * stride] - ((s1 + s2 + 2) >> 2); */
  713|   535k|        dn_0 = SUB(LOADU(in_odd + j * stride),
  ------------------
  |  |  535|   535k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  714|   535k|                   SAR(ADD3(s1_0, s2_0, two), 2));
  715|   535k|        dn_1 = SUB(LOADU(in_odd + j * stride + VREG_INT_COUNT),
  ------------------
  |  |  535|   535k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  716|   535k|                   SAR(ADD3(s1_1, s2_1, two), 2));
  717|       |
  718|   535k|        STORE(tmp + PARALLEL_COLS_53 * i, dc_0);
  ------------------
  |  |  532|   535k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  719|   535k|        STORE(tmp + PARALLEL_COLS_53 * i + VREG_INT_COUNT, dc_1);
  ------------------
  |  |  532|   535k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  720|       |
  721|       |        /* tmp[i + 1] = s1 + ((dn + dc) >> 1); */
  722|   535k|        STORE(tmp + PARALLEL_COLS_53 * (i + 1) + 0,
  ------------------
  |  |  532|   535k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  723|   535k|              ADD(s1_0, SAR(ADD(dn_0, dc_0), 1)));
  724|   535k|        STORE(tmp + PARALLEL_COLS_53 * (i + 1) + VREG_INT_COUNT,
  ------------------
  |  |  532|   535k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  725|   535k|              ADD(s1_1, SAR(ADD(dn_1, dc_1), 1)));
  726|       |
  727|   535k|        dc_0 = dn_0;
  728|   535k|        s1_0 = s2_0;
  729|   535k|        dc_1 = dn_1;
  730|   535k|        s1_1 = s2_1;
  731|   535k|    }
  732|  17.9k|    STORE(tmp + PARALLEL_COLS_53 * i, dc_0);
  ------------------
  |  |  532|  17.9k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  733|  17.9k|    STORE(tmp + PARALLEL_COLS_53 * i + VREG_INT_COUNT, dc_1);
  ------------------
  |  |  532|  17.9k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  734|       |
  735|  17.9k|    if (!(len & 1)) {
  ------------------
  |  Branch (735:9): [True: 6.48k, False: 11.4k]
  ------------------
  736|       |        /*dn = in_odd[(len / 2 - 1) * stride] - ((s1 + 1) >> 1); */
  737|  6.48k|        dn_0 = SUB(LOADU(in_odd + (OPJ_SIZE_T)(len / 2 - 1) * stride),
  ------------------
  |  |  535|  6.48k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  738|  6.48k|                   SAR(ADD3(s1_0, s1_0, two), 2));
  739|  6.48k|        dn_1 = SUB(LOADU(in_odd + (OPJ_SIZE_T)(len / 2 - 1) * stride + VREG_INT_COUNT),
  ------------------
  |  |  535|  6.48k|#define SUB(x,y)    _mm_sub_epi32((x),(y))
  ------------------
  740|  6.48k|                   SAR(ADD3(s1_1, s1_1, two), 2));
  741|       |
  742|       |        /* tmp[len - 2] = s1 + ((dn + dc) >> 1); */
  743|  6.48k|        STORE(tmp + PARALLEL_COLS_53 * (len - 2) + 0,
  ------------------
  |  |  532|  6.48k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  744|  6.48k|              ADD(s1_0, SAR(ADD(dn_0, dc_0), 1)));
  745|  6.48k|        STORE(tmp + PARALLEL_COLS_53 * (len - 2) + VREG_INT_COUNT,
  ------------------
  |  |  532|  6.48k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  746|  6.48k|              ADD(s1_1, SAR(ADD(dn_1, dc_1), 1)));
  747|       |
  748|  6.48k|        STORE(tmp + PARALLEL_COLS_53 * (len - 1) + 0, dn_0);
  ------------------
  |  |  532|  6.48k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  749|  6.48k|        STORE(tmp + PARALLEL_COLS_53 * (len - 1) + VREG_INT_COUNT, dn_1);
  ------------------
  |  |  532|  6.48k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  750|  11.4k|    } else {
  751|  11.4k|        STORE(tmp + PARALLEL_COLS_53 * (len - 1) + 0, ADD(s1_0, dc_0));
  ------------------
  |  |  532|  11.4k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  752|  11.4k|        STORE(tmp + PARALLEL_COLS_53 * (len - 1) + VREG_INT_COUNT,
  ------------------
  |  |  532|  11.4k|#define STORE(x,y)  _mm_store_si128((VREG*)(x),(y))
  ------------------
  753|  11.4k|              ADD(s1_1, dc_1));
  754|  11.4k|    }
  755|       |
  756|  17.9k|    opj_idwt53_v_final_memcpy(tiledp_col, tmp, len, stride);
  757|  17.9k|}
dwt.c:opj_idwt3_v_cas1:
  832|  17.1k|{
  833|  17.1k|    OPJ_INT32 i, j;
  834|  17.1k|    OPJ_INT32 s1, s2, dc, dn;
  835|  17.1k|    const OPJ_INT32* in_even = &tiledp_col[(OPJ_SIZE_T)sn * stride];
  836|  17.1k|    const OPJ_INT32* in_odd = &tiledp_col[0];
  837|       |
  838|  17.1k|    assert(len > 2);
  839|       |
  840|       |    /* Performs lifting in one single iteration. Saves memory */
  841|       |    /* accesses and explicit interleaving. */
  842|       |
  843|  17.1k|    s1 = in_even[stride];
  844|  17.1k|    dc = in_odd[0] - ((in_even[0] + s1 + 2) >> 2);
  845|  17.1k|    tmp[0] = in_even[0] + dc;
  846|   325k|    for (i = 1, j = 1; i < (len - 2 - !(len & 1)); i += 2, j++) {
  ------------------
  |  Branch (846:24): [True: 308k, False: 17.1k]
  ------------------
  847|       |
  848|   308k|        s2 = in_even[(OPJ_SIZE_T)(j + 1) * stride];
  849|       |
  850|   308k|        dn = in_odd[(OPJ_SIZE_T)j * stride] - ((s1 + s2 + 2) >> 2);
  851|   308k|        tmp[i  ] = dc;
  852|   308k|        tmp[i + 1] = s1 + ((dn + dc) >> 1);
  853|       |
  854|   308k|        dc = dn;
  855|   308k|        s1 = s2;
  856|   308k|    }
  857|  17.1k|    tmp[i] = dc;
  858|  17.1k|    if (!(len & 1)) {
  ------------------
  |  Branch (858:9): [True: 6.79k, False: 10.3k]
  ------------------
  859|  6.79k|        dn = in_odd[(OPJ_SIZE_T)(len / 2 - 1) * stride] - ((s1 + 1) >> 1);
  860|  6.79k|        tmp[len - 2] = s1 + ((dn + dc) >> 1);
  861|  6.79k|        tmp[len - 1] = dn;
  862|  10.3k|    } else {
  863|  10.3k|        tmp[len - 1] = s1 + dc;
  864|  10.3k|    }
  865|       |
  866|   692k|    for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (866:17): [True: 675k, False: 17.1k]
  ------------------
  867|   675k|        tiledp_col[(OPJ_SIZE_T)i * stride] = tmp[i];
  868|   675k|    }
  869|  17.1k|}
dwt.c:opj_dwt_decode_partial_tile:
 2622|  5.03k|{
 2623|  5.03k|    opj_sparse_array_int32_t* sa;
 2624|  5.03k|    opj_dwt_t h;
 2625|  5.03k|    opj_dwt_t v;
 2626|  5.03k|    OPJ_UINT32 resno;
 2627|       |    /* This value matches the maximum left/right extension given in tables */
 2628|       |    /* F.2 and F.3 of the standard. */
 2629|  5.03k|    const OPJ_UINT32 filter_width = 2U;
 2630|       |
 2631|  5.03k|    opj_tcd_resolution_t* tr = tilec->resolutions;
 2632|  5.03k|    opj_tcd_resolution_t* tr_max = &(tilec->resolutions[numres - 1]);
 2633|       |
 2634|  5.03k|    OPJ_UINT32 rw = (OPJ_UINT32)(tr->x1 -
 2635|  5.03k|                                 tr->x0);  /* width of the resolution level computed */
 2636|  5.03k|    OPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 -
 2637|  5.03k|                                 tr->y0);  /* height of the resolution level computed */
 2638|       |
 2639|  5.03k|    OPJ_SIZE_T h_mem_size;
 2640|       |
 2641|       |    /* Compute the intersection of the area of interest, expressed in tile coordinates */
 2642|       |    /* with the tile coordinates */
 2643|  5.03k|    OPJ_UINT32 win_tcx0 = tilec->win_x0;
 2644|  5.03k|    OPJ_UINT32 win_tcy0 = tilec->win_y0;
 2645|  5.03k|    OPJ_UINT32 win_tcx1 = tilec->win_x1;
 2646|  5.03k|    OPJ_UINT32 win_tcy1 = tilec->win_y1;
 2647|       |
 2648|  5.03k|    if (tr_max->x0 == tr_max->x1 || tr_max->y0 == tr_max->y1) {
  ------------------
  |  Branch (2648:9): [True: 327, False: 4.71k]
  |  Branch (2648:37): [True: 234, False: 4.47k]
  ------------------
 2649|    561|        return OPJ_TRUE;
  ------------------
  |  |  117|    561|#define OPJ_TRUE 1
  ------------------
 2650|    561|    }
 2651|       |
 2652|  4.47k|    sa = opj_dwt_init_sparse_array(tilec, numres);
 2653|  4.47k|    if (sa == NULL) {
  ------------------
  |  Branch (2653:9): [True: 0, False: 4.47k]
  ------------------
 2654|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2655|      0|    }
 2656|       |
 2657|  4.47k|    if (numres == 1U) {
  ------------------
  |  Branch (2657:9): [True: 2.32k, False: 2.15k]
  ------------------
 2658|  2.32k|        OPJ_BOOL ret = opj_sparse_array_int32_read(sa,
 2659|  2.32k|                       tr_max->win_x0 - (OPJ_UINT32)tr_max->x0,
 2660|  2.32k|                       tr_max->win_y0 - (OPJ_UINT32)tr_max->y0,
 2661|  2.32k|                       tr_max->win_x1 - (OPJ_UINT32)tr_max->x0,
 2662|  2.32k|                       tr_max->win_y1 - (OPJ_UINT32)tr_max->y0,
 2663|  2.32k|                       tilec->data_win,
 2664|  2.32k|                       1, tr_max->win_x1 - tr_max->win_x0,
 2665|  2.32k|                       OPJ_TRUE);
  ------------------
  |  |  117|  2.32k|#define OPJ_TRUE 1
  ------------------
 2666|  2.32k|        assert(ret);
 2667|  2.32k|        OPJ_UNUSED(ret);
  ------------------
  |  |  219|  2.32k|#define OPJ_UNUSED(x) (void)x
  ------------------
 2668|  2.32k|        opj_sparse_array_int32_free(sa);
 2669|  2.32k|        return OPJ_TRUE;
  ------------------
  |  |  117|  2.32k|#define OPJ_TRUE 1
  ------------------
 2670|  2.32k|    }
 2671|  2.15k|    h_mem_size = opj_dwt_max_resolution(tr, numres);
 2672|       |    /* overflow check */
 2673|       |    /* in vertical pass, we process 4 columns at a time */
 2674|  2.15k|    if (h_mem_size > (SIZE_MAX / (4 * sizeof(OPJ_INT32)))) {
  ------------------
  |  Branch (2674:9): [True: 0, False: 2.15k]
  ------------------
 2675|       |        /* FIXME event manager error callback */
 2676|      0|        opj_sparse_array_int32_free(sa);
 2677|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2678|      0|    }
 2679|       |
 2680|  2.15k|    h_mem_size *= 4 * sizeof(OPJ_INT32);
 2681|  2.15k|    h.mem = (OPJ_INT32*)opj_aligned_32_malloc(h_mem_size);
 2682|  2.15k|    if (! h.mem) {
  ------------------
  |  Branch (2682:9): [True: 0, False: 2.15k]
  ------------------
 2683|       |        /* FIXME event manager error callback */
 2684|      0|        opj_sparse_array_int32_free(sa);
 2685|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2686|      0|    }
 2687|       |
 2688|  2.15k|    v.mem = h.mem;
 2689|       |
 2690|  27.8k|    for (resno = 1; resno < numres; resno ++) {
  ------------------
  |  Branch (2690:21): [True: 25.6k, False: 2.15k]
  ------------------
 2691|  25.6k|        OPJ_UINT32 i, j;
 2692|       |        /* Window of interest subband-based coordinates */
 2693|  25.6k|        OPJ_UINT32 win_ll_x0, win_ll_y0, win_ll_x1, win_ll_y1;
 2694|  25.6k|        OPJ_UINT32 win_hl_x0, win_hl_x1;
 2695|  25.6k|        OPJ_UINT32 win_lh_y0, win_lh_y1;
 2696|       |        /* Window of interest tile-resolution-based coordinates */
 2697|  25.6k|        OPJ_UINT32 win_tr_x0, win_tr_x1, win_tr_y0, win_tr_y1;
 2698|       |        /* Tile-resolution subband-based coordinates */
 2699|  25.6k|        OPJ_UINT32 tr_ll_x0, tr_ll_y0, tr_hl_x0, tr_lh_y0;
 2700|       |
 2701|  25.6k|        ++tr;
 2702|       |
 2703|  25.6k|        h.sn = (OPJ_INT32)rw;
 2704|  25.6k|        v.sn = (OPJ_INT32)rh;
 2705|       |
 2706|  25.6k|        rw = (OPJ_UINT32)(tr->x1 - tr->x0);
 2707|  25.6k|        rh = (OPJ_UINT32)(tr->y1 - tr->y0);
 2708|       |
 2709|  25.6k|        h.dn = (OPJ_INT32)(rw - (OPJ_UINT32)h.sn);
 2710|  25.6k|        h.cas = tr->x0 % 2;
 2711|       |
 2712|  25.6k|        v.dn = (OPJ_INT32)(rh - (OPJ_UINT32)v.sn);
 2713|  25.6k|        v.cas = tr->y0 % 2;
 2714|       |
 2715|       |        /* Get the subband coordinates for the window of interest */
 2716|       |        /* LL band */
 2717|  25.6k|        opj_dwt_get_band_coordinates(tilec, resno, 0,
 2718|  25.6k|                                     win_tcx0, win_tcy0, win_tcx1, win_tcy1,
 2719|  25.6k|                                     &win_ll_x0, &win_ll_y0,
 2720|  25.6k|                                     &win_ll_x1, &win_ll_y1);
 2721|       |
 2722|       |        /* HL band */
 2723|  25.6k|        opj_dwt_get_band_coordinates(tilec, resno, 1,
 2724|  25.6k|                                     win_tcx0, win_tcy0, win_tcx1, win_tcy1,
 2725|  25.6k|                                     &win_hl_x0, NULL, &win_hl_x1, NULL);
 2726|       |
 2727|       |        /* LH band */
 2728|  25.6k|        opj_dwt_get_band_coordinates(tilec, resno, 2,
 2729|  25.6k|                                     win_tcx0, win_tcy0, win_tcx1, win_tcy1,
 2730|  25.6k|                                     NULL, &win_lh_y0, NULL, &win_lh_y1);
 2731|       |
 2732|       |        /* Beware: band index for non-LL0 resolution are 0=HL, 1=LH and 2=HH */
 2733|  25.6k|        tr_ll_x0 = (OPJ_UINT32)tr->bands[1].x0;
 2734|  25.6k|        tr_ll_y0 = (OPJ_UINT32)tr->bands[0].y0;
 2735|  25.6k|        tr_hl_x0 = (OPJ_UINT32)tr->bands[0].x0;
 2736|  25.6k|        tr_lh_y0 = (OPJ_UINT32)tr->bands[1].y0;
 2737|       |
 2738|       |        /* Subtract the origin of the bands for this tile, to the subwindow */
 2739|       |        /* of interest band coordinates, so as to get them relative to the */
 2740|       |        /* tile */
 2741|  25.6k|        win_ll_x0 = opj_uint_subs(win_ll_x0, tr_ll_x0);
 2742|  25.6k|        win_ll_y0 = opj_uint_subs(win_ll_y0, tr_ll_y0);
 2743|  25.6k|        win_ll_x1 = opj_uint_subs(win_ll_x1, tr_ll_x0);
 2744|  25.6k|        win_ll_y1 = opj_uint_subs(win_ll_y1, tr_ll_y0);
 2745|  25.6k|        win_hl_x0 = opj_uint_subs(win_hl_x0, tr_hl_x0);
 2746|  25.6k|        win_hl_x1 = opj_uint_subs(win_hl_x1, tr_hl_x0);
 2747|  25.6k|        win_lh_y0 = opj_uint_subs(win_lh_y0, tr_lh_y0);
 2748|  25.6k|        win_lh_y1 = opj_uint_subs(win_lh_y1, tr_lh_y0);
 2749|       |
 2750|  25.6k|        opj_dwt_segment_grow(filter_width, (OPJ_UINT32)h.sn, &win_ll_x0, &win_ll_x1);
 2751|  25.6k|        opj_dwt_segment_grow(filter_width, (OPJ_UINT32)h.dn, &win_hl_x0, &win_hl_x1);
 2752|       |
 2753|  25.6k|        opj_dwt_segment_grow(filter_width, (OPJ_UINT32)v.sn, &win_ll_y0, &win_ll_y1);
 2754|  25.6k|        opj_dwt_segment_grow(filter_width, (OPJ_UINT32)v.dn, &win_lh_y0, &win_lh_y1);
 2755|       |
 2756|       |        /* Compute the tile-resolution-based coordinates for the window of interest */
 2757|  25.6k|        if (h.cas == 0) {
  ------------------
  |  Branch (2757:13): [True: 18.8k, False: 6.85k]
  ------------------
 2758|  18.8k|            win_tr_x0 = opj_uint_min(2 * win_ll_x0, 2 * win_hl_x0 + 1);
 2759|  18.8k|            win_tr_x1 = opj_uint_min(opj_uint_max(2 * win_ll_x1, 2 * win_hl_x1 + 1), rw);
 2760|  18.8k|        } else {
 2761|  6.85k|            win_tr_x0 = opj_uint_min(2 * win_hl_x0, 2 * win_ll_x0 + 1);
 2762|  6.85k|            win_tr_x1 = opj_uint_min(opj_uint_max(2 * win_hl_x1, 2 * win_ll_x1 + 1), rw);
 2763|  6.85k|        }
 2764|       |
 2765|  25.6k|        if (v.cas == 0) {
  ------------------
  |  Branch (2765:13): [True: 6.28k, False: 19.3k]
  ------------------
 2766|  6.28k|            win_tr_y0 = opj_uint_min(2 * win_ll_y0, 2 * win_lh_y0 + 1);
 2767|  6.28k|            win_tr_y1 = opj_uint_min(opj_uint_max(2 * win_ll_y1, 2 * win_lh_y1 + 1), rh);
 2768|  19.3k|        } else {
 2769|  19.3k|            win_tr_y0 = opj_uint_min(2 * win_lh_y0, 2 * win_ll_y0 + 1);
 2770|  19.3k|            win_tr_y1 = opj_uint_min(opj_uint_max(2 * win_lh_y1, 2 * win_ll_y1 + 1), rh);
 2771|  19.3k|        }
 2772|       |
 2773|  1.65G|        for (j = 0; j < rh; ++j) {
  ------------------
  |  Branch (2773:21): [True: 1.65G, False: 25.6k]
  ------------------
 2774|  1.65G|            if ((j >= win_ll_y0 && j < win_ll_y1) ||
  ------------------
  |  Branch (2774:18): [True: 1.65G, False: 0]
  |  Branch (2774:36): [True: 715k, False: 1.65G]
  ------------------
 2775|  1.65G|                    (j >= win_lh_y0 + (OPJ_UINT32)v.sn && j < win_lh_y1 + (OPJ_UINT32)v.sn)) {
  ------------------
  |  Branch (2775:22): [True: 829M, False: 828M]
  |  Branch (2775:59): [True: 716k, False: 828M]
  ------------------
 2776|       |
 2777|       |                /* Avoids dwt.c:1584:44 (in opj_dwt_decode_partial_1): runtime error: */
 2778|       |                /* signed integer overflow: -1094795586 + -1094795586 cannot be represented in type 'int' */
 2779|       |                /* on opj_decompress -i  ../../openjpeg/MAPA.jp2 -o out.tif -d 0,0,256,256 */
 2780|       |                /* This is less extreme than memsetting the whole buffer to 0 */
 2781|       |                /* although we could potentially do better with better handling of edge conditions */
 2782|  1.43M|                if (win_tr_x1 >= 1 && win_tr_x1 < rw) {
  ------------------
  |  Branch (2782:21): [True: 1.33M, False: 92.3k]
  |  Branch (2782:39): [True: 313k, False: 1.02M]
  ------------------
 2783|   313k|                    h.mem[win_tr_x1 - 1] = 0;
 2784|   313k|                }
 2785|  1.43M|                if (win_tr_x1 < rw) {
  ------------------
  |  Branch (2785:21): [True: 313k, False: 1.11M]
  ------------------
 2786|   313k|                    h.mem[win_tr_x1] = 0;
 2787|   313k|                }
 2788|       |
 2789|  1.43M|                opj_dwt_interleave_partial_h(h.mem,
 2790|  1.43M|                                             h.cas,
 2791|  1.43M|                                             sa,
 2792|  1.43M|                                             j,
 2793|  1.43M|                                             (OPJ_UINT32)h.sn,
 2794|  1.43M|                                             win_ll_x0,
 2795|  1.43M|                                             win_ll_x1,
 2796|  1.43M|                                             win_hl_x0,
 2797|  1.43M|                                             win_hl_x1);
 2798|  1.43M|                opj_dwt_decode_partial_1(h.mem, h.dn, h.sn, h.cas,
 2799|  1.43M|                                         (OPJ_INT32)win_ll_x0,
 2800|  1.43M|                                         (OPJ_INT32)win_ll_x1,
 2801|  1.43M|                                         (OPJ_INT32)win_hl_x0,
 2802|  1.43M|                                         (OPJ_INT32)win_hl_x1);
 2803|  1.43M|                if (!opj_sparse_array_int32_write(sa,
  ------------------
  |  Branch (2803:21): [True: 0, False: 1.43M]
  ------------------
 2804|  1.43M|                                                  win_tr_x0, j,
 2805|  1.43M|                                                  win_tr_x1, j + 1,
 2806|  1.43M|                                                  h.mem + win_tr_x0,
 2807|  1.43M|                                                  1, 0, OPJ_TRUE)) {
  ------------------
  |  |  117|  1.43M|#define OPJ_TRUE 1
  ------------------
 2808|       |                    /* FIXME event manager error callback */
 2809|      0|                    opj_sparse_array_int32_free(sa);
 2810|      0|                    opj_aligned_free(h.mem);
 2811|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2812|      0|                }
 2813|  1.43M|            }
 2814|  1.65G|        }
 2815|       |
 2816|   275k|        for (i = win_tr_x0; i < win_tr_x1;) {
  ------------------
  |  Branch (2816:29): [True: 249k, False: 25.6k]
  ------------------
 2817|   249k|            OPJ_UINT32 nb_cols = opj_uint_min(4U, win_tr_x1 - i);
 2818|   249k|            opj_dwt_interleave_partial_v(v.mem,
 2819|   249k|                                         v.cas,
 2820|   249k|                                         sa,
 2821|   249k|                                         i,
 2822|   249k|                                         nb_cols,
 2823|   249k|                                         (OPJ_UINT32)v.sn,
 2824|   249k|                                         win_ll_y0,
 2825|   249k|                                         win_ll_y1,
 2826|   249k|                                         win_lh_y0,
 2827|   249k|                                         win_lh_y1);
 2828|   249k|            opj_dwt_decode_partial_1_parallel(v.mem, nb_cols, v.dn, v.sn, v.cas,
 2829|   249k|                                              (OPJ_INT32)win_ll_y0,
 2830|   249k|                                              (OPJ_INT32)win_ll_y1,
 2831|   249k|                                              (OPJ_INT32)win_lh_y0,
 2832|   249k|                                              (OPJ_INT32)win_lh_y1);
 2833|   249k|            if (!opj_sparse_array_int32_write(sa,
  ------------------
  |  Branch (2833:17): [True: 0, False: 249k]
  ------------------
 2834|   249k|                                              i, win_tr_y0,
 2835|   249k|                                              i + nb_cols, win_tr_y1,
 2836|   249k|                                              v.mem + 4 * win_tr_y0,
 2837|   249k|                                              1, 4, OPJ_TRUE)) {
  ------------------
  |  |  117|   249k|#define OPJ_TRUE 1
  ------------------
 2838|       |                /* FIXME event manager error callback */
 2839|      0|                opj_sparse_array_int32_free(sa);
 2840|      0|                opj_aligned_free(h.mem);
 2841|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2842|      0|            }
 2843|       |
 2844|   249k|            i += nb_cols;
 2845|   249k|        }
 2846|  25.6k|    }
 2847|  2.15k|    opj_aligned_free(h.mem);
 2848|       |
 2849|  2.15k|    {
 2850|  2.15k|        OPJ_BOOL ret = opj_sparse_array_int32_read(sa,
 2851|  2.15k|                       tr_max->win_x0 - (OPJ_UINT32)tr_max->x0,
 2852|  2.15k|                       tr_max->win_y0 - (OPJ_UINT32)tr_max->y0,
 2853|  2.15k|                       tr_max->win_x1 - (OPJ_UINT32)tr_max->x0,
 2854|  2.15k|                       tr_max->win_y1 - (OPJ_UINT32)tr_max->y0,
 2855|  2.15k|                       tilec->data_win,
 2856|  2.15k|                       1, tr_max->win_x1 - tr_max->win_x0,
 2857|  2.15k|                       OPJ_TRUE);
  ------------------
  |  |  117|  2.15k|#define OPJ_TRUE 1
  ------------------
 2858|  2.15k|        assert(ret);
 2859|  2.15k|        OPJ_UNUSED(ret);
  ------------------
  |  |  219|  2.15k|#define OPJ_UNUSED(x) (void)x
  ------------------
 2860|  2.15k|    }
 2861|  2.15k|    opj_sparse_array_int32_free(sa);
 2862|  2.15k|    return OPJ_TRUE;
  ------------------
  |  |  117|  2.15k|#define OPJ_TRUE 1
  ------------------
 2863|  2.15k|}
dwt.c:opj_dwt_init_sparse_array:
 2566|  7.27k|{
 2567|  7.27k|    opj_tcd_resolution_t* tr_max = &(tilec->resolutions[numres - 1]);
 2568|  7.27k|    OPJ_UINT32 w = (OPJ_UINT32)(tr_max->x1 - tr_max->x0);
 2569|  7.27k|    OPJ_UINT32 h = (OPJ_UINT32)(tr_max->y1 - tr_max->y0);
 2570|  7.27k|    OPJ_UINT32 resno, bandno, precno, cblkno;
 2571|  7.27k|    opj_sparse_array_int32_t* sa = opj_sparse_array_int32_create(
 2572|  7.27k|                                       w, h, opj_uint_min(w, 64), opj_uint_min(h, 64));
 2573|  7.27k|    if (sa == NULL) {
  ------------------
  |  Branch (2573:9): [True: 0, False: 7.27k]
  ------------------
 2574|      0|        return NULL;
 2575|      0|    }
 2576|       |
 2577|  52.6k|    for (resno = 0; resno < numres; ++resno) {
  ------------------
  |  Branch (2577:21): [True: 45.3k, False: 7.27k]
  ------------------
 2578|  45.3k|        opj_tcd_resolution_t* res = &tilec->resolutions[resno];
 2579|       |
 2580|   166k|        for (bandno = 0; bandno < res->numbands; ++bandno) {
  ------------------
  |  Branch (2580:26): [True: 121k, False: 45.3k]
  ------------------
 2581|   121k|            opj_tcd_band_t* band = &res->bands[bandno];
 2582|       |
 2583|  21.3M|            for (precno = 0; precno < res->pw * res->ph; ++precno) {
  ------------------
  |  Branch (2583:30): [True: 21.1M, False: 121k]
  ------------------
 2584|  21.1M|                opj_tcd_precinct_t* precinct = &band->precincts[precno];
 2585|   209M|                for (cblkno = 0; cblkno < precinct->cw * precinct->ch; ++cblkno) {
  ------------------
  |  Branch (2585:34): [True: 188M, False: 21.1M]
  ------------------
 2586|   188M|                    opj_tcd_cblk_dec_t* cblk = &precinct->cblks.dec[cblkno];
 2587|   188M|                    if (cblk->decoded_data != NULL) {
  ------------------
  |  Branch (2587:25): [True: 1.11M, False: 187M]
  ------------------
 2588|  1.11M|                        OPJ_UINT32 x = (OPJ_UINT32)(cblk->x0 - band->x0);
 2589|  1.11M|                        OPJ_UINT32 y = (OPJ_UINT32)(cblk->y0 - band->y0);
 2590|  1.11M|                        OPJ_UINT32 cblk_w = (OPJ_UINT32)(cblk->x1 - cblk->x0);
 2591|  1.11M|                        OPJ_UINT32 cblk_h = (OPJ_UINT32)(cblk->y1 - cblk->y0);
 2592|       |
 2593|  1.11M|                        if (band->bandno & 1) {
  ------------------
  |  Branch (2593:29): [True: 230k, False: 887k]
  ------------------
 2594|   230k|                            opj_tcd_resolution_t* pres = &tilec->resolutions[resno - 1];
 2595|   230k|                            x += (OPJ_UINT32)(pres->x1 - pres->x0);
 2596|   230k|                        }
 2597|  1.11M|                        if (band->bandno & 2) {
  ------------------
  |  Branch (2597:29): [True: 241k, False: 876k]
  ------------------
 2598|   241k|                            opj_tcd_resolution_t* pres = &tilec->resolutions[resno - 1];
 2599|   241k|                            y += (OPJ_UINT32)(pres->y1 - pres->y0);
 2600|   241k|                        }
 2601|       |
 2602|  1.11M|                        if (!opj_sparse_array_int32_write(sa, x, y,
  ------------------
  |  Branch (2602:29): [True: 0, False: 1.11M]
  ------------------
 2603|  1.11M|                                                          x + cblk_w, y + cblk_h,
 2604|  1.11M|                                                          cblk->decoded_data,
 2605|  1.11M|                                                          1, cblk_w, OPJ_TRUE)) {
  ------------------
  |  |  117|  1.11M|#define OPJ_TRUE 1
  ------------------
 2606|      0|                            opj_sparse_array_int32_free(sa);
 2607|      0|                            return NULL;
 2608|      0|                        }
 2609|  1.11M|                    }
 2610|   188M|                }
 2611|  21.1M|            }
 2612|   121k|        }
 2613|  45.3k|    }
 2614|       |
 2615|  7.27k|    return sa;
 2616|  7.27k|}
dwt.c:opj_dwt_get_band_coordinates:
 2521|   114k|{
 2522|       |    /* Compute number of decomposition for this band. See table F-1 */
 2523|   114k|    OPJ_UINT32 nb = (resno == 0) ?
  ------------------
  |  Branch (2523:21): [True: 0, False: 114k]
  ------------------
 2524|      0|                    tilec->numresolutions - 1 :
 2525|   114k|                    tilec->numresolutions - resno;
 2526|       |    /* Map above tile-based coordinates to sub-band-based coordinates per */
 2527|       |    /* equation B-15 of the standard */
 2528|   114k|    OPJ_UINT32 x0b = bandno & 1;
 2529|   114k|    OPJ_UINT32 y0b = bandno >> 1;
 2530|   114k|    if (tbx0) {
  ------------------
  |  Branch (2530:9): [True: 76.1k, False: 38.0k]
  ------------------
 2531|  76.1k|        *tbx0 = (nb == 0) ? tcx0 :
  ------------------
  |  Branch (2531:17): [True: 0, False: 76.1k]
  ------------------
 2532|  76.1k|                (tcx0 <= (1U << (nb - 1)) * x0b) ? 0 :
  ------------------
  |  Branch (2532:17): [True: 49.5k, False: 26.5k]
  ------------------
 2533|  76.1k|                opj_uint_ceildivpow2(tcx0 - (1U << (nb - 1)) * x0b, nb);
 2534|  76.1k|    }
 2535|   114k|    if (tby0) {
  ------------------
  |  Branch (2535:9): [True: 76.1k, False: 38.0k]
  ------------------
 2536|  76.1k|        *tby0 = (nb == 0) ? tcy0 :
  ------------------
  |  Branch (2536:17): [True: 0, False: 76.1k]
  ------------------
 2537|  76.1k|                (tcy0 <= (1U << (nb - 1)) * y0b) ? 0 :
  ------------------
  |  Branch (2537:17): [True: 37.4k, False: 38.6k]
  ------------------
 2538|  76.1k|                opj_uint_ceildivpow2(tcy0 - (1U << (nb - 1)) * y0b, nb);
 2539|  76.1k|    }
 2540|   114k|    if (tbx1) {
  ------------------
  |  Branch (2540:9): [True: 76.1k, False: 38.0k]
  ------------------
 2541|  76.1k|        *tbx1 = (nb == 0) ? tcx1 :
  ------------------
  |  Branch (2541:17): [True: 0, False: 76.1k]
  ------------------
 2542|  76.1k|                (tcx1 <= (1U << (nb - 1)) * x0b) ? 0 :
  ------------------
  |  Branch (2542:17): [True: 24.4k, False: 51.6k]
  ------------------
 2543|  76.1k|                opj_uint_ceildivpow2(tcx1 - (1U << (nb - 1)) * x0b, nb);
 2544|  76.1k|    }
 2545|   114k|    if (tby1) {
  ------------------
  |  Branch (2545:9): [True: 76.1k, False: 38.0k]
  ------------------
 2546|  76.1k|        *tby1 = (nb == 0) ? tcy1 :
  ------------------
  |  Branch (2546:17): [True: 0, False: 76.1k]
  ------------------
 2547|  76.1k|                (tcy1 <= (1U << (nb - 1)) * y0b) ? 0 :
  ------------------
  |  Branch (2547:17): [True: 21.3k, False: 54.8k]
  ------------------
 2548|  76.1k|                opj_uint_ceildivpow2(tcy1 - (1U << (nb - 1)) * y0b, nb);
 2549|  76.1k|    }
 2550|   114k|}
dwt.c:opj_dwt_segment_grow:
 2556|   152k|{
 2557|   152k|    *start = opj_uint_subs(*start, filter_width);
 2558|   152k|    *end = opj_uint_adds(*end, filter_width);
 2559|   152k|    *end = opj_uint_min(*end, max_size);
 2560|   152k|}
dwt.c:opj_dwt_interleave_partial_h:
 2238|  1.43M|{
 2239|  1.43M|    OPJ_BOOL ret;
 2240|  1.43M|    ret = opj_sparse_array_int32_read(sa,
 2241|  1.43M|                                      win_l_x0, sa_line,
 2242|  1.43M|                                      win_l_x1, sa_line + 1,
 2243|  1.43M|                                      dest + cas + 2 * win_l_x0,
 2244|  1.43M|                                      2, 0, OPJ_TRUE);
  ------------------
  |  |  117|  1.43M|#define OPJ_TRUE 1
  ------------------
 2245|  1.43M|    assert(ret);
 2246|  1.43M|    ret = opj_sparse_array_int32_read(sa,
 2247|  1.43M|                                      sn + win_h_x0, sa_line,
 2248|  1.43M|                                      sn + win_h_x1, sa_line + 1,
 2249|  1.43M|                                      dest + 1 - cas + 2 * win_h_x0,
 2250|  1.43M|                                      2, 0, OPJ_TRUE);
  ------------------
  |  |  117|  1.43M|#define OPJ_TRUE 1
  ------------------
 2251|  1.43M|    assert(ret);
 2252|  1.43M|    OPJ_UNUSED(ret);
  ------------------
  |  |  219|  1.43M|#define OPJ_UNUSED(x) (void)x
  ------------------
 2253|  1.43M|}
dwt.c:opj_dwt_decode_partial_1:
 2289|  1.43M|{
 2290|  1.43M|    OPJ_INT32 i;
 2291|       |
 2292|  1.43M|    if (!cas) {
  ------------------
  |  Branch (2292:9): [True: 1.08M, False: 351k]
  ------------------
 2293|  1.08M|        if ((dn > 0) || (sn > 1)) { /* NEW :  CASE ONE ELEMENT */
  ------------------
  |  Branch (2293:13): [True: 456k, False: 624k]
  |  Branch (2293:25): [True: 0, False: 624k]
  ------------------
 2294|       |
 2295|       |            /* Naive version is :
 2296|       |            for (i = win_l_x0; i < i_max; i++) {
 2297|       |                OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;
 2298|       |            }
 2299|       |            for (i = win_h_x0; i < win_h_x1; i++) {
 2300|       |                OPJ_D(i) += (OPJ_S_(i) + OPJ_S_(i + 1)) >> 1;
 2301|       |            }
 2302|       |            but the compiler doesn't manage to unroll it to avoid bound
 2303|       |            checking in OPJ_S_ and OPJ_D_ macros
 2304|       |            */
 2305|       |
 2306|   456k|            i = win_l_x0;
 2307|   456k|            if (i < win_l_x1) {
  ------------------
  |  Branch (2307:17): [True: 456k, False: 0]
  ------------------
 2308|   456k|                OPJ_INT32 i_max;
 2309|       |
 2310|       |                /* Left-most case */
 2311|   456k|                OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;
  ------------------
  |  |  184|   456k|#define OPJ_S(i) a[(i)*2]
  ------------------
                              OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;
  ------------------
  |  |  187|   456k|#define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|   456k|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |  |  Branch (187:20): [True: 456k, False: 0]
  |  |  |  Branch (187:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;
  ------------------
  |  |  187|   456k|#define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|   456k|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |  |  Branch (187:20): [True: 0, False: 456k]
  |  |  |  Branch (187:36): [True: 0, False: 456k]
  |  |  ------------------
  ------------------
 2312|   456k|                i ++;
 2313|       |
 2314|   456k|                i_max = win_l_x1;
 2315|   456k|                if (i_max > dn) {
  ------------------
  |  Branch (2315:21): [True: 84.0k, False: 372k]
  ------------------
 2316|  84.0k|                    i_max = dn;
 2317|  84.0k|                }
 2318|  73.1M|                for (; i < i_max; i++) {
  ------------------
  |  Branch (2318:24): [True: 72.7M, False: 456k]
  ------------------
 2319|       |                    /* No bound checking */
 2320|  72.7M|                    OPJ_S(i) -= (OPJ_D(i - 1) + OPJ_D(i) + 2) >> 2;
  ------------------
  |  |  184|  72.7M|#define OPJ_S(i) a[(i)*2]
  ------------------
                                  OPJ_S(i) -= (OPJ_D(i - 1) + OPJ_D(i) + 2) >> 2;
  ------------------
  |  |  185|  72.7M|#define OPJ_D(i) a[(1+(i)*2)]
  ------------------
                                  OPJ_S(i) -= (OPJ_D(i - 1) + OPJ_D(i) + 2) >> 2;
  ------------------
  |  |  185|  72.7M|#define OPJ_D(i) a[(1+(i)*2)]
  ------------------
 2321|  72.7M|                }
 2322|   540k|                for (; i < win_l_x1; i++) {
  ------------------
  |  Branch (2322:24): [True: 84.0k, False: 456k]
  ------------------
 2323|       |                    /* Right-most case */
 2324|  84.0k|                    OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;
  ------------------
  |  |  184|  84.0k|#define OPJ_S(i) a[(i)*2]
  ------------------
                                  OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;
  ------------------
  |  |  187|  84.0k|#define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|  84.0k|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |  |  Branch (187:20): [True: 0, False: 84.0k]
  |  |  |  Branch (187:36): [True: 0, False: 84.0k]
  |  |  ------------------
  ------------------
                                  OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;
  ------------------
  |  |  187|  84.0k|#define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|  84.0k|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_D_(i) ((i)<0?OPJ_D(0):((i)>=dn?OPJ_D(dn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |  |  Branch (187:20): [True: 0, False: 84.0k]
  |  |  |  Branch (187:36): [True: 84.0k, False: 0]
  |  |  ------------------
  ------------------
 2325|  84.0k|                }
 2326|   456k|            }
 2327|       |
 2328|   456k|            i = win_h_x0;
 2329|   456k|            if (i < win_h_x1) {
  ------------------
  |  Branch (2329:17): [True: 456k, False: 0]
  ------------------
 2330|   456k|                OPJ_INT32 i_max = win_h_x1;
 2331|   456k|                if (i_max >= sn) {
  ------------------
  |  Branch (2331:21): [True: 82.1k, False: 373k]
  ------------------
 2332|  82.1k|                    i_max = sn - 1;
 2333|  82.1k|                }
 2334|  73.4M|                for (; i < i_max; i++) {
  ------------------
  |  Branch (2334:24): [True: 73.0M, False: 456k]
  ------------------
 2335|       |                    /* No bound checking */
 2336|  73.0M|                    OPJ_D(i) += (OPJ_S(i) + OPJ_S(i + 1)) >> 1;
  ------------------
  |  |  185|  73.0M|#define OPJ_D(i) a[(1+(i)*2)]
  ------------------
                                  OPJ_D(i) += (OPJ_S(i) + OPJ_S(i + 1)) >> 1;
  ------------------
  |  |  184|  73.0M|#define OPJ_S(i) a[(i)*2]
  ------------------
                                  OPJ_D(i) += (OPJ_S(i) + OPJ_S(i + 1)) >> 1;
  ------------------
  |  |  184|  73.0M|#define OPJ_S(i) a[(i)*2]
  ------------------
 2337|  73.0M|                }
 2338|   538k|                for (; i < win_h_x1; i++) {
  ------------------
  |  Branch (2338:24): [True: 82.1k, False: 456k]
  ------------------
 2339|       |                    /* Right-most case */
 2340|  82.1k|                    OPJ_D(i) += (OPJ_S_(i) + OPJ_S_(i + 1)) >> 1;
  ------------------
  |  |  185|  82.1k|#define OPJ_D(i) a[(1+(i)*2)]
  ------------------
                                  OPJ_D(i) += (OPJ_S_(i) + OPJ_S_(i + 1)) >> 1;
  ------------------
  |  |  186|  82.1k|#define OPJ_S_(i) ((i)<0?OPJ_S(0):((i)>=sn?OPJ_S(sn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|      0|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |               #define OPJ_S_(i) ((i)<0?OPJ_S(0):((i)>=sn?OPJ_S(sn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|      0|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |               #define OPJ_S_(i) ((i)<0?OPJ_S(0):((i)>=sn?OPJ_S(sn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|  82.1k|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |  |  Branch (186:20): [True: 0, False: 82.1k]
  |  |  |  Branch (186:36): [True: 0, False: 82.1k]
  |  |  ------------------
  ------------------
                                  OPJ_D(i) += (OPJ_S_(i) + OPJ_S_(i + 1)) >> 1;
  ------------------
  |  |  186|  82.1k|#define OPJ_S_(i) ((i)<0?OPJ_S(0):((i)>=sn?OPJ_S(sn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|      0|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |               #define OPJ_S_(i) ((i)<0?OPJ_S(0):((i)>=sn?OPJ_S(sn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|  82.1k|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |               #define OPJ_S_(i) ((i)<0?OPJ_S(0):((i)>=sn?OPJ_S(sn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|      0|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |  |  Branch (186:20): [True: 0, False: 82.1k]
  |  |  |  Branch (186:36): [True: 82.1k, False: 0]
  |  |  ------------------
  ------------------
 2341|  82.1k|                }
 2342|   456k|            }
 2343|   456k|        }
 2344|  1.08M|    } else {
 2345|   351k|        if (!sn  && dn == 1) {        /* NEW :  CASE ONE ELEMENT */
  ------------------
  |  Branch (2345:13): [True: 218k, False: 132k]
  |  Branch (2345:21): [True: 153k, False: 64.9k]
  ------------------
 2346|   153k|            OPJ_S(0) /= 2;
  ------------------
  |  |  184|   153k|#define OPJ_S(i) a[(i)*2]
  ------------------
 2347|   197k|        } else {
 2348|  7.29M|            for (i = win_l_x0; i < win_l_x1; i++) {
  ------------------
  |  Branch (2348:32): [True: 7.09M, False: 197k]
  ------------------
 2349|  7.09M|                OPJ_D(i) = opj_int_sub_no_overflow(OPJ_D(i),
  ------------------
  |  |  185|  7.09M|#define OPJ_D(i) a[(1+(i)*2)]
  ------------------
                              OPJ_D(i) = opj_int_sub_no_overflow(OPJ_D(i),
  ------------------
  |  |  185|  7.09M|#define OPJ_D(i) a[(1+(i)*2)]
  ------------------
 2350|  7.09M|                                                   opj_int_add_no_overflow(opj_int_add_no_overflow(OPJ_SS_(i), OPJ_SS_(i + 1)),
  ------------------
  |  |  189|  7.09M|#define OPJ_SS_(i) ((i)<0?OPJ_S(0):((i)>=dn?OPJ_S(dn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|      0|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |               #define OPJ_SS_(i) ((i)<0?OPJ_S(0):((i)>=dn?OPJ_S(dn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|      0|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |               #define OPJ_SS_(i) ((i)<0?OPJ_S(0):((i)>=dn?OPJ_S(dn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|  7.09M|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |  |  Branch (189:21): [True: 0, False: 7.09M]
  |  |  |  Branch (189:37): [True: 0, False: 7.09M]
  |  |  ------------------
  ------------------
                                                                 opj_int_add_no_overflow(opj_int_add_no_overflow(OPJ_SS_(i), OPJ_SS_(i + 1)),
  ------------------
  |  |  189|  7.09M|#define OPJ_SS_(i) ((i)<0?OPJ_S(0):((i)>=dn?OPJ_S(dn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|      0|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |               #define OPJ_SS_(i) ((i)<0?OPJ_S(0):((i)>=dn?OPJ_S(dn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|  23.4k|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |               #define OPJ_SS_(i) ((i)<0?OPJ_S(0):((i)>=dn?OPJ_S(dn-1):OPJ_S(i)))
  |  |  ------------------
  |  |  |  |  184|  7.07M|#define OPJ_S(i) a[(i)*2]
  |  |  ------------------
  |  |  |  Branch (189:21): [True: 0, False: 7.09M]
  |  |  |  Branch (189:37): [True: 23.4k, False: 7.07M]
  |  |  ------------------
  ------------------
 2351|  7.09M|                                                           2) >> 2);
 2352|  7.09M|            }
 2353|  7.38M|            for (i = win_h_x0; i < win_h_x1; i++) {
  ------------------
  |  Branch (2353:32): [True: 7.18M, False: 197k]
  ------------------
 2354|  7.18M|                OPJ_S(i) = opj_int_add_no_overflow(OPJ_S(i),
  ------------------
  |  |  184|  7.18M|#define OPJ_S(i) a[(i)*2]
  ------------------
                              OPJ_S(i) = opj_int_add_no_overflow(OPJ_S(i),
  ------------------
  |  |  184|  7.18M|#define OPJ_S(i) a[(i)*2]
  ------------------
 2355|  7.18M|                                                   opj_int_add_no_overflow(OPJ_DD_(i), OPJ_DD_(i - 1)) >> 1);
  ------------------
  |  |  190|  7.18M|#define OPJ_DD_(i) ((i)<0?OPJ_D(0):((i)>=sn?OPJ_D(sn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_DD_(i) ((i)<0?OPJ_D(0):((i)>=sn?OPJ_D(sn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|  81.5k|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_DD_(i) ((i)<0?OPJ_D(0):((i)>=sn?OPJ_D(sn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|  7.10M|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |  |  Branch (190:21): [True: 0, False: 7.18M]
  |  |  |  Branch (190:37): [True: 81.5k, False: 7.10M]
  |  |  ------------------
  ------------------
                                                                 opj_int_add_no_overflow(OPJ_DD_(i), OPJ_DD_(i - 1)) >> 1);
  ------------------
  |  |  190|  7.18M|#define OPJ_DD_(i) ((i)<0?OPJ_D(0):((i)>=sn?OPJ_D(sn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|   132k|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_DD_(i) ((i)<0?OPJ_D(0):((i)>=sn?OPJ_D(sn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|      0|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |               #define OPJ_DD_(i) ((i)<0?OPJ_D(0):((i)>=sn?OPJ_D(sn-1):OPJ_D(i)))
  |  |  ------------------
  |  |  |  |  185|  7.05M|#define OPJ_D(i) a[(1+(i)*2)]
  |  |  ------------------
  |  |  |  Branch (190:21): [True: 132k, False: 7.05M]
  |  |  |  Branch (190:37): [True: 0, False: 7.05M]
  |  |  ------------------
  ------------------
 2356|  7.18M|            }
 2357|   197k|        }
 2358|   351k|    }
 2359|  1.43M|}
dwt.c:opj_dwt_interleave_partial_v:
 2266|   249k|{
 2267|   249k|    OPJ_BOOL ret;
 2268|   249k|    ret  = opj_sparse_array_int32_read(sa,
 2269|   249k|                                       sa_col, win_l_y0,
 2270|   249k|                                       sa_col + nb_cols, win_l_y1,
 2271|   249k|                                       dest + cas * 4 + 2 * 4 * win_l_y0,
 2272|   249k|                                       1, 2 * 4, OPJ_TRUE);
  ------------------
  |  |  117|   249k|#define OPJ_TRUE 1
  ------------------
 2273|   249k|    assert(ret);
 2274|   249k|    ret = opj_sparse_array_int32_read(sa,
 2275|   249k|                                      sa_col, sn + win_h_y0,
 2276|   249k|                                      sa_col + nb_cols, sn + win_h_y1,
 2277|   249k|                                      dest + (1 - cas) * 4 + 2 * 4 * win_h_y0,
 2278|   249k|                                      1, 2 * 4, OPJ_TRUE);
  ------------------
  |  |  117|   249k|#define OPJ_TRUE 1
  ------------------
 2279|   249k|    assert(ret);
 2280|   249k|    OPJ_UNUSED(ret);
  ------------------
  |  |  219|   249k|#define OPJ_UNUSED(x) (void)x
  ------------------
 2281|   249k|}
dwt.c:opj_dwt_decode_partial_1_parallel:
 2376|   249k|{
 2377|   249k|    OPJ_INT32 i;
 2378|   249k|    OPJ_UINT32 off;
 2379|       |
 2380|   249k|    (void)nb_cols;
 2381|       |
 2382|   249k|    if (!cas) {
  ------------------
  |  Branch (2382:9): [True: 155k, False: 94.9k]
  ------------------
 2383|   155k|        if ((dn > 0) || (sn > 1)) { /* NEW :  CASE ONE ELEMENT */
  ------------------
  |  Branch (2383:13): [True: 138k, False: 16.3k]
  |  Branch (2383:25): [True: 0, False: 16.3k]
  ------------------
 2384|       |
 2385|       |            /* Naive version is :
 2386|       |            for (i = win_l_x0; i < i_max; i++) {
 2387|       |                OPJ_S(i) -= (OPJ_D_(i - 1) + OPJ_D_(i) + 2) >> 2;
 2388|       |            }
 2389|       |            for (i = win_h_x0; i < win_h_x1; i++) {
 2390|       |                OPJ_D(i) += (OPJ_S_(i) + OPJ_S_(i + 1)) >> 1;
 2391|       |            }
 2392|       |            but the compiler doesn't manage to unroll it to avoid bound
 2393|       |            checking in OPJ_S_ and OPJ_D_ macros
 2394|       |            */
 2395|       |
 2396|   138k|            i = win_l_x0;
 2397|   138k|            if (i < win_l_x1) {
  ------------------
  |  Branch (2397:17): [True: 138k, False: 0]
  ------------------
 2398|   138k|                OPJ_INT32 i_max;
 2399|       |
 2400|       |                /* Left-most case */
 2401|   693k|                for (off = 0; off < 4; off++) {
  ------------------
  |  Branch (2401:31): [True: 554k, False: 138k]
  ------------------
 2402|   554k|                    OPJ_S_off(i, off) -= (OPJ_D__off(i - 1, off) + OPJ_D__off(i, off) + 2) >> 2;
  ------------------
  |  | 2361|   554k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  ------------------
                                  OPJ_S_off(i, off) -= (OPJ_D__off(i - 1, off) + OPJ_D__off(i, off) + 2) >> 2;
  ------------------
  |  | 2364|   554k|#define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|   554k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |  |  Branch (2364:28): [True: 554k, False: 0]
  |  |  |  Branch (2364:52): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                  OPJ_S_off(i, off) -= (OPJ_D__off(i - 1, off) + OPJ_D__off(i, off) + 2) >> 2;
  ------------------
  |  | 2364|   554k|#define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|   554k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |  |  Branch (2364:28): [True: 0, False: 554k]
  |  |  |  Branch (2364:52): [True: 0, False: 554k]
  |  |  ------------------
  ------------------
 2403|   554k|                }
 2404|   138k|                i ++;
 2405|       |
 2406|   138k|                i_max = win_l_x1;
 2407|   138k|                if (i_max > dn) {
  ------------------
  |  Branch (2407:21): [True: 26.4k, False: 112k]
  ------------------
 2408|  26.4k|                    i_max = dn;
 2409|  26.4k|                }
 2410|       |
 2411|   138k|#ifdef __SSE2__
 2412|   138k|                if (i + 1 < i_max) {
  ------------------
  |  Branch (2412:21): [True: 120k, False: 18.4k]
  ------------------
 2413|   120k|                    const __m128i two = _mm_set1_epi32(2);
 2414|   120k|                    __m128i Dm1 = _mm_load_si128((__m128i * const)(a + 4 + (i - 1) * 8));
 2415|  9.30M|                    for (; i + 1 < i_max; i += 2) {
  ------------------
  |  Branch (2415:28): [True: 9.18M, False: 120k]
  ------------------
 2416|       |                        /* No bound checking */
 2417|  9.18M|                        __m128i S = _mm_load_si128((__m128i * const)(a + i * 8));
 2418|  9.18M|                        __m128i D = _mm_load_si128((__m128i * const)(a + 4 + i * 8));
 2419|  9.18M|                        __m128i S1 = _mm_load_si128((__m128i * const)(a + (i + 1) * 8));
 2420|  9.18M|                        __m128i D1 = _mm_load_si128((__m128i * const)(a + 4 + (i + 1) * 8));
 2421|  9.18M|                        S = _mm_sub_epi32(S,
 2422|  9.18M|                                          _mm_srai_epi32(_mm_add_epi32(_mm_add_epi32(Dm1, D), two), 2));
 2423|  9.18M|                        S1 = _mm_sub_epi32(S1,
 2424|  9.18M|                                           _mm_srai_epi32(_mm_add_epi32(_mm_add_epi32(D, D1), two), 2));
 2425|  9.18M|                        _mm_store_si128((__m128i*)(a + i * 8), S);
 2426|  9.18M|                        _mm_store_si128((__m128i*)(a + (i + 1) * 8), S1);
 2427|  9.18M|                        Dm1 = D1;
 2428|  9.18M|                    }
 2429|   120k|                }
 2430|   138k|#endif
 2431|       |
 2432|   231k|                for (; i < i_max; i++) {
  ------------------
  |  Branch (2432:24): [True: 92.6k, False: 138k]
  ------------------
 2433|       |                    /* No bound checking */
 2434|   463k|                    for (off = 0; off < 4; off++) {
  ------------------
  |  Branch (2434:35): [True: 370k, False: 92.6k]
  ------------------
 2435|   370k|                        OPJ_S_off(i, off) -= (OPJ_D_off(i - 1, off) + OPJ_D_off(i, off) + 2) >> 2;
  ------------------
  |  | 2361|   370k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  ------------------
                                      OPJ_S_off(i, off) -= (OPJ_D_off(i - 1, off) + OPJ_D_off(i, off) + 2) >> 2;
  ------------------
  |  | 2362|   370k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  ------------------
                                      OPJ_S_off(i, off) -= (OPJ_D_off(i - 1, off) + OPJ_D_off(i, off) + 2) >> 2;
  ------------------
  |  | 2362|   370k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  ------------------
 2436|   370k|                    }
 2437|  92.6k|                }
 2438|   165k|                for (; i < win_l_x1; i++) {
  ------------------
  |  Branch (2438:24): [True: 26.4k, False: 138k]
  ------------------
 2439|       |                    /* Right-most case */
 2440|   132k|                    for (off = 0; off < 4; off++) {
  ------------------
  |  Branch (2440:35): [True: 105k, False: 26.4k]
  ------------------
 2441|   105k|                        OPJ_S_off(i, off) -= (OPJ_D__off(i - 1, off) + OPJ_D__off(i, off) + 2) >> 2;
  ------------------
  |  | 2361|   105k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  ------------------
                                      OPJ_S_off(i, off) -= (OPJ_D__off(i - 1, off) + OPJ_D__off(i, off) + 2) >> 2;
  ------------------
  |  | 2364|   105k|#define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|   105k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |  |  Branch (2364:28): [True: 0, False: 105k]
  |  |  |  Branch (2364:52): [True: 0, False: 105k]
  |  |  ------------------
  ------------------
                                      OPJ_S_off(i, off) -= (OPJ_D__off(i - 1, off) + OPJ_D__off(i, off) + 2) >> 2;
  ------------------
  |  | 2364|   105k|#define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|   105k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_D__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=dn?OPJ_D_off(dn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |  |  Branch (2364:28): [True: 0, False: 105k]
  |  |  |  Branch (2364:52): [True: 105k, False: 0]
  |  |  ------------------
  ------------------
 2442|   105k|                    }
 2443|  26.4k|                }
 2444|   138k|            }
 2445|       |
 2446|   138k|            i = win_h_x0;
 2447|   138k|            if (i < win_h_x1) {
  ------------------
  |  Branch (2447:17): [True: 138k, False: 0]
  ------------------
 2448|   138k|                OPJ_INT32 i_max = win_h_x1;
 2449|   138k|                if (i_max >= sn) {
  ------------------
  |  Branch (2449:21): [True: 55.2k, False: 83.4k]
  ------------------
 2450|  55.2k|                    i_max = sn - 1;
 2451|  55.2k|                }
 2452|       |
 2453|   138k|#ifdef __SSE2__
 2454|   138k|                if (i + 1 < i_max) {
  ------------------
  |  Branch (2454:21): [True: 120k, False: 18.1k]
  ------------------
 2455|   120k|                    __m128i S =  _mm_load_si128((__m128i * const)(a + i * 8));
 2456|  9.35M|                    for (; i + 1 < i_max; i += 2) {
  ------------------
  |  Branch (2456:28): [True: 9.23M, False: 120k]
  ------------------
 2457|       |                        /* No bound checking */
 2458|  9.23M|                        __m128i D = _mm_load_si128((__m128i * const)(a + 4 + i * 8));
 2459|  9.23M|                        __m128i S1 = _mm_load_si128((__m128i * const)(a + (i + 1) * 8));
 2460|  9.23M|                        __m128i D1 = _mm_load_si128((__m128i * const)(a + 4 + (i + 1) * 8));
 2461|  9.23M|                        __m128i S2 = _mm_load_si128((__m128i * const)(a + (i + 2) * 8));
 2462|  9.23M|                        D = _mm_add_epi32(D, _mm_srai_epi32(_mm_add_epi32(S, S1), 1));
 2463|  9.23M|                        D1 = _mm_add_epi32(D1, _mm_srai_epi32(_mm_add_epi32(S1, S2), 1));
 2464|  9.23M|                        _mm_store_si128((__m128i*)(a + 4 + i * 8), D);
 2465|  9.23M|                        _mm_store_si128((__m128i*)(a + 4 + (i + 1) * 8), D1);
 2466|  9.23M|                        S = S2;
 2467|  9.23M|                    }
 2468|   120k|                }
 2469|   138k|#endif
 2470|       |
 2471|   199k|                for (; i < i_max; i++) {
  ------------------
  |  Branch (2471:24): [True: 60.8k, False: 138k]
  ------------------
 2472|       |                    /* No bound checking */
 2473|   304k|                    for (off = 0; off < 4; off++) {
  ------------------
  |  Branch (2473:35): [True: 243k, False: 60.8k]
  ------------------
 2474|   243k|                        OPJ_D_off(i, off) += (OPJ_S_off(i, off) + OPJ_S_off(i + 1, off)) >> 1;
  ------------------
  |  | 2362|   243k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  ------------------
                                      OPJ_D_off(i, off) += (OPJ_S_off(i, off) + OPJ_S_off(i + 1, off)) >> 1;
  ------------------
  |  | 2361|   243k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  ------------------
                                      OPJ_D_off(i, off) += (OPJ_S_off(i, off) + OPJ_S_off(i + 1, off)) >> 1;
  ------------------
  |  | 2361|   243k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  ------------------
 2475|   243k|                    }
 2476|  60.8k|                }
 2477|   193k|                for (; i < win_h_x1; i++) {
  ------------------
  |  Branch (2477:24): [True: 55.2k, False: 138k]
  ------------------
 2478|       |                    /* Right-most case */
 2479|   276k|                    for (off = 0; off < 4; off++) {
  ------------------
  |  Branch (2479:35): [True: 220k, False: 55.2k]
  ------------------
 2480|   220k|                        OPJ_D_off(i, off) += (OPJ_S__off(i, off) + OPJ_S__off(i + 1, off)) >> 1;
  ------------------
  |  | 2362|   220k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  ------------------
                                      OPJ_D_off(i, off) += (OPJ_S__off(i, off) + OPJ_S__off(i + 1, off)) >> 1;
  ------------------
  |  | 2363|   220k|#define OPJ_S__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=sn?OPJ_S_off(sn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|      0|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |               #define OPJ_S__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=sn?OPJ_S_off(sn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|      0|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |               #define OPJ_S__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=sn?OPJ_S_off(sn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|   220k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |  |  Branch (2363:28): [True: 0, False: 220k]
  |  |  |  Branch (2363:52): [True: 0, False: 220k]
  |  |  ------------------
  ------------------
                                      OPJ_D_off(i, off) += (OPJ_S__off(i, off) + OPJ_S__off(i + 1, off)) >> 1;
  ------------------
  |  | 2363|   220k|#define OPJ_S__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=sn?OPJ_S_off(sn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|      0|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |               #define OPJ_S__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=sn?OPJ_S_off(sn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|   220k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |               #define OPJ_S__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=sn?OPJ_S_off(sn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|      0|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |  |  Branch (2363:28): [True: 0, False: 220k]
  |  |  |  Branch (2363:52): [True: 220k, False: 0]
  |  |  ------------------
  ------------------
 2481|   220k|                    }
 2482|  55.2k|                }
 2483|   138k|            }
 2484|   138k|        }
 2485|   155k|    } else {
 2486|  94.9k|        if (!sn  && dn == 1) {        /* NEW :  CASE ONE ELEMENT */
  ------------------
  |  Branch (2486:13): [True: 32.9k, False: 61.9k]
  |  Branch (2486:21): [True: 13.9k, False: 18.9k]
  ------------------
 2487|  69.9k|            for (off = 0; off < 4; off++) {
  ------------------
  |  Branch (2487:27): [True: 55.9k, False: 13.9k]
  ------------------
 2488|  55.9k|                OPJ_S_off(0, off) /= 2;
  ------------------
  |  | 2361|  55.9k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  ------------------
 2489|  55.9k|            }
 2490|  80.9k|        } else {
 2491|  2.08M|            for (i = win_l_x0; i < win_l_x1; i++) {
  ------------------
  |  Branch (2491:32): [True: 2.00M, False: 80.9k]
  ------------------
 2492|  10.0M|                for (off = 0; off < 4; off++) {
  ------------------
  |  Branch (2492:31): [True: 8.00M, False: 2.00M]
  ------------------
 2493|  8.00M|                    OPJ_D_off(i, off) = opj_int_sub_no_overflow(
  ------------------
  |  | 2362|  8.00M|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  ------------------
 2494|  8.00M|                                            OPJ_D_off(i, off),
  ------------------
  |  | 2362|  8.00M|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  ------------------
 2495|  8.00M|                                            opj_int_add_no_overflow(
 2496|  8.00M|                                                opj_int_add_no_overflow(OPJ_SS__off(i, off), OPJ_SS__off(i + 1, off)), 2) >> 2);
  ------------------
  |  | 2365|  8.00M|#define OPJ_SS__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=dn?OPJ_S_off(dn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|      0|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |               #define OPJ_SS__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=dn?OPJ_S_off(dn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|      0|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |               #define OPJ_SS__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=dn?OPJ_S_off(dn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|  8.00M|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |  |  Branch (2365:29): [True: 0, False: 8.00M]
  |  |  |  Branch (2365:53): [True: 0, False: 8.00M]
  |  |  ------------------
  ------------------
                                                              opj_int_add_no_overflow(OPJ_SS__off(i, off), OPJ_SS__off(i + 1, off)), 2) >> 2);
  ------------------
  |  | 2365|  8.00M|#define OPJ_SS__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=dn?OPJ_S_off(dn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|      0|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |               #define OPJ_SS__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=dn?OPJ_S_off(dn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|  45.1k|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |               #define OPJ_SS__off(i,off) ((i)<0?OPJ_S_off(0,off):((i)>=dn?OPJ_S_off(dn-1,off):OPJ_S_off(i,off)))
  |  |  ------------------
  |  |  |  | 2361|  7.95M|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  |  |  ------------------
  |  |  |  Branch (2365:29): [True: 0, False: 8.00M]
  |  |  |  Branch (2365:53): [True: 45.1k, False: 7.95M]
  |  |  ------------------
  ------------------
 2497|  8.00M|                }
 2498|  2.00M|            }
 2499|  2.10M|            for (i = win_h_x0; i < win_h_x1; i++) {
  ------------------
  |  Branch (2499:32): [True: 2.02M, False: 80.9k]
  ------------------
 2500|  10.1M|                for (off = 0; off < 4; off++) {
  ------------------
  |  Branch (2500:31): [True: 8.10M, False: 2.02M]
  ------------------
 2501|  8.10M|                    OPJ_S_off(i, off) = opj_int_add_no_overflow(
  ------------------
  |  | 2361|  8.10M|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  ------------------
 2502|  8.10M|                                            OPJ_S_off(i, off),
  ------------------
  |  | 2361|  8.10M|#define OPJ_S_off(i,off) a[(OPJ_UINT32)(i)*2*4+off]
  ------------------
 2503|  8.10M|                                            opj_int_add_no_overflow(OPJ_DD__off(i, off), OPJ_DD__off(i - 1, off)) >> 1);
  ------------------
  |  | 2366|  8.10M|#define OPJ_DD__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=sn?OPJ_D_off(sn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_DD__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=sn?OPJ_D_off(sn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|  77.2k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_DD__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=sn?OPJ_D_off(sn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|  8.03M|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |  |  Branch (2366:29): [True: 0, False: 8.10M]
  |  |  |  Branch (2366:53): [True: 77.2k, False: 8.03M]
  |  |  ------------------
  ------------------
                                                          opj_int_add_no_overflow(OPJ_DD__off(i, off), OPJ_DD__off(i - 1, off)) >> 1);
  ------------------
  |  | 2366|  8.10M|#define OPJ_DD__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=sn?OPJ_D_off(sn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|   247k|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_DD__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=sn?OPJ_D_off(sn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|      0|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |               #define OPJ_DD__off(i,off) ((i)<0?OPJ_D_off(0,off):((i)>=sn?OPJ_D_off(sn-1,off):OPJ_D_off(i,off)))
  |  |  ------------------
  |  |  |  | 2362|  7.86M|#define OPJ_D_off(i,off) a[(1+(OPJ_UINT32)(i)*2)*4+off]
  |  |  ------------------
  |  |  |  Branch (2366:29): [True: 247k, False: 7.86M]
  |  |  |  Branch (2366:53): [True: 0, False: 7.86M]
  |  |  ------------------
  ------------------
 2504|  8.10M|                }
 2505|  2.02M|            }
 2506|  80.9k|        }
 2507|  94.9k|    }
 2508|   249k|}
dwt.c:opj_dwt_decode_tile_97:
 3304|  5.81k|{
 3305|  5.81k|    opj_v8dwt_t h;
 3306|  5.81k|    opj_v8dwt_t v;
 3307|       |
 3308|  5.81k|    opj_tcd_resolution_t* res = tilec->resolutions;
 3309|       |
 3310|  5.81k|    OPJ_UINT32 rw = (OPJ_UINT32)(res->x1 -
 3311|  5.81k|                                 res->x0);    /* width of the resolution level computed */
 3312|  5.81k|    OPJ_UINT32 rh = (OPJ_UINT32)(res->y1 -
 3313|  5.81k|                                 res->y0);    /* height of the resolution level computed */
 3314|       |
 3315|  5.81k|    OPJ_UINT32 w = (OPJ_UINT32)(tilec->resolutions[tilec->minimum_num_resolutions -
 3316|  5.81k|                                                               1].x1 -
 3317|  5.81k|                                tilec->resolutions[tilec->minimum_num_resolutions - 1].x0);
 3318|       |
 3319|  5.81k|    OPJ_SIZE_T l_data_size;
 3320|  5.81k|    const int num_threads = opj_thread_pool_get_thread_count(tp);
 3321|       |
 3322|  5.81k|    if (numres == 1) {
  ------------------
  |  Branch (3322:9): [True: 1.43k, False: 4.37k]
  ------------------
 3323|  1.43k|        return OPJ_TRUE;
  ------------------
  |  |  117|  1.43k|#define OPJ_TRUE 1
  ------------------
 3324|  1.43k|    }
 3325|       |
 3326|  4.37k|    l_data_size = opj_dwt_max_resolution(res, numres);
 3327|       |    /* overflow check */
 3328|  4.37k|    if (l_data_size > (SIZE_MAX / sizeof(opj_v8_t))) {
  ------------------
  |  Branch (3328:9): [True: 0, False: 4.37k]
  ------------------
 3329|       |        /* FIXME event manager error callback */
 3330|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3331|      0|    }
 3332|  4.37k|    h.wavelet = (opj_v8_t*) opj_aligned_malloc(l_data_size * sizeof(opj_v8_t));
 3333|  4.37k|    if (!h.wavelet) {
  ------------------
  |  Branch (3333:9): [True: 0, False: 4.37k]
  ------------------
 3334|       |        /* FIXME event manager error callback */
 3335|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3336|      0|    }
 3337|  4.37k|    v.wavelet = h.wavelet;
 3338|       |
 3339|  45.3k|    while (--numres) {
  ------------------
  |  Branch (3339:12): [True: 41.0k, False: 4.37k]
  ------------------
 3340|  41.0k|        OPJ_FLOAT32 * OPJ_RESTRICT aj = (OPJ_FLOAT32*) tilec->data;
 3341|  41.0k|        OPJ_UINT32 j;
 3342|       |
 3343|  41.0k|        h.sn = (OPJ_INT32)rw;
 3344|  41.0k|        v.sn = (OPJ_INT32)rh;
 3345|       |
 3346|  41.0k|        ++res;
 3347|       |
 3348|  41.0k|        rw = (OPJ_UINT32)(res->x1 -
 3349|  41.0k|                          res->x0);   /* width of the resolution level computed */
 3350|  41.0k|        rh = (OPJ_UINT32)(res->y1 -
 3351|  41.0k|                          res->y0);   /* height of the resolution level computed */
 3352|       |
 3353|  41.0k|        h.dn = (OPJ_INT32)(rw - (OPJ_UINT32)h.sn);
 3354|  41.0k|        h.cas = res->x0 % 2;
 3355|       |
 3356|  41.0k|        h.win_l_x0 = 0;
 3357|  41.0k|        h.win_l_x1 = (OPJ_UINT32)h.sn;
 3358|  41.0k|        h.win_h_x0 = 0;
 3359|  41.0k|        h.win_h_x1 = (OPJ_UINT32)h.dn;
 3360|       |
 3361|  41.0k|        if (num_threads <= 1 || rh < 2 * NB_ELTS_V8) {
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3361:13): [True: 41.0k, False: 0]
  |  Branch (3361:33): [True: 0, False: 0]
  ------------------
 3362|   148k|            for (j = 0; j + (NB_ELTS_V8 - 1) < rh; j += NB_ELTS_V8) {
  ------------------
  |  |   90|   148k|#define NB_ELTS_V8  8
  ------------------
                          for (j = 0; j + (NB_ELTS_V8 - 1) < rh; j += NB_ELTS_V8) {
  ------------------
  |  |   90|   107k|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3362:25): [True: 107k, False: 41.0k]
  ------------------
 3363|   107k|                OPJ_UINT32 k;
 3364|   107k|                opj_v8dwt_interleave_h(&h, aj, w, NB_ELTS_V8);
  ------------------
  |  |   90|   107k|#define NB_ELTS_V8  8
  ------------------
 3365|   107k|                opj_v8dwt_decode(&h);
 3366|       |
 3367|       |                /* To be adapted if NB_ELTS_V8 changes */
 3368|  5.33M|                for (k = 0; k < rw; k++) {
  ------------------
  |  Branch (3368:29): [True: 5.23M, False: 107k]
  ------------------
 3369|  5.23M|                    aj[k      ] = h.wavelet[k].f[0];
 3370|  5.23M|                    aj[k + (OPJ_SIZE_T)w  ] = h.wavelet[k].f[1];
 3371|  5.23M|                    aj[k + (OPJ_SIZE_T)w * 2] = h.wavelet[k].f[2];
 3372|  5.23M|                    aj[k + (OPJ_SIZE_T)w * 3] = h.wavelet[k].f[3];
 3373|  5.23M|                }
 3374|  5.33M|                for (k = 0; k < rw; k++) {
  ------------------
  |  Branch (3374:29): [True: 5.23M, False: 107k]
  ------------------
 3375|  5.23M|                    aj[k + (OPJ_SIZE_T)w * 4] = h.wavelet[k].f[4];
 3376|  5.23M|                    aj[k + (OPJ_SIZE_T)w * 5] = h.wavelet[k].f[5];
 3377|  5.23M|                    aj[k + (OPJ_SIZE_T)w * 6] = h.wavelet[k].f[6];
 3378|  5.23M|                    aj[k + (OPJ_SIZE_T)w * 7] = h.wavelet[k].f[7];
 3379|  5.23M|                }
 3380|       |
 3381|   107k|                aj += w * NB_ELTS_V8;
  ------------------
  |  |   90|   107k|#define NB_ELTS_V8  8
  ------------------
 3382|   107k|            }
 3383|  41.0k|        } else {
 3384|      0|            OPJ_UINT32 num_jobs = (OPJ_UINT32)num_threads;
 3385|      0|            OPJ_UINT32 step_j;
 3386|       |
 3387|      0|            if ((rh / NB_ELTS_V8) < num_jobs) {
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3387:17): [True: 0, False: 0]
  ------------------
 3388|      0|                num_jobs = rh / NB_ELTS_V8;
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
 3389|      0|            }
 3390|      0|            step_j = ((rh / num_jobs) / NB_ELTS_V8) * NB_ELTS_V8;
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
                          step_j = ((rh / num_jobs) / NB_ELTS_V8) * NB_ELTS_V8;
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
 3391|      0|            for (j = 0; j < num_jobs; j++) {
  ------------------
  |  Branch (3391:25): [True: 0, False: 0]
  ------------------
 3392|      0|                opj_dwt97_decode_h_job_t* job;
 3393|       |
 3394|      0|                job = (opj_dwt97_decode_h_job_t*) opj_malloc(sizeof(opj_dwt97_decode_h_job_t));
 3395|      0|                if (!job) {
  ------------------
  |  Branch (3395:21): [True: 0, False: 0]
  ------------------
 3396|      0|                    opj_thread_pool_wait_completion(tp, 0);
 3397|      0|                    opj_aligned_free(h.wavelet);
 3398|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3399|      0|                }
 3400|      0|                job->h.wavelet = (opj_v8_t*)opj_aligned_malloc(l_data_size * sizeof(opj_v8_t));
 3401|      0|                if (!job->h.wavelet) {
  ------------------
  |  Branch (3401:21): [True: 0, False: 0]
  ------------------
 3402|      0|                    opj_thread_pool_wait_completion(tp, 0);
 3403|      0|                    opj_free(job);
 3404|      0|                    opj_aligned_free(h.wavelet);
 3405|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3406|      0|                }
 3407|      0|                job->h.dn = h.dn;
 3408|      0|                job->h.sn = h.sn;
 3409|      0|                job->h.cas = h.cas;
 3410|      0|                job->h.win_l_x0 = h.win_l_x0;
 3411|      0|                job->h.win_l_x1 = h.win_l_x1;
 3412|      0|                job->h.win_h_x0 = h.win_h_x0;
 3413|      0|                job->h.win_h_x1 = h.win_h_x1;
 3414|      0|                job->rw = rw;
 3415|      0|                job->w = w;
 3416|      0|                job->aj = aj;
 3417|      0|                job->nb_rows = (j + 1 == num_jobs) ? (rh & (OPJ_UINT32)~
  ------------------
  |  Branch (3417:32): [True: 0, False: 0]
  ------------------
 3418|      0|                                                      (NB_ELTS_V8 - 1)) - j * step_j : step_j;
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
 3419|      0|                aj += w * job->nb_rows;
 3420|      0|                opj_thread_pool_submit_job(tp, opj_dwt97_decode_h_func, job);
 3421|      0|            }
 3422|      0|            opj_thread_pool_wait_completion(tp, 0);
 3423|      0|            j = rh & (OPJ_UINT32)~(NB_ELTS_V8 - 1);
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
 3424|      0|        }
 3425|       |
 3426|  41.0k|        if (j < rh) {
  ------------------
  |  Branch (3426:13): [True: 23.5k, False: 17.4k]
  ------------------
 3427|  23.5k|            OPJ_UINT32 k;
 3428|  23.5k|            opj_v8dwt_interleave_h(&h, aj, w, rh - j);
 3429|  23.5k|            opj_v8dwt_decode(&h);
 3430|   513k|            for (k = 0; k < rw; k++) {
  ------------------
  |  Branch (3430:25): [True: 490k, False: 23.5k]
  ------------------
 3431|   490k|                OPJ_UINT32 l;
 3432|  2.32M|                for (l = 0; l < rh - j; l++) {
  ------------------
  |  Branch (3432:29): [True: 1.83M, False: 490k]
  ------------------
 3433|  1.83M|                    aj[k + (OPJ_SIZE_T)w  * l ] = h.wavelet[k].f[l];
 3434|  1.83M|                }
 3435|   490k|            }
 3436|  23.5k|        }
 3437|       |
 3438|  41.0k|        v.dn = (OPJ_INT32)(rh - (OPJ_UINT32)v.sn);
 3439|  41.0k|        v.cas = res->y0 % 2;
 3440|  41.0k|        v.win_l_x0 = 0;
 3441|  41.0k|        v.win_l_x1 = (OPJ_UINT32)v.sn;
 3442|  41.0k|        v.win_h_x0 = 0;
 3443|  41.0k|        v.win_h_x1 = (OPJ_UINT32)v.dn;
 3444|       |
 3445|  41.0k|        aj = (OPJ_FLOAT32*) tilec->data;
 3446|  41.0k|        if (num_threads <= 1 || rw < 2 * NB_ELTS_V8) {
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3446:13): [True: 41.0k, False: 0]
  |  Branch (3446:33): [True: 0, False: 0]
  ------------------
 3447|   101k|            for (j = rw; j > (NB_ELTS_V8 - 1); j -= NB_ELTS_V8) {
  ------------------
  |  |   90|   101k|#define NB_ELTS_V8  8
  ------------------
                          for (j = rw; j > (NB_ELTS_V8 - 1); j -= NB_ELTS_V8) {
  ------------------
  |  |   90|  60.0k|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3447:26): [True: 60.0k, False: 41.0k]
  ------------------
 3448|  60.0k|                OPJ_UINT32 k;
 3449|       |
 3450|  60.0k|                opj_v8dwt_interleave_v(&v, aj, w, NB_ELTS_V8);
  ------------------
  |  |   90|  60.0k|#define NB_ELTS_V8  8
  ------------------
 3451|  60.0k|                opj_v8dwt_decode(&v);
 3452|       |
 3453|  5.34M|                for (k = 0; k < rh; ++k) {
  ------------------
  |  Branch (3453:29): [True: 5.28M, False: 60.0k]
  ------------------
 3454|  5.28M|                    memcpy(&aj[k * (OPJ_SIZE_T)w], &v.wavelet[k], NB_ELTS_V8 * sizeof(OPJ_FLOAT32));
  ------------------
  |  |   90|  5.28M|#define NB_ELTS_V8  8
  ------------------
 3455|  5.28M|                }
 3456|  60.0k|                aj += NB_ELTS_V8;
  ------------------
  |  |   90|  60.0k|#define NB_ELTS_V8  8
  ------------------
 3457|  60.0k|            }
 3458|  41.0k|        } else {
 3459|       |            /* "bench_dwt -I" shows that scaling is poor, likely due to RAM
 3460|       |                transfer being the limiting factor. So limit the number of
 3461|       |                threads.
 3462|       |             */
 3463|      0|            OPJ_UINT32 num_jobs = opj_uint_max((OPJ_UINT32)num_threads / 2, 2U);
 3464|      0|            OPJ_UINT32 step_j;
 3465|       |
 3466|      0|            if ((rw / NB_ELTS_V8) < num_jobs) {
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3466:17): [True: 0, False: 0]
  ------------------
 3467|      0|                num_jobs = rw / NB_ELTS_V8;
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
 3468|      0|            }
 3469|      0|            step_j = ((rw / num_jobs) / NB_ELTS_V8) * NB_ELTS_V8;
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
                          step_j = ((rw / num_jobs) / NB_ELTS_V8) * NB_ELTS_V8;
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
 3470|      0|            for (j = 0; j < num_jobs; j++) {
  ------------------
  |  Branch (3470:25): [True: 0, False: 0]
  ------------------
 3471|      0|                opj_dwt97_decode_v_job_t* job;
 3472|       |
 3473|      0|                job = (opj_dwt97_decode_v_job_t*) opj_malloc(sizeof(opj_dwt97_decode_v_job_t));
 3474|      0|                if (!job) {
  ------------------
  |  Branch (3474:21): [True: 0, False: 0]
  ------------------
 3475|      0|                    opj_thread_pool_wait_completion(tp, 0);
 3476|      0|                    opj_aligned_free(h.wavelet);
 3477|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3478|      0|                }
 3479|      0|                job->v.wavelet = (opj_v8_t*)opj_aligned_malloc(l_data_size * sizeof(opj_v8_t));
 3480|      0|                if (!job->v.wavelet) {
  ------------------
  |  Branch (3480:21): [True: 0, False: 0]
  ------------------
 3481|      0|                    opj_thread_pool_wait_completion(tp, 0);
 3482|      0|                    opj_free(job);
 3483|      0|                    opj_aligned_free(h.wavelet);
 3484|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3485|      0|                }
 3486|      0|                job->v.dn = v.dn;
 3487|      0|                job->v.sn = v.sn;
 3488|      0|                job->v.cas = v.cas;
 3489|      0|                job->v.win_l_x0 = v.win_l_x0;
 3490|      0|                job->v.win_l_x1 = v.win_l_x1;
 3491|      0|                job->v.win_h_x0 = v.win_h_x0;
 3492|      0|                job->v.win_h_x1 = v.win_h_x1;
 3493|      0|                job->rh = rh;
 3494|      0|                job->w = w;
 3495|      0|                job->aj = aj;
 3496|      0|                job->nb_columns = (j + 1 == num_jobs) ? (rw & (OPJ_UINT32)~
  ------------------
  |  Branch (3496:35): [True: 0, False: 0]
  ------------------
 3497|      0|                                  (NB_ELTS_V8 - 1)) - j * step_j : step_j;
  ------------------
  |  |   90|      0|#define NB_ELTS_V8  8
  ------------------
 3498|      0|                aj += job->nb_columns;
 3499|      0|                opj_thread_pool_submit_job(tp, opj_dwt97_decode_v_func, job);
 3500|      0|            }
 3501|      0|            opj_thread_pool_wait_completion(tp, 0);
 3502|      0|        }
 3503|       |
 3504|  41.0k|        if (rw & (NB_ELTS_V8 - 1)) {
  ------------------
  |  |   90|  41.0k|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3504:13): [True: 17.8k, False: 23.1k]
  ------------------
 3505|  17.8k|            OPJ_UINT32 k;
 3506|       |
 3507|  17.8k|            j = rw & (NB_ELTS_V8 - 1);
  ------------------
  |  |   90|  17.8k|#define NB_ELTS_V8  8
  ------------------
 3508|       |
 3509|  17.8k|            opj_v8dwt_interleave_v(&v, aj, w, j);
 3510|  17.8k|            opj_v8dwt_decode(&v);
 3511|       |
 3512|   781k|            for (k = 0; k < rh; ++k) {
  ------------------
  |  Branch (3512:25): [True: 763k, False: 17.8k]
  ------------------
 3513|   763k|                memcpy(&aj[k * (OPJ_SIZE_T)w], &v.wavelet[k],
 3514|   763k|                       (OPJ_SIZE_T)j * sizeof(OPJ_FLOAT32));
 3515|   763k|            }
 3516|  17.8k|        }
 3517|  41.0k|    }
 3518|       |
 3519|  4.37k|    opj_aligned_free(h.wavelet);
 3520|  4.37k|    return OPJ_TRUE;
  ------------------
  |  |  117|  4.37k|#define OPJ_TRUE 1
  ------------------
 3521|  4.37k|}
dwt.c:opj_v8dwt_interleave_h:
 2869|   131k|{
 2870|   131k|    OPJ_FLOAT32* OPJ_RESTRICT bi = (OPJ_FLOAT32*)(dwt->wavelet + dwt->cas);
 2871|   131k|    OPJ_UINT32 i, k;
 2872|   131k|    OPJ_UINT32 x0 = dwt->win_l_x0;
 2873|   131k|    OPJ_UINT32 x1 = dwt->win_l_x1;
 2874|       |
 2875|   394k|    for (k = 0; k < 2; ++k) {
  ------------------
  |  Branch (2875:17): [True: 262k, False: 131k]
  ------------------
 2876|   262k|        if (remaining_height >= NB_ELTS_V8 && ((OPJ_SIZE_T) a & 0x0f) == 0 &&
  ------------------
  |  |   90|   525k|#define NB_ELTS_V8  8
  ------------------
  |  Branch (2876:13): [True: 215k, False: 47.1k]
  |  Branch (2876:47): [True: 128k, False: 87.1k]
  ------------------
 2877|   262k|                ((OPJ_SIZE_T) bi & 0x0f) == 0) {
  ------------------
  |  Branch (2877:17): [True: 128k, False: 0]
  ------------------
 2878|       |            /* Fast code path */
 2879|  4.48M|            for (i = x0; i < x1; ++i) {
  ------------------
  |  Branch (2879:26): [True: 4.35M, False: 128k]
  ------------------
 2880|  4.35M|                OPJ_UINT32 j = i;
 2881|  4.35M|                OPJ_FLOAT32* OPJ_RESTRICT dst = bi + i * 2 * NB_ELTS_V8;
  ------------------
  |  |   90|  4.35M|#define NB_ELTS_V8  8
  ------------------
 2882|  4.35M|                dst[0] = a[j];
 2883|  4.35M|                j += width;
 2884|  4.35M|                dst[1] = a[j];
 2885|  4.35M|                j += width;
 2886|  4.35M|                dst[2] = a[j];
 2887|  4.35M|                j += width;
 2888|  4.35M|                dst[3] = a[j];
 2889|  4.35M|                j += width;
 2890|  4.35M|                dst[4] = a[j];
 2891|  4.35M|                j += width;
 2892|  4.35M|                dst[5] = a[j];
 2893|  4.35M|                j += width;
 2894|  4.35M|                dst[6] = a[j];
 2895|  4.35M|                j += width;
 2896|  4.35M|                dst[7] = a[j];
 2897|  4.35M|            }
 2898|   134k|        } else {
 2899|       |            /* Slow code path */
 2900|  1.50M|            for (i = x0; i < x1; ++i) {
  ------------------
  |  Branch (2900:26): [True: 1.36M, False: 134k]
  ------------------
 2901|  1.36M|                OPJ_UINT32 j = i;
 2902|  1.36M|                OPJ_FLOAT32* OPJ_RESTRICT dst = bi + i * 2 * NB_ELTS_V8;
  ------------------
  |  |   90|  1.36M|#define NB_ELTS_V8  8
  ------------------
 2903|  1.36M|                dst[0] = a[j];
 2904|  1.36M|                j += width;
 2905|  1.36M|                if (remaining_height == 1) {
  ------------------
  |  Branch (2905:21): [True: 110k, False: 1.25M]
  ------------------
 2906|   110k|                    continue;
 2907|   110k|                }
 2908|  1.25M|                dst[1] = a[j];
 2909|  1.25M|                j += width;
 2910|  1.25M|                if (remaining_height == 2) {
  ------------------
  |  Branch (2910:21): [True: 69.0k, False: 1.18M]
  ------------------
 2911|  69.0k|                    continue;
 2912|  69.0k|                }
 2913|  1.18M|                dst[2] = a[j];
 2914|  1.18M|                j += width;
 2915|  1.18M|                if (remaining_height == 3) {
  ------------------
  |  Branch (2915:21): [True: 55.3k, False: 1.13M]
  ------------------
 2916|  55.3k|                    continue;
 2917|  55.3k|                }
 2918|  1.13M|                dst[3] = a[j];
 2919|  1.13M|                j += width;
 2920|  1.13M|                if (remaining_height == 4) {
  ------------------
  |  Branch (2920:21): [True: 76.9k, False: 1.05M]
  ------------------
 2921|  76.9k|                    continue;
 2922|  76.9k|                }
 2923|  1.05M|                dst[4] = a[j];
 2924|  1.05M|                j += width;
 2925|  1.05M|                if (remaining_height == 5) {
  ------------------
  |  Branch (2925:21): [True: 26.6k, False: 1.02M]
  ------------------
 2926|  26.6k|                    continue;
 2927|  26.6k|                }
 2928|  1.02M|                dst[5] = a[j];
 2929|  1.02M|                j += width;
 2930|  1.02M|                if (remaining_height == 6) {
  ------------------
  |  Branch (2930:21): [True: 82.3k, False: 945k]
  ------------------
 2931|  82.3k|                    continue;
 2932|  82.3k|                }
 2933|   945k|                dst[6] = a[j];
 2934|   945k|                j += width;
 2935|   945k|                if (remaining_height == 7) {
  ------------------
  |  Branch (2935:21): [True: 69.3k, False: 876k]
  ------------------
 2936|  69.3k|                    continue;
 2937|  69.3k|                }
 2938|   876k|                dst[7] = a[j];
 2939|   876k|            }
 2940|   134k|        }
 2941|       |
 2942|   262k|        bi = (OPJ_FLOAT32*)(dwt->wavelet + 1 - dwt->cas);
 2943|   262k|        a += dwt->sn;
 2944|   262k|        x0 = dwt->win_h_x0;
 2945|   262k|        x1 = dwt->win_h_x1;
 2946|   262k|    }
 2947|   131k|}
dwt.c:opj_v8dwt_decode:
 3142|   450k|{
 3143|   450k|    OPJ_INT32 a, b;
 3144|       |    /* BUG_WEIRD_TWO_INVK (look for this identifier in tcd.c) */
 3145|       |    /* Historic value for 2 / opj_invK */
 3146|       |    /* Normally, we should use invK, but if we do so, we have failures in the */
 3147|       |    /* conformance test, due to MSE and peak errors significantly higher than */
 3148|       |    /* accepted value */
 3149|       |    /* Due to using two_invK instead of invK, we have to compensate in tcd.c */
 3150|       |    /* the computation of the stepsize for the non LL subbands */
 3151|   450k|    const float two_invK = 1.625732422f;
 3152|   450k|    if (dwt->cas == 0) {
  ------------------
  |  Branch (3152:9): [True: 303k, False: 146k]
  ------------------
 3153|   303k|        if (!((dwt->dn > 0) || (dwt->sn > 1))) {
  ------------------
  |  Branch (3153:15): [True: 164k, False: 138k]
  |  Branch (3153:32): [True: 0, False: 138k]
  ------------------
 3154|   138k|            return;
 3155|   138k|        }
 3156|   164k|        a = 0;
 3157|   164k|        b = 1;
 3158|   164k|    } else {
 3159|   146k|        if (!((dwt->sn > 0) || (dwt->dn > 1))) {
  ------------------
  |  Branch (3159:15): [True: 100k, False: 45.9k]
  |  Branch (3159:32): [True: 0, False: 45.9k]
  ------------------
 3160|  45.9k|            return;
 3161|  45.9k|        }
 3162|   100k|        a = 1;
 3163|   100k|        b = 0;
 3164|   100k|    }
 3165|   265k|#ifdef __SSE__
 3166|   265k|    opj_v8dwt_decode_step1_sse(dwt->wavelet + a, dwt->win_l_x0, dwt->win_l_x1,
 3167|   265k|                               _mm_set1_ps(opj_K));
 3168|   265k|    opj_v8dwt_decode_step1_sse(dwt->wavelet + b, dwt->win_h_x0, dwt->win_h_x1,
 3169|   265k|                               _mm_set1_ps(two_invK));
 3170|   265k|    opj_v8dwt_decode_step2_sse(dwt->wavelet + b, dwt->wavelet + a + 1,
 3171|   265k|                               dwt->win_l_x0, dwt->win_l_x1,
 3172|   265k|                               (OPJ_UINT32)opj_int_min(dwt->sn, dwt->dn - a),
 3173|   265k|                               _mm_set1_ps(-opj_dwt_delta));
 3174|   265k|    opj_v8dwt_decode_step2_sse(dwt->wavelet + a, dwt->wavelet + b + 1,
 3175|   265k|                               dwt->win_h_x0, dwt->win_h_x1,
 3176|   265k|                               (OPJ_UINT32)opj_int_min(dwt->dn, dwt->sn - b),
 3177|   265k|                               _mm_set1_ps(-opj_dwt_gamma));
 3178|   265k|    opj_v8dwt_decode_step2_sse(dwt->wavelet + b, dwt->wavelet + a + 1,
 3179|   265k|                               dwt->win_l_x0, dwt->win_l_x1,
 3180|   265k|                               (OPJ_UINT32)opj_int_min(dwt->sn, dwt->dn - a),
 3181|   265k|                               _mm_set1_ps(-opj_dwt_beta));
 3182|   265k|    opj_v8dwt_decode_step2_sse(dwt->wavelet + a, dwt->wavelet + b + 1,
 3183|   265k|                               dwt->win_h_x0, dwt->win_h_x1,
 3184|   265k|                               (OPJ_UINT32)opj_int_min(dwt->dn, dwt->sn - b),
 3185|   265k|                               _mm_set1_ps(-opj_dwt_alpha));
 3186|       |#else
 3187|       |    opj_v8dwt_decode_step1(dwt->wavelet + a, dwt->win_l_x0, dwt->win_l_x1,
 3188|       |                           opj_K);
 3189|       |    opj_v8dwt_decode_step1(dwt->wavelet + b, dwt->win_h_x0, dwt->win_h_x1,
 3190|       |                           two_invK);
 3191|       |    opj_v8dwt_decode_step2(dwt->wavelet + b, dwt->wavelet + a + 1,
 3192|       |                           dwt->win_l_x0, dwt->win_l_x1,
 3193|       |                           (OPJ_UINT32)opj_int_min(dwt->sn, dwt->dn - a),
 3194|       |                           -opj_dwt_delta);
 3195|       |    opj_v8dwt_decode_step2(dwt->wavelet + a, dwt->wavelet + b + 1,
 3196|       |                           dwt->win_h_x0, dwt->win_h_x1,
 3197|       |                           (OPJ_UINT32)opj_int_min(dwt->dn, dwt->sn - b),
 3198|       |                           -opj_dwt_gamma);
 3199|       |    opj_v8dwt_decode_step2(dwt->wavelet + b, dwt->wavelet + a + 1,
 3200|       |                           dwt->win_l_x0, dwt->win_l_x1,
 3201|       |                           (OPJ_UINT32)opj_int_min(dwt->sn, dwt->dn - a),
 3202|       |                           -opj_dwt_beta);
 3203|       |    opj_v8dwt_decode_step2(dwt->wavelet + a, dwt->wavelet + b + 1,
 3204|       |                           dwt->win_h_x0, dwt->win_h_x1,
 3205|       |                           (OPJ_UINT32)opj_int_min(dwt->dn, dwt->sn - b),
 3206|       |                           -opj_dwt_alpha);
 3207|       |#endif
 3208|   265k|}
dwt.c:opj_v8dwt_decode_step1_sse:
 3024|   530k|{
 3025|   530k|    __m128* OPJ_RESTRICT vw = (__m128*) w;
 3026|   530k|    OPJ_UINT32 i = start;
 3027|       |    /* To be adapted if NB_ELTS_V8 changes */
 3028|   530k|    vw += 4 * start;
 3029|       |    /* Note: attempt at loop unrolling x2 doesn't help */
 3030|  18.0M|    for (; i < end; ++i, vw += 4) {
  ------------------
  |  Branch (3030:12): [True: 17.4M, False: 530k]
  ------------------
 3031|  17.4M|        vw[0] = _mm_mul_ps(vw[0], c);
 3032|  17.4M|        vw[1] = _mm_mul_ps(vw[1], c);
 3033|  17.4M|    }
 3034|   530k|}
dwt.c:opj_v8dwt_decode_step2_sse:
 3041|  1.06M|{
 3042|  1.06M|    __m128* OPJ_RESTRICT vl = (__m128*) l;
 3043|  1.06M|    __m128* OPJ_RESTRICT vw = (__m128*) w;
 3044|       |    /* To be adapted if NB_ELTS_V8 changes */
 3045|  1.06M|    OPJ_UINT32 i;
 3046|  1.06M|    OPJ_UINT32 imax = opj_uint_min(end, m);
 3047|  1.06M|    if (start == 0) {
  ------------------
  |  Branch (3047:9): [True: 1.06M, False: 0]
  ------------------
 3048|  1.06M|        if (imax >= 1) {
  ------------------
  |  Branch (3048:13): [True: 971k, False: 88.8k]
  ------------------
 3049|   971k|            vw[-2] = _mm_add_ps(vw[-2], _mm_mul_ps(_mm_add_ps(vl[0], vw[0]), c));
 3050|   971k|            vw[-1] = _mm_add_ps(vw[-1], _mm_mul_ps(_mm_add_ps(vl[1], vw[1]), c));
 3051|   971k|            vw += 4;
 3052|   971k|            start = 1;
 3053|   971k|        }
 3054|  1.06M|    } else {
 3055|      0|        vw += start * 4;
 3056|      0|    }
 3057|       |
 3058|  1.06M|    i = start;
 3059|       |    /* Note: attempt at loop unrolling x2 doesn't help */
 3060|  34.6M|    for (; i < imax; ++i) {
  ------------------
  |  Branch (3060:12): [True: 33.5M, False: 1.06M]
  ------------------
 3061|  33.5M|        vw[-2] = _mm_add_ps(vw[-2], _mm_mul_ps(_mm_add_ps(vw[-4], vw[0]), c));
 3062|  33.5M|        vw[-1] = _mm_add_ps(vw[-1], _mm_mul_ps(_mm_add_ps(vw[-3], vw[1]), c));
 3063|  33.5M|        vw += 4;
 3064|  33.5M|    }
 3065|  1.06M|    if (m < end) {
  ------------------
  |  Branch (3065:9): [True: 479k, False: 580k]
  ------------------
 3066|   479k|        assert(m + 1 == end);
 3067|   479k|        c = _mm_add_ps(c, c);
 3068|   479k|        vw[-2] = _mm_add_ps(vw[-2], _mm_mul_ps(c, vw[-4]));
 3069|   479k|        vw[-1] = _mm_add_ps(vw[-1], _mm_mul_ps(c, vw[-3]));
 3070|   479k|    }
 3071|  1.06M|}
dwt.c:opj_v8dwt_interleave_v:
 2979|  77.8k|{
 2980|  77.8k|    opj_v8_t* OPJ_RESTRICT bi = dwt->wavelet + dwt->cas;
 2981|  77.8k|    OPJ_UINT32 i;
 2982|       |
 2983|  3.10M|    for (i = dwt->win_l_x0; i < dwt->win_l_x1; ++i) {
  ------------------
  |  Branch (2983:29): [True: 3.02M, False: 77.8k]
  ------------------
 2984|  3.02M|        memcpy(&bi[i * 2], &a[i * (OPJ_SIZE_T)width],
 2985|  3.02M|               (OPJ_SIZE_T)nb_elts_read * sizeof(OPJ_FLOAT32));
 2986|  3.02M|    }
 2987|       |
 2988|  77.8k|    a += (OPJ_UINT32)dwt->sn * (OPJ_SIZE_T)width;
 2989|  77.8k|    bi = dwt->wavelet + 1 - dwt->cas;
 2990|       |
 2991|  3.09M|    for (i = dwt->win_h_x0; i < dwt->win_h_x1; ++i) {
  ------------------
  |  Branch (2991:29): [True: 3.01M, False: 77.8k]
  ------------------
 2992|  3.01M|        memcpy(&bi[i * 2], &a[i * (OPJ_SIZE_T)width],
 2993|  3.01M|               (OPJ_SIZE_T)nb_elts_read * sizeof(OPJ_FLOAT32));
 2994|  3.01M|    }
 2995|  77.8k|}
dwt.c:opj_dwt_decode_partial_97:
 3526|  3.56k|{
 3527|  3.56k|    opj_sparse_array_int32_t* sa;
 3528|  3.56k|    opj_v8dwt_t h;
 3529|  3.56k|    opj_v8dwt_t v;
 3530|  3.56k|    OPJ_UINT32 resno;
 3531|       |    /* This value matches the maximum left/right extension given in tables */
 3532|       |    /* F.2 and F.3 of the standard. Note: in opj_tcd_is_subband_area_of_interest() */
 3533|       |    /* we currently use 3. */
 3534|  3.56k|    const OPJ_UINT32 filter_width = 4U;
 3535|       |
 3536|  3.56k|    opj_tcd_resolution_t* tr = tilec->resolutions;
 3537|  3.56k|    opj_tcd_resolution_t* tr_max = &(tilec->resolutions[numres - 1]);
 3538|       |
 3539|  3.56k|    OPJ_UINT32 rw = (OPJ_UINT32)(tr->x1 -
 3540|  3.56k|                                 tr->x0);    /* width of the resolution level computed */
 3541|  3.56k|    OPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 -
 3542|  3.56k|                                 tr->y0);    /* height of the resolution level computed */
 3543|       |
 3544|  3.56k|    OPJ_SIZE_T l_data_size;
 3545|       |
 3546|       |    /* Compute the intersection of the area of interest, expressed in tile coordinates */
 3547|       |    /* with the tile coordinates */
 3548|  3.56k|    OPJ_UINT32 win_tcx0 = tilec->win_x0;
 3549|  3.56k|    OPJ_UINT32 win_tcy0 = tilec->win_y0;
 3550|  3.56k|    OPJ_UINT32 win_tcx1 = tilec->win_x1;
 3551|  3.56k|    OPJ_UINT32 win_tcy1 = tilec->win_y1;
 3552|       |
 3553|  3.56k|    if (tr_max->x0 == tr_max->x1 || tr_max->y0 == tr_max->y1) {
  ------------------
  |  Branch (3553:9): [True: 303, False: 3.26k]
  |  Branch (3553:37): [True: 466, False: 2.79k]
  ------------------
 3554|    769|        return OPJ_TRUE;
  ------------------
  |  |  117|    769|#define OPJ_TRUE 1
  ------------------
 3555|    769|    }
 3556|       |
 3557|  2.79k|    sa = opj_dwt_init_sparse_array(tilec, numres);
 3558|  2.79k|    if (sa == NULL) {
  ------------------
  |  Branch (3558:9): [True: 0, False: 2.79k]
  ------------------
 3559|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3560|      0|    }
 3561|       |
 3562|  2.79k|    if (numres == 1U) {
  ------------------
  |  Branch (3562:9): [True: 1.16k, False: 1.62k]
  ------------------
 3563|  1.16k|        OPJ_BOOL ret = opj_sparse_array_int32_read(sa,
 3564|  1.16k|                       tr_max->win_x0 - (OPJ_UINT32)tr_max->x0,
 3565|  1.16k|                       tr_max->win_y0 - (OPJ_UINT32)tr_max->y0,
 3566|  1.16k|                       tr_max->win_x1 - (OPJ_UINT32)tr_max->x0,
 3567|  1.16k|                       tr_max->win_y1 - (OPJ_UINT32)tr_max->y0,
 3568|  1.16k|                       tilec->data_win,
 3569|  1.16k|                       1, tr_max->win_x1 - tr_max->win_x0,
 3570|  1.16k|                       OPJ_TRUE);
  ------------------
  |  |  117|  1.16k|#define OPJ_TRUE 1
  ------------------
 3571|  1.16k|        assert(ret);
 3572|  1.16k|        OPJ_UNUSED(ret);
  ------------------
  |  |  219|  1.16k|#define OPJ_UNUSED(x) (void)x
  ------------------
 3573|  1.16k|        opj_sparse_array_int32_free(sa);
 3574|  1.16k|        return OPJ_TRUE;
  ------------------
  |  |  117|  1.16k|#define OPJ_TRUE 1
  ------------------
 3575|  1.16k|    }
 3576|       |
 3577|  1.62k|    l_data_size = opj_dwt_max_resolution(tr, numres);
 3578|       |    /* overflow check */
 3579|  1.62k|    if (l_data_size > (SIZE_MAX / sizeof(opj_v8_t))) {
  ------------------
  |  Branch (3579:9): [True: 0, False: 1.62k]
  ------------------
 3580|       |        /* FIXME event manager error callback */
 3581|      0|        opj_sparse_array_int32_free(sa);
 3582|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3583|      0|    }
 3584|  1.62k|    h.wavelet = (opj_v8_t*) opj_aligned_malloc(l_data_size * sizeof(opj_v8_t));
 3585|  1.62k|    if (!h.wavelet) {
  ------------------
  |  Branch (3585:9): [True: 0, False: 1.62k]
  ------------------
 3586|       |        /* FIXME event manager error callback */
 3587|      0|        opj_sparse_array_int32_free(sa);
 3588|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3589|      0|    }
 3590|  1.62k|    v.wavelet = h.wavelet;
 3591|       |
 3592|  14.0k|    for (resno = 1; resno < numres; resno ++) {
  ------------------
  |  Branch (3592:21): [True: 12.3k, False: 1.62k]
  ------------------
 3593|  12.3k|        OPJ_UINT32 j;
 3594|       |        /* Window of interest subband-based coordinates */
 3595|  12.3k|        OPJ_UINT32 win_ll_x0, win_ll_y0, win_ll_x1, win_ll_y1;
 3596|  12.3k|        OPJ_UINT32 win_hl_x0, win_hl_x1;
 3597|  12.3k|        OPJ_UINT32 win_lh_y0, win_lh_y1;
 3598|       |        /* Window of interest tile-resolution-based coordinates */
 3599|  12.3k|        OPJ_UINT32 win_tr_x0, win_tr_x1, win_tr_y0, win_tr_y1;
 3600|       |        /* Tile-resolution subband-based coordinates */
 3601|  12.3k|        OPJ_UINT32 tr_ll_x0, tr_ll_y0, tr_hl_x0, tr_lh_y0;
 3602|       |
 3603|  12.3k|        ++tr;
 3604|       |
 3605|  12.3k|        h.sn = (OPJ_INT32)rw;
 3606|  12.3k|        v.sn = (OPJ_INT32)rh;
 3607|       |
 3608|  12.3k|        rw = (OPJ_UINT32)(tr->x1 - tr->x0);
 3609|  12.3k|        rh = (OPJ_UINT32)(tr->y1 - tr->y0);
 3610|       |
 3611|  12.3k|        h.dn = (OPJ_INT32)(rw - (OPJ_UINT32)h.sn);
 3612|  12.3k|        h.cas = tr->x0 % 2;
 3613|       |
 3614|  12.3k|        v.dn = (OPJ_INT32)(rh - (OPJ_UINT32)v.sn);
 3615|  12.3k|        v.cas = tr->y0 % 2;
 3616|       |
 3617|       |        /* Get the subband coordinates for the window of interest */
 3618|       |        /* LL band */
 3619|  12.3k|        opj_dwt_get_band_coordinates(tilec, resno, 0,
 3620|  12.3k|                                     win_tcx0, win_tcy0, win_tcx1, win_tcy1,
 3621|  12.3k|                                     &win_ll_x0, &win_ll_y0,
 3622|  12.3k|                                     &win_ll_x1, &win_ll_y1);
 3623|       |
 3624|       |        /* HL band */
 3625|  12.3k|        opj_dwt_get_band_coordinates(tilec, resno, 1,
 3626|  12.3k|                                     win_tcx0, win_tcy0, win_tcx1, win_tcy1,
 3627|  12.3k|                                     &win_hl_x0, NULL, &win_hl_x1, NULL);
 3628|       |
 3629|       |        /* LH band */
 3630|  12.3k|        opj_dwt_get_band_coordinates(tilec, resno, 2,
 3631|  12.3k|                                     win_tcx0, win_tcy0, win_tcx1, win_tcy1,
 3632|  12.3k|                                     NULL, &win_lh_y0, NULL, &win_lh_y1);
 3633|       |
 3634|       |        /* Beware: band index for non-LL0 resolution are 0=HL, 1=LH and 2=HH */
 3635|  12.3k|        tr_ll_x0 = (OPJ_UINT32)tr->bands[1].x0;
 3636|  12.3k|        tr_ll_y0 = (OPJ_UINT32)tr->bands[0].y0;
 3637|  12.3k|        tr_hl_x0 = (OPJ_UINT32)tr->bands[0].x0;
 3638|  12.3k|        tr_lh_y0 = (OPJ_UINT32)tr->bands[1].y0;
 3639|       |
 3640|       |        /* Subtract the origin of the bands for this tile, to the subwindow */
 3641|       |        /* of interest band coordinates, so as to get them relative to the */
 3642|       |        /* tile */
 3643|  12.3k|        win_ll_x0 = opj_uint_subs(win_ll_x0, tr_ll_x0);
 3644|  12.3k|        win_ll_y0 = opj_uint_subs(win_ll_y0, tr_ll_y0);
 3645|  12.3k|        win_ll_x1 = opj_uint_subs(win_ll_x1, tr_ll_x0);
 3646|  12.3k|        win_ll_y1 = opj_uint_subs(win_ll_y1, tr_ll_y0);
 3647|  12.3k|        win_hl_x0 = opj_uint_subs(win_hl_x0, tr_hl_x0);
 3648|  12.3k|        win_hl_x1 = opj_uint_subs(win_hl_x1, tr_hl_x0);
 3649|  12.3k|        win_lh_y0 = opj_uint_subs(win_lh_y0, tr_lh_y0);
 3650|  12.3k|        win_lh_y1 = opj_uint_subs(win_lh_y1, tr_lh_y0);
 3651|       |
 3652|  12.3k|        opj_dwt_segment_grow(filter_width, (OPJ_UINT32)h.sn, &win_ll_x0, &win_ll_x1);
 3653|  12.3k|        opj_dwt_segment_grow(filter_width, (OPJ_UINT32)h.dn, &win_hl_x0, &win_hl_x1);
 3654|       |
 3655|  12.3k|        opj_dwt_segment_grow(filter_width, (OPJ_UINT32)v.sn, &win_ll_y0, &win_ll_y1);
 3656|  12.3k|        opj_dwt_segment_grow(filter_width, (OPJ_UINT32)v.dn, &win_lh_y0, &win_lh_y1);
 3657|       |
 3658|       |        /* Compute the tile-resolution-based coordinates for the window of interest */
 3659|  12.3k|        if (h.cas == 0) {
  ------------------
  |  Branch (3659:13): [True: 5.77k, False: 6.61k]
  ------------------
 3660|  5.77k|            win_tr_x0 = opj_uint_min(2 * win_ll_x0, 2 * win_hl_x0 + 1);
 3661|  5.77k|            win_tr_x1 = opj_uint_min(opj_uint_max(2 * win_ll_x1, 2 * win_hl_x1 + 1), rw);
 3662|  6.61k|        } else {
 3663|  6.61k|            win_tr_x0 = opj_uint_min(2 * win_hl_x0, 2 * win_ll_x0 + 1);
 3664|  6.61k|            win_tr_x1 = opj_uint_min(opj_uint_max(2 * win_hl_x1, 2 * win_ll_x1 + 1), rw);
 3665|  6.61k|        }
 3666|       |
 3667|  12.3k|        if (v.cas == 0) {
  ------------------
  |  Branch (3667:13): [True: 7.34k, False: 5.04k]
  ------------------
 3668|  7.34k|            win_tr_y0 = opj_uint_min(2 * win_ll_y0, 2 * win_lh_y0 + 1);
 3669|  7.34k|            win_tr_y1 = opj_uint_min(opj_uint_max(2 * win_ll_y1, 2 * win_lh_y1 + 1), rh);
 3670|  7.34k|        } else {
 3671|  5.04k|            win_tr_y0 = opj_uint_min(2 * win_lh_y0, 2 * win_ll_y0 + 1);
 3672|  5.04k|            win_tr_y1 = opj_uint_min(opj_uint_max(2 * win_lh_y1, 2 * win_ll_y1 + 1), rh);
 3673|  5.04k|        }
 3674|       |
 3675|  12.3k|        h.win_l_x0 = win_ll_x0;
 3676|  12.3k|        h.win_l_x1 = win_ll_x1;
 3677|  12.3k|        h.win_h_x0 = win_hl_x0;
 3678|  12.3k|        h.win_h_x1 = win_hl_x1;
 3679|   121M|        for (j = 0; j + (NB_ELTS_V8 - 1) < rh; j += NB_ELTS_V8) {
  ------------------
  |  |   90|   121M|#define NB_ELTS_V8  8
  ------------------
                      for (j = 0; j + (NB_ELTS_V8 - 1) < rh; j += NB_ELTS_V8) {
  ------------------
  |  |   90|   121M|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3679:21): [True: 121M, False: 12.3k]
  ------------------
 3680|   121M|            if ((j + (NB_ELTS_V8 - 1) >= win_ll_y0 && j < win_ll_y1) ||
  ------------------
  |  |   90|   121M|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3680:18): [True: 121M, False: 0]
  |  Branch (3680:55): [True: 65.5k, False: 121M]
  ------------------
 3681|   121M|                    (j + (NB_ELTS_V8 - 1) >= win_lh_y0 + (OPJ_UINT32)v.sn &&
  ------------------
  |  |   90|   121M|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3681:22): [True: 60.6M, False: 60.5M]
  ------------------
 3682|   121M|                     j < win_lh_y1 + (OPJ_UINT32)v.sn)) {
  ------------------
  |  Branch (3682:22): [True: 65.8k, False: 60.5M]
  ------------------
 3683|   131k|                opj_v8dwt_interleave_partial_h(&h, sa, j, opj_uint_min(NB_ELTS_V8, rh - j));
  ------------------
  |  |   90|   131k|#define NB_ELTS_V8  8
  ------------------
 3684|   131k|                opj_v8dwt_decode(&h);
 3685|   131k|                if (!opj_sparse_array_int32_write(sa,
  ------------------
  |  Branch (3685:21): [True: 0, False: 131k]
  ------------------
 3686|   131k|                                                  win_tr_x0, j,
 3687|   131k|                                                  win_tr_x1, j + NB_ELTS_V8,
  ------------------
  |  |   90|   131k|#define NB_ELTS_V8  8
  ------------------
 3688|   131k|                                                  (OPJ_INT32*)&h.wavelet[win_tr_x0].f[0],
 3689|   131k|                                                  NB_ELTS_V8, 1, OPJ_TRUE)) {
  ------------------
  |  |   90|   131k|#define NB_ELTS_V8  8
  ------------------
                                                                NB_ELTS_V8, 1, OPJ_TRUE)) {
  ------------------
  |  |  117|   131k|#define OPJ_TRUE 1
  ------------------
 3690|       |                    /* FIXME event manager error callback */
 3691|      0|                    opj_sparse_array_int32_free(sa);
 3692|      0|                    opj_aligned_free(h.wavelet);
 3693|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3694|      0|                }
 3695|   131k|            }
 3696|   121M|        }
 3697|       |
 3698|  12.3k|        if (j < rh &&
  ------------------
  |  Branch (3698:13): [True: 8.98k, False: 3.40k]
  ------------------
 3699|  12.3k|                ((j + (NB_ELTS_V8 - 1) >= win_ll_y0 && j < win_ll_y1) ||
  ------------------
  |  |   90|  8.98k|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3699:19): [True: 8.98k, False: 0]
  |  Branch (3699:56): [True: 4.03k, False: 4.95k]
  ------------------
 3700|  8.98k|                 (j + (NB_ELTS_V8 - 1) >= win_lh_y0 + (OPJ_UINT32)v.sn &&
  ------------------
  |  |   90|  4.95k|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3700:19): [True: 4.95k, False: 0]
  ------------------
 3701|  5.18k|                  j < win_lh_y1 + (OPJ_UINT32)v.sn))) {
  ------------------
  |  Branch (3701:19): [True: 1.14k, False: 3.80k]
  ------------------
 3702|  5.18k|            opj_v8dwt_interleave_partial_h(&h, sa, j, rh - j);
 3703|  5.18k|            opj_v8dwt_decode(&h);
 3704|  5.18k|            if (!opj_sparse_array_int32_write(sa,
  ------------------
  |  Branch (3704:17): [True: 0, False: 5.18k]
  ------------------
 3705|  5.18k|                                              win_tr_x0, j,
 3706|  5.18k|                                              win_tr_x1, rh,
 3707|  5.18k|                                              (OPJ_INT32*)&h.wavelet[win_tr_x0].f[0],
 3708|  5.18k|                                              NB_ELTS_V8, 1, OPJ_TRUE)) {
  ------------------
  |  |   90|  5.18k|#define NB_ELTS_V8  8
  ------------------
                                                            NB_ELTS_V8, 1, OPJ_TRUE)) {
  ------------------
  |  |  117|  5.18k|#define OPJ_TRUE 1
  ------------------
 3709|       |                /* FIXME event manager error callback */
 3710|      0|                opj_sparse_array_int32_free(sa);
 3711|      0|                opj_aligned_free(h.wavelet);
 3712|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3713|      0|            }
 3714|  5.18k|        }
 3715|       |
 3716|  12.3k|        v.win_l_x0 = win_ll_y0;
 3717|  12.3k|        v.win_l_x1 = win_ll_y1;
 3718|  12.3k|        v.win_h_x0 = win_lh_y0;
 3719|  12.3k|        v.win_h_x1 = win_lh_y1;
 3720|   116k|        for (j = win_tr_x0; j < win_tr_x1; j += NB_ELTS_V8) {
  ------------------
  |  |   90|   104k|#define NB_ELTS_V8  8
  ------------------
  |  Branch (3720:29): [True: 104k, False: 12.3k]
  ------------------
 3721|   104k|            OPJ_UINT32 nb_elts = opj_uint_min(NB_ELTS_V8, win_tr_x1 - j);
  ------------------
  |  |   90|   104k|#define NB_ELTS_V8  8
  ------------------
 3722|       |
 3723|   104k|            opj_v8dwt_interleave_partial_v(&v, sa, j, nb_elts);
 3724|   104k|            opj_v8dwt_decode(&v);
 3725|       |
 3726|   104k|            if (!opj_sparse_array_int32_write(sa,
  ------------------
  |  Branch (3726:17): [True: 0, False: 104k]
  ------------------
 3727|   104k|                                              j, win_tr_y0,
 3728|   104k|                                              j + nb_elts, win_tr_y1,
 3729|   104k|                                              (OPJ_INT32*)&h.wavelet[win_tr_y0].f[0],
 3730|   104k|                                              1, NB_ELTS_V8, OPJ_TRUE)) {
  ------------------
  |  |   90|   104k|#define NB_ELTS_V8  8
  ------------------
                                                            1, NB_ELTS_V8, OPJ_TRUE)) {
  ------------------
  |  |  117|   104k|#define OPJ_TRUE 1
  ------------------
 3731|       |                /* FIXME event manager error callback */
 3732|      0|                opj_sparse_array_int32_free(sa);
 3733|      0|                opj_aligned_free(h.wavelet);
 3734|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3735|      0|            }
 3736|   104k|        }
 3737|  12.3k|    }
 3738|       |
 3739|  1.62k|    {
 3740|  1.62k|        OPJ_BOOL ret = opj_sparse_array_int32_read(sa,
 3741|  1.62k|                       tr_max->win_x0 - (OPJ_UINT32)tr_max->x0,
 3742|  1.62k|                       tr_max->win_y0 - (OPJ_UINT32)tr_max->y0,
 3743|  1.62k|                       tr_max->win_x1 - (OPJ_UINT32)tr_max->x0,
 3744|  1.62k|                       tr_max->win_y1 - (OPJ_UINT32)tr_max->y0,
 3745|  1.62k|                       tilec->data_win,
 3746|  1.62k|                       1, tr_max->win_x1 - tr_max->win_x0,
 3747|  1.62k|                       OPJ_TRUE);
  ------------------
  |  |  117|  1.62k|#define OPJ_TRUE 1
  ------------------
 3748|  1.62k|        assert(ret);
 3749|  1.62k|        OPJ_UNUSED(ret);
  ------------------
  |  |  219|  1.62k|#define OPJ_UNUSED(x) (void)x
  ------------------
 3750|  1.62k|    }
 3751|  1.62k|    opj_sparse_array_int32_free(sa);
 3752|       |
 3753|  1.62k|    opj_aligned_free(h.wavelet);
 3754|  1.62k|    return OPJ_TRUE;
  ------------------
  |  |  117|  1.62k|#define OPJ_TRUE 1
  ------------------
 3755|  1.62k|}
dwt.c:opj_v8dwt_interleave_partial_h:
 2953|   136k|{
 2954|   136k|    OPJ_UINT32 i;
 2955|  1.19M|    for (i = 0; i < remaining_height; i++) {
  ------------------
  |  Branch (2955:17): [True: 1.06M, False: 136k]
  ------------------
 2956|  1.06M|        OPJ_BOOL ret;
 2957|  1.06M|        ret = opj_sparse_array_int32_read(sa,
 2958|  1.06M|                                          dwt->win_l_x0, sa_line + i,
 2959|  1.06M|                                          dwt->win_l_x1, sa_line + i + 1,
 2960|       |                                          /* Nasty cast from float* to int32* */
 2961|  1.06M|                                          (OPJ_INT32*)(dwt->wavelet + dwt->cas + 2 * dwt->win_l_x0) + i,
 2962|  1.06M|                                          2 * NB_ELTS_V8, 0, OPJ_TRUE);
  ------------------
  |  |   90|  1.06M|#define NB_ELTS_V8  8
  ------------------
                                                        2 * NB_ELTS_V8, 0, OPJ_TRUE);
  ------------------
  |  |  117|  1.06M|#define OPJ_TRUE 1
  ------------------
 2963|  1.06M|        assert(ret);
 2964|  1.06M|        ret = opj_sparse_array_int32_read(sa,
 2965|  1.06M|                                          (OPJ_UINT32)dwt->sn + dwt->win_h_x0, sa_line + i,
 2966|  1.06M|                                          (OPJ_UINT32)dwt->sn + dwt->win_h_x1, sa_line + i + 1,
 2967|       |                                          /* Nasty cast from float* to int32* */
 2968|  1.06M|                                          (OPJ_INT32*)(dwt->wavelet + 1 - dwt->cas + 2 * dwt->win_h_x0) + i,
 2969|  1.06M|                                          2 * NB_ELTS_V8, 0, OPJ_TRUE);
  ------------------
  |  |   90|  1.06M|#define NB_ELTS_V8  8
  ------------------
                                                        2 * NB_ELTS_V8, 0, OPJ_TRUE);
  ------------------
  |  |  117|  1.06M|#define OPJ_TRUE 1
  ------------------
 2970|  1.06M|        assert(ret);
 2971|  1.06M|        OPJ_UNUSED(ret);
  ------------------
  |  |  219|  1.06M|#define OPJ_UNUSED(x) (void)x
  ------------------
 2972|  1.06M|    }
 2973|   136k|}
dwt.c:opj_v8dwt_interleave_partial_v:
 3001|   104k|{
 3002|   104k|    OPJ_BOOL ret;
 3003|   104k|    ret = opj_sparse_array_int32_read(sa,
 3004|   104k|                                      sa_col, dwt->win_l_x0,
 3005|   104k|                                      sa_col + nb_elts_read, dwt->win_l_x1,
 3006|   104k|                                      (OPJ_INT32*)(dwt->wavelet + dwt->cas + 2 * dwt->win_l_x0),
 3007|   104k|                                      1, 2 * NB_ELTS_V8, OPJ_TRUE);
  ------------------
  |  |   90|   104k|#define NB_ELTS_V8  8
  ------------------
                                                    1, 2 * NB_ELTS_V8, OPJ_TRUE);
  ------------------
  |  |  117|   104k|#define OPJ_TRUE 1
  ------------------
 3008|   104k|    assert(ret);
 3009|   104k|    ret = opj_sparse_array_int32_read(sa,
 3010|   104k|                                      sa_col, (OPJ_UINT32)dwt->sn + dwt->win_h_x0,
 3011|   104k|                                      sa_col + nb_elts_read, (OPJ_UINT32)dwt->sn + dwt->win_h_x1,
 3012|   104k|                                      (OPJ_INT32*)(dwt->wavelet + 1 - dwt->cas + 2 * dwt->win_h_x0),
 3013|   104k|                                      1, 2 * NB_ELTS_V8, OPJ_TRUE);
  ------------------
  |  |   90|   104k|#define NB_ELTS_V8  8
  ------------------
                                                    1, 2 * NB_ELTS_V8, OPJ_TRUE);
  ------------------
  |  |  117|   104k|#define OPJ_TRUE 1
  ------------------
 3014|   104k|    assert(ret);
 3015|   104k|    OPJ_UNUSED(ret);
  ------------------
  |  |  219|   104k|#define OPJ_UNUSED(x) (void)x
  ------------------
 3016|   104k|}

opj_event_msg:
   93|   664M|{
   94|   664M|#define OPJ_MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
   95|   664M|    opj_msg_callback msg_handler = 00;
   96|   664M|    void * l_data = 00;
   97|       |
   98|   664M|    if (p_event_mgr != 00) {
  ------------------
  |  Branch (98:9): [True: 664M, False: 0]
  ------------------
   99|   664M|        switch (event_type) {
  100|  12.8k|        case EVT_ERROR:
  ------------------
  |  |   66|  12.8k|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  |  Branch (100:9): [True: 12.8k, False: 664M]
  ------------------
  101|  12.8k|            msg_handler = p_event_mgr->error_handler;
  102|  12.8k|            l_data = p_event_mgr->m_error_data;
  103|  12.8k|            break;
  104|   664M|        case EVT_WARNING:
  ------------------
  |  |   67|   664M|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
  |  Branch (104:9): [True: 664M, False: 69.5k]
  ------------------
  105|   664M|            msg_handler = p_event_mgr->warning_handler;
  106|   664M|            l_data = p_event_mgr->m_warning_data;
  107|   664M|            break;
  108|  56.7k|        case EVT_INFO:
  ------------------
  |  |   68|  56.7k|#define EVT_INFO    4   /**< Debug event type */
  ------------------
  |  Branch (108:9): [True: 56.7k, False: 664M]
  ------------------
  109|  56.7k|            msg_handler = p_event_mgr->info_handler;
  110|  56.7k|            l_data = p_event_mgr->m_info_data;
  111|  56.7k|            break;
  112|      0|        default:
  ------------------
  |  Branch (112:9): [True: 0, False: 664M]
  ------------------
  113|      0|            break;
  114|   664M|        }
  115|   664M|        if (msg_handler == 00) {
  ------------------
  |  Branch (115:13): [True: 0, False: 664M]
  ------------------
  116|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  117|      0|        }
  118|   664M|    } else {
  119|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  120|      0|    }
  121|       |
  122|   664M|    if ((fmt != 00) && (p_event_mgr != 00)) {
  ------------------
  |  Branch (122:9): [True: 664M, False: 0]
  |  Branch (122:24): [True: 664M, False: 0]
  ------------------
  123|   664M|        va_list arg;
  124|   664M|        char message[OPJ_MSG_SIZE];
  125|   664M|        memset(message, 0, OPJ_MSG_SIZE);
  ------------------
  |  |   94|   664M|#define OPJ_MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
  ------------------
  126|       |        /* initialize the optional parameter list */
  127|   664M|        va_start(arg, fmt);
  128|       |        /* parse the format string and put the result in 'message' */
  129|   664M|        vsnprintf(message, OPJ_MSG_SIZE, fmt, arg);
  ------------------
  |  |   94|   664M|#define OPJ_MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
  ------------------
  130|       |        /* force zero termination for Windows _vsnprintf() of old MSVC */
  131|   664M|        message[OPJ_MSG_SIZE - 1] = '\0';
  ------------------
  |  |   94|   664M|#define OPJ_MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
  ------------------
  132|       |        /* deinitialize the optional parameter list */
  133|   664M|        va_end(arg);
  134|       |
  135|       |        /* output the message to the user program */
  136|   664M|        msg_handler(message, l_data);
  137|   664M|    }
  138|       |
  139|   664M|    return OPJ_TRUE;
  ------------------
  |  |  117|   664M|#define OPJ_TRUE 1
  ------------------
  140|   664M|}
opj_set_default_event_handler:
  143|  9.21k|{
  144|  9.21k|    p_manager->m_error_data = 00;
  145|  9.21k|    p_manager->m_warning_data = 00;
  146|  9.21k|    p_manager->m_info_data = 00;
  147|  9.21k|    p_manager->error_handler = opj_default_callback;
  148|  9.21k|    p_manager->info_handler = opj_default_callback;
  149|  9.21k|    p_manager->warning_handler = opj_default_callback;
  150|  9.21k|}

opj_procedure_list_create:
   40|  18.4k|{
   41|       |    /* memory allocation */
   42|  18.4k|    opj_procedure_list_t * l_validation = (opj_procedure_list_t *) opj_calloc(1,
   43|  18.4k|                                          sizeof(opj_procedure_list_t));
   44|  18.4k|    if (! l_validation) {
  ------------------
  |  Branch (44:9): [True: 0, False: 18.4k]
  ------------------
   45|      0|        return 00;
   46|      0|    }
   47|       |    /* initialization */
   48|  18.4k|    l_validation->m_nb_max_procedures = OPJ_VALIDATION_SIZE;
  ------------------
  |  |   37|  18.4k|#define OPJ_VALIDATION_SIZE 10
  ------------------
   49|  18.4k|    l_validation->m_procedures = (opj_procedure*)opj_calloc(OPJ_VALIDATION_SIZE,
  ------------------
  |  |   37|  18.4k|#define OPJ_VALIDATION_SIZE 10
  ------------------
   50|  18.4k|                                 sizeof(opj_procedure));
   51|  18.4k|    if (! l_validation->m_procedures) {
  ------------------
  |  Branch (51:9): [True: 0, False: 18.4k]
  ------------------
   52|      0|        opj_free(l_validation);
   53|      0|        return 00;
   54|      0|    }
   55|  18.4k|    return l_validation;
   56|  18.4k|}
opj_procedure_list_destroy:
   59|  18.4k|{
   60|  18.4k|    if (! p_list) {
  ------------------
  |  Branch (60:9): [True: 0, False: 18.4k]
  ------------------
   61|      0|        return;
   62|      0|    }
   63|       |    /* initialization */
   64|  18.4k|    if (p_list->m_procedures) {
  ------------------
  |  Branch (64:9): [True: 18.4k, False: 0]
  ------------------
   65|  18.4k|        opj_free(p_list->m_procedures);
   66|  18.4k|    }
   67|  18.4k|    opj_free(p_list);
   68|  18.4k|}
opj_procedure_list_add_procedure:
   72|  44.6k|{
   73|       |
   74|  44.6k|    assert(p_manager != NULL);
   75|       |
   76|  44.6k|    if (p_validation_list->m_nb_max_procedures ==
  ------------------
  |  Branch (76:9): [True: 0, False: 44.6k]
  ------------------
   77|  44.6k|            p_validation_list->m_nb_procedures) {
   78|      0|        opj_procedure * new_procedures;
   79|       |
   80|      0|        p_validation_list->m_nb_max_procedures += OPJ_VALIDATION_SIZE;
  ------------------
  |  |   37|      0|#define OPJ_VALIDATION_SIZE 10
  ------------------
   81|      0|        new_procedures = (opj_procedure*)opj_realloc(
   82|      0|                             p_validation_list->m_procedures,
   83|      0|                             p_validation_list->m_nb_max_procedures * sizeof(opj_procedure));
   84|      0|        if (! new_procedures) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|            opj_free(p_validation_list->m_procedures);
   86|      0|            p_validation_list->m_nb_max_procedures = 0;
   87|      0|            p_validation_list->m_nb_procedures = 0;
   88|      0|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
   89|      0|                          "Not enough memory to add a new validation procedure\n");
   90|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
   91|      0|        } else {
   92|      0|            p_validation_list->m_procedures = new_procedures;
   93|      0|        }
   94|      0|    }
   95|  44.6k|    p_validation_list->m_procedures[p_validation_list->m_nb_procedures] =
   96|  44.6k|        p_procedure;
   97|  44.6k|    ++p_validation_list->m_nb_procedures;
   98|       |
   99|  44.6k|    return OPJ_TRUE;
  ------------------
  |  |  117|  44.6k|#define OPJ_TRUE 1
  ------------------
  100|  44.6k|}
opj_procedure_list_get_nb_procedures:
  104|  26.2k|{
  105|  26.2k|    return p_validation_list->m_nb_procedures;
  106|  26.2k|}
opj_procedure_list_get_first_procedure:
  110|  26.2k|{
  111|  26.2k|    return p_validation_list->m_procedures;
  112|  26.2k|}
opj_procedure_list_clear:
  115|  26.2k|{
  116|  26.2k|    p_validation_list->m_nb_procedures = 0;
  117|  26.2k|}

opj_t1_ht_decode_cblk:
 1127|  95.8k|{
 1128|  95.8k|    OPJ_BYTE* cblkdata = NULL;
 1129|  95.8k|    OPJ_UINT8* coded_data;
 1130|  95.8k|    OPJ_UINT32* decoded_data;
 1131|  95.8k|    OPJ_UINT32 zero_bplanes;
 1132|  95.8k|    OPJ_UINT32 num_passes;
 1133|  95.8k|    OPJ_UINT32 lengths1;
 1134|  95.8k|    OPJ_UINT32 lengths2;
 1135|  95.8k|    OPJ_INT32 width;
 1136|  95.8k|    OPJ_INT32 height;
 1137|  95.8k|    OPJ_INT32 stride;
 1138|  95.8k|    OPJ_UINT32 *pflags, *sigma1, *sigma2, *mbr1, *mbr2, *sip, sip_shift;
 1139|  95.8k|    OPJ_UINT32 p;
 1140|  95.8k|    OPJ_UINT32 zero_bplanes_p1;
 1141|  95.8k|    int lcup, scup;
 1142|  95.8k|    dec_mel_t mel;
 1143|  95.8k|    rev_struct_t vlc;
 1144|  95.8k|    frwd_struct_t magsgn;
 1145|  95.8k|    frwd_struct_t sigprop;
 1146|  95.8k|    rev_struct_t magref;
 1147|  95.8k|    OPJ_UINT8 *lsp, *line_state;
 1148|  95.8k|    int run;
 1149|  95.8k|    OPJ_UINT32 vlc_val;              // fetched data from VLC bitstream
 1150|  95.8k|    OPJ_UINT32 qinf[2];
 1151|  95.8k|    OPJ_UINT32 c_q;
 1152|  95.8k|    OPJ_UINT32* sp;
 1153|  95.8k|    OPJ_INT32 x, y; // loop indices
 1154|  95.8k|    OPJ_BOOL stripe_causal = (cblksty & J2K_CCP_CBLKSTY_VSC) != 0;
  ------------------
  |  |   61|  95.8k|#define J2K_CCP_CBLKSTY_VSC 0x08      /**< Vertically stripe causal context */
  ------------------
 1155|  95.8k|    OPJ_UINT32 cblk_len = 0;
 1156|       |
 1157|  95.8k|    (void)(orient);      // stops unused parameter message
 1158|  95.8k|    (void)(check_pterm); // stops unused parameter message
 1159|       |
 1160|       |    // We ignor orient, because the same decoder is used for all subbands
 1161|       |    // We also ignore check_pterm, because I am not sure how it applies
 1162|  95.8k|    if (roishift != 0) {
  ------------------
  |  Branch (1162:9): [True: 1, False: 95.8k]
  ------------------
 1163|      1|        if (p_manager_mutex) {
  ------------------
  |  Branch (1163:13): [True: 1, False: 0]
  ------------------
 1164|      1|            opj_mutex_lock(p_manager_mutex);
 1165|      1|        }
 1166|      1|        opj_event_msg(p_manager, EVT_ERROR, "We do not support ROI in decoding "
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1167|      1|                      "HT codeblocks\n");
 1168|      1|        if (p_manager_mutex) {
  ------------------
  |  Branch (1168:13): [True: 1, False: 0]
  ------------------
 1169|      1|            opj_mutex_unlock(p_manager_mutex);
 1170|      1|        }
 1171|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 1172|      1|    }
 1173|       |
 1174|  95.8k|    if (!opj_t1_allocate_buffers(
  ------------------
  |  Branch (1174:9): [True: 0, False: 95.8k]
  ------------------
 1175|  95.8k|                t1,
 1176|  95.8k|                (OPJ_UINT32)(cblk->x1 - cblk->x0),
 1177|  95.8k|                (OPJ_UINT32)(cblk->y1 - cblk->y0))) {
 1178|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1179|      0|    }
 1180|       |
 1181|  95.8k|    if (cblk->Mb == 0) {
  ------------------
  |  Branch (1181:9): [True: 92.5k, False: 3.29k]
  ------------------
 1182|  92.5k|        return OPJ_TRUE;
  ------------------
  |  |  117|  92.5k|#define OPJ_TRUE 1
  ------------------
 1183|  92.5k|    }
 1184|       |
 1185|       |    /* numbps = Mb + 1 - zero_bplanes, Mb = Kmax, zero_bplanes = missing_msbs */
 1186|  3.29k|    zero_bplanes = (cblk->Mb + 1) - cblk->numbps;
 1187|       |
 1188|       |    /* Compute whole codeblock length from chunk lengths */
 1189|  3.29k|    cblk_len = 0;
 1190|  3.29k|    {
 1191|  3.29k|        OPJ_UINT32 i;
 1192|   166k|        for (i = 0; i < cblk->numchunks; i++) {
  ------------------
  |  Branch (1192:21): [True: 163k, False: 3.29k]
  ------------------
 1193|   163k|            cblk_len += cblk->chunks[i].len;
 1194|   163k|        }
 1195|  3.29k|    }
 1196|       |
 1197|  3.29k|    if (cblk->numchunks > 1 || t1->mustuse_cblkdatabuffer) {
  ------------------
  |  Branch (1197:9): [True: 1.88k, False: 1.41k]
  |  Branch (1197:32): [True: 0, False: 1.41k]
  ------------------
 1198|  1.88k|        OPJ_UINT32 i;
 1199|       |
 1200|       |        /* Allocate temporary memory if needed */
 1201|  1.88k|        if (cblk_len > t1->cblkdatabuffersize) {
  ------------------
  |  Branch (1201:13): [True: 633, False: 1.25k]
  ------------------
 1202|    633|            cblkdata = (OPJ_BYTE*)opj_realloc(
 1203|    633|                           t1->cblkdatabuffer, cblk_len);
 1204|    633|            if (cblkdata == NULL) {
  ------------------
  |  Branch (1204:17): [True: 0, False: 633]
  ------------------
 1205|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1206|      0|            }
 1207|    633|            t1->cblkdatabuffer = cblkdata;
 1208|    633|            t1->cblkdatabuffersize = cblk_len;
 1209|    633|        }
 1210|       |
 1211|       |        /* Concatenate all chunks */
 1212|  1.88k|        cblkdata = t1->cblkdatabuffer;
 1213|  1.88k|        cblk_len = 0;
 1214|   163k|        for (i = 0; i < cblk->numchunks; i++) {
  ------------------
  |  Branch (1214:21): [True: 161k, False: 1.88k]
  ------------------
 1215|   161k|            memcpy(cblkdata + cblk_len, cblk->chunks[i].data, cblk->chunks[i].len);
 1216|   161k|            cblk_len += cblk->chunks[i].len;
 1217|   161k|        }
 1218|  1.88k|    } else if (cblk->numchunks == 1) {
  ------------------
  |  Branch (1218:16): [True: 1.41k, False: 0]
  ------------------
 1219|  1.41k|        cblkdata = cblk->chunks[0].data;
 1220|  1.41k|    } else {
 1221|       |        /* Not sure if that can happen in practice, but avoid Coverity to */
 1222|       |        /* think we will dereference a null cblkdta pointer */
 1223|      0|        return OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
 1224|      0|    }
 1225|       |
 1226|       |    // OPJ_BYTE* coded_data is a pointer to bitstream
 1227|  3.29k|    coded_data = cblkdata;
 1228|       |    // OPJ_UINT32* decoded_data is a pointer to decoded codeblock data buf.
 1229|  3.29k|    decoded_data = (OPJ_UINT32*)t1->data;
 1230|       |    // OPJ_UINT32 num_passes is the number of passes: 1 if CUP only, 2 for
 1231|       |    // CUP+SPP, and 3 for CUP+SPP+MRP
 1232|  3.29k|    num_passes = cblk->numsegs > 0 ? cblk->segs[0].real_num_passes : 0;
  ------------------
  |  Branch (1232:18): [True: 3.29k, False: 0]
  ------------------
 1233|  3.29k|    num_passes += cblk->numsegs > 1 ? cblk->segs[1].real_num_passes : 0;
  ------------------
  |  Branch (1233:19): [True: 1.88k, False: 1.41k]
  ------------------
 1234|       |    // OPJ_UINT32 lengths1 is the length of cleanup pass
 1235|  3.29k|    lengths1 = num_passes > 0 ? cblk->segs[0].len : 0;
  ------------------
  |  Branch (1235:16): [True: 3.29k, False: 0]
  ------------------
 1236|       |    // OPJ_UINT32 lengths2 is the length of refinement passes (either SPP only or SPP+MRP)
 1237|  3.29k|    lengths2 = num_passes > 1 ? cblk->segs[1].len : 0;
  ------------------
  |  Branch (1237:16): [True: 1.88k, False: 1.41k]
  ------------------
 1238|       |    // OPJ_INT32 width is the decoded codeblock width
 1239|  3.29k|    width = cblk->x1 - cblk->x0;
 1240|       |    // OPJ_INT32 height is the decoded codeblock height
 1241|  3.29k|    height = cblk->y1 - cblk->y0;
 1242|       |    // OPJ_INT32 stride is the decoded codeblock buffer stride
 1243|  3.29k|    stride = width;
 1244|       |
 1245|       |    /*  sigma1 and sigma2 contains significant (i.e., non-zero) pixel
 1246|       |     *  locations.  The buffers are used interchangeably, because we need
 1247|       |     *  more than 4 rows of significance information at a given time.
 1248|       |     *  Each 32 bits contain significance information for 4 rows of 8
 1249|       |     *  columns each.  If we denote 32 bits by 0xaaaaaaaa, the each "a" is
 1250|       |     *  called a nibble and has significance information for 4 rows.
 1251|       |     *  The least significant nibble has information for the first column,
 1252|       |     *  and so on. The nibble's LSB is for the first row, and so on.
 1253|       |     *  Since, at most, we can have 1024 columns in a quad, we need 128
 1254|       |     *  entries; we added 1 for convenience when propagation of signifcance
 1255|       |     *  goes outside the structure
 1256|       |     *  To work in OpenJPEG these buffers has been expanded to 132.
 1257|       |     */
 1258|       |    // OPJ_UINT32 *pflags, *sigma1, *sigma2, *mbr1, *mbr2, *sip, sip_shift;
 1259|  3.29k|    pflags = (OPJ_UINT32 *)t1->flags;
 1260|  3.29k|    sigma1 = pflags;
 1261|  3.29k|    sigma2 = sigma1 + 132;
 1262|       |    // mbr arrangement is similar to sigma; mbr contains locations
 1263|       |    // that become significant during significance propagation pass
 1264|  3.29k|    mbr1 = sigma2 + 132;
 1265|  3.29k|    mbr2 = mbr1 + 132;
 1266|       |    //a pointer to sigma
 1267|  3.29k|    sip = sigma1;  //pointers to arrays to be used interchangeably
 1268|  3.29k|    sip_shift = 0; //the amount of shift needed for sigma
 1269|       |
 1270|  3.29k|    if (num_passes > 1 && lengths2 == 0) {
  ------------------
  |  Branch (1270:9): [True: 1.88k, False: 1.41k]
  |  Branch (1270:27): [True: 93, False: 1.79k]
  ------------------
 1271|     93|        if (p_manager_mutex) {
  ------------------
  |  Branch (1271:13): [True: 93, False: 0]
  ------------------
 1272|     93|            opj_mutex_lock(p_manager_mutex);
 1273|     93|        }
 1274|     93|        opj_event_msg(p_manager, EVT_WARNING, "A malformed codeblock that has "
  ------------------
  |  |   67|     93|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1275|     93|                      "more than one coding pass, but zero length for "
 1276|     93|                      "2nd and potentially the 3rd pass in an HT codeblock.\n");
 1277|     93|        if (p_manager_mutex) {
  ------------------
  |  Branch (1277:13): [True: 93, False: 0]
  ------------------
 1278|     93|            opj_mutex_unlock(p_manager_mutex);
 1279|     93|        }
 1280|     93|        num_passes = 1;
 1281|     93|    }
 1282|  3.29k|    if (num_passes > 3) {
  ------------------
  |  Branch (1282:9): [True: 81, False: 3.21k]
  ------------------
 1283|     81|        if (p_manager_mutex) {
  ------------------
  |  Branch (1283:13): [True: 81, False: 0]
  ------------------
 1284|     81|            opj_mutex_lock(p_manager_mutex);
 1285|     81|        }
 1286|     81|        opj_event_msg(p_manager, EVT_ERROR, "We do not support more than 3 "
  ------------------
  |  |   66|     81|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1287|     81|                      "coding passes in an HT codeblock; This codeblocks has "
 1288|     81|                      "%d passes.\n", num_passes);
 1289|     81|        if (p_manager_mutex) {
  ------------------
  |  Branch (1289:13): [True: 81, False: 0]
  ------------------
 1290|     81|            opj_mutex_unlock(p_manager_mutex);
 1291|     81|        }
 1292|     81|        return OPJ_FALSE;
  ------------------
  |  |  118|     81|#define OPJ_FALSE 0
  ------------------
 1293|     81|    }
 1294|       |
 1295|  3.21k|    if (cblk->Mb > 30) {
  ------------------
  |  Branch (1295:9): [True: 31, False: 3.18k]
  ------------------
 1296|       |        /* This check is better moved to opj_t2_read_packet_header() in t2.c
 1297|       |           We do not have enough precision to decode any passes
 1298|       |           The design of openjpeg assumes that the bits of a 32-bit integer are
 1299|       |           assigned as follows:
 1300|       |           bit 31 is for sign
 1301|       |           bits 30-1 are for magnitude
 1302|       |           bit 0 is for the center of the quantization bin
 1303|       |           Therefore we can only do values of cblk->Mb <= 30
 1304|       |         */
 1305|     31|        if (p_manager_mutex) {
  ------------------
  |  Branch (1305:13): [True: 31, False: 0]
  ------------------
 1306|     31|            opj_mutex_lock(p_manager_mutex);
 1307|     31|        }
 1308|     31|        opj_event_msg(p_manager, EVT_ERROR, "32 bits are not enough to "
  ------------------
  |  |   66|     31|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1309|     31|                      "decode this codeblock, since the number of "
 1310|     31|                      "bitplane, %d, is larger than 30.\n", cblk->Mb);
 1311|     31|        if (p_manager_mutex) {
  ------------------
  |  Branch (1311:13): [True: 31, False: 0]
  ------------------
 1312|     31|            opj_mutex_unlock(p_manager_mutex);
 1313|     31|        }
 1314|     31|        return OPJ_FALSE;
  ------------------
  |  |  118|     31|#define OPJ_FALSE 0
  ------------------
 1315|     31|    }
 1316|  3.18k|    if (zero_bplanes > cblk->Mb) {
  ------------------
  |  Branch (1316:9): [True: 7, False: 3.17k]
  ------------------
 1317|       |        /* This check is better moved to opj_t2_read_packet_header() in t2.c,
 1318|       |           in the line "l_cblk->numbps = (OPJ_UINT32)l_band->numbps + 1 - i;"
 1319|       |           where i is the zero bitplanes, and should be no larger than cblk->Mb
 1320|       |           We cannot have more zero bitplanes than there are planes. */
 1321|      7|        if (p_manager_mutex) {
  ------------------
  |  Branch (1321:13): [True: 7, False: 0]
  ------------------
 1322|      7|            opj_mutex_lock(p_manager_mutex);
 1323|      7|        }
 1324|      7|        opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
  ------------------
  |  |   66|      7|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1325|      7|                      "Decoding this codeblock is stopped. There are "
 1326|      7|                      "%d zero bitplanes in %d bitplanes.\n",
 1327|      7|                      zero_bplanes, cblk->Mb);
 1328|       |
 1329|      7|        if (p_manager_mutex) {
  ------------------
  |  Branch (1329:13): [True: 7, False: 0]
  ------------------
 1330|      7|            opj_mutex_unlock(p_manager_mutex);
 1331|      7|        }
 1332|      7|        return OPJ_FALSE;
  ------------------
  |  |  118|      7|#define OPJ_FALSE 0
  ------------------
 1333|  3.17k|    } else if (zero_bplanes == cblk->Mb && num_passes > 1) {
  ------------------
  |  Branch (1333:16): [True: 153, False: 3.02k]
  |  Branch (1333:44): [True: 47, False: 106]
  ------------------
 1334|       |        /* When the number of zero bitplanes is equal to the number of bitplanes,
 1335|       |           only the cleanup pass makes sense*/
 1336|     47|        if (only_cleanup_pass_is_decoded == OPJ_FALSE) {
  ------------------
  |  |  118|     47|#define OPJ_FALSE 0
  ------------------
  |  Branch (1336:13): [True: 1, False: 46]
  ------------------
 1337|      1|            if (p_manager_mutex) {
  ------------------
  |  Branch (1337:17): [True: 1, False: 0]
  ------------------
 1338|      1|                opj_mutex_lock(p_manager_mutex);
 1339|      1|            }
 1340|       |            /* We have a second check to prevent the possibility of an overrun condition,
 1341|       |               in the very unlikely event of a second thread discovering that
 1342|       |               only_cleanup_pass_is_decoded is false before the first thread changing
 1343|       |               the condition. */
 1344|      1|            if (only_cleanup_pass_is_decoded == OPJ_FALSE) {
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
  |  Branch (1344:17): [True: 1, False: 0]
  ------------------
 1345|      1|                only_cleanup_pass_is_decoded = OPJ_TRUE;
  ------------------
  |  |  117|      1|#define OPJ_TRUE 1
  ------------------
 1346|      1|                opj_event_msg(p_manager, EVT_WARNING, "Malformed HT codeblock. "
  ------------------
  |  |   67|      1|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1347|      1|                              "When the number of zero planes bitplanes is "
 1348|      1|                              "equal to the number of bitplanes, only the cleanup "
 1349|      1|                              "pass makes sense, but we have %d passes in this "
 1350|      1|                              "codeblock. Therefore, only the cleanup pass will be "
 1351|      1|                              "decoded. This message will not be displayed again.\n",
 1352|      1|                              num_passes);
 1353|      1|            }
 1354|      1|            if (p_manager_mutex) {
  ------------------
  |  Branch (1354:17): [True: 1, False: 0]
  ------------------
 1355|      1|                opj_mutex_unlock(p_manager_mutex);
 1356|      1|            }
 1357|      1|        }
 1358|     47|        num_passes = 1;
 1359|     47|    }
 1360|       |
 1361|       |    /* OPJ_UINT32 */
 1362|  3.17k|    p = cblk->numbps;
 1363|       |
 1364|       |    // OPJ_UINT32 zero planes plus 1
 1365|  3.17k|    zero_bplanes_p1 = zero_bplanes + 1;
 1366|       |
 1367|  3.17k|    if (lengths1 < 2 || (OPJ_UINT32)lengths1 > cblk_len ||
  ------------------
  |  Branch (1367:9): [True: 80, False: 3.09k]
  |  Branch (1367:25): [True: 0, False: 3.09k]
  ------------------
 1368|  3.17k|            (OPJ_UINT32)(lengths1 + lengths2) > cblk_len) {
  ------------------
  |  Branch (1368:13): [True: 0, False: 3.09k]
  ------------------
 1369|     80|        if (p_manager_mutex) {
  ------------------
  |  Branch (1369:13): [True: 80, False: 0]
  ------------------
 1370|     80|            opj_mutex_lock(p_manager_mutex);
 1371|     80|        }
 1372|     80|        opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
  ------------------
  |  |   66|     80|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1373|     80|                      "Invalid codeblock length values.\n");
 1374|       |
 1375|     80|        if (p_manager_mutex) {
  ------------------
  |  Branch (1375:13): [True: 80, False: 0]
  ------------------
 1376|     80|            opj_mutex_unlock(p_manager_mutex);
 1377|     80|        }
 1378|     80|        return OPJ_FALSE;
  ------------------
  |  |  118|     80|#define OPJ_FALSE 0
  ------------------
 1379|     80|    }
 1380|       |    // read scup and fix the bytes there
 1381|  3.09k|    lcup = (int)lengths1;  // length of CUP
 1382|       |    //scup is the length of MEL + VLC
 1383|  3.09k|    scup = (((int)coded_data[lcup - 1]) << 4) + (coded_data[lcup - 2] & 0xF);
 1384|  3.09k|    if (scup < 2 || scup > lcup || scup > 4079) { //something is wrong
  ------------------
  |  Branch (1384:9): [True: 15, False: 3.08k]
  |  Branch (1384:21): [True: 92, False: 2.98k]
  |  Branch (1384:36): [True: 0, False: 2.98k]
  ------------------
 1385|       |        /* The standard stipulates 2 <= Scup <= min(Lcup, 4079) */
 1386|    107|        if (p_manager_mutex) {
  ------------------
  |  Branch (1386:13): [True: 107, False: 0]
  ------------------
 1387|    107|            opj_mutex_lock(p_manager_mutex);
 1388|    107|        }
 1389|    107|        opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
  ------------------
  |  |   66|    107|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1390|    107|                      "One of the following condition is not met: "
 1391|    107|                      "2 <= Scup <= min(Lcup, 4079)\n");
 1392|       |
 1393|    107|        if (p_manager_mutex) {
  ------------------
  |  Branch (1393:13): [True: 107, False: 0]
  ------------------
 1394|    107|            opj_mutex_unlock(p_manager_mutex);
 1395|    107|        }
 1396|    107|        return OPJ_FALSE;
  ------------------
  |  |  118|    107|#define OPJ_FALSE 0
  ------------------
 1397|    107|    }
 1398|       |
 1399|       |    // init structures
 1400|  2.98k|    if (mel_init(&mel, coded_data, lcup, scup) == OPJ_FALSE) {
  ------------------
  |  |  118|  2.98k|#define OPJ_FALSE 0
  ------------------
  |  Branch (1400:9): [True: 3, False: 2.98k]
  ------------------
 1401|      3|        if (p_manager_mutex) {
  ------------------
  |  Branch (1401:13): [True: 3, False: 0]
  ------------------
 1402|      3|            opj_mutex_lock(p_manager_mutex);
 1403|      3|        }
 1404|      3|        opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1405|      3|                      "Incorrect MEL segment sequence.\n");
 1406|      3|        if (p_manager_mutex) {
  ------------------
  |  Branch (1406:13): [True: 3, False: 0]
  ------------------
 1407|      3|            opj_mutex_unlock(p_manager_mutex);
 1408|      3|        }
 1409|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 1410|      3|    }
 1411|  2.98k|    rev_init(&vlc, coded_data, lcup, scup);
 1412|  2.98k|    frwd_init(&magsgn, coded_data, lcup - scup, 0xFF);
 1413|  2.98k|    if (num_passes > 1) { // needs to be tested
  ------------------
  |  Branch (1413:9): [True: 1.59k, False: 1.39k]
  ------------------
 1414|  1.59k|        frwd_init(&sigprop, coded_data + lengths1, (int)lengths2, 0);
 1415|  1.59k|    }
 1416|  2.98k|    if (num_passes > 2) {
  ------------------
  |  Branch (1416:9): [True: 1.47k, False: 1.51k]
  ------------------
 1417|  1.47k|        rev_init_mrp(&magref, coded_data, (int)lengths1, (int)lengths2);
 1418|  1.47k|    }
 1419|       |
 1420|       |    /** State storage
 1421|       |      *  One byte per quad; for 1024 columns, or 512 quads, we need
 1422|       |      *  512 bytes. We are using 2 extra bytes one on the left and one on
 1423|       |      *  the right for convenience.
 1424|       |      *
 1425|       |      *  The MSB bit in each byte is (\sigma^nw | \sigma^n), and the 7 LSBs
 1426|       |      *  contain max(E^nw | E^n)
 1427|       |      */
 1428|       |
 1429|       |    // 514 is enough for a block width of 1024, +2 extra
 1430|       |    // here expanded to 528
 1431|  2.98k|    line_state = (OPJ_UINT8 *)(mbr2 + 132);
 1432|       |
 1433|       |    //initial 2 lines
 1434|       |    /////////////////
 1435|  2.98k|    lsp = line_state;              // point to line state
 1436|  2.98k|    lsp[0] = 0;                    // for initial row of quad, we set to 0
 1437|  2.98k|    run = mel_get_run(&mel);    // decode runs of events from MEL bitstrm
 1438|       |    // data represented as runs of 0 events
 1439|       |    // See mel_decode description
 1440|  2.98k|    qinf[0] = qinf[1] = 0;      // quad info decoded from VLC bitstream
 1441|  2.98k|    c_q = 0;                    // context for quad q
 1442|  2.98k|    sp = decoded_data;          // decoded codeblock samples
 1443|       |    // vlc_val;                 // fetched data from VLC bitstream
 1444|       |
 1445|  37.0k|    for (x = 0; x < width; x += 4) { // one iteration per quad pair
  ------------------
  |  Branch (1445:17): [True: 34.0k, False: 2.93k]
  ------------------
 1446|  34.0k|        OPJ_UINT32 U_q[2]; // u values for the quad pair
 1447|  34.0k|        OPJ_UINT32 uvlc_mode;
 1448|  34.0k|        OPJ_UINT32 consumed_bits;
 1449|  34.0k|        OPJ_UINT32 m_n, v_n;
 1450|  34.0k|        OPJ_UINT32 ms_val;
 1451|  34.0k|        OPJ_UINT32 locs;
 1452|       |
 1453|       |        // decode VLC
 1454|       |        /////////////
 1455|       |
 1456|       |        //first quad
 1457|       |        // Get the head of the VLC bitstream. One fetch is enough for two
 1458|       |        // quads, since the largest VLC code is 7 bits, and maximum number of
 1459|       |        // bits used for u is 8.  Therefore for two quads we need 30 bits
 1460|       |        // (if we include unstuffing, then 32 bits are enough, since we have
 1461|       |        // a maximum of one stuffing per two bytes)
 1462|  34.0k|        vlc_val = rev_fetch(&vlc);
 1463|       |
 1464|       |        //decode VLC using the context c_q and the head of the VLC bitstream
 1465|  34.0k|        qinf[0] = vlc_tbl0[(c_q << 7) | (vlc_val & 0x7F) ];
 1466|       |
 1467|  34.0k|        if (c_q == 0) { // if zero context, we need to use one MEL event
  ------------------
  |  Branch (1467:13): [True: 18.7k, False: 15.3k]
  ------------------
 1468|  18.7k|            run -= 2; //the number of 0 events is multiplied by 2, so subtract 2
 1469|       |
 1470|       |            // Is the run terminated in 1? if so, use decoded VLC code,
 1471|       |            // otherwise, discard decoded data, since we will decoded again
 1472|       |            // using a different context
 1473|  18.7k|            qinf[0] = (run == -1) ? qinf[0] : 0;
  ------------------
  |  Branch (1473:23): [True: 5.95k, False: 12.7k]
  ------------------
 1474|       |
 1475|       |            // is run -1 or -2? this means a run has been consumed
 1476|  18.7k|            if (run < 0) {
  ------------------
  |  Branch (1476:17): [True: 11.0k, False: 7.66k]
  ------------------
 1477|  11.0k|                run = mel_get_run(&mel);    // get another run
 1478|  11.0k|            }
 1479|  18.7k|        }
 1480|       |
 1481|       |        // prepare context for the next quad; eqn. 1 in ITU T.814
 1482|  34.0k|        c_q = ((qinf[0] & 0x10) >> 4) | ((qinf[0] & 0xE0) >> 5);
 1483|       |
 1484|       |        //remove data from vlc stream (0 bits are removed if qinf is not used)
 1485|  34.0k|        vlc_val = rev_advance(&vlc, qinf[0] & 0x7);
 1486|       |
 1487|       |        //update sigma
 1488|       |        // The update depends on the value of x; consider one OPJ_UINT32
 1489|       |        // if x is 0, 8, 16 and so on, then this line update c locations
 1490|       |        //      nibble (4 bits) number   0 1 2 3 4 5 6 7
 1491|       |        //                         LSB   c c 0 0 0 0 0 0
 1492|       |        //                               c c 0 0 0 0 0 0
 1493|       |        //                               0 0 0 0 0 0 0 0
 1494|       |        //                               0 0 0 0 0 0 0 0
 1495|       |        // if x is 4, 12, 20, then this line update locations c
 1496|       |        //      nibble (4 bits) number   0 1 2 3 4 5 6 7
 1497|       |        //                         LSB   0 0 0 0 c c 0 0
 1498|       |        //                               0 0 0 0 c c 0 0
 1499|       |        //                               0 0 0 0 0 0 0 0
 1500|       |        //                               0 0 0 0 0 0 0 0
 1501|  34.0k|        *sip |= (((qinf[0] & 0x30) >> 4) | ((qinf[0] & 0xC0) >> 2)) << sip_shift;
 1502|       |
 1503|       |        //second quad
 1504|  34.0k|        qinf[1] = 0;
 1505|  34.0k|        if (x + 2 < width) { // do not run if codeblock is narrower
  ------------------
  |  Branch (1505:13): [True: 33.4k, False: 594]
  ------------------
 1506|       |            //decode VLC using the context c_q and the head of the VLC bitstream
 1507|  33.4k|            qinf[1] = vlc_tbl0[(c_q << 7) | (vlc_val & 0x7F)];
 1508|       |
 1509|       |            // if context is zero, use one MEL event
 1510|  33.4k|            if (c_q == 0) { //zero context
  ------------------
  |  Branch (1510:17): [True: 16.4k, False: 17.0k]
  ------------------
 1511|  16.4k|                run -= 2; //subtract 2, since events number if multiplied by 2
 1512|       |
 1513|       |                // if event is 0, discard decoded qinf
 1514|  16.4k|                qinf[1] = (run == -1) ? qinf[1] : 0;
  ------------------
  |  Branch (1514:27): [True: 5.14k, False: 11.3k]
  ------------------
 1515|       |
 1516|  16.4k|                if (run < 0) { // have we consumed all events in a run
  ------------------
  |  Branch (1516:21): [True: 7.65k, False: 8.81k]
  ------------------
 1517|  7.65k|                    run = mel_get_run(&mel);    // if yes, then get another run
 1518|  7.65k|                }
 1519|  16.4k|            }
 1520|       |
 1521|       |            //prepare context for the next quad, eqn. 1 in ITU T.814
 1522|  33.4k|            c_q = ((qinf[1] & 0x10) >> 4) | ((qinf[1] & 0xE0) >> 5);
 1523|       |
 1524|       |            //remove data from vlc stream, if qinf is not used, cwdlen is 0
 1525|  33.4k|            vlc_val = rev_advance(&vlc, qinf[1] & 0x7);
 1526|  33.4k|        }
 1527|       |
 1528|       |        //update sigma
 1529|       |        // The update depends on the value of x; consider one OPJ_UINT32
 1530|       |        // if x is 0, 8, 16 and so on, then this line update c locations
 1531|       |        //      nibble (4 bits) number   0 1 2 3 4 5 6 7
 1532|       |        //                         LSB   0 0 c c 0 0 0 0
 1533|       |        //                               0 0 c c 0 0 0 0
 1534|       |        //                               0 0 0 0 0 0 0 0
 1535|       |        //                               0 0 0 0 0 0 0 0
 1536|       |        // if x is 4, 12, 20, then this line update locations c
 1537|       |        //      nibble (4 bits) number   0 1 2 3 4 5 6 7
 1538|       |        //                         LSB   0 0 0 0 0 0 c c
 1539|       |        //                               0 0 0 0 0 0 c c
 1540|       |        //                               0 0 0 0 0 0 0 0
 1541|       |        //                               0 0 0 0 0 0 0 0
 1542|  34.0k|        *sip |= (((qinf[1] & 0x30) | ((qinf[1] & 0xC0) << 2))) << (4 + sip_shift);
 1543|       |
 1544|  34.0k|        sip += x & 0x7 ? 1 : 0; // move sigma pointer to next entry
  ------------------
  |  Branch (1544:16): [True: 16.0k, False: 18.0k]
  ------------------
 1545|  34.0k|        sip_shift ^= 0x10;      // increment/decrement sip_shift by 16
 1546|       |
 1547|       |        // retrieve u
 1548|       |        /////////////
 1549|       |
 1550|       |        // uvlc_mode is made up of u_offset bits from the quad pair
 1551|  34.0k|        uvlc_mode = ((qinf[0] & 0x8) >> 3) | ((qinf[1] & 0x8) >> 2);
 1552|  34.0k|        if (uvlc_mode == 3) { // if both u_offset are set, get an event from
  ------------------
  |  Branch (1552:13): [True: 8.82k, False: 25.2k]
  ------------------
 1553|       |            // the MEL run of events
 1554|  8.82k|            run -= 2; //subtract 2, since events number if multiplied by 2
 1555|  8.82k|            uvlc_mode += (run == -1) ? 1 : 0; //increment uvlc_mode if event is 1
  ------------------
  |  Branch (1555:26): [True: 4.03k, False: 4.78k]
  ------------------
 1556|  8.82k|            if (run < 0) { // if run is consumed (run is -1 or -2), get another run
  ------------------
  |  Branch (1556:17): [True: 5.49k, False: 3.32k]
  ------------------
 1557|  5.49k|                run = mel_get_run(&mel);
 1558|  5.49k|            }
 1559|  8.82k|        }
 1560|       |        //decode uvlc_mode to get u for both quads
 1561|  34.0k|        consumed_bits = decode_init_uvlc(vlc_val, uvlc_mode, U_q);
 1562|  34.0k|        if (U_q[0] > zero_bplanes_p1 || U_q[1] > zero_bplanes_p1) {
  ------------------
  |  Branch (1562:13): [True: 29, False: 34.0k]
  |  Branch (1562:41): [True: 18, False: 34.0k]
  ------------------
 1563|     47|            if (p_manager_mutex) {
  ------------------
  |  Branch (1563:17): [True: 47, False: 0]
  ------------------
 1564|     47|                opj_mutex_lock(p_manager_mutex);
 1565|     47|            }
 1566|     47|            opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. Decoding "
  ------------------
  |  |   66|     47|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1567|     47|                          "this codeblock is stopped. U_q is larger than zero "
 1568|     47|                          "bitplanes + 1 \n");
 1569|     47|            if (p_manager_mutex) {
  ------------------
  |  Branch (1569:17): [True: 47, False: 0]
  ------------------
 1570|     47|                opj_mutex_unlock(p_manager_mutex);
 1571|     47|            }
 1572|     47|            return OPJ_FALSE;
  ------------------
  |  |  118|     47|#define OPJ_FALSE 0
  ------------------
 1573|     47|        }
 1574|       |
 1575|       |        //consume u bits in the VLC code
 1576|  34.0k|        vlc_val = rev_advance(&vlc, consumed_bits);
 1577|       |
 1578|       |        //decode magsgn and update line_state
 1579|       |        /////////////////////////////////////
 1580|       |
 1581|       |        //We obtain a mask for the samples locations that needs evaluation
 1582|  34.0k|        locs = 0xFF;
 1583|  34.0k|        if (x + 4 > width) {
  ------------------
  |  Branch (1583:13): [True: 636, False: 33.3k]
  ------------------
 1584|    636|            locs >>= (x + 4 - width) << 1;    // limits width
 1585|    636|        }
 1586|  34.0k|        locs = height > 1 ? locs : (locs & 0x55);         // limits height
  ------------------
  |  Branch (1586:16): [True: 33.8k, False: 145]
  ------------------
 1587|       |
 1588|  34.0k|        if ((((qinf[0] & 0xF0) >> 4) | (qinf[1] & 0xF0)) & ~locs) {
  ------------------
  |  Branch (1588:13): [True: 7, False: 34.0k]
  ------------------
 1589|      7|            if (p_manager_mutex) {
  ------------------
  |  Branch (1589:17): [True: 7, False: 0]
  ------------------
 1590|      7|                opj_mutex_lock(p_manager_mutex);
 1591|      7|            }
 1592|      7|            opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
  ------------------
  |  |   66|      7|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1593|      7|                          "VLC code produces significant samples outside "
 1594|      7|                          "the codeblock area.\n");
 1595|      7|            if (p_manager_mutex) {
  ------------------
  |  Branch (1595:17): [True: 7, False: 0]
  ------------------
 1596|      7|                opj_mutex_unlock(p_manager_mutex);
 1597|      7|            }
 1598|      7|            return OPJ_FALSE;
  ------------------
  |  |  118|      7|#define OPJ_FALSE 0
  ------------------
 1599|      7|        }
 1600|       |
 1601|       |        //first quad, starting at first sample in quad and moving on
 1602|  34.0k|        if (qinf[0] & 0x10) { //is it significant? (sigma_n)
  ------------------
  |  Branch (1602:13): [True: 10.2k, False: 23.7k]
  ------------------
 1603|  10.2k|            OPJ_UINT32 val;
 1604|       |
 1605|  10.2k|            ms_val = frwd_fetch(&magsgn);         //get 32 bits of magsgn data
 1606|  10.2k|            m_n = U_q[0] - ((qinf[0] >> 12) & 1); //evaluate m_n (number of bits
 1607|       |            // to read from bitstream), using EMB e_k
 1608|  10.2k|            frwd_advance(&magsgn, m_n);         //consume m_n
 1609|  10.2k|            val = ms_val << 31;                 //get sign bit
 1610|  10.2k|            v_n = ms_val & ((1U << m_n) - 1);   //keep only m_n bits
 1611|  10.2k|            v_n |= ((qinf[0] & 0x100) >> 8) << m_n;  //add EMB e_1 as MSB
 1612|  10.2k|            v_n |= 1;                                //add center of bin
 1613|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1614|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1615|  10.2k|            sp[0] = val | ((v_n + 2) << (p - 1));
 1616|  23.7k|        } else if (locs & 0x1) { // if this is inside the codeblock, set the
  ------------------
  |  Branch (1616:20): [True: 23.7k, False: 0]
  ------------------
 1617|  23.7k|            sp[0] = 0;           // sample to zero
 1618|  23.7k|        }
 1619|       |
 1620|  34.0k|        if (qinf[0] & 0x20) { //sigma_n
  ------------------
  |  Branch (1620:13): [True: 14.1k, False: 19.8k]
  ------------------
 1621|  14.1k|            OPJ_UINT32 val, t;
 1622|       |
 1623|  14.1k|            ms_val = frwd_fetch(&magsgn);         //get 32 bits
 1624|  14.1k|            m_n = U_q[0] - ((qinf[0] >> 13) & 1); //m_n, uses EMB e_k
 1625|  14.1k|            frwd_advance(&magsgn, m_n);           //consume m_n
 1626|  14.1k|            val = ms_val << 31;                   //get sign bit
 1627|  14.1k|            v_n = ms_val & ((1U << m_n) - 1);     //keep only m_n bits
 1628|  14.1k|            v_n |= ((qinf[0] & 0x200) >> 9) << m_n; //add EMB e_1
 1629|  14.1k|            v_n |= 1;                               //bin center
 1630|       |            //v_n now has 2 * (\mu - 1) + 0.5 with correct sign bit
 1631|       |            //add 2 to make it 2*\mu+0.5, shift it up to missing MSBs
 1632|  14.1k|            sp[stride] = val | ((v_n + 2) << (p - 1));
 1633|       |
 1634|       |            //update line_state: bit 7 (\sigma^N), and E^N
 1635|  14.1k|            t = lsp[0] & 0x7F;       // keep E^NW
 1636|  14.1k|            v_n = 32 - count_leading_zeros(v_n);
 1637|  14.1k|            lsp[0] = (OPJ_UINT8)(0x80 | (t > v_n ? t : v_n)); //max(E^NW, E^N) | s
  ------------------
  |  Branch (1637:42): [True: 1.43k, False: 12.7k]
  ------------------
 1638|  19.8k|        } else if (locs & 0x2) { // if this is inside the codeblock, set the
  ------------------
  |  Branch (1638:20): [True: 19.7k, False: 141]
  ------------------
 1639|  19.7k|            sp[stride] = 0;      // sample to zero
 1640|  19.7k|        }
 1641|       |
 1642|  34.0k|        ++lsp; // move to next quad information
 1643|  34.0k|        ++sp;  // move to next column of samples
 1644|       |
 1645|       |        //this is similar to the above two samples
 1646|  34.0k|        if (qinf[0] & 0x40) {
  ------------------
  |  Branch (1646:13): [True: 8.93k, False: 25.0k]
  ------------------
 1647|  8.93k|            OPJ_UINT32 val;
 1648|       |
 1649|  8.93k|            ms_val = frwd_fetch(&magsgn);
 1650|  8.93k|            m_n = U_q[0] - ((qinf[0] >> 14) & 1);
 1651|  8.93k|            frwd_advance(&magsgn, m_n);
 1652|  8.93k|            val = ms_val << 31;
 1653|  8.93k|            v_n = ms_val & ((1U << m_n) - 1);
 1654|  8.93k|            v_n |= (((qinf[0] & 0x400) >> 10) << m_n);
 1655|  8.93k|            v_n |= 1;
 1656|  8.93k|            sp[0] = val | ((v_n + 2) << (p - 1));
 1657|  25.0k|        } else if (locs & 0x4) {
  ------------------
  |  Branch (1657:20): [True: 25.0k, False: 61]
  ------------------
 1658|  25.0k|            sp[0] = 0;
 1659|  25.0k|        }
 1660|       |
 1661|  34.0k|        lsp[0] = 0;
 1662|  34.0k|        if (qinf[0] & 0x80) {
  ------------------
  |  Branch (1662:13): [True: 11.5k, False: 22.4k]
  ------------------
 1663|  11.5k|            OPJ_UINT32 val;
 1664|  11.5k|            ms_val = frwd_fetch(&magsgn);
 1665|  11.5k|            m_n = U_q[0] - ((qinf[0] >> 15) & 1); //m_n
 1666|  11.5k|            frwd_advance(&magsgn, m_n);
 1667|  11.5k|            val = ms_val << 31;
 1668|  11.5k|            v_n = ms_val & ((1U << m_n) - 1);
 1669|  11.5k|            v_n |= ((qinf[0] & 0x800) >> 11) << m_n;
 1670|  11.5k|            v_n |= 1; //center of bin
 1671|  11.5k|            sp[stride] = val | ((v_n + 2) << (p - 1));
 1672|       |
 1673|       |            //line_state: bit 7 (\sigma^NW), and E^NW for next quad
 1674|  11.5k|            lsp[0] = (OPJ_UINT8)(0x80 | (32 - count_leading_zeros(v_n)));
 1675|  22.4k|        } else if (locs & 0x8) { //if outside set to 0
  ------------------
  |  Branch (1675:20): [True: 22.2k, False: 202]
  ------------------
 1676|  22.2k|            sp[stride] = 0;
 1677|  22.2k|        }
 1678|       |
 1679|  34.0k|        ++sp; //move to next column
 1680|       |
 1681|       |        //second quad
 1682|  34.0k|        if (qinf[1] & 0x10) {
  ------------------
  |  Branch (1682:13): [True: 9.43k, False: 24.5k]
  ------------------
 1683|  9.43k|            OPJ_UINT32 val;
 1684|       |
 1685|  9.43k|            ms_val = frwd_fetch(&magsgn);
 1686|  9.43k|            m_n = U_q[1] - ((qinf[1] >> 12) & 1); //m_n
 1687|  9.43k|            frwd_advance(&magsgn, m_n);
 1688|  9.43k|            val = ms_val << 31;
 1689|  9.43k|            v_n = ms_val & ((1U << m_n) - 1);
 1690|  9.43k|            v_n |= (((qinf[1] & 0x100) >> 8) << m_n);
 1691|  9.43k|            v_n |= 1;
 1692|  9.43k|            sp[0] = val | ((v_n + 2) << (p - 1));
 1693|  24.5k|        } else if (locs & 0x10) {
  ------------------
  |  Branch (1693:20): [True: 23.9k, False: 591]
  ------------------
 1694|  23.9k|            sp[0] = 0;
 1695|  23.9k|        }
 1696|       |
 1697|  34.0k|        if (qinf[1] & 0x20) {
  ------------------
  |  Branch (1697:13): [True: 14.2k, False: 19.7k]
  ------------------
 1698|  14.2k|            OPJ_UINT32 val, t;
 1699|       |
 1700|  14.2k|            ms_val = frwd_fetch(&magsgn);
 1701|  14.2k|            m_n = U_q[1] - ((qinf[1] >> 13) & 1); //m_n
 1702|  14.2k|            frwd_advance(&magsgn, m_n);
 1703|  14.2k|            val = ms_val << 31;
 1704|  14.2k|            v_n = ms_val & ((1U << m_n) - 1);
 1705|  14.2k|            v_n |= (((qinf[1] & 0x200) >> 9) << m_n);
 1706|  14.2k|            v_n |= 1;
 1707|  14.2k|            sp[stride] = val | ((v_n + 2) << (p - 1));
 1708|       |
 1709|       |            //update line_state: bit 7 (\sigma^N), and E^N
 1710|  14.2k|            t = lsp[0] & 0x7F;            //E^NW
 1711|  14.2k|            v_n = 32 - count_leading_zeros(v_n);     //E^N
 1712|  14.2k|            lsp[0] = (OPJ_UINT8)(0x80 | (t > v_n ? t : v_n)); //max(E^NW, E^N) | s
  ------------------
  |  Branch (1712:42): [True: 4.17k, False: 10.1k]
  ------------------
 1713|  19.7k|        } else if (locs & 0x20) {
  ------------------
  |  Branch (1713:20): [True: 18.9k, False: 730]
  ------------------
 1714|  18.9k|            sp[stride] = 0;    //no need to update line_state
 1715|  18.9k|        }
 1716|       |
 1717|  34.0k|        ++lsp; //move line state to next quad
 1718|  34.0k|        ++sp;  //move to next sample
 1719|       |
 1720|  34.0k|        if (qinf[1] & 0x40) {
  ------------------
  |  Branch (1720:13): [True: 10.0k, False: 23.9k]
  ------------------
 1721|  10.0k|            OPJ_UINT32 val;
 1722|       |
 1723|  10.0k|            ms_val = frwd_fetch(&magsgn);
 1724|  10.0k|            m_n = U_q[1] - ((qinf[1] >> 14) & 1); //m_n
 1725|  10.0k|            frwd_advance(&magsgn, m_n);
 1726|  10.0k|            val = ms_val << 31;
 1727|  10.0k|            v_n = ms_val & ((1U << m_n) - 1);
 1728|  10.0k|            v_n |= (((qinf[1] & 0x400) >> 10) << m_n);
 1729|  10.0k|            v_n |= 1;
 1730|  10.0k|            sp[0] = val | ((v_n + 2) << (p - 1));
 1731|  23.9k|        } else if (locs & 0x40) {
  ------------------
  |  Branch (1731:20): [True: 23.3k, False: 632]
  ------------------
 1732|  23.3k|            sp[0] = 0;
 1733|  23.3k|        }
 1734|       |
 1735|  34.0k|        lsp[0] = 0;
 1736|  34.0k|        if (qinf[1] & 0x80) {
  ------------------
  |  Branch (1736:13): [True: 9.56k, False: 24.4k]
  ------------------
 1737|  9.56k|            OPJ_UINT32 val;
 1738|       |
 1739|  9.56k|            ms_val = frwd_fetch(&magsgn);
 1740|  9.56k|            m_n = U_q[1] - ((qinf[1] >> 15) & 1); //m_n
 1741|  9.56k|            frwd_advance(&magsgn, m_n);
 1742|  9.56k|            val = ms_val << 31;
 1743|  9.56k|            v_n = ms_val & ((1U << m_n) - 1);
 1744|  9.56k|            v_n |= (((qinf[1] & 0x800) >> 11) << m_n);
 1745|  9.56k|            v_n |= 1; //center of bin
 1746|  9.56k|            sp[stride] = val | ((v_n + 2) << (p - 1));
 1747|       |
 1748|       |            //line_state: bit 7 (\sigma^NW), and E^NW for next quad
 1749|  9.56k|            lsp[0] = (OPJ_UINT8)(0x80 | (32 - count_leading_zeros(v_n)));
 1750|  24.4k|        } else if (locs & 0x80) {
  ------------------
  |  Branch (1750:20): [True: 23.6k, False: 768]
  ------------------
 1751|  23.6k|            sp[stride] = 0;
 1752|  23.6k|        }
 1753|       |
 1754|  34.0k|        ++sp;
 1755|  34.0k|    }
 1756|       |
 1757|       |    //non-initial lines
 1758|       |    //////////////////////////
 1759|  71.2k|    for (y = 2; y < height; /*done at the end of loop*/) {
  ------------------
  |  Branch (1759:17): [True: 68.3k, False: 2.85k]
  ------------------
 1760|  68.3k|        OPJ_UINT32 *sip;
 1761|  68.3k|        OPJ_UINT8 ls0;
 1762|  68.3k|        OPJ_INT32 x;
 1763|       |
 1764|  68.3k|        sip_shift ^= 0x2;  // shift sigma to the upper half od the nibble
 1765|  68.3k|        sip_shift &= 0xFFFFFFEFU; //move back to 0 (it might have been at 0x10)
 1766|  68.3k|        sip = y & 0x4 ? sigma2 : sigma1; //choose sigma array
  ------------------
  |  Branch (1766:15): [True: 35.0k, False: 33.2k]
  ------------------
 1767|       |
 1768|  68.3k|        lsp = line_state;
 1769|  68.3k|        ls0 = lsp[0];                   // read the line state value
 1770|  68.3k|        lsp[0] = 0;                     // and set it to zero
 1771|  68.3k|        sp = decoded_data + y * stride; // generated samples
 1772|  68.3k|        c_q = 0;                        // context
 1773|   302k|        for (x = 0; x < width; x += 4) {
  ------------------
  |  Branch (1773:21): [True: 234k, False: 68.2k]
  ------------------
 1774|   234k|            OPJ_UINT32 U_q[2];
 1775|   234k|            OPJ_UINT32 uvlc_mode, consumed_bits;
 1776|   234k|            OPJ_UINT32 m_n, v_n;
 1777|   234k|            OPJ_UINT32 ms_val;
 1778|   234k|            OPJ_UINT32 locs;
 1779|       |
 1780|       |            // decode vlc
 1781|       |            /////////////
 1782|       |
 1783|       |            //first quad
 1784|       |            // get context, eqn. 2 ITU T.814
 1785|       |            // c_q has \sigma^W | \sigma^SW
 1786|   234k|            c_q |= (ls0 >> 7);          //\sigma^NW | \sigma^N
 1787|   234k|            c_q |= (lsp[1] >> 5) & 0x4; //\sigma^NE | \sigma^NF
 1788|       |
 1789|       |            //the following is very similar to previous code, so please refer to
 1790|       |            // that
 1791|   234k|            vlc_val = rev_fetch(&vlc);
 1792|   234k|            qinf[0] = vlc_tbl1[(c_q << 7) | (vlc_val & 0x7F)];
 1793|   234k|            if (c_q == 0) { //zero context
  ------------------
  |  Branch (1793:17): [True: 209k, False: 25.1k]
  ------------------
 1794|   209k|                run -= 2;
 1795|   209k|                qinf[0] = (run == -1) ? qinf[0] : 0;
  ------------------
  |  Branch (1795:27): [True: 44.6k, False: 164k]
  ------------------
 1796|   209k|                if (run < 0) {
  ------------------
  |  Branch (1796:21): [True: 69.8k, False: 139k]
  ------------------
 1797|  69.8k|                    run = mel_get_run(&mel);
 1798|  69.8k|                }
 1799|   209k|            }
 1800|       |            //prepare context for the next quad, \sigma^W | \sigma^SW
 1801|   234k|            c_q = ((qinf[0] & 0x40) >> 5) | ((qinf[0] & 0x80) >> 6);
 1802|       |
 1803|       |            //remove data from vlc stream
 1804|   234k|            vlc_val = rev_advance(&vlc, qinf[0] & 0x7);
 1805|       |
 1806|       |            //update sigma
 1807|       |            // The update depends on the value of x and y; consider one OPJ_UINT32
 1808|       |            // if x is 0, 8, 16 and so on, and y is 2, 6, etc., then this
 1809|       |            // line update c locations
 1810|       |            //      nibble (4 bits) number   0 1 2 3 4 5 6 7
 1811|       |            //                         LSB   0 0 0 0 0 0 0 0
 1812|       |            //                               0 0 0 0 0 0 0 0
 1813|       |            //                               c c 0 0 0 0 0 0
 1814|       |            //                               c c 0 0 0 0 0 0
 1815|   234k|            *sip |= (((qinf[0] & 0x30) >> 4) | ((qinf[0] & 0xC0) >> 2)) << sip_shift;
 1816|       |
 1817|       |            //second quad
 1818|   234k|            qinf[1] = 0;
 1819|   234k|            if (x + 2 < width) {
  ------------------
  |  Branch (1819:17): [True: 219k, False: 14.9k]
  ------------------
 1820|   219k|                c_q |= (lsp[1] >> 7);
 1821|   219k|                c_q |= (lsp[2] >> 5) & 0x4;
 1822|   219k|                qinf[1] = vlc_tbl1[(c_q << 7) | (vlc_val & 0x7F)];
 1823|   219k|                if (c_q == 0) { //zero context
  ------------------
  |  Branch (1823:21): [True: 193k, False: 26.1k]
  ------------------
 1824|   193k|                    run -= 2;
 1825|   193k|                    qinf[1] = (run == -1) ? qinf[1] : 0;
  ------------------
  |  Branch (1825:31): [True: 37.0k, False: 156k]
  ------------------
 1826|   193k|                    if (run < 0) {
  ------------------
  |  Branch (1826:25): [True: 59.6k, False: 133k]
  ------------------
 1827|  59.6k|                        run = mel_get_run(&mel);
 1828|  59.6k|                    }
 1829|   193k|                }
 1830|       |                //prepare context for the next quad
 1831|   219k|                c_q = ((qinf[1] & 0x40) >> 5) | ((qinf[1] & 0x80) >> 6);
 1832|       |                //remove data from vlc stream
 1833|   219k|                vlc_val = rev_advance(&vlc, qinf[1] & 0x7);
 1834|   219k|            }
 1835|       |
 1836|       |            //update sigma
 1837|   234k|            *sip |= (((qinf[1] & 0x30) | ((qinf[1] & 0xC0) << 2))) << (4 + sip_shift);
 1838|       |
 1839|   234k|            sip += x & 0x7 ? 1 : 0;
  ------------------
  |  Branch (1839:20): [True: 90.3k, False: 144k]
  ------------------
 1840|   234k|            sip_shift ^= 0x10;
 1841|       |
 1842|       |            //retrieve u
 1843|       |            ////////////
 1844|   234k|            uvlc_mode = ((qinf[0] & 0x8) >> 3) | ((qinf[1] & 0x8) >> 2);
 1845|   234k|            consumed_bits = decode_noninit_uvlc(vlc_val, uvlc_mode, U_q);
 1846|   234k|            vlc_val = rev_advance(&vlc, consumed_bits);
 1847|       |
 1848|       |            //calculate E^max and add it to U_q, eqns 5 and 6 in ITU T.814
 1849|   234k|            if ((qinf[0] & 0xF0) & ((qinf[0] & 0xF0) - 1)) { // is \gamma_q 1?
  ------------------
  |  Branch (1849:17): [True: 6.16k, False: 228k]
  ------------------
 1850|  6.16k|                OPJ_UINT32 E = (ls0 & 0x7Fu);
 1851|  6.16k|                E = E > (lsp[1] & 0x7Fu) ? E : (lsp[1] & 0x7Fu); //max(E, E^NE, E^NF)
  ------------------
  |  Branch (1851:21): [True: 1.65k, False: 4.50k]
  ------------------
 1852|       |                //since U_q already has u_q + 1, we subtract 2 instead of 1
 1853|  6.16k|                U_q[0] += E > 2 ? E - 2 : 0;
  ------------------
  |  Branch (1853:27): [True: 2.68k, False: 3.47k]
  ------------------
 1854|  6.16k|            }
 1855|       |
 1856|   234k|            if ((qinf[1] & 0xF0) & ((qinf[1] & 0xF0) - 1)) { //is \gamma_q 1?
  ------------------
  |  Branch (1856:17): [True: 5.08k, False: 229k]
  ------------------
 1857|  5.08k|                OPJ_UINT32 E = (lsp[1] & 0x7Fu);
 1858|  5.08k|                E = E > (lsp[2] & 0x7Fu) ? E : (lsp[2] & 0x7Fu); //max(E, E^NE, E^NF)
  ------------------
  |  Branch (1858:21): [True: 1.08k, False: 3.99k]
  ------------------
 1859|       |                //since U_q already has u_q + 1, we subtract 2 instead of 1
 1860|  5.08k|                U_q[1] += E > 2 ? E - 2 : 0;
  ------------------
  |  Branch (1860:27): [True: 2.71k, False: 2.37k]
  ------------------
 1861|  5.08k|            }
 1862|       |
 1863|   234k|            if (U_q[0] > zero_bplanes_p1 || U_q[1] > zero_bplanes_p1) {
  ------------------
  |  Branch (1863:17): [True: 36, False: 234k]
  |  Branch (1863:45): [True: 26, False: 234k]
  ------------------
 1864|     62|                if (p_manager_mutex) {
  ------------------
  |  Branch (1864:21): [True: 62, False: 0]
  ------------------
 1865|     62|                    opj_mutex_lock(p_manager_mutex);
 1866|     62|                }
 1867|     62|                opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
  ------------------
  |  |   66|     62|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1868|     62|                              "Decoding this codeblock is stopped. U_q is"
 1869|     62|                              "larger than bitplanes + 1 \n");
 1870|     62|                if (p_manager_mutex) {
  ------------------
  |  Branch (1870:21): [True: 62, False: 0]
  ------------------
 1871|     62|                    opj_mutex_unlock(p_manager_mutex);
 1872|     62|                }
 1873|     62|                return OPJ_FALSE;
  ------------------
  |  |  118|     62|#define OPJ_FALSE 0
  ------------------
 1874|     62|            }
 1875|       |
 1876|   234k|            ls0 = lsp[2]; //for next double quad
 1877|   234k|            lsp[1] = lsp[2] = 0;
 1878|       |
 1879|       |            //decode magsgn and update line_state
 1880|       |            /////////////////////////////////////
 1881|       |
 1882|       |            //locations where samples need update
 1883|   234k|            locs = 0xFF;
 1884|   234k|            if (x + 4 > width) {
  ------------------
  |  Branch (1884:17): [True: 15.4k, False: 218k]
  ------------------
 1885|  15.4k|                locs >>= (x + 4 - width) << 1;
 1886|  15.4k|            }
 1887|   234k|            locs = y + 2 <= height ? locs : (locs & 0x55);
  ------------------
  |  Branch (1887:20): [True: 230k, False: 3.75k]
  ------------------
 1888|       |
 1889|   234k|            if ((((qinf[0] & 0xF0) >> 4) | (qinf[1] & 0xF0)) & ~locs) {
  ------------------
  |  Branch (1889:17): [True: 12, False: 234k]
  ------------------
 1890|     12|                if (p_manager_mutex) {
  ------------------
  |  Branch (1890:21): [True: 12, False: 0]
  ------------------
 1891|     12|                    opj_mutex_lock(p_manager_mutex);
 1892|     12|                }
 1893|     12|                opj_event_msg(p_manager, EVT_ERROR, "Malformed HT codeblock. "
  ------------------
  |  |   66|     12|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1894|     12|                              "VLC code produces significant samples outside "
 1895|     12|                              "the codeblock area.\n");
 1896|     12|                if (p_manager_mutex) {
  ------------------
  |  Branch (1896:21): [True: 12, False: 0]
  ------------------
 1897|     12|                    opj_mutex_unlock(p_manager_mutex);
 1898|     12|                }
 1899|     12|                return OPJ_FALSE;
  ------------------
  |  |  118|     12|#define OPJ_FALSE 0
  ------------------
 1900|     12|            }
 1901|       |
 1902|       |
 1903|       |
 1904|   234k|            if (qinf[0] & 0x10) { //sigma_n
  ------------------
  |  Branch (1904:17): [True: 45.0k, False: 189k]
  ------------------
 1905|  45.0k|                OPJ_UINT32 val;
 1906|       |
 1907|  45.0k|                ms_val = frwd_fetch(&magsgn);
 1908|  45.0k|                m_n = U_q[0] - ((qinf[0] >> 12) & 1); //m_n
 1909|  45.0k|                frwd_advance(&magsgn, m_n);
 1910|  45.0k|                val = ms_val << 31;
 1911|  45.0k|                v_n = ms_val & ((1U << m_n) - 1);
 1912|  45.0k|                v_n |= ((qinf[0] & 0x100) >> 8) << m_n;
 1913|  45.0k|                v_n |= 1; //center of bin
 1914|  45.0k|                sp[0] = val | ((v_n + 2) << (p - 1));
 1915|   189k|            } else if (locs & 0x1) {
  ------------------
  |  Branch (1915:24): [True: 189k, False: 0]
  ------------------
 1916|   189k|                sp[0] = 0;
 1917|   189k|            }
 1918|       |
 1919|   234k|            if (qinf[0] & 0x20) { //sigma_n
  ------------------
  |  Branch (1919:17): [True: 5.12k, False: 229k]
  ------------------
 1920|  5.12k|                OPJ_UINT32 val, t;
 1921|       |
 1922|  5.12k|                ms_val = frwd_fetch(&magsgn);
 1923|  5.12k|                m_n = U_q[0] - ((qinf[0] >> 13) & 1); //m_n
 1924|  5.12k|                frwd_advance(&magsgn, m_n);
 1925|  5.12k|                val = ms_val << 31;
 1926|  5.12k|                v_n = ms_val & ((1U << m_n) - 1);
 1927|  5.12k|                v_n |= ((qinf[0] & 0x200) >> 9) << m_n;
 1928|  5.12k|                v_n |= 1; //center of bin
 1929|  5.12k|                sp[stride] = val | ((v_n + 2) << (p - 1));
 1930|       |
 1931|       |                //update line_state: bit 7 (\sigma^N), and E^N
 1932|  5.12k|                t = lsp[0] & 0x7F;          //E^NW
 1933|  5.12k|                v_n = 32 - count_leading_zeros(v_n);
 1934|  5.12k|                lsp[0] = (OPJ_UINT8)(0x80 | (t > v_n ? t : v_n));
  ------------------
  |  Branch (1934:46): [True: 494, False: 4.63k]
  ------------------
 1935|   229k|            } else if (locs & 0x2) {
  ------------------
  |  Branch (1935:24): [True: 225k, False: 3.75k]
  ------------------
 1936|   225k|                sp[stride] = 0;    //no need to update line_state
 1937|   225k|            }
 1938|       |
 1939|   234k|            ++lsp;
 1940|   234k|            ++sp;
 1941|       |
 1942|   234k|            if (qinf[0] & 0x40) { //sigma_n
  ------------------
  |  Branch (1942:17): [True: 6.87k, False: 227k]
  ------------------
 1943|  6.87k|                OPJ_UINT32 val;
 1944|       |
 1945|  6.87k|                ms_val = frwd_fetch(&magsgn);
 1946|  6.87k|                m_n = U_q[0] - ((qinf[0] >> 14) & 1); //m_n
 1947|  6.87k|                frwd_advance(&magsgn, m_n);
 1948|  6.87k|                val = ms_val << 31;
 1949|  6.87k|                v_n = ms_val & ((1U << m_n) - 1);
 1950|  6.87k|                v_n |= (((qinf[0] & 0x400) >> 10) << m_n);
 1951|  6.87k|                v_n |= 1;                            //center of bin
 1952|  6.87k|                sp[0] = val | ((v_n + 2) << (p - 1));
 1953|   227k|            } else if (locs & 0x4) {
  ------------------
  |  Branch (1953:24): [True: 226k, False: 1.02k]
  ------------------
 1954|   226k|                sp[0] = 0;
 1955|   226k|            }
 1956|       |
 1957|   234k|            if (qinf[0] & 0x80) { //sigma_n
  ------------------
  |  Branch (1957:17): [True: 6.00k, False: 228k]
  ------------------
 1958|  6.00k|                OPJ_UINT32 val;
 1959|       |
 1960|  6.00k|                ms_val = frwd_fetch(&magsgn);
 1961|  6.00k|                m_n = U_q[0] - ((qinf[0] >> 15) & 1); //m_n
 1962|  6.00k|                frwd_advance(&magsgn, m_n);
 1963|  6.00k|                val = ms_val << 31;
 1964|  6.00k|                v_n = ms_val & ((1U << m_n) - 1);
 1965|  6.00k|                v_n |= ((qinf[0] & 0x800) >> 11) << m_n;
 1966|  6.00k|                v_n |= 1; //center of bin
 1967|  6.00k|                sp[stride] = val | ((v_n + 2) << (p - 1));
 1968|       |
 1969|       |                //update line_state: bit 7 (\sigma^NW), and E^NW for next quad
 1970|  6.00k|                lsp[0] = (OPJ_UINT8)(0x80 | (32 - count_leading_zeros(v_n)));
 1971|   228k|            } else if (locs & 0x8) {
  ------------------
  |  Branch (1971:24): [True: 223k, False: 4.78k]
  ------------------
 1972|   223k|                sp[stride] = 0;
 1973|   223k|            }
 1974|       |
 1975|   234k|            ++sp;
 1976|       |
 1977|   234k|            if (qinf[1] & 0x10) { //sigma_n
  ------------------
  |  Branch (1977:17): [True: 39.9k, False: 194k]
  ------------------
 1978|  39.9k|                OPJ_UINT32 val;
 1979|       |
 1980|  39.9k|                ms_val = frwd_fetch(&magsgn);
 1981|  39.9k|                m_n = U_q[1] - ((qinf[1] >> 12) & 1); //m_n
 1982|  39.9k|                frwd_advance(&magsgn, m_n);
 1983|  39.9k|                val = ms_val << 31;
 1984|  39.9k|                v_n = ms_val & ((1U << m_n) - 1);
 1985|  39.9k|                v_n |= (((qinf[1] & 0x100) >> 8) << m_n);
 1986|  39.9k|                v_n |= 1;                            //center of bin
 1987|  39.9k|                sp[0] = val | ((v_n + 2) << (p - 1));
 1988|   194k|            } else if (locs & 0x10) {
  ------------------
  |  Branch (1988:24): [True: 179k, False: 14.9k]
  ------------------
 1989|   179k|                sp[0] = 0;
 1990|   179k|            }
 1991|       |
 1992|   234k|            if (qinf[1] & 0x20) { //sigma_n
  ------------------
  |  Branch (1992:17): [True: 4.80k, False: 229k]
  ------------------
 1993|  4.80k|                OPJ_UINT32 val, t;
 1994|       |
 1995|  4.80k|                ms_val = frwd_fetch(&magsgn);
 1996|  4.80k|                m_n = U_q[1] - ((qinf[1] >> 13) & 1); //m_n
 1997|  4.80k|                frwd_advance(&magsgn, m_n);
 1998|  4.80k|                val = ms_val << 31;
 1999|  4.80k|                v_n = ms_val & ((1U << m_n) - 1);
 2000|  4.80k|                v_n |= (((qinf[1] & 0x200) >> 9) << m_n);
 2001|  4.80k|                v_n |= 1; //center of bin
 2002|  4.80k|                sp[stride] = val | ((v_n + 2) << (p - 1));
 2003|       |
 2004|       |                //update line_state: bit 7 (\sigma^N), and E^N
 2005|  4.80k|                t = lsp[0] & 0x7F;          //E^NW
 2006|  4.80k|                v_n = 32 - count_leading_zeros(v_n);
 2007|  4.80k|                lsp[0] = (OPJ_UINT8)(0x80 | (t > v_n ? t : v_n));
  ------------------
  |  Branch (2007:46): [True: 597, False: 4.20k]
  ------------------
 2008|   229k|            } else if (locs & 0x20) {
  ------------------
  |  Branch (2008:24): [True: 210k, False: 18.6k]
  ------------------
 2009|   210k|                sp[stride] = 0;    //no need to update line_state
 2010|   210k|            }
 2011|       |
 2012|   234k|            ++lsp;
 2013|   234k|            ++sp;
 2014|       |
 2015|   234k|            if (qinf[1] & 0x40) { //sigma_n
  ------------------
  |  Branch (2015:17): [True: 4.09k, False: 230k]
  ------------------
 2016|  4.09k|                OPJ_UINT32 val;
 2017|       |
 2018|  4.09k|                ms_val = frwd_fetch(&magsgn);
 2019|  4.09k|                m_n = U_q[1] - ((qinf[1] >> 14) & 1); //m_n
 2020|  4.09k|                frwd_advance(&magsgn, m_n);
 2021|  4.09k|                val = ms_val << 31;
 2022|  4.09k|                v_n = ms_val & ((1U << m_n) - 1);
 2023|  4.09k|                v_n |= (((qinf[1] & 0x400) >> 10) << m_n);
 2024|  4.09k|                v_n |= 1;                            //center of bin
 2025|  4.09k|                sp[0] = val | ((v_n + 2) << (p - 1));
 2026|   230k|            } else if (locs & 0x40) {
  ------------------
  |  Branch (2026:24): [True: 214k, False: 15.4k]
  ------------------
 2027|   214k|                sp[0] = 0;
 2028|   214k|            }
 2029|       |
 2030|   234k|            if (qinf[1] & 0x80) { //sigma_n
  ------------------
  |  Branch (2030:17): [True: 4.48k, False: 229k]
  ------------------
 2031|  4.48k|                OPJ_UINT32 val;
 2032|       |
 2033|  4.48k|                ms_val = frwd_fetch(&magsgn);
 2034|  4.48k|                m_n = U_q[1] - ((qinf[1] >> 15) & 1); //m_n
 2035|  4.48k|                frwd_advance(&magsgn, m_n);
 2036|  4.48k|                val = ms_val << 31;
 2037|  4.48k|                v_n = ms_val & ((1U << m_n) - 1);
 2038|  4.48k|                v_n |= (((qinf[1] & 0x800) >> 11) << m_n);
 2039|  4.48k|                v_n |= 1; //center of bin
 2040|  4.48k|                sp[stride] = val | ((v_n + 2) << (p - 1));
 2041|       |
 2042|       |                //update line_state: bit 7 (\sigma^NW), and E^NW for next quad
 2043|  4.48k|                lsp[0] = (OPJ_UINT8)(0x80 | (32 - count_leading_zeros(v_n)));
 2044|   229k|            } else if (locs & 0x80) {
  ------------------
  |  Branch (2044:24): [True: 210k, False: 19.0k]
  ------------------
 2045|   210k|                sp[stride] = 0;
 2046|   210k|            }
 2047|       |
 2048|   234k|            ++sp;
 2049|   234k|        }
 2050|       |
 2051|  68.2k|        y += 2;
 2052|  68.2k|        if (num_passes > 1 && (y & 3) == 0) { //executed at multiples of 4
  ------------------
  |  Branch (2052:13): [True: 30.6k, False: 37.6k]
  |  Branch (2052:31): [True: 15.8k, False: 14.7k]
  ------------------
 2053|       |            // This is for SPP and potentially MRP
 2054|       |
 2055|  15.8k|            if (num_passes > 2) { //do MRP
  ------------------
  |  Branch (2055:17): [True: 15.0k, False: 809]
  ------------------
 2056|       |                // select the current stripe
 2057|  15.0k|                OPJ_UINT32 *cur_sig = y & 0x4 ? sigma1 : sigma2;
  ------------------
  |  Branch (2057:39): [True: 7.73k, False: 7.27k]
  ------------------
 2058|       |                // the address of the data that needs updating
 2059|  15.0k|                OPJ_UINT32 *dpp = decoded_data + (y - 4) * stride;
 2060|  15.0k|                OPJ_UINT32 half = 1u << (p - 2); // half the center of the bin
 2061|  15.0k|                OPJ_INT32 i;
 2062|  57.2k|                for (i = 0; i < width; i += 8) {
  ------------------
  |  Branch (2062:29): [True: 42.2k, False: 15.0k]
  ------------------
 2063|       |                    //Process one entry from sigma array at a time
 2064|       |                    // Each nibble (4 bits) in the sigma array represents 4 rows,
 2065|       |                    // and the 32 bits contain 8 columns
 2066|  42.2k|                    OPJ_UINT32 cwd = rev_fetch_mrp(&magref); // get 32 bit data
 2067|  42.2k|                    OPJ_UINT32 sig = *cur_sig++; // 32 bit that will be processed now
 2068|  42.2k|                    OPJ_UINT32 col_mask = 0xFu;  // a mask for a column in sig
 2069|  42.2k|                    OPJ_UINT32 *dp = dpp + i;    // next column in decode samples
 2070|  42.2k|                    if (sig) { // if any of the 32 bits are set
  ------------------
  |  Branch (2070:25): [True: 21.4k, False: 20.7k]
  ------------------
 2071|  21.4k|                        int j;
 2072|   193k|                        for (j = 0; j < 8; ++j, dp++) { //one column at a time
  ------------------
  |  Branch (2072:37): [True: 171k, False: 21.4k]
  ------------------
 2073|   171k|                            if (sig & col_mask) { // lowest nibble
  ------------------
  |  Branch (2073:33): [True: 70.2k, False: 101k]
  ------------------
 2074|  70.2k|                                OPJ_UINT32 sample_mask = 0x11111111u & col_mask; //LSB
 2075|       |
 2076|  70.2k|                                if (sig & sample_mask) { //if LSB is set
  ------------------
  |  Branch (2076:37): [True: 47.4k, False: 22.8k]
  ------------------
 2077|  47.4k|                                    OPJ_UINT32 sym;
 2078|       |
 2079|  47.4k|                                    assert(dp[0] != 0); // decoded value cannot be zero
 2080|  47.4k|                                    sym = cwd & 1; // get it value
 2081|       |                                    // remove center of bin if sym is 0
 2082|  47.4k|                                    dp[0] ^= (1 - sym) << (p - 1);
 2083|  47.4k|                                    dp[0] |= half;      // put half the center of bin
 2084|  47.4k|                                    cwd >>= 1;          //consume word
 2085|  47.4k|                                }
 2086|  70.2k|                                sample_mask += sample_mask; //next row
 2087|       |
 2088|  70.2k|                                if (sig & sample_mask) {
  ------------------
  |  Branch (2088:37): [True: 32.3k, False: 37.9k]
  ------------------
 2089|  32.3k|                                    OPJ_UINT32 sym;
 2090|       |
 2091|  32.3k|                                    assert(dp[stride] != 0);
 2092|  32.3k|                                    sym = cwd & 1;
 2093|  32.3k|                                    dp[stride] ^= (1 - sym) << (p - 1);
 2094|  32.3k|                                    dp[stride] |= half;
 2095|  32.3k|                                    cwd >>= 1;
 2096|  32.3k|                                }
 2097|  70.2k|                                sample_mask += sample_mask;
 2098|       |
 2099|  70.2k|                                if (sig & sample_mask) {
  ------------------
  |  Branch (2099:37): [True: 31.9k, False: 38.2k]
  ------------------
 2100|  31.9k|                                    OPJ_UINT32 sym;
 2101|       |
 2102|  31.9k|                                    assert(dp[2 * stride] != 0);
 2103|  31.9k|                                    sym = cwd & 1;
 2104|  31.9k|                                    dp[2 * stride] ^= (1 - sym) << (p - 1);
 2105|  31.9k|                                    dp[2 * stride] |= half;
 2106|  31.9k|                                    cwd >>= 1;
 2107|  31.9k|                                }
 2108|  70.2k|                                sample_mask += sample_mask;
 2109|       |
 2110|  70.2k|                                if (sig & sample_mask) {
  ------------------
  |  Branch (2110:37): [True: 9.91k, False: 60.3k]
  ------------------
 2111|  9.91k|                                    OPJ_UINT32 sym;
 2112|       |
 2113|  9.91k|                                    assert(dp[3 * stride] != 0);
 2114|  9.91k|                                    sym = cwd & 1;
 2115|  9.91k|                                    dp[3 * stride] ^= (1 - sym) << (p - 1);
 2116|  9.91k|                                    dp[3 * stride] |= half;
 2117|  9.91k|                                    cwd >>= 1;
 2118|  9.91k|                                }
 2119|  70.2k|                                sample_mask += sample_mask;
 2120|  70.2k|                            }
 2121|   171k|                            col_mask <<= 4; //next column
 2122|   171k|                        }
 2123|  21.4k|                    }
 2124|       |                    // consume data according to the number of bits set
 2125|  42.2k|                    rev_advance_mrp(&magref, population_count(sig));
 2126|  42.2k|                }
 2127|  15.0k|            }
 2128|       |
 2129|  15.8k|            if (y >= 4) { // update mbr array at the end of each stripe
  ------------------
  |  Branch (2129:17): [True: 15.8k, False: 0]
  ------------------
 2130|       |                //generate mbr corresponding to a stripe
 2131|  15.8k|                OPJ_UINT32 *sig = y & 0x4 ? sigma1 : sigma2;
  ------------------
  |  Branch (2131:35): [True: 8.16k, False: 7.65k]
  ------------------
 2132|  15.8k|                OPJ_UINT32 *mbr = y & 0x4 ? mbr1 : mbr2;
  ------------------
  |  Branch (2132:35): [True: 8.16k, False: 7.65k]
  ------------------
 2133|       |
 2134|       |                //data is processed in patches of 8 columns, each
 2135|       |                // each 32 bits in sigma1 or mbr1 represent 4 rows
 2136|       |
 2137|       |                //integrate horizontally
 2138|  15.8k|                OPJ_UINT32 prev = 0; // previous columns
 2139|  15.8k|                OPJ_INT32 i;
 2140|  63.1k|                for (i = 0; i < width; i += 8, mbr++, sig++) {
  ------------------
  |  Branch (2140:29): [True: 47.2k, False: 15.8k]
  ------------------
 2141|  47.2k|                    OPJ_UINT32 t, z;
 2142|       |
 2143|  47.2k|                    mbr[0] = sig[0];         //start with significant samples
 2144|  47.2k|                    mbr[0] |= prev >> 28;    //for first column, left neighbors
 2145|  47.2k|                    mbr[0] |= sig[0] << 4;   //left neighbors
 2146|  47.2k|                    mbr[0] |= sig[0] >> 4;   //right neighbors
 2147|  47.2k|                    mbr[0] |= sig[1] << 28;  //for last column, right neighbors
 2148|  47.2k|                    prev = sig[0];           // for next group of columns
 2149|       |
 2150|       |                    //integrate vertically
 2151|  47.2k|                    t = mbr[0], z = mbr[0];
 2152|  47.2k|                    z |= (t & 0x77777777) << 1; //above neighbors
 2153|  47.2k|                    z |= (t & 0xEEEEEEEE) >> 1; //below neighbors
 2154|  47.2k|                    mbr[0] = z & ~sig[0]; //remove already significance samples
 2155|  47.2k|                }
 2156|  15.8k|            }
 2157|       |
 2158|  15.8k|            if (y >= 8) { //wait until 8 rows has been processed
  ------------------
  |  Branch (2158:17): [True: 14.3k, False: 1.49k]
  ------------------
 2159|  14.3k|                OPJ_UINT32 *cur_sig, *cur_mbr, *nxt_sig, *nxt_mbr;
 2160|  14.3k|                OPJ_UINT32 prev;
 2161|  14.3k|                OPJ_UINT32 val;
 2162|  14.3k|                OPJ_INT32 i;
 2163|       |
 2164|       |                // add membership from the next stripe, obtained above
 2165|  14.3k|                cur_sig = y & 0x4 ? sigma2 : sigma1;
  ------------------
  |  Branch (2165:27): [True: 6.67k, False: 7.65k]
  ------------------
 2166|  14.3k|                cur_mbr = y & 0x4 ? mbr2 : mbr1;
  ------------------
  |  Branch (2166:27): [True: 6.67k, False: 7.65k]
  ------------------
 2167|  14.3k|                nxt_sig = y & 0x4 ? sigma1 : sigma2;  //future samples
  ------------------
  |  Branch (2167:27): [True: 6.67k, False: 7.65k]
  ------------------
 2168|  14.3k|                prev = 0; // the columns before these group of 8 columns
 2169|  50.0k|                for (i = 0; i < width; i += 8, cur_mbr++, cur_sig++, nxt_sig++) {
  ------------------
  |  Branch (2169:29): [True: 35.6k, False: 14.3k]
  ------------------
 2170|  35.6k|                    OPJ_UINT32 t = nxt_sig[0];
 2171|  35.6k|                    t |= prev >> 28;        //for first column, left neighbors
 2172|  35.6k|                    t |= nxt_sig[0] << 4;   //left neighbors
 2173|  35.6k|                    t |= nxt_sig[0] >> 4;   //right neighbors
 2174|  35.6k|                    t |= nxt_sig[1] << 28;  //for last column, right neighbors
 2175|  35.6k|                    prev = nxt_sig[0];      // for next group of columns
 2176|       |
 2177|  35.6k|                    if (!stripe_causal) {
  ------------------
  |  Branch (2177:25): [True: 8.81k, False: 26.8k]
  ------------------
 2178|  8.81k|                        cur_mbr[0] |= (t & 0x11111111u) << 3; //propagate up to cur_mbr
 2179|  8.81k|                    }
 2180|  35.6k|                    cur_mbr[0] &= ~cur_sig[0]; //remove already significance samples
 2181|  35.6k|                }
 2182|       |
 2183|       |                //find new locations and get signs
 2184|  14.3k|                cur_sig = y & 0x4 ? sigma2 : sigma1;
  ------------------
  |  Branch (2184:27): [True: 6.67k, False: 7.65k]
  ------------------
 2185|  14.3k|                cur_mbr = y & 0x4 ? mbr2 : mbr1;
  ------------------
  |  Branch (2185:27): [True: 6.67k, False: 7.65k]
  ------------------
 2186|  14.3k|                nxt_sig = y & 0x4 ? sigma1 : sigma2; //future samples
  ------------------
  |  Branch (2186:27): [True: 6.67k, False: 7.65k]
  ------------------
 2187|  14.3k|                nxt_mbr = y & 0x4 ? mbr1 : mbr2;     //future samples
  ------------------
  |  Branch (2187:27): [True: 6.67k, False: 7.65k]
  ------------------
 2188|  14.3k|                val = 3u << (p - 2); // sample values for newly discovered
 2189|       |                // significant samples including the bin center
 2190|  50.0k|                for (i = 0; i < width;
  ------------------
  |  Branch (2190:29): [True: 35.6k, False: 14.3k]
  ------------------
 2191|  35.6k|                        i += 8, cur_sig++, cur_mbr++, nxt_sig++, nxt_mbr++) {
 2192|  35.6k|                    OPJ_UINT32 ux, tx;
 2193|  35.6k|                    OPJ_UINT32 mbr = *cur_mbr;
 2194|  35.6k|                    OPJ_UINT32 new_sig = 0;
 2195|  35.6k|                    if (mbr) { //are there any samples that might be significant
  ------------------
  |  Branch (2195:25): [True: 17.3k, False: 18.3k]
  ------------------
 2196|  17.3k|                        OPJ_INT32 n;
 2197|  52.0k|                        for (n = 0; n < 8; n += 4) {
  ------------------
  |  Branch (2197:37): [True: 34.6k, False: 17.3k]
  ------------------
 2198|  34.6k|                            OPJ_UINT32 col_mask;
 2199|  34.6k|                            OPJ_UINT32 inv_sig;
 2200|  34.6k|                            OPJ_INT32 end;
 2201|  34.6k|                            OPJ_INT32 j;
 2202|       |
 2203|  34.6k|                            OPJ_UINT32 cwd = frwd_fetch(&sigprop); //get 32 bits
 2204|  34.6k|                            OPJ_UINT32 cnt = 0;
 2205|       |
 2206|  34.6k|                            OPJ_UINT32 *dp = decoded_data + (y - 8) * stride;
 2207|  34.6k|                            dp += i + n; //address for decoded samples
 2208|       |
 2209|  34.6k|                            col_mask = 0xFu << (4 * n); //a mask to select a column
 2210|       |
 2211|  34.6k|                            inv_sig = ~cur_sig[0]; // insignificant samples
 2212|       |
 2213|       |                            //find the last sample we operate on
 2214|  34.6k|                            end = n + 4 + i < width ? n + 4 : width - i;
  ------------------
  |  Branch (2214:35): [True: 17.9k, False: 16.7k]
  ------------------
 2215|       |
 2216|   133k|                            for (j = n; j < end; ++j, ++dp, col_mask <<= 4) {
  ------------------
  |  Branch (2216:41): [True: 99.1k, False: 34.6k]
  ------------------
 2217|  99.1k|                                OPJ_UINT32 sample_mask;
 2218|       |
 2219|  99.1k|                                if ((col_mask & mbr) == 0) { //no samples need checking
  ------------------
  |  Branch (2219:37): [True: 9.89k, False: 89.2k]
  ------------------
 2220|  9.89k|                                    continue;
 2221|  9.89k|                                }
 2222|       |
 2223|       |                                //scan mbr to find a new significant sample
 2224|  89.2k|                                sample_mask = 0x11111111u & col_mask; // LSB
 2225|  89.2k|                                if (mbr & sample_mask) {
  ------------------
  |  Branch (2225:37): [True: 54.8k, False: 34.4k]
  ------------------
 2226|  54.8k|                                    assert(dp[0] == 0); // the sample must have been 0
 2227|  54.8k|                                    if (cwd & 1) { //if this sample has become significant
  ------------------
  |  Branch (2227:41): [True: 14.2k, False: 40.6k]
  ------------------
 2228|       |                                        // must propagate it to nearby samples
 2229|  14.2k|                                        OPJ_UINT32 t;
 2230|  14.2k|                                        new_sig |= sample_mask;  // new significant samples
 2231|  14.2k|                                        t = 0x32u << (j * 4);// propagation to neighbors
 2232|  14.2k|                                        mbr |= t & inv_sig; //remove already significant samples
 2233|  14.2k|                                    }
 2234|  54.8k|                                    cwd >>= 1;
 2235|  54.8k|                                    ++cnt; //consume bit and increment number of
 2236|       |                                    //consumed bits
 2237|  54.8k|                                }
 2238|       |
 2239|  89.2k|                                sample_mask += sample_mask;  // next row
 2240|  89.2k|                                if (mbr & sample_mask) {
  ------------------
  |  Branch (2240:37): [True: 76.1k, False: 13.1k]
  ------------------
 2241|  76.1k|                                    assert(dp[stride] == 0);
 2242|  76.1k|                                    if (cwd & 1) {
  ------------------
  |  Branch (2242:41): [True: 18.7k, False: 57.3k]
  ------------------
 2243|  18.7k|                                        OPJ_UINT32 t;
 2244|  18.7k|                                        new_sig |= sample_mask;
 2245|  18.7k|                                        t = 0x74u << (j * 4);
 2246|  18.7k|                                        mbr |= t & inv_sig;
 2247|  18.7k|                                    }
 2248|  76.1k|                                    cwd >>= 1;
 2249|  76.1k|                                    ++cnt;
 2250|  76.1k|                                }
 2251|       |
 2252|  89.2k|                                sample_mask += sample_mask;
 2253|  89.2k|                                if (mbr & sample_mask) {
  ------------------
  |  Branch (2253:37): [True: 45.7k, False: 43.5k]
  ------------------
 2254|  45.7k|                                    assert(dp[2 * stride] == 0);
 2255|  45.7k|                                    if (cwd & 1) {
  ------------------
  |  Branch (2255:41): [True: 12.8k, False: 32.9k]
  ------------------
 2256|  12.8k|                                        OPJ_UINT32 t;
 2257|  12.8k|                                        new_sig |= sample_mask;
 2258|  12.8k|                                        t = 0xE8u << (j * 4);
 2259|  12.8k|                                        mbr |= t & inv_sig;
 2260|  12.8k|                                    }
 2261|  45.7k|                                    cwd >>= 1;
 2262|  45.7k|                                    ++cnt;
 2263|  45.7k|                                }
 2264|       |
 2265|  89.2k|                                sample_mask += sample_mask;
 2266|  89.2k|                                if (mbr & sample_mask) {
  ------------------
  |  Branch (2266:37): [True: 59.8k, False: 29.4k]
  ------------------
 2267|  59.8k|                                    assert(dp[3 * stride] == 0);
 2268|  59.8k|                                    if (cwd & 1) {
  ------------------
  |  Branch (2268:41): [True: 16.3k, False: 43.4k]
  ------------------
 2269|  16.3k|                                        OPJ_UINT32 t;
 2270|  16.3k|                                        new_sig |= sample_mask;
 2271|  16.3k|                                        t = 0xC0u << (j * 4);
 2272|  16.3k|                                        mbr |= t & inv_sig;
 2273|  16.3k|                                    }
 2274|  59.8k|                                    cwd >>= 1;
 2275|  59.8k|                                    ++cnt;
 2276|  59.8k|                                }
 2277|  89.2k|                            }
 2278|       |
 2279|       |                            //obtain signs here
 2280|  34.6k|                            if (new_sig & (0xFFFFu << (4 * n))) { //if any
  ------------------
  |  Branch (2280:33): [True: 16.2k, False: 18.4k]
  ------------------
 2281|  16.2k|                                OPJ_UINT32 col_mask;
 2282|  16.2k|                                OPJ_INT32 j;
 2283|  16.2k|                                OPJ_UINT32 *dp = decoded_data + (y - 8) * stride;
 2284|  16.2k|                                dp += i + n; // decoded samples address
 2285|  16.2k|                                col_mask = 0xFu << (4 * n); //mask to select a column
 2286|       |
 2287|  73.1k|                                for (j = n; j < end; ++j, ++dp, col_mask <<= 4) {
  ------------------
  |  Branch (2287:45): [True: 56.8k, False: 16.2k]
  ------------------
 2288|  56.8k|                                    OPJ_UINT32 sample_mask;
 2289|       |
 2290|  56.8k|                                    if ((col_mask & new_sig) == 0) { //if non is significant
  ------------------
  |  Branch (2290:41): [True: 20.0k, False: 36.8k]
  ------------------
 2291|  20.0k|                                        continue;
 2292|  20.0k|                                    }
 2293|       |
 2294|       |                                    //scan 4 signs
 2295|  36.8k|                                    sample_mask = 0x11111111u & col_mask;
 2296|  36.8k|                                    if (new_sig & sample_mask) {
  ------------------
  |  Branch (2296:41): [True: 14.2k, False: 22.6k]
  ------------------
 2297|  14.2k|                                        assert(dp[0] == 0);
 2298|  14.2k|                                        dp[0] |= ((cwd & 1) << 31) | val; //put value and sign
 2299|  14.2k|                                        cwd >>= 1;
 2300|  14.2k|                                        ++cnt; //consume bit and increment number
 2301|       |                                        //of consumed bits
 2302|  14.2k|                                    }
 2303|       |
 2304|  36.8k|                                    sample_mask += sample_mask;
 2305|  36.8k|                                    if (new_sig & sample_mask) {
  ------------------
  |  Branch (2305:41): [True: 18.7k, False: 18.0k]
  ------------------
 2306|  18.7k|                                        assert(dp[stride] == 0);
 2307|  18.7k|                                        dp[stride] |= ((cwd & 1) << 31) | val;
 2308|  18.7k|                                        cwd >>= 1;
 2309|  18.7k|                                        ++cnt;
 2310|  18.7k|                                    }
 2311|       |
 2312|  36.8k|                                    sample_mask += sample_mask;
 2313|  36.8k|                                    if (new_sig & sample_mask) {
  ------------------
  |  Branch (2313:41): [True: 12.8k, False: 24.0k]
  ------------------
 2314|  12.8k|                                        assert(dp[2 * stride] == 0);
 2315|  12.8k|                                        dp[2 * stride] |= ((cwd & 1) << 31) | val;
 2316|  12.8k|                                        cwd >>= 1;
 2317|  12.8k|                                        ++cnt;
 2318|  12.8k|                                    }
 2319|       |
 2320|  36.8k|                                    sample_mask += sample_mask;
 2321|  36.8k|                                    if (new_sig & sample_mask) {
  ------------------
  |  Branch (2321:41): [True: 16.3k, False: 20.5k]
  ------------------
 2322|  16.3k|                                        assert(dp[3 * stride] == 0);
 2323|  16.3k|                                        dp[3 * stride] |= ((cwd & 1) << 31) | val;
 2324|  16.3k|                                        cwd >>= 1;
 2325|  16.3k|                                        ++cnt;
 2326|  16.3k|                                    }
 2327|  36.8k|                                }
 2328|       |
 2329|  16.2k|                            }
 2330|  34.6k|                            frwd_advance(&sigprop, cnt); //consume the bits from bitstrm
 2331|  34.6k|                            cnt = 0;
 2332|       |
 2333|       |                            //update the next 8 columns
 2334|  34.6k|                            if (n == 4) {
  ------------------
  |  Branch (2334:33): [True: 17.3k, False: 17.3k]
  ------------------
 2335|       |                                //horizontally
 2336|  17.3k|                                OPJ_UINT32 t = new_sig >> 28;
 2337|  17.3k|                                t |= ((t & 0xE) >> 1) | ((t & 7) << 1);
 2338|  17.3k|                                cur_mbr[1] |= t & ~cur_sig[1];
 2339|  17.3k|                            }
 2340|  34.6k|                        }
 2341|  17.3k|                    }
 2342|       |                    //update the next stripe (vertically propagation)
 2343|  35.6k|                    new_sig |= cur_sig[0];
 2344|  35.6k|                    ux = (new_sig & 0x88888888) >> 3;
 2345|  35.6k|                    tx = ux | (ux << 4) | (ux >> 4); //left and right neighbors
 2346|  35.6k|                    if (i > 0) {
  ------------------
  |  Branch (2346:25): [True: 21.3k, False: 14.3k]
  ------------------
 2347|  21.3k|                        nxt_mbr[-1] |= (ux << 28) & ~nxt_sig[-1];
 2348|  21.3k|                    }
 2349|  35.6k|                    nxt_mbr[0] |= tx & ~nxt_sig[0];
 2350|  35.6k|                    nxt_mbr[1] |= (ux >> 28) & ~nxt_sig[1];
 2351|  35.6k|                }
 2352|       |
 2353|       |                //clear current sigma
 2354|       |                //mbr need not be cleared because it is overwritten
 2355|  14.3k|                cur_sig = y & 0x4 ? sigma2 : sigma1;
  ------------------
  |  Branch (2355:27): [True: 6.67k, False: 7.65k]
  ------------------
 2356|  14.3k|                memset(cur_sig, 0, ((((OPJ_UINT32)width + 7u) >> 3) + 1u) << 2);
 2357|  14.3k|            }
 2358|  15.8k|        }
 2359|  68.2k|    }
 2360|       |
 2361|       |    //terminating
 2362|  2.85k|    if (num_passes > 1) {
  ------------------
  |  Branch (2362:9): [True: 1.49k, False: 1.36k]
  ------------------
 2363|  1.49k|        OPJ_INT32 st, y;
 2364|       |
 2365|  1.49k|        if (num_passes > 2 && ((height & 3) == 1 || (height & 3) == 2)) {
  ------------------
  |  Branch (2365:13): [True: 1.39k, False: 98]
  |  Branch (2365:32): [True: 144, False: 1.25k]
  |  Branch (2365:53): [True: 327, False: 928]
  ------------------
 2366|       |            //do magref
 2367|    471|            OPJ_UINT32 *cur_sig = height & 0x4 ? sigma2 : sigma1; //reversed
  ------------------
  |  Branch (2367:35): [True: 340, False: 131]
  ------------------
 2368|    471|            OPJ_UINT32 *dpp = decoded_data + (height & 0xFFFFFC) * stride;
 2369|    471|            OPJ_UINT32 half = 1u << (p - 2);
 2370|    471|            OPJ_INT32 i;
 2371|  4.18k|            for (i = 0; i < width; i += 8) {
  ------------------
  |  Branch (2371:25): [True: 3.71k, False: 471]
  ------------------
 2372|  3.71k|                OPJ_UINT32 cwd = rev_fetch_mrp(&magref);
 2373|  3.71k|                OPJ_UINT32 sig = *cur_sig++;
 2374|  3.71k|                OPJ_UINT32 col_mask = 0xF;
 2375|  3.71k|                OPJ_UINT32 *dp = dpp + i;
 2376|  3.71k|                if (sig) {
  ------------------
  |  Branch (2376:21): [True: 1.89k, False: 1.82k]
  ------------------
 2377|  1.89k|                    int j;
 2378|  17.0k|                    for (j = 0; j < 8; ++j, dp++) {
  ------------------
  |  Branch (2378:33): [True: 15.1k, False: 1.89k]
  ------------------
 2379|  15.1k|                        if (sig & col_mask) {
  ------------------
  |  Branch (2379:29): [True: 4.57k, False: 10.5k]
  ------------------
 2380|  4.57k|                            OPJ_UINT32 sample_mask = 0x11111111 & col_mask;
 2381|       |
 2382|  4.57k|                            if (sig & sample_mask) {
  ------------------
  |  Branch (2382:33): [True: 2.80k, False: 1.76k]
  ------------------
 2383|  2.80k|                                OPJ_UINT32 sym;
 2384|  2.80k|                                assert(dp[0] != 0);
 2385|  2.80k|                                sym = cwd & 1;
 2386|  2.80k|                                dp[0] ^= (1 - sym) << (p - 1);
 2387|  2.80k|                                dp[0] |= half;
 2388|  2.80k|                                cwd >>= 1;
 2389|  2.80k|                            }
 2390|  4.57k|                            sample_mask += sample_mask;
 2391|       |
 2392|  4.57k|                            if (sig & sample_mask) {
  ------------------
  |  Branch (2392:33): [True: 1.84k, False: 2.73k]
  ------------------
 2393|  1.84k|                                OPJ_UINT32 sym;
 2394|  1.84k|                                assert(dp[stride] != 0);
 2395|  1.84k|                                sym = cwd & 1;
 2396|  1.84k|                                dp[stride] ^= (1 - sym) << (p - 1);
 2397|  1.84k|                                dp[stride] |= half;
 2398|  1.84k|                                cwd >>= 1;
 2399|  1.84k|                            }
 2400|  4.57k|                            sample_mask += sample_mask;
 2401|       |
 2402|  4.57k|                            if (sig & sample_mask) {
  ------------------
  |  Branch (2402:33): [True: 0, False: 4.57k]
  ------------------
 2403|      0|                                OPJ_UINT32 sym;
 2404|      0|                                assert(dp[2 * stride] != 0);
 2405|      0|                                sym = cwd & 1;
 2406|      0|                                dp[2 * stride] ^= (1 - sym) << (p - 1);
 2407|      0|                                dp[2 * stride] |= half;
 2408|      0|                                cwd >>= 1;
 2409|      0|                            }
 2410|  4.57k|                            sample_mask += sample_mask;
 2411|       |
 2412|  4.57k|                            if (sig & sample_mask) {
  ------------------
  |  Branch (2412:33): [True: 0, False: 4.57k]
  ------------------
 2413|      0|                                OPJ_UINT32 sym;
 2414|      0|                                assert(dp[3 * stride] != 0);
 2415|      0|                                sym = cwd & 1;
 2416|      0|                                dp[3 * stride] ^= (1 - sym) << (p - 1);
 2417|      0|                                dp[3 * stride] |= half;
 2418|      0|                                cwd >>= 1;
 2419|      0|                            }
 2420|  4.57k|                            sample_mask += sample_mask;
 2421|  4.57k|                        }
 2422|  15.1k|                        col_mask <<= 4;
 2423|  15.1k|                    }
 2424|  1.89k|                }
 2425|  3.71k|                rev_advance_mrp(&magref, population_count(sig));
 2426|  3.71k|            }
 2427|    471|        }
 2428|       |
 2429|       |        //do the last incomplete stripe
 2430|       |        // for cases of (height & 3) == 0 and 3
 2431|       |        // the should have been processed previously
 2432|  1.49k|        if ((height & 3) == 1 || (height & 3) == 2) {
  ------------------
  |  Branch (2432:13): [True: 152, False: 1.34k]
  |  Branch (2432:34): [True: 346, False: 999]
  ------------------
 2433|       |            //generate mbr of first stripe
 2434|    498|            OPJ_UINT32 *sig = height & 0x4 ? sigma2 : sigma1;
  ------------------
  |  Branch (2434:31): [True: 355, False: 143]
  ------------------
 2435|    498|            OPJ_UINT32 *mbr = height & 0x4 ? mbr2 : mbr1;
  ------------------
  |  Branch (2435:31): [True: 355, False: 143]
  ------------------
 2436|       |            //integrate horizontally
 2437|    498|            OPJ_UINT32 prev = 0;
 2438|    498|            OPJ_INT32 i;
 2439|  4.40k|            for (i = 0; i < width; i += 8, mbr++, sig++) {
  ------------------
  |  Branch (2439:25): [True: 3.90k, False: 498]
  ------------------
 2440|  3.90k|                OPJ_UINT32 t, z;
 2441|       |
 2442|  3.90k|                mbr[0] = sig[0];
 2443|  3.90k|                mbr[0] |= prev >> 28;    //for first column, left neighbors
 2444|  3.90k|                mbr[0] |= sig[0] << 4;   //left neighbors
 2445|  3.90k|                mbr[0] |= sig[0] >> 4;   //left neighbors
 2446|  3.90k|                mbr[0] |= sig[1] << 28;  //for last column, right neighbors
 2447|  3.90k|                prev = sig[0];
 2448|       |
 2449|       |                //integrate vertically
 2450|  3.90k|                t = mbr[0], z = mbr[0];
 2451|  3.90k|                z |= (t & 0x77777777) << 1; //above neighbors
 2452|  3.90k|                z |= (t & 0xEEEEEEEE) >> 1; //below neighbors
 2453|  3.90k|                mbr[0] = z & ~sig[0]; //remove already significance samples
 2454|  3.90k|            }
 2455|    498|        }
 2456|       |
 2457|  1.49k|        st = height;
 2458|  1.49k|        st -= height > 6 ? (((height + 1) & 3) + 3) : height;
  ------------------
  |  Branch (2458:15): [True: 1.07k, False: 418]
  ------------------
 2459|  3.44k|        for (y = st; y < height; y += 4) {
  ------------------
  |  Branch (2459:22): [True: 1.95k, False: 1.49k]
  ------------------
 2460|  1.95k|            OPJ_UINT32 *cur_sig, *cur_mbr, *nxt_sig, *nxt_mbr;
 2461|  1.95k|            OPJ_UINT32 val;
 2462|  1.95k|            OPJ_INT32 i;
 2463|       |
 2464|  1.95k|            OPJ_UINT32 pattern = 0xFFFFFFFFu; // a pattern needed samples
 2465|  1.95k|            if (height - y == 3) {
  ------------------
  |  Branch (2465:17): [True: 150, False: 1.80k]
  ------------------
 2466|    150|                pattern = 0x77777777u;
 2467|  1.80k|            } else if (height - y == 2) {
  ------------------
  |  Branch (2467:24): [True: 346, False: 1.45k]
  ------------------
 2468|    346|                pattern = 0x33333333u;
 2469|  1.45k|            } else if (height - y == 1) {
  ------------------
  |  Branch (2469:24): [True: 152, False: 1.30k]
  ------------------
 2470|    152|                pattern = 0x11111111u;
 2471|    152|            }
 2472|       |
 2473|       |            //add membership from the next stripe, obtained above
 2474|  1.95k|            if (height - y > 4) {
  ------------------
  |  Branch (2474:17): [True: 454, False: 1.49k]
  ------------------
 2475|    454|                OPJ_UINT32 prev = 0;
 2476|    454|                OPJ_INT32 i;
 2477|    454|                cur_sig = y & 0x4 ? sigma2 : sigma1;
  ------------------
  |  Branch (2477:27): [True: 99, False: 355]
  ------------------
 2478|    454|                cur_mbr = y & 0x4 ? mbr2 : mbr1;
  ------------------
  |  Branch (2478:27): [True: 99, False: 355]
  ------------------
 2479|    454|                nxt_sig = y & 0x4 ? sigma1 : sigma2;
  ------------------
  |  Branch (2479:27): [True: 99, False: 355]
  ------------------
 2480|  2.97k|                for (i = 0; i < width; i += 8, cur_mbr++, cur_sig++, nxt_sig++) {
  ------------------
  |  Branch (2480:29): [True: 2.52k, False: 454]
  ------------------
 2481|  2.52k|                    OPJ_UINT32 t = nxt_sig[0];
 2482|  2.52k|                    t |= prev >> 28;     //for first column, left neighbors
 2483|  2.52k|                    t |= nxt_sig[0] << 4;   //left neighbors
 2484|  2.52k|                    t |= nxt_sig[0] >> 4;   //left neighbors
 2485|  2.52k|                    t |= nxt_sig[1] << 28;  //for last column, right neighbors
 2486|  2.52k|                    prev = nxt_sig[0];
 2487|       |
 2488|  2.52k|                    if (!stripe_causal) {
  ------------------
  |  Branch (2488:25): [True: 756, False: 1.76k]
  ------------------
 2489|    756|                        cur_mbr[0] |= (t & 0x11111111u) << 3;
 2490|    756|                    }
 2491|       |                    //remove already significance samples
 2492|  2.52k|                    cur_mbr[0] &= ~cur_sig[0];
 2493|  2.52k|                }
 2494|    454|            }
 2495|       |
 2496|       |            //find new locations and get signs
 2497|  1.95k|            cur_sig = y & 0x4 ? sigma2 : sigma1;
  ------------------
  |  Branch (2497:23): [True: 1.31k, False: 632]
  ------------------
 2498|  1.95k|            cur_mbr = y & 0x4 ? mbr2 : mbr1;
  ------------------
  |  Branch (2498:23): [True: 1.31k, False: 632]
  ------------------
 2499|  1.95k|            nxt_sig = y & 0x4 ? sigma1 : sigma2;
  ------------------
  |  Branch (2499:23): [True: 1.31k, False: 632]
  ------------------
 2500|  1.95k|            nxt_mbr = y & 0x4 ? mbr1 : mbr2;
  ------------------
  |  Branch (2500:23): [True: 1.31k, False: 632]
  ------------------
 2501|  1.95k|            val = 3u << (p - 2);
 2502|  17.2k|            for (i = 0; i < width; i += 8,
  ------------------
  |  Branch (2502:25): [True: 15.2k, False: 1.95k]
  ------------------
 2503|  15.2k|                    cur_sig++, cur_mbr++, nxt_sig++, nxt_mbr++) {
 2504|  15.2k|                OPJ_UINT32 mbr = *cur_mbr & pattern; //skip unneeded samples
 2505|  15.2k|                OPJ_UINT32 new_sig = 0;
 2506|  15.2k|                OPJ_UINT32 ux, tx;
 2507|  15.2k|                if (mbr) {
  ------------------
  |  Branch (2507:21): [True: 9.23k, False: 6.06k]
  ------------------
 2508|  9.23k|                    OPJ_INT32 n;
 2509|  27.6k|                    for (n = 0; n < 8; n += 4) {
  ------------------
  |  Branch (2509:33): [True: 18.4k, False: 9.23k]
  ------------------
 2510|  18.4k|                        OPJ_UINT32 col_mask;
 2511|  18.4k|                        OPJ_UINT32 inv_sig;
 2512|  18.4k|                        OPJ_INT32 end;
 2513|  18.4k|                        OPJ_INT32 j;
 2514|       |
 2515|  18.4k|                        OPJ_UINT32 cwd = frwd_fetch(&sigprop);
 2516|  18.4k|                        OPJ_UINT32 cnt = 0;
 2517|       |
 2518|  18.4k|                        OPJ_UINT32 *dp = decoded_data + y * stride;
 2519|  18.4k|                        dp += i + n;
 2520|       |
 2521|  18.4k|                        col_mask = 0xFu << (4 * n);
 2522|       |
 2523|  18.4k|                        inv_sig = ~cur_sig[0] & pattern;
 2524|       |
 2525|  18.4k|                        end = n + 4 + i < width ? n + 4 : width - i;
  ------------------
  |  Branch (2525:31): [True: 16.7k, False: 1.73k]
  ------------------
 2526|  89.2k|                        for (j = n; j < end; ++j, ++dp, col_mask <<= 4) {
  ------------------
  |  Branch (2526:37): [True: 70.8k, False: 18.4k]
  ------------------
 2527|  70.8k|                            OPJ_UINT32 sample_mask;
 2528|       |
 2529|  70.8k|                            if ((col_mask & mbr) == 0) {
  ------------------
  |  Branch (2529:33): [True: 10.3k, False: 60.4k]
  ------------------
 2530|  10.3k|                                continue;
 2531|  10.3k|                            }
 2532|       |
 2533|       |                            //scan 4 mbr
 2534|  60.4k|                            sample_mask = 0x11111111u & col_mask;
 2535|  60.4k|                            if (mbr & sample_mask) {
  ------------------
  |  Branch (2535:33): [True: 32.5k, False: 27.8k]
  ------------------
 2536|  32.5k|                                assert(dp[0] == 0);
 2537|  32.5k|                                if (cwd & 1) {
  ------------------
  |  Branch (2537:37): [True: 10.6k, False: 21.9k]
  ------------------
 2538|  10.6k|                                    OPJ_UINT32 t;
 2539|  10.6k|                                    new_sig |= sample_mask;
 2540|  10.6k|                                    t = 0x32u << (j * 4);
 2541|  10.6k|                                    mbr |= t & inv_sig;
 2542|  10.6k|                                }
 2543|  32.5k|                                cwd >>= 1;
 2544|  32.5k|                                ++cnt;
 2545|  32.5k|                            }
 2546|       |
 2547|  60.4k|                            sample_mask += sample_mask;
 2548|  60.4k|                            if (mbr & sample_mask) {
  ------------------
  |  Branch (2548:33): [True: 32.7k, False: 27.7k]
  ------------------
 2549|  32.7k|                                assert(dp[stride] == 0);
 2550|  32.7k|                                if (cwd & 1) {
  ------------------
  |  Branch (2550:37): [True: 10.8k, False: 21.8k]
  ------------------
 2551|  10.8k|                                    OPJ_UINT32 t;
 2552|  10.8k|                                    new_sig |= sample_mask;
 2553|  10.8k|                                    t = 0x74u << (j * 4);
 2554|  10.8k|                                    mbr |= t & inv_sig;
 2555|  10.8k|                                }
 2556|  32.7k|                                cwd >>= 1;
 2557|  32.7k|                                ++cnt;
 2558|  32.7k|                            }
 2559|       |
 2560|  60.4k|                            sample_mask += sample_mask;
 2561|  60.4k|                            if (mbr & sample_mask) {
  ------------------
  |  Branch (2561:33): [True: 39.8k, False: 20.5k]
  ------------------
 2562|  39.8k|                                assert(dp[2 * stride] == 0);
 2563|  39.8k|                                if (cwd & 1) {
  ------------------
  |  Branch (2563:37): [True: 12.7k, False: 27.0k]
  ------------------
 2564|  12.7k|                                    OPJ_UINT32 t;
 2565|  12.7k|                                    new_sig |= sample_mask;
 2566|  12.7k|                                    t = 0xE8u << (j * 4);
 2567|  12.7k|                                    mbr |= t & inv_sig;
 2568|  12.7k|                                }
 2569|  39.8k|                                cwd >>= 1;
 2570|  39.8k|                                ++cnt;
 2571|  39.8k|                            }
 2572|       |
 2573|  60.4k|                            sample_mask += sample_mask;
 2574|  60.4k|                            if (mbr & sample_mask) {
  ------------------
  |  Branch (2574:33): [True: 24.4k, False: 36.0k]
  ------------------
 2575|  24.4k|                                assert(dp[3 * stride] == 0);
 2576|  24.4k|                                if (cwd & 1) {
  ------------------
  |  Branch (2576:37): [True: 12.0k, False: 12.3k]
  ------------------
 2577|  12.0k|                                    OPJ_UINT32 t;
 2578|  12.0k|                                    new_sig |= sample_mask;
 2579|  12.0k|                                    t = 0xC0u << (j * 4);
 2580|  12.0k|                                    mbr |= t & inv_sig;
 2581|  12.0k|                                }
 2582|  24.4k|                                cwd >>= 1;
 2583|  24.4k|                                ++cnt;
 2584|  24.4k|                            }
 2585|  60.4k|                        }
 2586|       |
 2587|       |                        //signs here
 2588|  18.4k|                        if (new_sig & (0xFFFFu << (4 * n))) {
  ------------------
  |  Branch (2588:29): [True: 10.7k, False: 7.69k]
  ------------------
 2589|  10.7k|                            OPJ_UINT32 col_mask;
 2590|  10.7k|                            OPJ_INT32 j;
 2591|  10.7k|                            OPJ_UINT32 *dp = decoded_data + y * stride;
 2592|  10.7k|                            dp += i + n;
 2593|  10.7k|                            col_mask = 0xFu << (4 * n);
 2594|       |
 2595|  53.3k|                            for (j = n; j < end; ++j, ++dp, col_mask <<= 4) {
  ------------------
  |  Branch (2595:41): [True: 42.5k, False: 10.7k]
  ------------------
 2596|  42.5k|                                OPJ_UINT32 sample_mask;
 2597|  42.5k|                                if ((col_mask & new_sig) == 0) {
  ------------------
  |  Branch (2597:37): [True: 16.4k, False: 26.0k]
  ------------------
 2598|  16.4k|                                    continue;
 2599|  16.4k|                                }
 2600|       |
 2601|       |                                //scan 4 signs
 2602|  26.0k|                                sample_mask = 0x11111111u & col_mask;
 2603|  26.0k|                                if (new_sig & sample_mask) {
  ------------------
  |  Branch (2603:37): [True: 10.6k, False: 15.4k]
  ------------------
 2604|  10.6k|                                    assert(dp[0] == 0);
 2605|  10.6k|                                    dp[0] |= ((cwd & 1) << 31) | val;
 2606|  10.6k|                                    cwd >>= 1;
 2607|  10.6k|                                    ++cnt;
 2608|  10.6k|                                }
 2609|       |
 2610|  26.0k|                                sample_mask += sample_mask;
 2611|  26.0k|                                if (new_sig & sample_mask) {
  ------------------
  |  Branch (2611:37): [True: 10.8k, False: 15.2k]
  ------------------
 2612|  10.8k|                                    assert(dp[stride] == 0);
 2613|  10.8k|                                    dp[stride] |= ((cwd & 1) << 31) | val;
 2614|  10.8k|                                    cwd >>= 1;
 2615|  10.8k|                                    ++cnt;
 2616|  10.8k|                                }
 2617|       |
 2618|  26.0k|                                sample_mask += sample_mask;
 2619|  26.0k|                                if (new_sig & sample_mask) {
  ------------------
  |  Branch (2619:37): [True: 12.7k, False: 13.3k]
  ------------------
 2620|  12.7k|                                    assert(dp[2 * stride] == 0);
 2621|  12.7k|                                    dp[2 * stride] |= ((cwd & 1) << 31) | val;
 2622|  12.7k|                                    cwd >>= 1;
 2623|  12.7k|                                    ++cnt;
 2624|  12.7k|                                }
 2625|       |
 2626|  26.0k|                                sample_mask += sample_mask;
 2627|  26.0k|                                if (new_sig & sample_mask) {
  ------------------
  |  Branch (2627:37): [True: 12.0k, False: 14.0k]
  ------------------
 2628|  12.0k|                                    assert(dp[3 * stride] == 0);
 2629|  12.0k|                                    dp[3 * stride] |= ((cwd & 1) << 31) | val;
 2630|  12.0k|                                    cwd >>= 1;
 2631|  12.0k|                                    ++cnt;
 2632|  12.0k|                                }
 2633|  26.0k|                            }
 2634|       |
 2635|  10.7k|                        }
 2636|  18.4k|                        frwd_advance(&sigprop, cnt);
 2637|  18.4k|                        cnt = 0;
 2638|       |
 2639|       |                        //update next columns
 2640|  18.4k|                        if (n == 4) {
  ------------------
  |  Branch (2640:29): [True: 9.23k, False: 9.23k]
  ------------------
 2641|       |                            //horizontally
 2642|  9.23k|                            OPJ_UINT32 t = new_sig >> 28;
 2643|  9.23k|                            t |= ((t & 0xE) >> 1) | ((t & 7) << 1);
 2644|  9.23k|                            cur_mbr[1] |= t & ~cur_sig[1];
 2645|  9.23k|                        }
 2646|  18.4k|                    }
 2647|  9.23k|                }
 2648|       |                //propagate down (vertically propagation)
 2649|  15.2k|                new_sig |= cur_sig[0];
 2650|  15.2k|                ux = (new_sig & 0x88888888) >> 3;
 2651|  15.2k|                tx = ux | (ux << 4) | (ux >> 4);
 2652|  15.2k|                if (i > 0) {
  ------------------
  |  Branch (2652:21): [True: 13.3k, False: 1.95k]
  ------------------
 2653|  13.3k|                    nxt_mbr[-1] |= (ux << 28) & ~nxt_sig[-1];
 2654|  13.3k|                }
 2655|  15.2k|                nxt_mbr[0] |= tx & ~nxt_sig[0];
 2656|  15.2k|                nxt_mbr[1] |= (ux >> 28) & ~nxt_sig[1];
 2657|  15.2k|            }
 2658|  1.95k|        }
 2659|  1.49k|    }
 2660|       |
 2661|  2.85k|    {
 2662|  2.85k|        OPJ_INT32 x, y;
 2663|   143k|        for (y = 0; y < height; ++y) {
  ------------------
  |  Branch (2663:21): [True: 140k, False: 2.85k]
  ------------------
 2664|   140k|            OPJ_INT32* sp = (OPJ_INT32*)decoded_data + y * stride;
 2665|  2.14M|            for (x = 0; x < width; ++x, ++sp) {
  ------------------
  |  Branch (2665:25): [True: 2.00M, False: 140k]
  ------------------
 2666|  2.00M|                OPJ_INT32 val = (*sp & 0x7FFFFFFF);
 2667|  2.00M|                *sp = ((OPJ_UINT32) * sp & 0x80000000) ? -val : val;
  ------------------
  |  Branch (2667:23): [True: 190k, False: 1.81M]
  ------------------
 2668|  2.00M|            }
 2669|   140k|        }
 2670|  2.85k|    }
 2671|       |
 2672|  2.85k|    return OPJ_TRUE;
  ------------------
  |  |  117|  2.85k|#define OPJ_TRUE 1
  ------------------
 2673|  2.93k|}
ht_dec.c:opj_t1_allocate_buffers:
 1030|  95.8k|{
 1031|  95.8k|    OPJ_UINT32 flagssize;
 1032|       |
 1033|       |    /* No risk of overflow. Prior checks ensure those assert are met */
 1034|       |    /* They are per the specification */
 1035|  95.8k|    assert(w <= 1024);
 1036|  95.8k|    assert(h <= 1024);
 1037|  95.8k|    assert(w * h <= 4096);
 1038|       |
 1039|       |    /* encoder uses tile buffer, so no need to allocate */
 1040|  95.8k|    {
 1041|  95.8k|        OPJ_UINT32 datasize = w * h;
 1042|       |
 1043|  95.8k|        if (datasize > t1->datasize) {
  ------------------
  |  Branch (1043:13): [True: 1.20k, False: 94.6k]
  ------------------
 1044|  1.20k|            opj_aligned_free(t1->data);
 1045|  1.20k|            t1->data = (OPJ_INT32*)
 1046|  1.20k|                       opj_aligned_malloc(datasize * sizeof(OPJ_INT32));
 1047|  1.20k|            if (!t1->data) {
  ------------------
  |  Branch (1047:17): [True: 0, False: 1.20k]
  ------------------
 1048|       |                /* FIXME event manager error callback */
 1049|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1050|      0|            }
 1051|  1.20k|            t1->datasize = datasize;
 1052|  1.20k|        }
 1053|       |        /* memset first arg is declared to never be null by gcc */
 1054|  95.8k|        if (t1->data != NULL) {
  ------------------
  |  Branch (1054:13): [True: 95.6k, False: 209]
  ------------------
 1055|  95.6k|            memset(t1->data, 0, datasize * sizeof(OPJ_INT32));
 1056|  95.6k|        }
 1057|  95.8k|    }
 1058|       |
 1059|       |    // We expand these buffers to multiples of 16 bytes.
 1060|       |    // We need 4 buffers of 129 integers each, expanded to 132 integers each
 1061|       |    // We also need 514 bytes of buffer, expanded to 528 bytes
 1062|      0|    flagssize = 132U * sizeof(OPJ_UINT32) * 4U; // expanded to multiple of 16
 1063|  95.8k|    flagssize += 528U; // 514 expanded to multiples of 16
 1064|       |
 1065|  95.8k|    {
 1066|  95.8k|        if (flagssize > t1->flagssize) {
  ------------------
  |  Branch (1066:13): [True: 749, False: 95.0k]
  ------------------
 1067|       |
 1068|    749|            opj_aligned_free(t1->flags);
 1069|    749|            t1->flags = (opj_flag_t*) opj_aligned_malloc(flagssize * sizeof(opj_flag_t));
 1070|    749|            if (!t1->flags) {
  ------------------
  |  Branch (1070:17): [True: 0, False: 749]
  ------------------
 1071|       |                /* FIXME event manager error callback */
 1072|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1073|      0|            }
 1074|    749|        }
 1075|  95.8k|        t1->flagssize = flagssize;
 1076|       |
 1077|  95.8k|        memset(t1->flags, 0, flagssize * sizeof(opj_flag_t));
 1078|  95.8k|    }
 1079|       |
 1080|      0|    t1->w = w;
 1081|  95.8k|    t1->h = h;
 1082|       |
 1083|  95.8k|    return OPJ_TRUE;
  ------------------
  |  |  117|  95.8k|#define OPJ_TRUE 1
  ------------------
 1084|  95.8k|}
ht_dec.c:mel_init:
  298|  2.98k|{
  299|  2.98k|    int num;
  300|  2.98k|    int i;
  301|       |
  302|  2.98k|    melp->data = bbuf + lcup - scup; // move the pointer to the start of MEL
  303|  2.98k|    melp->bits = 0;                  // 0 bits in tmp
  304|  2.98k|    melp->tmp = 0;                   //
  305|  2.98k|    melp->unstuff = OPJ_FALSE;       // no unstuffing
  ------------------
  |  |  118|  2.98k|#define OPJ_FALSE 0
  ------------------
  306|  2.98k|    melp->size = scup - 1;           // size is the length of MEL+VLC-1
  307|  2.98k|    melp->k = 0;                     // 0 for state
  308|  2.98k|    melp->num_runs = 0;              // num_runs is 0
  309|  2.98k|    melp->runs = 0;                  //
  310|       |
  311|       |    //This code is borrowed; original is for a different architecture
  312|       |    //These few lines take care of the case where data is not at a multiple
  313|       |    // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MEL segment
  314|  2.98k|    num = 4 - (int)((intptr_t)(melp->data) & 0x3);
  315|  8.95k|    for (i = 0; i < num; ++i) { // this code is similar to mel_read
  ------------------
  |  Branch (315:17): [True: 5.97k, False: 2.98k]
  ------------------
  316|  5.97k|        OPJ_UINT64 d;
  317|  5.97k|        int d_bits;
  318|       |
  319|  5.97k|        if (melp->unstuff == OPJ_TRUE && melp->data[0] > 0x8F) {
  ------------------
  |  |  117|  11.9k|#define OPJ_TRUE 1
  ------------------
  |  Branch (319:13): [True: 273, False: 5.69k]
  |  Branch (319:42): [True: 3, False: 270]
  ------------------
  320|      3|            return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
  321|      3|        }
  322|  5.96k|        d = (melp->size > 0) ? *melp->data : 0xFF; // if buffer is consumed
  ------------------
  |  Branch (322:13): [True: 5.64k, False: 329]
  ------------------
  323|       |        // set data to 0xFF
  324|  5.96k|        if (melp->size == 1) {
  ------------------
  |  Branch (324:13): [True: 231, False: 5.73k]
  ------------------
  325|    231|            d |= 0xF;    //if this is MEL+VLC-1, set LSBs to 0xF
  326|    231|        }
  327|       |        // see the standard
  328|  5.96k|        melp->data += melp->size-- > 0; //increment if the end is not reached
  329|  5.96k|        d_bits = 8 - melp->unstuff; //if unstuffing is needed, reduce by 1
  330|  5.96k|        melp->tmp = (melp->tmp << d_bits) | d; //store bits in tmp
  331|  5.96k|        melp->bits += d_bits;  //increment tmp by number of bits
  332|  5.96k|        melp->unstuff = ((d & 0xFF) == 0xFF); //true of next byte needs
  333|       |        //unstuffing
  334|  5.96k|    }
  335|  2.98k|    melp->tmp <<= (64 - melp->bits); //push all the way up so the first bit
  336|       |    // is the MSB
  337|  2.98k|    return OPJ_TRUE;
  ------------------
  |  |  117|  2.98k|#define OPJ_TRUE 1
  ------------------
  338|  2.98k|}
ht_dec.c:rev_init:
  464|  2.98k|{
  465|  2.98k|    OPJ_UINT32 d;
  466|  2.98k|    int num, tnum, i;
  467|       |
  468|       |    //first byte has only the upper 4 bits
  469|  2.98k|    vlcp->data = data + lcup - 2;
  470|       |
  471|       |    //size can not be larger than this, in fact it should be smaller
  472|  2.98k|    vlcp->size = scup - 2;
  473|       |
  474|  2.98k|    d = *vlcp->data--;            // read one byte (this is a half byte)
  475|  2.98k|    vlcp->tmp = d >> 4;           // both initialize and set
  476|  2.98k|    vlcp->bits = 4 - ((vlcp->tmp & 7) == 7); //check standard
  477|  2.98k|    vlcp->unstuff = (d | 0xF) > 0x8F; //this is useful for the next byte
  478|       |
  479|       |    //This code is designed for an architecture that read address should
  480|       |    // align to the read size (address multiple of 4 if read size is 4)
  481|       |    //These few lines take care of the case where data is not at a multiple
  482|       |    // of 4 boundary. It reads 1,2,3 up to 4 bytes from the VLC bitstream.
  483|       |    // To read 32 bits, read from (vlcp->data - 3)
  484|  2.98k|    num = 1 + (int)((intptr_t)(vlcp->data) & 0x3);
  485|  2.98k|    tnum = num < vlcp->size ? num : vlcp->size;
  ------------------
  |  Branch (485:12): [True: 2.63k, False: 347]
  ------------------
  486|  7.67k|    for (i = 0; i < tnum; ++i) {
  ------------------
  |  Branch (486:17): [True: 4.68k, False: 2.98k]
  ------------------
  487|  4.68k|        OPJ_UINT64 d;
  488|  4.68k|        OPJ_UINT32 d_bits;
  489|  4.68k|        d = *vlcp->data--;  // read one byte and move read pointer
  490|       |        //check if the last byte was >0x8F (unstuff == true) and this is 0x7F
  491|  4.68k|        d_bits = 8u - ((vlcp->unstuff && ((d & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (491:25): [True: 1.01k, False: 3.67k]
  |  Branch (491:42): [True: 60, False: 950]
  ------------------
  492|  4.68k|        vlcp->tmp |= d << vlcp->bits; // move data to vlcp->tmp
  493|  4.68k|        vlcp->bits += d_bits;
  494|  4.68k|        vlcp->unstuff = d > 0x8F; // for next byte
  495|  4.68k|    }
  496|  2.98k|    vlcp->size -= tnum;
  497|  2.98k|    rev_read(vlcp);  // read another 32 buts
  498|  2.98k|}
ht_dec.c:rev_read:
  396|  23.0k|{
  397|  23.0k|    OPJ_UINT32 val;
  398|  23.0k|    OPJ_UINT32 tmp;
  399|  23.0k|    OPJ_UINT32 bits;
  400|  23.0k|    OPJ_BOOL unstuff;
  401|       |
  402|       |    //process 4 bytes at a time
  403|  23.0k|    if (vlcp->bits > 32) { // if there are more than 32 bits in tmp, then
  ------------------
  |  Branch (403:9): [True: 284, False: 22.7k]
  ------------------
  404|    284|        return;    // reading 32 bits can overflow vlcp->tmp
  405|    284|    }
  406|  22.7k|    val = 0;
  407|       |    //the next line (the if statement) needs to be tested first
  408|  22.7k|    if (vlcp->size > 3) { // if there are more than 3 bytes left in VLC
  ------------------
  |  Branch (408:9): [True: 9.33k, False: 13.4k]
  ------------------
  409|       |        // (vlcp->data - 3) move pointer back to read 32 bits at once
  410|  9.33k|        val = read_le_uint32(vlcp->data - 3); // then read 32 bits
  411|  9.33k|        vlcp->data -= 4;                // move data pointer back by 4
  412|  9.33k|        vlcp->size -= 4;                // reduce available byte by 4
  413|  13.4k|    } else if (vlcp->size > 0) { // 4 or less
  ------------------
  |  Branch (413:16): [True: 1.41k, False: 11.9k]
  ------------------
  414|  1.41k|        int i = 24;
  415|  3.85k|        while (vlcp->size > 0) {
  ------------------
  |  Branch (415:16): [True: 2.44k, False: 1.41k]
  ------------------
  416|  2.44k|            OPJ_UINT32 v = *vlcp->data--; // read one byte at a time
  417|  2.44k|            val |= (v << i);              // put byte in its correct location
  418|  2.44k|            --vlcp->size;
  419|  2.44k|            i -= 8;
  420|  2.44k|        }
  421|  1.41k|    }
  422|       |
  423|       |    //accumulate in tmp, number of bits in tmp are stored in bits
  424|  22.7k|    tmp = val >> 24;  //start with the MSB byte
  425|       |
  426|       |    // test unstuff (previous byte is >0x8F), and this byte is 0x7F
  427|  22.7k|    bits = 8u - ((vlcp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (427:19): [True: 2.20k, False: 20.5k]
  |  Branch (427:36): [True: 136, False: 2.06k]
  ------------------
  428|  22.7k|    unstuff = (val >> 24) > 0x8F; //this is for the next byte
  429|       |
  430|  22.7k|    tmp |= ((val >> 16) & 0xFF) << bits; //process the next byte
  431|  22.7k|    bits += 8u - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (431:20): [True: 2.91k, False: 19.8k]
  |  Branch (431:31): [True: 134, False: 2.77k]
  ------------------
  432|  22.7k|    unstuff = ((val >> 16) & 0xFF) > 0x8F;
  433|       |
  434|  22.7k|    tmp |= ((val >> 8) & 0xFF) << bits;
  435|  22.7k|    bits += 8u - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (435:20): [True: 2.77k, False: 19.9k]
  |  Branch (435:31): [True: 134, False: 2.64k]
  ------------------
  436|  22.7k|    unstuff = ((val >> 8) & 0xFF) > 0x8F;
  437|       |
  438|  22.7k|    tmp |= (val & 0xFF) << bits;
  439|  22.7k|    bits += 8u - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (439:20): [True: 1.79k, False: 20.9k]
  |  Branch (439:31): [True: 113, False: 1.67k]
  ------------------
  440|  22.7k|    unstuff = (val & 0xFF) > 0x8F;
  441|       |
  442|       |    // now move the read and unstuffed bits into vlcp->tmp
  443|  22.7k|    vlcp->tmp |= (OPJ_UINT64)tmp << vlcp->bits;
  444|  22.7k|    vlcp->bits += bits;
  445|  22.7k|    vlcp->unstuff = unstuff; // this for the next read
  446|  22.7k|}
ht_dec.c:read_le_uint32:
  119|  35.7k|{
  120|       |#if defined(OPJ_BIG_ENDIAN)
  121|       |    const OPJ_UINT8* data = (const OPJ_UINT8*)dataIn;
  122|       |    return ((OPJ_UINT32)data[0]) | (OPJ_UINT32)(data[1] << 8) | (OPJ_UINT32)(
  123|       |               data[2] << 16) | (((
  124|       |                                      OPJ_UINT32)data[3]) <<
  125|       |                                 24U);
  126|       |#else
  127|  35.7k|    return *(OPJ_UINT32*)dataIn;
  128|  35.7k|#endif
  129|  35.7k|}
ht_dec.c:frwd_init:
  961|  4.58k|{
  962|  4.58k|    int num, i;
  963|       |
  964|  4.58k|    msp->data = data;
  965|  4.58k|    msp->tmp = 0;
  966|  4.58k|    msp->bits = 0;
  967|  4.58k|    msp->unstuff = OPJ_FALSE;
  ------------------
  |  |  118|  4.58k|#define OPJ_FALSE 0
  ------------------
  968|  4.58k|    msp->size = size;
  969|  4.58k|    msp->X = X;
  970|  4.58k|    assert(msp->X == 0 || msp->X == 0xFF);
  971|       |
  972|       |    //This code is designed for an architecture that read address should
  973|       |    // align to the read size (address multiple of 4 if read size is 4)
  974|       |    //These few lines take care of the case where data is not at a multiple
  975|       |    // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the bitstream
  976|  4.58k|    num = 4 - (int)((intptr_t)(msp->data) & 0x3);
  977|  16.4k|    for (i = 0; i < num; ++i) {
  ------------------
  |  Branch (977:17): [True: 11.9k, False: 4.58k]
  ------------------
  978|  11.9k|        OPJ_UINT64 d;
  979|       |        //read a byte if the buffer is not exhausted, otherwise set it to X
  980|  11.9k|        d = msp->size-- > 0 ? *msp->data++ : msp->X;
  ------------------
  |  Branch (980:13): [True: 10.1k, False: 1.76k]
  ------------------
  981|  11.9k|        msp->tmp |= (d << msp->bits);      // store data in msp->tmp
  982|  11.9k|        msp->bits += 8u - (msp->unstuff ? 1u : 0u); // number of bits added to msp->tmp
  ------------------
  |  Branch (982:28): [True: 1.21k, False: 10.6k]
  ------------------
  983|  11.9k|        msp->unstuff = ((d & 0xFF) == 0xFF); // unstuffing for next byte
  984|  11.9k|    }
  985|  4.58k|    frwd_read(msp); // read 32 bits more
  986|  4.58k|}
ht_dec.c:frwd_read:
  901|  35.6k|{
  902|  35.6k|    OPJ_UINT32 val;
  903|  35.6k|    OPJ_UINT32 bits;
  904|  35.6k|    OPJ_UINT32 t;
  905|  35.6k|    OPJ_BOOL unstuff;
  906|       |
  907|  35.6k|    assert(msp->bits <= 32); // assert that there is a space for 32 bits
  908|       |
  909|  35.6k|    val = 0u;
  910|  35.6k|    if (msp->size > 3) {
  ------------------
  |  Branch (910:9): [True: 18.8k, False: 16.7k]
  ------------------
  911|  18.8k|        val = read_le_uint32(msp->data);  // read 32 bits
  912|  18.8k|        msp->data += 4;           // increment pointer
  913|  18.8k|        msp->size -= 4;           // reduce size
  914|  18.8k|    } else if (msp->size > 0) {
  ------------------
  |  Branch (914:16): [True: 1.01k, False: 15.7k]
  ------------------
  915|  1.01k|        int i = 0;
  916|  1.01k|        val = msp->X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (916:15): [True: 903, False: 109]
  ------------------
  917|  3.53k|        while (msp->size > 0) {
  ------------------
  |  Branch (917:16): [True: 2.52k, False: 1.01k]
  ------------------
  918|  2.52k|            OPJ_UINT32 v = *msp->data++;  // read one byte at a time
  919|  2.52k|            OPJ_UINT32 m = ~(0xFFu << i); // mask of location
  920|  2.52k|            val = (val & m) | (v << i);   // put one byte in its correct location
  921|  2.52k|            --msp->size;
  922|  2.52k|            i += 8;
  923|  2.52k|        }
  924|  15.7k|    } else {
  925|  15.7k|        val = msp->X != 0 ? 0xFFFFFFFFu : 0;
  ------------------
  |  Branch (925:15): [True: 13.0k, False: 2.69k]
  ------------------
  926|  15.7k|    }
  927|       |
  928|       |    // we accumulate in t and keep a count of the number of bits in bits
  929|  35.6k|    bits = 8u - (msp->unstuff ? 1u : 0u);
  ------------------
  |  Branch (929:18): [True: 15.1k, False: 20.4k]
  ------------------
  930|  35.6k|    t = val & 0xFF;
  931|  35.6k|    unstuff = ((val & 0xFF) == 0xFF);  // Do we need unstuffing next?
  932|       |
  933|  35.6k|    t |= ((val >> 8) & 0xFF) << bits;
  934|  35.6k|    bits += 8u - (unstuff ? 1u : 0u);
  ------------------
  |  Branch (934:19): [True: 15.4k, False: 20.1k]
  ------------------
  935|  35.6k|    unstuff = (((val >> 8) & 0xFF) == 0xFF);
  936|       |
  937|  35.6k|    t |= ((val >> 16) & 0xFF) << bits;
  938|  35.6k|    bits += 8u - (unstuff ? 1u : 0u);
  ------------------
  |  Branch (938:19): [True: 15.5k, False: 20.0k]
  ------------------
  939|  35.6k|    unstuff = (((val >> 16) & 0xFF) == 0xFF);
  940|       |
  941|  35.6k|    t |= ((val >> 24) & 0xFF) << bits;
  942|  35.6k|    bits += 8u - (unstuff ? 1u : 0u);
  ------------------
  |  Branch (942:19): [True: 16.2k, False: 19.3k]
  ------------------
  943|  35.6k|    msp->unstuff = (((val >> 24) & 0xFF) == 0xFF); // for next byte
  944|       |
  945|  35.6k|    msp->tmp |= ((OPJ_UINT64)t) << msp->bits;  // move data to msp->tmp
  946|  35.6k|    msp->bits += bits;
  947|  35.6k|}
ht_dec.c:rev_init_mrp:
  616|  1.47k|{
  617|  1.47k|    int num, i;
  618|       |
  619|  1.47k|    mrp->data = data + lcup + len2 - 1;
  620|  1.47k|    mrp->size = len2;
  621|  1.47k|    mrp->unstuff = OPJ_TRUE;
  ------------------
  |  |  117|  1.47k|#define OPJ_TRUE 1
  ------------------
  622|  1.47k|    mrp->bits = 0;
  623|  1.47k|    mrp->tmp = 0;
  624|       |
  625|       |    //This code is designed for an architecture that read address should
  626|       |    // align to the read size (address multiple of 4 if read size is 4)
  627|       |    //These few lines take care of the case where data is not at a multiple
  628|       |    // of 4 boundary.  It reads 1,2,3 up to 4 bytes from the MRP stream
  629|  1.47k|    num = 1 + (int)((intptr_t)(mrp->data) & 0x3);
  630|  7.14k|    for (i = 0; i < num; ++i) {
  ------------------
  |  Branch (630:17): [True: 5.66k, False: 1.47k]
  ------------------
  631|  5.66k|        OPJ_UINT64 d;
  632|  5.66k|        OPJ_UINT32 d_bits;
  633|       |
  634|       |        //read a byte, 0 if no more data
  635|  5.66k|        d = (mrp->size-- > 0) ? *mrp->data-- : 0;
  ------------------
  |  Branch (635:13): [True: 5.63k, False: 35]
  ------------------
  636|       |        //check if unstuffing is needed
  637|  5.66k|        d_bits = 8u - ((mrp->unstuff && ((d & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (637:25): [True: 3.44k, False: 2.22k]
  |  Branch (637:41): [True: 1.17k, False: 2.27k]
  ------------------
  638|  5.66k|        mrp->tmp |= d << mrp->bits; // move data to vlcp->tmp
  639|  5.66k|        mrp->bits += d_bits;
  640|  5.66k|        mrp->unstuff = d > 0x8F; // for next byte
  641|  5.66k|    }
  642|  1.47k|    rev_read_mrp(mrp);
  643|  1.47k|}
ht_dec.c:rev_read_mrp:
  547|  4.78k|{
  548|  4.78k|    OPJ_UINT32 val;
  549|  4.78k|    OPJ_UINT32 tmp;
  550|  4.78k|    OPJ_UINT32 bits;
  551|  4.78k|    OPJ_BOOL unstuff;
  552|       |
  553|       |    //process 4 bytes at a time
  554|  4.78k|    if (mrp->bits > 32) {
  ------------------
  |  Branch (554:9): [True: 0, False: 4.78k]
  ------------------
  555|      0|        return;
  556|      0|    }
  557|  4.78k|    val = 0;
  558|  4.78k|    if (mrp->size > 3) { // If there are 3 byte or more
  ------------------
  |  Branch (558:9): [True: 4.17k, False: 610]
  ------------------
  559|       |        // (mrp->data - 3) move pointer back to read 32 bits at once
  560|  4.17k|        val = read_le_uint32(mrp->data - 3); // read 32 bits
  561|  4.17k|        mrp->data -= 4;                      // move back pointer
  562|  4.17k|        mrp->size -= 4;                      // reduce count
  563|  4.17k|    } else if (mrp->size > 0) {
  ------------------
  |  Branch (563:16): [True: 46, False: 564]
  ------------------
  564|     46|        int i = 24;
  565|    114|        while (mrp->size > 0) {
  ------------------
  |  Branch (565:16): [True: 68, False: 46]
  ------------------
  566|     68|            OPJ_UINT32 v = *mrp->data--; // read one byte at a time
  567|     68|            val |= (v << i);             // put byte in its correct location
  568|     68|            --mrp->size;
  569|     68|            i -= 8;
  570|     68|        }
  571|     46|    }
  572|       |
  573|       |
  574|       |    //accumulate in tmp, and keep count in bits
  575|  4.78k|    tmp = val >> 24;
  576|       |
  577|       |    //test if the last byte > 0x8F (unstuff must be true) and this is 0x7F
  578|  4.78k|    bits = 8u - ((mrp->unstuff && (((val >> 24) & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (578:19): [True: 1.11k, False: 3.66k]
  |  Branch (578:35): [True: 405, False: 711]
  ------------------
  579|  4.78k|    unstuff = (val >> 24) > 0x8F;
  580|       |
  581|       |    //process the next byte
  582|  4.78k|    tmp |= ((val >> 16) & 0xFF) << bits;
  583|  4.78k|    bits += 8u - ((unstuff && (((val >> 16) & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (583:20): [True: 1.21k, False: 3.56k]
  |  Branch (583:31): [True: 498, False: 720]
  ------------------
  584|  4.78k|    unstuff = ((val >> 16) & 0xFF) > 0x8F;
  585|       |
  586|  4.78k|    tmp |= ((val >> 8) & 0xFF) << bits;
  587|  4.78k|    bits += 8u - ((unstuff && (((val >> 8) & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (587:20): [True: 1.15k, False: 3.62k]
  |  Branch (587:31): [True: 363, False: 794]
  ------------------
  588|  4.78k|    unstuff = ((val >> 8) & 0xFF) > 0x8F;
  589|       |
  590|  4.78k|    tmp |= (val & 0xFF) << bits;
  591|  4.78k|    bits += 8u - ((unstuff && ((val & 0x7F) == 0x7F)) ? 1u : 0u);
  ------------------
  |  Branch (591:20): [True: 1.05k, False: 3.73k]
  |  Branch (591:31): [True: 377, False: 675]
  ------------------
  592|  4.78k|    unstuff = (val & 0xFF) > 0x8F;
  593|       |
  594|  4.78k|    mrp->tmp |= (OPJ_UINT64)tmp << mrp->bits; // move data to mrp pointer
  595|  4.78k|    mrp->bits += bits;
  596|  4.78k|    mrp->unstuff = unstuff;                   // next byte
  597|  4.78k|}
ht_dec.c:mel_get_run:
  348|   156k|{
  349|   156k|    int t;
  350|   156k|    if (melp->num_runs == 0) { //if no runs, decode more bit from MEL segment
  ------------------
  |  Branch (350:9): [True: 23.4k, False: 133k]
  ------------------
  351|  23.4k|        mel_decode(melp);
  352|  23.4k|    }
  353|       |
  354|   156k|    t = melp->runs & 0x7F; //retrieve one run
  355|   156k|    melp->runs >>= 7;  // remove the retrieved run
  356|   156k|    melp->num_runs--;
  357|   156k|    return t; // return run
  358|   156k|}
ht_dec.c:mel_decode:
  248|  23.4k|{
  249|  23.4k|    static const int mel_exp[13] = { //MEL exponents
  250|  23.4k|        0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5
  251|  23.4k|    };
  252|       |
  253|  23.4k|    if (melp->bits < 6) { // if there are less than 6 bits in tmp
  ------------------
  |  Branch (253:9): [True: 5.77k, False: 17.6k]
  ------------------
  254|  5.77k|        mel_read(melp);    // then read from the MEL bitstream
  255|  5.77k|    }
  256|       |    // 6 bits is the largest decodable MEL cwd
  257|       |
  258|       |    //repeat so long that there is enough decodable bits in tmp,
  259|       |    // and the runs store is not full (num_runs < 8)
  260|   190k|    while (melp->bits >= 6 && melp->num_runs < 8) {
  ------------------
  |  Branch (260:12): [True: 184k, False: 6.65k]
  |  Branch (260:31): [True: 167k, False: 16.8k]
  ------------------
  261|   167k|        int eval = mel_exp[melp->k]; // number of bits associated with state
  262|   167k|        int run = 0;
  263|   167k|        if (melp->tmp & (1ull << 63)) { //The next bit to decode (stored in MSB)
  ------------------
  |  Branch (263:13): [True: 67.4k, False: 99.8k]
  ------------------
  264|       |            //one is found
  265|  67.4k|            run = 1 << eval;
  266|  67.4k|            run--; // consecutive runs of 0 events - 1
  267|  67.4k|            melp->k = melp->k + 1 < 12 ? melp->k + 1 : 12;//increment, max is 12
  ------------------
  |  Branch (267:23): [True: 54.0k, False: 13.3k]
  ------------------
  268|  67.4k|            melp->tmp <<= 1; // consume one bit from tmp
  269|  67.4k|            melp->bits -= 1;
  270|  67.4k|            run = run << 1; // a stretch of zeros not terminating in one
  271|  99.8k|        } else {
  272|       |            //0 is found
  273|  99.8k|            run = (int)(melp->tmp >> (63 - eval)) & ((1 << eval) - 1);
  274|  99.8k|            melp->k = melp->k - 1 > 0 ? melp->k - 1 : 0; //decrement, min is 0
  ------------------
  |  Branch (274:23): [True: 19.6k, False: 80.1k]
  ------------------
  275|  99.8k|            melp->tmp <<= eval + 1; //consume eval + 1 bits (max is 6)
  276|  99.8k|            melp->bits -= eval + 1;
  277|  99.8k|            run = (run << 1) + 1; // a stretch of zeros terminating with one
  278|  99.8k|        }
  279|   167k|        eval = melp->num_runs * 7;                 // 7 bits per run
  280|   167k|        melp->runs &= ~((OPJ_UINT64)0x3F << eval); // 6 bits are sufficient
  281|   167k|        melp->runs |= ((OPJ_UINT64)run) << eval;   // store the value in runs
  282|   167k|        melp->num_runs++;                          // increment count
  283|   167k|    }
  284|  23.4k|}
ht_dec.c:mel_read:
  166|  5.77k|{
  167|  5.77k|    OPJ_UINT32 val;
  168|  5.77k|    int bits;
  169|  5.77k|    OPJ_UINT32 t;
  170|  5.77k|    OPJ_BOOL unstuff;
  171|       |
  172|  5.77k|    if (melp->bits > 32) { //there are enough bits in the tmp variable
  ------------------
  |  Branch (172:9): [True: 0, False: 5.77k]
  ------------------
  173|      0|        return;    // return without reading new data
  174|      0|    }
  175|       |
  176|  5.77k|    val = 0xFFFFFFFF;      // feed in 0xFF if buffer is exhausted
  177|  5.77k|    if (melp->size > 4) {  // if there is more than 4 bytes the MEL segment
  ------------------
  |  Branch (177:9): [True: 3.34k, False: 2.43k]
  ------------------
  178|  3.34k|        val = read_le_uint32(melp->data);  // read 32 bits from MEL data
  179|  3.34k|        melp->data += 4;           // advance pointer
  180|  3.34k|        melp->size -= 4;           // reduce counter
  181|  3.34k|    } else if (melp->size > 0) { // 4 or less
  ------------------
  |  Branch (181:16): [True: 1.53k, False: 894]
  ------------------
  182|  1.53k|        OPJ_UINT32 m, v;
  183|  1.53k|        int i = 0;
  184|  3.59k|        while (melp->size > 1) {
  ------------------
  |  Branch (184:16): [True: 2.06k, False: 1.53k]
  ------------------
  185|  2.06k|            OPJ_UINT32 v = *melp->data++; // read one byte at a time
  186|  2.06k|            OPJ_UINT32 m = ~(0xFFu << i); // mask of location
  187|  2.06k|            val = (val & m) | (v << i);   // put byte in its correct location
  188|  2.06k|            --melp->size;
  189|  2.06k|            i += 8;
  190|  2.06k|        }
  191|       |        // size equal to 1
  192|  1.53k|        v = *melp->data++;  // the one before the last is different
  193|  1.53k|        v |= 0xF;                         // MEL and VLC segments can overlap
  194|  1.53k|        m = ~(0xFFu << i);
  195|  1.53k|        val = (val & m) | (v << i);
  196|  1.53k|        --melp->size;
  197|  1.53k|    }
  198|       |
  199|       |    // next we unstuff them before adding them to the buffer
  200|  5.77k|    bits = 32 - melp->unstuff;      // number of bits in val, subtract 1 if
  201|       |    // the previously read byte requires
  202|       |    // unstuffing
  203|       |
  204|       |    // data is unstuffed and accumulated in t
  205|       |    // bits has the number of bits in t
  206|  5.77k|    t = val & 0xFF;
  207|  5.77k|    unstuff = ((val & 0xFF) == 0xFF); // true if the byte needs unstuffing
  208|  5.77k|    bits -= unstuff; // there is one less bit in t if unstuffing is needed
  209|  5.77k|    t = t << (8 - unstuff); // move up to make room for the next byte
  210|       |
  211|       |    //this is a repeat of the above
  212|  5.77k|    t |= (val >> 8) & 0xFF;
  213|  5.77k|    unstuff = (((val >> 8) & 0xFF) == 0xFF);
  214|  5.77k|    bits -= unstuff;
  215|  5.77k|    t = t << (8 - unstuff);
  216|       |
  217|  5.77k|    t |= (val >> 16) & 0xFF;
  218|  5.77k|    unstuff = (((val >> 16) & 0xFF) == 0xFF);
  219|  5.77k|    bits -= unstuff;
  220|  5.77k|    t = t << (8 - unstuff);
  221|       |
  222|  5.77k|    t |= (val >> 24) & 0xFF;
  223|  5.77k|    melp->unstuff = (((val >> 24) & 0xFF) == 0xFF);
  224|       |
  225|       |    // move t to tmp, and push the result all the way up, so we read from
  226|       |    // the MSB
  227|  5.77k|    melp->tmp |= ((OPJ_UINT64)t) << (64 - bits - melp->bits);
  228|  5.77k|    melp->bits += bits; //increment the number of bits in tmp
  229|  5.77k|}
ht_dec.c:rev_fetch:
  509|   268k|{
  510|   268k|    if (vlcp->bits < 32) { // if there are less then 32 bits, read more
  ------------------
  |  Branch (510:9): [True: 20.0k, False: 248k]
  ------------------
  511|  20.0k|        rev_read(vlcp);     // read 32 bits, but unstuffing might reduce this
  512|  20.0k|        if (vlcp->bits < 32) { // if there is still space in vlcp->tmp for 32 bits
  ------------------
  |  Branch (512:13): [True: 5, False: 20.0k]
  ------------------
  513|      5|            rev_read(vlcp);    // read another 32
  514|      5|        }
  515|  20.0k|    }
  516|   268k|    return (OPJ_UINT32)vlcp->tmp; // return the head (bottom-most) of vlcp->tmp
  517|   268k|}
ht_dec.c:rev_advance:
  527|   789k|{
  528|   789k|    assert(num_bits <= vlcp->bits); // vlcp->tmp must have more than num_bits
  529|   789k|    vlcp->tmp >>= num_bits;         // remove bits
  530|   789k|    vlcp->bits -= num_bits;         // decrement the number of bits
  531|   789k|    return (OPJ_UINT32)vlcp->tmp;
  532|   789k|}
ht_dec.c:decode_init_uvlc:
  692|  34.0k|{
  693|       |    //table stores possible decoding three bits from vlc
  694|       |    // there are 8 entries for xx1, x10, 100, 000, where x means do not care
  695|       |    // table value is made up of
  696|       |    // 2 bits in the LSB for prefix length
  697|       |    // 3 bits for suffix length
  698|       |    // 3 bits in the MSB for prefix value (u_pfx in Table 3 of ITU T.814)
  699|  34.0k|    static const OPJ_UINT8 dec[8] = { // the index is the prefix codeword
  700|  34.0k|        3 | (5 << 2) | (5 << 5),        //000 == 000, prefix codeword "000"
  701|  34.0k|        1 | (0 << 2) | (1 << 5),        //001 == xx1, prefix codeword "1"
  702|  34.0k|        2 | (0 << 2) | (2 << 5),        //010 == x10, prefix codeword "01"
  703|  34.0k|        1 | (0 << 2) | (1 << 5),        //011 == xx1, prefix codeword "1"
  704|  34.0k|        3 | (1 << 2) | (3 << 5),        //100 == 100, prefix codeword "001"
  705|  34.0k|        1 | (0 << 2) | (1 << 5),        //101 == xx1, prefix codeword "1"
  706|  34.0k|        2 | (0 << 2) | (2 << 5),        //110 == x10, prefix codeword "01"
  707|  34.0k|        1 | (0 << 2) | (1 << 5)         //111 == xx1, prefix codeword "1"
  708|  34.0k|    };
  709|       |
  710|  34.0k|    OPJ_UINT32 consumed_bits = 0;
  711|  34.0k|    if (mode == 0) { // both u_off are 0
  ------------------
  |  Branch (711:9): [True: 23.1k, False: 10.9k]
  ------------------
  712|  23.1k|        u[0] = u[1] = 1; //Kappa is 1 for initial line
  713|  23.1k|    } else if (mode <= 2) { // u_off are either 01 or 10
  ------------------
  |  Branch (713:16): [True: 2.12k, False: 8.82k]
  ------------------
  714|  2.12k|        OPJ_UINT32 d;
  715|  2.12k|        OPJ_UINT32 suffix_len;
  716|       |
  717|  2.12k|        d = dec[vlc & 0x7];   //look at the least significant 3 bits
  718|  2.12k|        vlc >>= d & 0x3;                 //prefix length
  719|  2.12k|        consumed_bits += d & 0x3;
  720|       |
  721|  2.12k|        suffix_len = ((d >> 2) & 0x7);
  722|  2.12k|        consumed_bits += suffix_len;
  723|       |
  724|  2.12k|        d = (d >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  725|  2.12k|        u[0] = (mode == 1) ? d + 1 : 1; // kappa is 1 for initial line
  ------------------
  |  Branch (725:16): [True: 1.18k, False: 942]
  ------------------
  726|  2.12k|        u[1] = (mode == 1) ? 1 : d + 1; // kappa is 1 for initial line
  ------------------
  |  Branch (726:16): [True: 1.18k, False: 942]
  ------------------
  727|  8.82k|    } else if (mode == 3) { // both u_off are 1, and MEL event is 0
  ------------------
  |  Branch (727:16): [True: 4.78k, False: 4.03k]
  ------------------
  728|  4.78k|        OPJ_UINT32 d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  729|  4.78k|        vlc >>= d1 & 0x3;                // Consume bits
  730|  4.78k|        consumed_bits += d1 & 0x3;
  731|       |
  732|  4.78k|        if ((d1 & 0x3) > 2) {
  ------------------
  |  Branch (732:13): [True: 3.05k, False: 1.73k]
  ------------------
  733|  3.05k|            OPJ_UINT32 suffix_len;
  734|       |
  735|       |            //u_{q_2} prefix
  736|  3.05k|            u[1] = (vlc & 1) + 1 + 1; //Kappa is 1 for initial line
  737|  3.05k|            ++consumed_bits;
  738|  3.05k|            vlc >>= 1;
  739|       |
  740|  3.05k|            suffix_len = ((d1 >> 2) & 0x7);
  741|  3.05k|            consumed_bits += suffix_len;
  742|  3.05k|            d1 = (d1 >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  743|  3.05k|            u[0] = d1 + 1; //Kappa is 1 for initial line
  744|  3.05k|        } else {
  745|  1.73k|            OPJ_UINT32 d2;
  746|  1.73k|            OPJ_UINT32 suffix_len;
  747|       |
  748|  1.73k|            d2 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  749|  1.73k|            vlc >>= d2 & 0x3;                // Consume bits
  750|  1.73k|            consumed_bits += d2 & 0x3;
  751|       |
  752|  1.73k|            suffix_len = ((d1 >> 2) & 0x7);
  753|  1.73k|            consumed_bits += suffix_len;
  754|       |
  755|  1.73k|            d1 = (d1 >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  756|  1.73k|            u[0] = d1 + 1; //Kappa is 1 for initial line
  757|  1.73k|            vlc >>= suffix_len;
  758|       |
  759|  1.73k|            suffix_len = ((d2 >> 2) & 0x7);
  760|  1.73k|            consumed_bits += suffix_len;
  761|       |
  762|  1.73k|            d2 = (d2 >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  763|  1.73k|            u[1] = d2 + 1; //Kappa is 1 for initial line
  764|  1.73k|        }
  765|  4.78k|    } else if (mode == 4) { // both u_off are 1, and MEL event is 1
  ------------------
  |  Branch (765:16): [True: 4.03k, False: 0]
  ------------------
  766|  4.03k|        OPJ_UINT32 d1;
  767|  4.03k|        OPJ_UINT32 d2;
  768|  4.03k|        OPJ_UINT32 suffix_len;
  769|       |
  770|  4.03k|        d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  771|  4.03k|        vlc >>= d1 & 0x3;                // Consume bits
  772|  4.03k|        consumed_bits += d1 & 0x3;
  773|       |
  774|  4.03k|        d2 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  775|  4.03k|        vlc >>= d2 & 0x3;                // Consume bits
  776|  4.03k|        consumed_bits += d2 & 0x3;
  777|       |
  778|  4.03k|        suffix_len = ((d1 >> 2) & 0x7);
  779|  4.03k|        consumed_bits += suffix_len;
  780|       |
  781|  4.03k|        d1 = (d1 >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  782|  4.03k|        u[0] = d1 + 3; // add 2+kappa
  783|  4.03k|        vlc >>= suffix_len;
  784|       |
  785|  4.03k|        suffix_len = ((d2 >> 2) & 0x7);
  786|  4.03k|        consumed_bits += suffix_len;
  787|       |
  788|  4.03k|        d2 = (d2 >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  789|  4.03k|        u[1] = d2 + 3; // add 2+kappa
  790|  4.03k|    }
  791|  34.0k|    return consumed_bits;
  792|  34.0k|}
ht_dec.c:frwd_fetch:
 1009|   257k|{
 1010|   257k|    if (msp->bits < 32) {
  ------------------
  |  Branch (1010:9): [True: 30.9k, False: 226k]
  ------------------
 1011|  30.9k|        frwd_read(msp);
 1012|  30.9k|        if (msp->bits < 32) { //need to test
  ------------------
  |  Branch (1012:13): [True: 100, False: 30.8k]
  ------------------
 1013|    100|            frwd_read(msp);
 1014|    100|        }
 1015|  30.9k|    }
 1016|   257k|    return (OPJ_UINT32)msp->tmp;
 1017|   257k|}
ht_dec.c:frwd_advance:
  996|   257k|{
  997|   257k|    assert(num_bits <= msp->bits);
  998|   257k|    msp->tmp >>= num_bits;  // consume num_bits
  999|   257k|    msp->bits -= num_bits;
 1000|   257k|}
ht_dec.c:count_leading_zeros:
   96|  69.9k|{
   97|       |#ifdef OPJ_COMPILER_MSVC
   98|       |    unsigned long result = 0;
   99|       |    _BitScanReverse(&result, val);
  100|       |    return 31U ^ (OPJ_UINT32)result;
  101|       |#elif (defined OPJ_COMPILER_GNUC)
  102|  69.9k|    return (OPJ_UINT32)__builtin_clz(val);
  103|       |#else
  104|       |    val |= (val >> 1);
  105|       |    val |= (val >> 2);
  106|       |    val |= (val >> 4);
  107|       |    val |= (val >> 8);
  108|       |    val |= (val >> 16);
  109|       |    return 32U - population_count(val);
  110|       |#endif
  111|  69.9k|}
ht_dec.c:decode_noninit_uvlc:
  805|   234k|{
  806|       |    //table stores possible decoding three bits from vlc
  807|       |    // there are 8 entries for xx1, x10, 100, 000, where x means do not care
  808|       |    // table value is made up of
  809|       |    // 2 bits in the LSB for prefix length
  810|       |    // 3 bits for suffix length
  811|       |    // 3 bits in the MSB for prefix value (u_pfx in Table 3 of ITU T.814)
  812|   234k|    static const OPJ_UINT8 dec[8] = {
  813|   234k|        3 | (5 << 2) | (5 << 5), //000 == 000, prefix codeword "000"
  814|   234k|        1 | (0 << 2) | (1 << 5), //001 == xx1, prefix codeword "1"
  815|   234k|        2 | (0 << 2) | (2 << 5), //010 == x10, prefix codeword "01"
  816|   234k|        1 | (0 << 2) | (1 << 5), //011 == xx1, prefix codeword "1"
  817|   234k|        3 | (1 << 2) | (3 << 5), //100 == 100, prefix codeword "001"
  818|   234k|        1 | (0 << 2) | (1 << 5), //101 == xx1, prefix codeword "1"
  819|   234k|        2 | (0 << 2) | (2 << 5), //110 == x10, prefix codeword "01"
  820|   234k|        1 | (0 << 2) | (1 << 5)  //111 == xx1, prefix codeword "1"
  821|   234k|    };
  822|       |
  823|   234k|    OPJ_UINT32 consumed_bits = 0;
  824|   234k|    if (mode == 0) {
  ------------------
  |  Branch (824:9): [True: 230k, False: 4.09k]
  ------------------
  825|   230k|        u[0] = u[1] = 1; //for kappa
  826|   230k|    } else if (mode <= 2) { //u_off are either 01 or 10
  ------------------
  |  Branch (826:16): [True: 3.17k, False: 924]
  ------------------
  827|  3.17k|        OPJ_UINT32 d;
  828|  3.17k|        OPJ_UINT32 suffix_len;
  829|       |
  830|  3.17k|        d = dec[vlc & 0x7];  //look at the least significant 3 bits
  831|  3.17k|        vlc >>= d & 0x3;                //prefix length
  832|  3.17k|        consumed_bits += d & 0x3;
  833|       |
  834|  3.17k|        suffix_len = ((d >> 2) & 0x7);
  835|  3.17k|        consumed_bits += suffix_len;
  836|       |
  837|  3.17k|        d = (d >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  838|  3.17k|        u[0] = (mode == 1) ? d + 1 : 1; //for kappa
  ------------------
  |  Branch (838:16): [True: 1.80k, False: 1.36k]
  ------------------
  839|  3.17k|        u[1] = (mode == 1) ? 1 : d + 1; //for kappa
  ------------------
  |  Branch (839:16): [True: 1.80k, False: 1.36k]
  ------------------
  840|  3.17k|    } else if (mode == 3) { // both u_off are 1
  ------------------
  |  Branch (840:16): [True: 924, False: 0]
  ------------------
  841|    924|        OPJ_UINT32 d1;
  842|    924|        OPJ_UINT32 d2;
  843|    924|        OPJ_UINT32 suffix_len;
  844|       |
  845|    924|        d1 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  846|    924|        vlc >>= d1 & 0x3;                // Consume bits
  847|    924|        consumed_bits += d1 & 0x3;
  848|       |
  849|    924|        d2 = dec[vlc & 0x7];  // LSBs of VLC are prefix codeword
  850|    924|        vlc >>= d2 & 0x3;                // Consume bits
  851|    924|        consumed_bits += d2 & 0x3;
  852|       |
  853|    924|        suffix_len = ((d1 >> 2) & 0x7);
  854|    924|        consumed_bits += suffix_len;
  855|       |
  856|    924|        d1 = (d1 >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  857|    924|        u[0] = d1 + 1;  //1 for kappa
  858|    924|        vlc >>= suffix_len;
  859|       |
  860|    924|        suffix_len = ((d2 >> 2) & 0x7);
  861|    924|        consumed_bits += suffix_len;
  862|       |
  863|    924|        d2 = (d2 >> 5) + (vlc & ((1U << suffix_len) - 1)); // u value
  864|    924|        u[1] = d2 + 1;  //1 for kappa
  865|    924|    }
  866|   234k|    return consumed_bits;
  867|   234k|}
ht_dec.c:rev_fetch_mrp:
  654|  45.9k|{
  655|  45.9k|    if (mrp->bits < 32) { // if there are less than 32 bits in mrp->tmp
  ------------------
  |  Branch (655:9): [True: 3.26k, False: 42.6k]
  ------------------
  656|  3.26k|        rev_read_mrp(mrp);    // read 30-32 bits from mrp
  657|  3.26k|        if (mrp->bits < 32) { // if there is a space of 32 bits
  ------------------
  |  Branch (657:13): [True: 40, False: 3.22k]
  ------------------
  658|     40|            rev_read_mrp(mrp);    // read more
  659|     40|        }
  660|  3.26k|    }
  661|  45.9k|    return (OPJ_UINT32)mrp->tmp;  // return the head of mrp->tmp
  662|  45.9k|}
ht_dec.c:rev_advance_mrp:
  672|  45.9k|{
  673|  45.9k|    assert(num_bits <= mrp->bits); // we must not consume more than mrp->bits
  674|  45.9k|    mrp->tmp >>= num_bits;         // discard the lowest num_bits bits
  675|  45.9k|    mrp->bits -= num_bits;
  676|  45.9k|    return (OPJ_UINT32)mrp->tmp;   // return data after consumption
  677|  45.9k|}
ht_dec.c:population_count:
   71|  45.9k|{
   72|       |#if defined(OPJ_COMPILER_MSVC) && (defined(_M_IX86) || defined(_M_AMD64))
   73|       |    return (OPJ_UINT32)__popcnt(val);
   74|       |#elif (defined OPJ_COMPILER_GNUC)
   75|  45.9k|    return (OPJ_UINT32)__builtin_popcount(val);
   76|       |#else
   77|       |    val -= ((val >> 1) & 0x55555555);
   78|       |    val = (((val >> 2) & 0x33333333) + (val & 0x33333333));
   79|       |    val = (((val >> 4) + val) & 0x0f0f0f0f);
   80|       |    val += (val >> 8);
   81|       |    val += (val >> 16);
   82|       |    return (OPJ_UINT32)(val & 0x0000003f);
   83|       |#endif
   84|  45.9k|}

opj_image_create0:
   35|  24.8k|{
   36|  24.8k|    opj_image_t *image = (opj_image_t*)opj_calloc(1, sizeof(opj_image_t));
   37|  24.8k|    return image;
   38|  24.8k|}
opj_image_destroy:
   92|  31.2k|{
   93|  31.2k|    if (image) {
  ------------------
  |  Branch (93:9): [True: 24.8k, False: 6.33k]
  ------------------
   94|  24.8k|        if (image->comps) {
  ------------------
  |  Branch (94:13): [True: 24.5k, False: 312]
  ------------------
   95|  24.5k|            OPJ_UINT32 compno;
   96|       |
   97|       |            /* image components */
   98|   106k|            for (compno = 0; compno < image->numcomps; compno++) {
  ------------------
  |  Branch (98:30): [True: 81.6k, False: 24.5k]
  ------------------
   99|  81.6k|                opj_image_comp_t *image_comp = &(image->comps[compno]);
  100|  81.6k|                if (image_comp->data) {
  ------------------
  |  Branch (100:21): [True: 13.8k, False: 67.8k]
  ------------------
  101|  13.8k|                    opj_image_data_free(image_comp->data);
  102|  13.8k|                }
  103|  81.6k|            }
  104|  24.5k|            opj_free(image->comps);
  105|  24.5k|        }
  106|       |
  107|  24.8k|        if (image->icc_profile_buf) {
  ------------------
  |  Branch (107:13): [True: 0, False: 24.8k]
  ------------------
  108|      0|            opj_free(image->icc_profile_buf);
  109|      0|        }
  110|       |
  111|  24.8k|        opj_free(image);
  112|  24.8k|    }
  113|  31.2k|}
opj_image_comp_header_update:
  123|  8.81k|{
  124|  8.81k|    OPJ_UINT32 i, l_width, l_height;
  125|  8.81k|    OPJ_UINT32 l_x0, l_y0, l_x1, l_y1;
  126|  8.81k|    OPJ_UINT32 l_comp_x0, l_comp_y0, l_comp_x1, l_comp_y1;
  127|  8.81k|    opj_image_comp_t* l_img_comp = NULL;
  128|       |
  129|  8.81k|    l_x0 = opj_uint_max(p_cp->tx0, p_image_header->x0);
  130|  8.81k|    l_y0 = opj_uint_max(p_cp->ty0, p_image_header->y0);
  131|  8.81k|    l_x1 = p_cp->tx0 + (p_cp->tw - 1U) *
  132|  8.81k|           p_cp->tdx; /* validity of p_cp members used here checked in opj_j2k_read_siz. Can't overflow. */
  133|  8.81k|    l_y1 = p_cp->ty0 + (p_cp->th - 1U) * p_cp->tdy; /* can't overflow */
  134|  8.81k|    l_x1 = opj_uint_min(opj_uint_adds(l_x1, p_cp->tdx),
  135|  8.81k|                        p_image_header->x1); /* use add saturated to prevent overflow */
  136|  8.81k|    l_y1 = opj_uint_min(opj_uint_adds(l_y1, p_cp->tdy),
  137|  8.81k|                        p_image_header->y1); /* use add saturated to prevent overflow */
  138|       |
  139|  8.81k|    l_img_comp = p_image_header->comps;
  140|  44.9k|    for (i = 0; i < p_image_header->numcomps; ++i) {
  ------------------
  |  Branch (140:17): [True: 36.1k, False: 8.81k]
  ------------------
  141|  36.1k|        l_comp_x0 = opj_uint_ceildiv(l_x0, l_img_comp->dx);
  142|  36.1k|        l_comp_y0 = opj_uint_ceildiv(l_y0, l_img_comp->dy);
  143|  36.1k|        l_comp_x1 = opj_uint_ceildiv(l_x1, l_img_comp->dx);
  144|  36.1k|        l_comp_y1 = opj_uint_ceildiv(l_y1, l_img_comp->dy);
  145|  36.1k|        l_width   = opj_uint_ceildivpow2(l_comp_x1 - l_comp_x0, l_img_comp->factor);
  146|  36.1k|        l_height  = opj_uint_ceildivpow2(l_comp_y1 - l_comp_y0, l_img_comp->factor);
  147|  36.1k|        l_img_comp->w = l_width;
  148|  36.1k|        l_img_comp->h = l_height;
  149|  36.1k|        l_img_comp->x0 = l_comp_x0;
  150|  36.1k|        l_img_comp->y0 = l_comp_y0;
  151|  36.1k|        ++l_img_comp;
  152|  36.1k|    }
  153|  8.81k|}
opj_copy_image_header:
  166|  15.6k|{
  167|  15.6k|    OPJ_UINT32 compno;
  168|       |
  169|       |    /* preconditions */
  170|  15.6k|    assert(p_image_src != 00);
  171|  15.6k|    assert(p_image_dest != 00);
  172|       |
  173|  15.6k|    p_image_dest->x0 = p_image_src->x0;
  174|  15.6k|    p_image_dest->y0 = p_image_src->y0;
  175|  15.6k|    p_image_dest->x1 = p_image_src->x1;
  176|  15.6k|    p_image_dest->y1 = p_image_src->y1;
  177|       |
  178|  15.6k|    if (p_image_dest->comps) {
  ------------------
  |  Branch (178:9): [True: 0, False: 15.6k]
  ------------------
  179|      0|        for (compno = 0; compno < p_image_dest->numcomps; compno++) {
  ------------------
  |  Branch (179:26): [True: 0, False: 0]
  ------------------
  180|      0|            opj_image_comp_t *image_comp = &(p_image_dest->comps[compno]);
  181|      0|            if (image_comp->data) {
  ------------------
  |  Branch (181:17): [True: 0, False: 0]
  ------------------
  182|      0|                opj_image_data_free(image_comp->data);
  183|      0|            }
  184|      0|        }
  185|      0|        opj_free(p_image_dest->comps);
  186|      0|        p_image_dest->comps = NULL;
  187|      0|    }
  188|       |
  189|  15.6k|    p_image_dest->numcomps = p_image_src->numcomps;
  190|       |
  191|  15.6k|    p_image_dest->comps = (opj_image_comp_t*) opj_malloc(p_image_dest->numcomps *
  192|  15.6k|                          sizeof(opj_image_comp_t));
  193|  15.6k|    if (!p_image_dest->comps) {
  ------------------
  |  Branch (193:9): [True: 0, False: 15.6k]
  ------------------
  194|      0|        p_image_dest->comps = NULL;
  195|      0|        p_image_dest->numcomps = 0;
  196|      0|        return;
  197|      0|    }
  198|       |
  199|  60.9k|    for (compno = 0; compno < p_image_dest->numcomps; compno++) {
  ------------------
  |  Branch (199:22): [True: 45.3k, False: 15.6k]
  ------------------
  200|  45.3k|        memcpy(&(p_image_dest->comps[compno]),
  201|  45.3k|               &(p_image_src->comps[compno]),
  202|  45.3k|               sizeof(opj_image_comp_t));
  203|  45.3k|        p_image_dest->comps[compno].data = NULL;
  204|  45.3k|    }
  205|       |
  206|  15.6k|    p_image_dest->color_space = p_image_src->color_space;
  207|  15.6k|    p_image_dest->icc_profile_len = p_image_src->icc_profile_len;
  208|       |
  209|  15.6k|    if (p_image_dest->icc_profile_len) {
  ------------------
  |  Branch (209:9): [True: 0, False: 15.6k]
  ------------------
  210|      0|        p_image_dest->icc_profile_buf = (OPJ_BYTE*)opj_malloc(
  211|      0|                                            p_image_dest->icc_profile_len);
  212|      0|        if (!p_image_dest->icc_profile_buf) {
  ------------------
  |  Branch (212:13): [True: 0, False: 0]
  ------------------
  213|      0|            p_image_dest->icc_profile_buf = NULL;
  214|      0|            p_image_dest->icc_profile_len = 0;
  215|      0|            return;
  216|      0|        }
  217|      0|        memcpy(p_image_dest->icc_profile_buf,
  218|      0|               p_image_src->icc_profile_buf,
  219|      0|               p_image_src->icc_profile_len);
  220|  15.6k|    } else {
  221|  15.6k|        p_image_dest->icc_profile_buf = NULL;
  222|  15.6k|    }
  223|       |
  224|  15.6k|    return;
  225|  15.6k|}

opj_j2k_setup_decoder:
 6689|  9.21k|{
 6690|  9.21k|    if (j2k && parameters) {
  ------------------
  |  Branch (6690:9): [True: 9.21k, False: 0]
  |  Branch (6690:16): [True: 9.21k, False: 0]
  ------------------
 6691|  9.21k|        j2k->m_cp.m_specific_param.m_dec.m_layer = parameters->cp_layer;
 6692|  9.21k|        j2k->m_cp.m_specific_param.m_dec.m_reduce = parameters->cp_reduce;
 6693|       |
 6694|  9.21k|        j2k->dump_state = (parameters->flags & OPJ_DPARAMETERS_DUMP_FLAG);
  ------------------
  |  |  547|  9.21k|#define OPJ_DPARAMETERS_DUMP_FLAG 0x0002
  ------------------
 6695|       |#ifdef USE_JPWL
 6696|       |        j2k->m_cp.correct = parameters->jpwl_correct;
 6697|       |        j2k->m_cp.exp_comps = parameters->jpwl_exp_comps;
 6698|       |        j2k->m_cp.max_tiles = parameters->jpwl_max_tiles;
 6699|       |#endif /* USE_JPWL */
 6700|  9.21k|    }
 6701|  9.21k|}
opj_j2k_end_decompress:
 8412|  7.85k|{
 8413|  7.85k|    (void)p_j2k;
 8414|  7.85k|    (void)p_stream;
 8415|  7.85k|    (void)p_manager;
 8416|  7.85k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.85k|#define OPJ_TRUE 1
  ------------------
 8417|  7.85k|}
opj_j2k_read_header:
 8423|  9.21k|{
 8424|       |    /* preconditions */
 8425|  9.21k|    assert(p_j2k != 00);
 8426|  9.21k|    assert(p_stream != 00);
 8427|  9.21k|    assert(p_manager != 00);
 8428|       |
 8429|       |    /* create an empty image header */
 8430|  9.21k|    p_j2k->m_private_image = opj_image_create0();
 8431|  9.21k|    if (! p_j2k->m_private_image) {
  ------------------
  |  Branch (8431:9): [True: 0, False: 9.21k]
  ------------------
 8432|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8433|      0|    }
 8434|       |
 8435|       |    /* customization of the validation */
 8436|  9.21k|    if (! opj_j2k_setup_decoding_validation(p_j2k, p_manager)) {
  ------------------
  |  Branch (8436:9): [True: 0, False: 9.21k]
  ------------------
 8437|      0|        opj_image_destroy(p_j2k->m_private_image);
 8438|      0|        p_j2k->m_private_image = NULL;
 8439|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8440|      0|    }
 8441|       |
 8442|       |    /* validation of the parameters codec */
 8443|  9.21k|    if (! opj_j2k_exec(p_j2k, p_j2k->m_validation_list, p_stream, p_manager)) {
  ------------------
  |  Branch (8443:9): [True: 0, False: 9.21k]
  ------------------
 8444|      0|        opj_image_destroy(p_j2k->m_private_image);
 8445|      0|        p_j2k->m_private_image = NULL;
 8446|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8447|      0|    }
 8448|       |
 8449|       |    /* customization of the encoding */
 8450|  9.21k|    if (! opj_j2k_setup_header_reading(p_j2k, p_manager)) {
  ------------------
  |  Branch (8450:9): [True: 0, False: 9.21k]
  ------------------
 8451|      0|        opj_image_destroy(p_j2k->m_private_image);
 8452|      0|        p_j2k->m_private_image = NULL;
 8453|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8454|      0|    }
 8455|       |
 8456|       |    /* read header */
 8457|  9.21k|    if (! opj_j2k_exec(p_j2k, p_j2k->m_procedure_list, p_stream, p_manager)) {
  ------------------
  |  Branch (8457:9): [True: 1.36k, False: 7.85k]
  ------------------
 8458|  1.36k|        opj_image_destroy(p_j2k->m_private_image);
 8459|  1.36k|        p_j2k->m_private_image = NULL;
 8460|  1.36k|        return OPJ_FALSE;
  ------------------
  |  |  118|  1.36k|#define OPJ_FALSE 0
  ------------------
 8461|  1.36k|    }
 8462|       |
 8463|  7.85k|    *p_image = opj_image_create0();
 8464|  7.85k|    if (!(*p_image)) {
  ------------------
  |  Branch (8464:9): [True: 0, False: 7.85k]
  ------------------
 8465|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8466|      0|    }
 8467|       |
 8468|       |    /* Copy codestream image information to the output image */
 8469|  7.85k|    opj_copy_image_header(p_j2k->m_private_image, *p_image);
 8470|       |
 8471|       |    /*Allocate and initialize some elements of codestrem index*/
 8472|  7.85k|    if (!opj_j2k_allocate_tile_element_cstr_index(p_j2k)) {
  ------------------
  |  Branch (8472:9): [True: 0, False: 7.85k]
  ------------------
 8473|      0|        opj_image_destroy(*p_image);
 8474|      0|        *p_image = NULL;
 8475|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8476|      0|    }
 8477|       |
 8478|  7.85k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.85k|#define OPJ_TRUE 1
  ------------------
 8479|  7.85k|}
opj_j2k_destroy:
 9208|  9.21k|{
 9209|  9.21k|    if (p_j2k == 00) {
  ------------------
  |  Branch (9209:9): [True: 0, False: 9.21k]
  ------------------
 9210|      0|        return;
 9211|      0|    }
 9212|       |
 9213|  9.21k|    if (p_j2k->m_is_decoder) {
  ------------------
  |  Branch (9213:9): [True: 9.21k, False: 0]
  ------------------
 9214|       |
 9215|  9.21k|        if (p_j2k->m_specific_param.m_decoder.m_default_tcp != 00) {
  ------------------
  |  Branch (9215:13): [True: 9.21k, False: 0]
  ------------------
 9216|  9.21k|            opj_j2k_tcp_destroy(p_j2k->m_specific_param.m_decoder.m_default_tcp);
 9217|  9.21k|            opj_free(p_j2k->m_specific_param.m_decoder.m_default_tcp);
 9218|  9.21k|            p_j2k->m_specific_param.m_decoder.m_default_tcp = 00;
 9219|  9.21k|        }
 9220|       |
 9221|  9.21k|        if (p_j2k->m_specific_param.m_decoder.m_header_data != 00) {
  ------------------
  |  Branch (9221:13): [True: 9.21k, False: 0]
  ------------------
 9222|  9.21k|            opj_free(p_j2k->m_specific_param.m_decoder.m_header_data);
 9223|  9.21k|            p_j2k->m_specific_param.m_decoder.m_header_data = 00;
 9224|  9.21k|            p_j2k->m_specific_param.m_decoder.m_header_data_size = 0;
 9225|  9.21k|        }
 9226|       |
 9227|  9.21k|        opj_free(p_j2k->m_specific_param.m_decoder.m_comps_indices_to_decode);
 9228|  9.21k|        p_j2k->m_specific_param.m_decoder.m_comps_indices_to_decode = 00;
 9229|  9.21k|        p_j2k->m_specific_param.m_decoder.m_numcomps_to_decode = 0;
 9230|       |
 9231|  9.21k|    } else {
 9232|       |
 9233|      0|        if (p_j2k->m_specific_param.m_encoder.m_encoded_tile_data) {
  ------------------
  |  Branch (9233:13): [True: 0, False: 0]
  ------------------
 9234|      0|            opj_free(p_j2k->m_specific_param.m_encoder.m_encoded_tile_data);
 9235|      0|            p_j2k->m_specific_param.m_encoder.m_encoded_tile_data = 00;
 9236|      0|        }
 9237|       |
 9238|      0|        if (p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer) {
  ------------------
  |  Branch (9238:13): [True: 0, False: 0]
  ------------------
 9239|      0|            opj_free(p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer);
 9240|      0|            p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_buffer = 00;
 9241|      0|            p_j2k->m_specific_param.m_encoder.m_tlm_sot_offsets_current = 00;
 9242|      0|        }
 9243|       |
 9244|      0|        if (p_j2k->m_specific_param.m_encoder.m_header_tile_data) {
  ------------------
  |  Branch (9244:13): [True: 0, False: 0]
  ------------------
 9245|      0|            opj_free(p_j2k->m_specific_param.m_encoder.m_header_tile_data);
 9246|      0|            p_j2k->m_specific_param.m_encoder.m_header_tile_data = 00;
 9247|      0|            p_j2k->m_specific_param.m_encoder.m_header_tile_data_size = 0;
 9248|      0|        }
 9249|      0|    }
 9250|       |
 9251|  9.21k|    opj_tcd_destroy(p_j2k->m_tcd);
 9252|       |
 9253|  9.21k|    opj_j2k_cp_destroy(&(p_j2k->m_cp));
 9254|  9.21k|    memset(&(p_j2k->m_cp), 0, sizeof(opj_cp_t));
 9255|       |
 9256|  9.21k|    opj_procedure_list_destroy(p_j2k->m_procedure_list);
 9257|  9.21k|    p_j2k->m_procedure_list = 00;
 9258|       |
 9259|  9.21k|    opj_procedure_list_destroy(p_j2k->m_validation_list);
 9260|  9.21k|    p_j2k->m_procedure_list = 00;
 9261|       |
 9262|  9.21k|    j2k_destroy_cstr_index(p_j2k->cstr_index);
 9263|  9.21k|    p_j2k->cstr_index = NULL;
 9264|       |
 9265|  9.21k|    opj_image_destroy(p_j2k->m_private_image);
 9266|  9.21k|    p_j2k->m_private_image = NULL;
 9267|       |
 9268|  9.21k|    opj_image_destroy(p_j2k->m_output_image);
 9269|  9.21k|    p_j2k->m_output_image = NULL;
 9270|       |
 9271|  9.21k|    opj_thread_pool_destroy(p_j2k->m_tp);
 9272|  9.21k|    p_j2k->m_tp = NULL;
 9273|       |
 9274|  9.21k|    opj_free(p_j2k);
 9275|  9.21k|}
j2k_destroy_cstr_index:
 9278|  9.21k|{
 9279|  9.21k|    if (p_cstr_ind) {
  ------------------
  |  Branch (9279:9): [True: 9.21k, False: 0]
  ------------------
 9280|       |
 9281|  9.21k|        if (p_cstr_ind->marker) {
  ------------------
  |  Branch (9281:13): [True: 9.21k, False: 0]
  ------------------
 9282|  9.21k|            opj_free(p_cstr_ind->marker);
 9283|  9.21k|            p_cstr_ind->marker = NULL;
 9284|  9.21k|        }
 9285|       |
 9286|  9.21k|        if (p_cstr_ind->tile_index) {
  ------------------
  |  Branch (9286:13): [True: 7.85k, False: 1.36k]
  ------------------
 9287|  7.85k|            OPJ_UINT32 it_tile = 0;
 9288|       |
 9289|  16.7M|            for (it_tile = 0; it_tile < p_cstr_ind->nb_of_tiles; it_tile++) {
  ------------------
  |  Branch (9289:31): [True: 16.7M, False: 7.85k]
  ------------------
 9290|       |
 9291|  16.7M|                if (p_cstr_ind->tile_index[it_tile].packet_index) {
  ------------------
  |  Branch (9291:21): [True: 0, False: 16.7M]
  ------------------
 9292|      0|                    opj_free(p_cstr_ind->tile_index[it_tile].packet_index);
 9293|      0|                    p_cstr_ind->tile_index[it_tile].packet_index = NULL;
 9294|      0|                }
 9295|       |
 9296|  16.7M|                if (p_cstr_ind->tile_index[it_tile].tp_index) {
  ------------------
  |  Branch (9296:21): [True: 9.72k, False: 16.7M]
  ------------------
 9297|  9.72k|                    opj_free(p_cstr_ind->tile_index[it_tile].tp_index);
 9298|  9.72k|                    p_cstr_ind->tile_index[it_tile].tp_index = NULL;
 9299|  9.72k|                }
 9300|       |
 9301|  16.7M|                if (p_cstr_ind->tile_index[it_tile].marker) {
  ------------------
  |  Branch (9301:21): [True: 16.7M, False: 0]
  ------------------
 9302|  16.7M|                    opj_free(p_cstr_ind->tile_index[it_tile].marker);
 9303|  16.7M|                    p_cstr_ind->tile_index[it_tile].marker = NULL;
 9304|       |
 9305|  16.7M|                }
 9306|  16.7M|            }
 9307|       |
 9308|  7.85k|            opj_free(p_cstr_ind->tile_index);
 9309|  7.85k|            p_cstr_ind->tile_index = NULL;
 9310|  7.85k|        }
 9311|       |
 9312|  9.21k|        opj_free(p_cstr_ind);
 9313|  9.21k|    }
 9314|  9.21k|}
opj_j2k_read_tile_header:
 9556|  9.65k|{
 9557|  9.65k|    OPJ_UINT32 l_current_marker = J2K_MS_SOT;
  ------------------
  |  |   73|  9.65k|#define J2K_MS_SOT 0xff90   /**< SOT marker value */
  ------------------
 9558|  9.65k|    OPJ_UINT32 l_marker_size;
 9559|  9.65k|    const opj_dec_memory_marker_handler_t * l_marker_handler = 00;
 9560|  9.65k|    opj_tcp_t * l_tcp = NULL;
 9561|  9.65k|    const OPJ_UINT32 l_nb_tiles = p_j2k->m_cp.tw * p_j2k->m_cp.th;
 9562|       |
 9563|       |    /* preconditions */
 9564|  9.65k|    assert(p_stream != 00);
 9565|  9.65k|    assert(p_j2k != 00);
 9566|  9.65k|    assert(p_manager != 00);
 9567|       |
 9568|       |    /* Reach the End Of Codestream ?*/
 9569|  9.65k|    if (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_EOC) {
  ------------------
  |  Branch (9569:9): [True: 23, False: 9.62k]
  ------------------
 9570|     23|        l_current_marker = J2K_MS_EOC;
  ------------------
  |  |   75|     23|#define J2K_MS_EOC 0xffd9   /**< EOC marker value */
  ------------------
 9571|     23|    }
 9572|       |    /* We need to encounter a SOT marker (a new tile-part header) */
 9573|  9.62k|    else if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_TPHSOT) {
  ------------------
  |  Branch (9573:14): [True: 0, False: 9.62k]
  ------------------
 9574|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9575|      0|    }
 9576|       |
 9577|       |    /* Read into the codestream until reach the EOC or ! can_decode ??? FIXME */
 9578|  21.5k|    while ((!p_j2k->m_specific_param.m_decoder.m_can_decode) &&
  ------------------
  |  Branch (9578:12): [True: 19.3k, False: 2.23k]
  ------------------
 9579|  21.5k|            (l_current_marker != J2K_MS_EOC)) {
  ------------------
  |  |   75|  19.3k|#define J2K_MS_EOC 0xffd9   /**< EOC marker value */
  ------------------
  |  Branch (9579:13): [True: 19.3k, False: 34]
  ------------------
 9580|       |
 9581|       |        /* Try to read until the Start Of Data is detected */
 9582|  33.7k|        while (l_current_marker != J2K_MS_SOD) {
  ------------------
  |  |   74|  33.7k|#define J2K_MS_SOD 0xff93   /**< SOD marker value */
  ------------------
  |  Branch (9582:16): [True: 21.6k, False: 12.0k]
  ------------------
 9583|       |
 9584|  21.6k|            if (opj_stream_get_number_byte_left(p_stream) == 0) {
  ------------------
  |  Branch (9584:17): [True: 6.68k, False: 14.9k]
  ------------------
 9585|  6.68k|                p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;
 9586|  6.68k|                break;
 9587|  6.68k|            }
 9588|       |
 9589|       |            /* Try to read 2 bytes (the marker size) from stream and copy them into the buffer */
 9590|  14.9k|            if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (9590:17): [True: 13, False: 14.9k]
  ------------------
 9591|  14.9k|                                     p_j2k->m_specific_param.m_decoder.m_header_data, 2, p_manager) != 2) {
 9592|     13|                opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|     13|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9593|     13|                return OPJ_FALSE;
  ------------------
  |  |  118|     13|#define OPJ_FALSE 0
  ------------------
 9594|     13|            }
 9595|       |
 9596|       |            /* Read 2 bytes from the buffer as the marker size */
 9597|  14.9k|            opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data, &l_marker_size,
  ------------------
  |  |   65|  14.9k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 9598|  14.9k|                           2);
 9599|       |
 9600|       |            /* Check marker size (does not include marker ID but includes marker size) */
 9601|  14.9k|            if (l_marker_size < 2) {
  ------------------
  |  Branch (9601:17): [True: 22, False: 14.9k]
  ------------------
 9602|     22|                opj_event_msg(p_manager, EVT_ERROR, "Inconsistent marker size\n");
  ------------------
  |  |   66|     22|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9603|     22|                return OPJ_FALSE;
  ------------------
  |  |  118|     22|#define OPJ_FALSE 0
  ------------------
 9604|     22|            }
 9605|       |
 9606|       |            /* cf. https://code.google.com/p/openjpeg/issues/detail?id=226 */
 9607|  14.9k|            if (l_current_marker == 0x8080 &&
  ------------------
  |  Branch (9607:17): [True: 2, False: 14.9k]
  ------------------
 9608|  14.9k|                    opj_stream_get_number_byte_left(p_stream) == 0) {
  ------------------
  |  Branch (9608:21): [True: 1, False: 1]
  ------------------
 9609|      1|                p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;
 9610|      1|                break;
 9611|      1|            }
 9612|       |
 9613|       |            /* Why this condition? FIXME */
 9614|  14.9k|            if (p_j2k->m_specific_param.m_decoder.m_state & J2K_STATE_TPH) {
  ------------------
  |  Branch (9614:17): [True: 4.95k, False: 9.97k]
  ------------------
 9615|  4.95k|                p_j2k->m_specific_param.m_decoder.m_sot_length -= (l_marker_size + 2);
 9616|  4.95k|            }
 9617|  14.9k|            l_marker_size -= 2; /* Subtract the size of the marker ID already read */
 9618|       |
 9619|       |            /* Get the marker handler from the marker ID */
 9620|  14.9k|            l_marker_handler = opj_j2k_get_marker_handler(l_current_marker);
 9621|       |
 9622|       |            /* Check if the marker is known and if it is the right place to find it */
 9623|  14.9k|            if (!(p_j2k->m_specific_param.m_decoder.m_state & l_marker_handler->states)) {
  ------------------
  |  Branch (9623:17): [True: 32, False: 14.9k]
  ------------------
 9624|     32|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     32|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9625|     32|                              "Marker is not compliant with its position\n");
 9626|     32|                return OPJ_FALSE;
  ------------------
  |  |  118|     32|#define OPJ_FALSE 0
  ------------------
 9627|     32|            }
 9628|       |            /* FIXME manage case of unknown marker as in the main header ? */
 9629|       |
 9630|       |            /* Check if the marker size is compatible with the header data size */
 9631|  14.9k|            if (l_marker_size > p_j2k->m_specific_param.m_decoder.m_header_data_size) {
  ------------------
  |  Branch (9631:17): [True: 121, False: 14.7k]
  ------------------
 9632|    121|                OPJ_BYTE *new_header_data = NULL;
 9633|       |                /* If we are here, this means we consider this marker as known & we will read it */
 9634|       |                /* Check enough bytes left in stream before allocation */
 9635|    121|                if ((OPJ_OFF_T)l_marker_size >  opj_stream_get_number_byte_left(p_stream)) {
  ------------------
  |  Branch (9635:21): [True: 94, False: 27]
  ------------------
 9636|     94|                    opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     94|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9637|     94|                                  "Marker size inconsistent with stream length\n");
 9638|     94|                    return OPJ_FALSE;
  ------------------
  |  |  118|     94|#define OPJ_FALSE 0
  ------------------
 9639|     94|                }
 9640|     27|                new_header_data = (OPJ_BYTE *) opj_realloc(
 9641|     27|                                      p_j2k->m_specific_param.m_decoder.m_header_data, l_marker_size);
 9642|     27|                if (! new_header_data) {
  ------------------
  |  Branch (9642:21): [True: 0, False: 27]
  ------------------
 9643|      0|                    opj_free(p_j2k->m_specific_param.m_decoder.m_header_data);
 9644|      0|                    p_j2k->m_specific_param.m_decoder.m_header_data = NULL;
 9645|      0|                    p_j2k->m_specific_param.m_decoder.m_header_data_size = 0;
 9646|      0|                    opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read header\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9647|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9648|      0|                }
 9649|     27|                p_j2k->m_specific_param.m_decoder.m_header_data = new_header_data;
 9650|     27|                p_j2k->m_specific_param.m_decoder.m_header_data_size = l_marker_size;
 9651|     27|            }
 9652|       |
 9653|       |            /* Try to read the rest of the marker segment from stream and copy them into the buffer */
 9654|  14.8k|            if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (9654:17): [True: 75, False: 14.7k]
  ------------------
 9655|  14.8k|                                     p_j2k->m_specific_param.m_decoder.m_header_data, l_marker_size,
 9656|  14.8k|                                     p_manager) != l_marker_size) {
 9657|     75|                opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|     75|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9658|     75|                return OPJ_FALSE;
  ------------------
  |  |  118|     75|#define OPJ_FALSE 0
  ------------------
 9659|     75|            }
 9660|       |
 9661|  14.7k|            if (!l_marker_handler->handler) {
  ------------------
  |  Branch (9661:17): [True: 10, False: 14.7k]
  ------------------
 9662|       |                /* See issue #175 */
 9663|     10|                opj_event_msg(p_manager, EVT_ERROR, "Not sure how that happened.\n");
  ------------------
  |  |   66|     10|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9664|     10|                return OPJ_FALSE;
  ------------------
  |  |  118|     10|#define OPJ_FALSE 0
  ------------------
 9665|     10|            }
 9666|       |            /* Read the marker segment with the correct marker handler */
 9667|  14.7k|            if (!(*(l_marker_handler->handler))(p_j2k,
  ------------------
  |  Branch (9667:17): [True: 177, False: 14.5k]
  ------------------
 9668|  14.7k|                                                p_j2k->m_specific_param.m_decoder.m_header_data, l_marker_size, p_manager)) {
 9669|    177|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    177|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9670|    177|                              "Fail to read the current marker segment (%#x)\n", l_current_marker);
 9671|    177|                return OPJ_FALSE;
  ------------------
  |  |  118|    177|#define OPJ_FALSE 0
  ------------------
 9672|    177|            }
 9673|       |
 9674|       |            /* Add the marker to the codestream index*/
 9675|  14.5k|            if (OPJ_FALSE == opj_j2k_add_tlmarker(p_j2k->m_current_tile_number,
  ------------------
  |  |  118|  14.5k|#define OPJ_FALSE 0
  ------------------
  |  Branch (9675:17): [True: 0, False: 14.5k]
  ------------------
 9676|  14.5k|                                                  p_j2k->cstr_index,
 9677|  14.5k|                                                  l_marker_handler->id,
 9678|  14.5k|                                                  (OPJ_UINT32) opj_stream_tell(p_stream) - l_marker_size - 4,
 9679|  14.5k|                                                  l_marker_size + 4)) {
 9680|      0|                opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to add tl marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9681|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9682|      0|            }
 9683|       |
 9684|       |            /* Keep the position of the last SOT marker read */
 9685|  14.5k|            if (l_marker_handler->id == J2K_MS_SOT) {
  ------------------
  |  |   73|  14.5k|#define J2K_MS_SOT 0xff90   /**< SOT marker value */
  ------------------
  |  Branch (9685:17): [True: 9.75k, False: 4.79k]
  ------------------
 9686|  9.75k|                OPJ_UINT32 sot_pos = (OPJ_UINT32) opj_stream_tell(p_stream) - l_marker_size - 4
 9687|  9.75k|                                     ;
 9688|  9.75k|                if (sot_pos > p_j2k->m_specific_param.m_decoder.m_last_sot_read_pos) {
  ------------------
  |  Branch (9688:21): [True: 9.75k, False: 0]
  ------------------
 9689|  9.75k|                    p_j2k->m_specific_param.m_decoder.m_last_sot_read_pos = sot_pos;
 9690|  9.75k|                }
 9691|  9.75k|            }
 9692|       |
 9693|  14.5k|            if (p_j2k->m_specific_param.m_decoder.m_skip_data) {
  ------------------
  |  Branch (9693:17): [True: 329, False: 14.2k]
  ------------------
 9694|       |                /* Skip the rest of the tile part header*/
 9695|    329|                if (opj_stream_skip(p_stream, p_j2k->m_specific_param.m_decoder.m_sot_length,
  ------------------
  |  Branch (9695:21): [True: 79, False: 250]
  ------------------
 9696|    329|                                    p_manager) != p_j2k->m_specific_param.m_decoder.m_sot_length) {
 9697|     79|                    opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|     79|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9698|     79|                    return OPJ_FALSE;
  ------------------
  |  |  118|     79|#define OPJ_FALSE 0
  ------------------
 9699|     79|                }
 9700|    250|                l_current_marker = J2K_MS_SOD; /* Normally we reached a SOD */
  ------------------
  |  |   74|    250|#define J2K_MS_SOD 0xff93   /**< SOD marker value */
  ------------------
 9701|  14.2k|            } else {
 9702|       |                /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer*/
 9703|  14.2k|                if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (9703:21): [True: 43, False: 14.1k]
  ------------------
 9704|  14.2k|                                         p_j2k->m_specific_param.m_decoder.m_header_data, 2, p_manager) != 2) {
 9705|     43|                    opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|     43|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9706|     43|                    return OPJ_FALSE;
  ------------------
  |  |  118|     43|#define OPJ_FALSE 0
  ------------------
 9707|     43|                }
 9708|       |                /* Read 2 bytes from the buffer as the new marker ID */
 9709|  14.1k|                opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,
  ------------------
  |  |   65|  14.1k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 9710|  14.1k|                               &l_current_marker, 2);
 9711|  14.1k|            }
 9712|  14.5k|        }
 9713|  18.7k|        if (opj_stream_get_number_byte_left(p_stream) == 0
  ------------------
  |  Branch (9713:13): [True: 6.71k, False: 12.0k]
  ------------------
 9714|  18.7k|                && p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_NEOC) {
  ------------------
  |  Branch (9714:20): [True: 6.68k, False: 31]
  ------------------
 9715|  6.68k|            break;
 9716|  6.68k|        }
 9717|       |
 9718|       |        /* If we didn't skip data before, we need to read the SOD marker*/
 9719|  12.0k|        if (! p_j2k->m_specific_param.m_decoder.m_skip_data) {
  ------------------
  |  Branch (9719:13): [True: 11.8k, False: 250]
  ------------------
 9720|       |            /* Try to read the SOD marker and skip data ? FIXME */
 9721|  11.8k|            if (! opj_j2k_read_sod(p_j2k, p_stream, p_manager)) {
  ------------------
  |  Branch (9721:17): [True: 118, False: 11.7k]
  ------------------
 9722|    118|                return OPJ_FALSE;
  ------------------
  |  |  118|    118|#define OPJ_FALSE 0
  ------------------
 9723|    118|            }
 9724|  11.7k|            if (p_j2k->m_specific_param.m_decoder.m_can_decode &&
  ------------------
  |  Branch (9724:17): [True: 2.25k, False: 9.45k]
  ------------------
 9725|  11.7k|                    !p_j2k->m_specific_param.m_decoder.m_nb_tile_parts_correction_checked) {
  ------------------
  |  Branch (9725:21): [True: 714, False: 1.54k]
  ------------------
 9726|       |                /* Issue 254 */
 9727|    714|                OPJ_BOOL l_correction_needed;
 9728|       |
 9729|    714|                p_j2k->m_specific_param.m_decoder.m_nb_tile_parts_correction_checked = 1;
 9730|    714|                if (!opj_j2k_need_nb_tile_parts_correction(p_stream,
  ------------------
  |  Branch (9730:21): [True: 3, False: 711]
  ------------------
 9731|    714|                        p_j2k->m_current_tile_number, &l_correction_needed, p_manager)) {
 9732|      3|                    opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9733|      3|                                  "opj_j2k_apply_nb_tile_parts_correction error\n");
 9734|      3|                    return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 9735|      3|                }
 9736|    711|                if (l_correction_needed) {
  ------------------
  |  Branch (9736:21): [True: 21, False: 690]
  ------------------
 9737|     21|                    OPJ_UINT32 l_tile_no;
 9738|       |
 9739|     21|                    p_j2k->m_specific_param.m_decoder.m_can_decode = 0;
 9740|     21|                    p_j2k->m_specific_param.m_decoder.m_nb_tile_parts_correction = 1;
 9741|       |                    /* correct tiles */
 9742|  1.43k|                    for (l_tile_no = 0U; l_tile_no < l_nb_tiles; ++l_tile_no) {
  ------------------
  |  Branch (9742:42): [True: 1.41k, False: 21]
  ------------------
 9743|  1.41k|                        if (p_j2k->m_cp.tcps[l_tile_no].m_nb_tile_parts != 0U) {
  ------------------
  |  Branch (9743:29): [True: 39, False: 1.37k]
  ------------------
 9744|     39|                            p_j2k->m_cp.tcps[l_tile_no].m_nb_tile_parts += 1;
 9745|     39|                        }
 9746|  1.41k|                    }
 9747|     21|                    opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|     21|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 9748|     21|                                  "Non conformant codestream TPsot==TNsot.\n");
 9749|     21|                }
 9750|    711|            }
 9751|  11.7k|        } else {
 9752|       |            /* Indicate we will try to read a new tile-part header*/
 9753|    250|            p_j2k->m_specific_param.m_decoder.m_skip_data = 0;
 9754|    250|            p_j2k->m_specific_param.m_decoder.m_can_decode = 0;
 9755|    250|            p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPHSOT;
 9756|    250|        }
 9757|       |
 9758|  11.9k|        if (! p_j2k->m_specific_param.m_decoder.m_can_decode) {
  ------------------
  |  Branch (9758:13): [True: 9.72k, False: 2.23k]
  ------------------
 9759|       |            /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer */
 9760|  9.72k|            if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (9760:17): [True: 28, False: 9.70k]
  ------------------
 9761|  9.72k|                                     p_j2k->m_specific_param.m_decoder.m_header_data, 2, p_manager) != 2) {
 9762|       |
 9763|       |                /* Deal with likely non conformant SPOT6 files, where the last */
 9764|       |                /* row of tiles have TPsot == 0 and TNsot == 0, and missing EOC, */
 9765|       |                /* but no other tile-parts were found. */
 9766|     28|                if (p_j2k->m_current_tile_number + 1 == l_nb_tiles) {
  ------------------
  |  Branch (9766:21): [True: 24, False: 4]
  ------------------
 9767|     24|                    OPJ_UINT32 l_tile_no;
 9768|    416|                    for (l_tile_no = 0U; l_tile_no < l_nb_tiles; ++l_tile_no) {
  ------------------
  |  Branch (9768:42): [True: 396, False: 20]
  ------------------
 9769|    396|                        if (p_j2k->m_cp.tcps[l_tile_no].m_current_tile_part_number == 0 &&
  ------------------
  |  Branch (9769:29): [True: 60, False: 336]
  ------------------
 9770|    396|                                p_j2k->m_cp.tcps[l_tile_no].m_nb_tile_parts == 0) {
  ------------------
  |  Branch (9770:33): [True: 4, False: 56]
  ------------------
 9771|      4|                            break;
 9772|      4|                        }
 9773|    396|                    }
 9774|     24|                    if (l_tile_no < l_nb_tiles) {
  ------------------
  |  Branch (9774:25): [True: 4, False: 20]
  ------------------
 9775|      4|                        opj_event_msg(p_manager, EVT_INFO,
  ------------------
  |  |   68|      4|#define EVT_INFO    4   /**< Debug event type */
  ------------------
 9776|      4|                                      "Tile %u has TPsot == 0 and TNsot == 0, "
 9777|      4|                                      "but no other tile-parts were found. "
 9778|      4|                                      "EOC is also missing.\n",
 9779|      4|                                      l_tile_no);
 9780|      4|                        p_j2k->m_current_tile_number = l_tile_no;
 9781|      4|                        l_current_marker = J2K_MS_EOC;
  ------------------
  |  |   75|      4|#define J2K_MS_EOC 0xffd9   /**< EOC marker value */
  ------------------
 9782|      4|                        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_EOC;
 9783|      4|                        break;
 9784|      4|                    }
 9785|     24|                }
 9786|       |
 9787|     24|                opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|     24|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9788|     24|                return OPJ_FALSE;
  ------------------
  |  |  118|     24|#define OPJ_FALSE 0
  ------------------
 9789|     28|            }
 9790|       |
 9791|       |            /* Read 2 bytes from buffer as the new marker ID */
 9792|  9.70k|            opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,
  ------------------
  |  |   65|  9.70k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 9793|  9.70k|                           &l_current_marker, 2);
 9794|  9.70k|        }
 9795|  11.9k|    }
 9796|       |
 9797|       |    /* Current marker is the EOC marker ?*/
 9798|  8.96k|    if (l_current_marker == J2K_MS_EOC) {
  ------------------
  |  |   75|  8.96k|#define J2K_MS_EOC 0xffd9   /**< EOC marker value */
  ------------------
  |  Branch (9798:9): [True: 39, False: 8.92k]
  ------------------
 9799|     39|        if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_EOC) {
  ------------------
  |  Branch (9799:13): [True: 12, False: 27]
  ------------------
 9800|     12|            p_j2k->m_current_tile_number = 0;
 9801|     12|            p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_EOC;
 9802|     12|        }
 9803|     39|    }
 9804|       |
 9805|       |    /* Deal with tiles that have a single tile-part with TPsot == 0 and TNsot == 0 */
 9806|  8.96k|    if (! p_j2k->m_specific_param.m_decoder.m_can_decode) {
  ------------------
  |  Branch (9806:9): [True: 6.71k, False: 2.24k]
  ------------------
 9807|  6.71k|        l_tcp = p_j2k->m_cp.tcps + p_j2k->m_current_tile_number;
 9808|       |
 9809|   393k|        while ((p_j2k->m_current_tile_number < l_nb_tiles) && (l_tcp->m_data == 00)) {
  ------------------
  |  Branch (9809:16): [True: 393k, False: 65]
  |  Branch (9809:63): [True: 386k, False: 6.65k]
  ------------------
 9810|   386k|            ++p_j2k->m_current_tile_number;
 9811|   386k|            ++l_tcp;
 9812|   386k|        }
 9813|       |
 9814|  6.71k|        if (p_j2k->m_current_tile_number == l_nb_tiles) {
  ------------------
  |  Branch (9814:13): [True: 65, False: 6.65k]
  ------------------
 9815|     65|            *p_go_on = OPJ_FALSE;
  ------------------
  |  |  118|     65|#define OPJ_FALSE 0
  ------------------
 9816|     65|            return OPJ_TRUE;
  ------------------
  |  |  117|     65|#define OPJ_TRUE 1
  ------------------
 9817|     65|        }
 9818|  6.71k|    }
 9819|       |
 9820|  8.89k|    if (! opj_j2k_merge_ppt(p_j2k->m_cp.tcps + p_j2k->m_current_tile_number,
  ------------------
  |  Branch (9820:9): [True: 0, False: 8.89k]
  ------------------
 9821|  8.89k|                            p_manager)) {
 9822|      0|        opj_event_msg(p_manager, EVT_ERROR, "Failed to merge PPT data\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9823|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9824|      0|    }
 9825|       |    /*FIXME ???*/
 9826|  8.89k|    if (! opj_tcd_init_decode_tile(p_j2k->m_tcd, p_j2k->m_current_tile_number,
  ------------------
  |  Branch (9826:9): [True: 50, False: 8.84k]
  ------------------
 9827|  8.89k|                                   p_manager)) {
 9828|     50|        opj_event_msg(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n");
  ------------------
  |  |   66|     50|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9829|     50|        return OPJ_FALSE;
  ------------------
  |  |  118|     50|#define OPJ_FALSE 0
  ------------------
 9830|     50|    }
 9831|       |
 9832|  8.84k|    opj_event_msg(p_manager, EVT_INFO, "Header of tile %d / %d has been read.\n",
  ------------------
  |  |   68|  8.84k|#define EVT_INFO    4   /**< Debug event type */
  ------------------
 9833|  8.84k|                  p_j2k->m_current_tile_number + 1, (p_j2k->m_cp.th * p_j2k->m_cp.tw));
 9834|       |
 9835|  8.84k|    *p_tile_index = p_j2k->m_current_tile_number;
 9836|  8.84k|    *p_go_on = OPJ_TRUE;
  ------------------
  |  |  117|  8.84k|#define OPJ_TRUE 1
  ------------------
 9837|  8.84k|    if (p_data_size) {
  ------------------
  |  Branch (9837:9): [True: 0, False: 8.84k]
  ------------------
 9838|       |        /* For internal use in j2k.c, we don't need this */
 9839|       |        /* This is just needed for folks using the opj_read_tile_header() / opj_decode_tile_data() combo */
 9840|      0|        *p_data_size = opj_tcd_get_decoded_tile_size(p_j2k->m_tcd, OPJ_FALSE);
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9841|      0|        if (*p_data_size == UINT_MAX) {
  ------------------
  |  Branch (9841:13): [True: 0, False: 0]
  ------------------
 9842|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9843|      0|        }
 9844|      0|    }
 9845|  8.84k|    *p_tile_x0 = p_j2k->m_tcd->tcd_image->tiles->x0;
 9846|  8.84k|    *p_tile_y0 = p_j2k->m_tcd->tcd_image->tiles->y0;
 9847|  8.84k|    *p_tile_x1 = p_j2k->m_tcd->tcd_image->tiles->x1;
 9848|  8.84k|    *p_tile_y1 = p_j2k->m_tcd->tcd_image->tiles->y1;
 9849|  8.84k|    *p_nb_comps = p_j2k->m_tcd->tcd_image->tiles->numcomps;
 9850|       |
 9851|  8.84k|    p_j2k->m_specific_param.m_decoder.m_state |= J2K_STATE_DATA;
 9852|       |
 9853|  8.84k|    return OPJ_TRUE;
  ------------------
  |  |  117|  8.84k|#define OPJ_TRUE 1
  ------------------
 9854|  8.84k|}
opj_j2k_decode_tile:
 9862|  8.84k|{
 9863|  8.84k|    OPJ_UINT32 l_current_marker;
 9864|  8.84k|    OPJ_BYTE l_data [2];
 9865|  8.84k|    opj_tcp_t * l_tcp;
 9866|  8.84k|    opj_image_t* l_image_for_bounds;
 9867|       |
 9868|       |    /* preconditions */
 9869|  8.84k|    assert(p_stream != 00);
 9870|  8.84k|    assert(p_j2k != 00);
 9871|  8.84k|    assert(p_manager != 00);
 9872|       |
 9873|  8.84k|    if (!(p_j2k->m_specific_param.m_decoder.m_state & J2K_STATE_DATA)
  ------------------
  |  Branch (9873:9): [True: 1, False: 8.84k]
  ------------------
 9874|  8.84k|            || (p_tile_index != p_j2k->m_current_tile_number)) {
  ------------------
  |  Branch (9874:16): [True: 0, False: 8.84k]
  ------------------
 9875|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 9876|      1|    }
 9877|       |
 9878|  8.84k|    l_tcp = &(p_j2k->m_cp.tcps[p_tile_index]);
 9879|  8.84k|    if (! l_tcp->m_data) {
  ------------------
  |  Branch (9879:9): [True: 6, False: 8.83k]
  ------------------
 9880|      6|        opj_j2k_tcp_destroy(l_tcp);
 9881|      6|        return OPJ_FALSE;
  ------------------
  |  |  118|      6|#define OPJ_FALSE 0
  ------------------
 9882|      6|    }
 9883|       |
 9884|       |    /* When using the opj_read_tile_header / opj_decode_tile_data API */
 9885|       |    /* such as in test_tile_decoder, m_output_image is NULL, so fall back */
 9886|       |    /* to the full image dimension. This is a bit surprising that */
 9887|       |    /* opj_set_decode_area() is only used to determine intersecting tiles, */
 9888|       |    /* but full tile decoding is done */
 9889|  8.83k|    l_image_for_bounds = p_j2k->m_output_image ? p_j2k->m_output_image :
  ------------------
  |  Branch (9889:26): [True: 8.83k, False: 0]
  ------------------
 9890|  8.83k|                         p_j2k->m_private_image;
 9891|  8.83k|    if (! opj_tcd_decode_tile(p_j2k->m_tcd,
  ------------------
  |  Branch (9891:9): [True: 1.12k, False: 7.71k]
  ------------------
 9892|  8.83k|                              l_image_for_bounds->x0,
 9893|  8.83k|                              l_image_for_bounds->y0,
 9894|  8.83k|                              l_image_for_bounds->x1,
 9895|  8.83k|                              l_image_for_bounds->y1,
 9896|  8.83k|                              p_j2k->m_specific_param.m_decoder.m_numcomps_to_decode,
 9897|  8.83k|                              p_j2k->m_specific_param.m_decoder.m_comps_indices_to_decode,
 9898|  8.83k|                              l_tcp->m_data,
 9899|  8.83k|                              l_tcp->m_data_size,
 9900|  8.83k|                              p_tile_index,
 9901|  8.83k|                              p_j2k->cstr_index, p_manager)) {
 9902|  1.12k|        opj_j2k_tcp_destroy(l_tcp);
 9903|  1.12k|        p_j2k->m_specific_param.m_decoder.m_state |= J2K_STATE_ERR;
 9904|  1.12k|        opj_event_msg(p_manager, EVT_ERROR, "Failed to decode.\n");
  ------------------
  |  |   66|  1.12k|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9905|  1.12k|        return OPJ_FALSE;
  ------------------
  |  |  118|  1.12k|#define OPJ_FALSE 0
  ------------------
 9906|  1.12k|    }
 9907|       |
 9908|       |    /* p_data can be set to NULL when the call will take care of using */
 9909|       |    /* itself the TCD data. This is typically the case for whole single */
 9910|       |    /* tile decoding optimization. */
 9911|  7.71k|    if (p_data != NULL) {
  ------------------
  |  Branch (9911:9): [True: 0, False: 7.71k]
  ------------------
 9912|      0|        if (! opj_tcd_update_tile_data(p_j2k->m_tcd, p_data, p_data_size)) {
  ------------------
  |  Branch (9912:13): [True: 0, False: 0]
  ------------------
 9913|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9914|      0|        }
 9915|       |
 9916|       |        /* To avoid to destroy the tcp which can be useful when we try to decode a tile decoded before (cf j2k_random_tile_access)
 9917|       |        * we destroy just the data which will be re-read in read_tile_header*/
 9918|       |        /*opj_j2k_tcp_destroy(l_tcp);
 9919|       |        p_j2k->m_tcd->tcp = 0;*/
 9920|      0|        opj_j2k_tcp_data_destroy(l_tcp);
 9921|      0|    }
 9922|       |
 9923|  7.71k|    p_j2k->m_specific_param.m_decoder.m_can_decode = 0;
 9924|  7.71k|    p_j2k->m_specific_param.m_decoder.m_state &= (~(OPJ_UINT32)J2K_STATE_DATA);
 9925|       |
 9926|  7.71k|    if (opj_stream_get_number_byte_left(p_stream) == 0
  ------------------
  |  Branch (9926:9): [True: 5.64k, False: 2.07k]
  ------------------
 9927|  7.71k|            && p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_NEOC) {
  ------------------
  |  Branch (9927:16): [True: 5.61k, False: 27]
  ------------------
 9928|  5.61k|        return OPJ_TRUE;
  ------------------
  |  |  117|  5.61k|#define OPJ_TRUE 1
  ------------------
 9929|  5.61k|    }
 9930|       |
 9931|  2.10k|    if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_EOC) {
  ------------------
  |  Branch (9931:9): [True: 2.08k, False: 20]
  ------------------
 9932|  2.08k|        if (opj_stream_read_data(p_stream, l_data, 2, p_manager) != 2) {
  ------------------
  |  Branch (9932:13): [True: 30, False: 2.05k]
  ------------------
 9933|     30|            opj_event_msg(p_manager, p_j2k->m_cp.strict ? EVT_ERROR : EVT_WARNING,
  ------------------
  |  |   66|     30|#define EVT_ERROR   1   /**< Error event type */
  ------------------
                          opj_event_msg(p_manager, p_j2k->m_cp.strict ? EVT_ERROR : EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
  |  Branch (9933:38): [True: 30, False: 0]
  ------------------
 9934|     30|                          "Stream too short\n");
 9935|     30|            return p_j2k->m_cp.strict ? OPJ_FALSE : OPJ_TRUE;
  ------------------
  |  |  118|     30|#define OPJ_FALSE 0
  ------------------
                          return p_j2k->m_cp.strict ? OPJ_FALSE : OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
  |  Branch (9935:20): [True: 30, False: 0]
  ------------------
 9936|     30|        }
 9937|  2.05k|        opj_read_bytes(l_data, &l_current_marker, 2);
  ------------------
  |  |   65|  2.05k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 9938|       |
 9939|  2.05k|        if (l_current_marker == J2K_MS_EOC) {
  ------------------
  |  |   75|  2.05k|#define J2K_MS_EOC 0xffd9   /**< EOC marker value */
  ------------------
  |  Branch (9939:13): [True: 3, False: 2.05k]
  ------------------
 9940|      3|            p_j2k->m_current_tile_number = 0;
 9941|      3|            p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_EOC;
 9942|  2.05k|        } else if (l_current_marker != J2K_MS_SOT) {
  ------------------
  |  |   73|  2.05k|#define J2K_MS_SOT 0xff90   /**< SOT marker value */
  ------------------
  |  Branch (9942:20): [True: 222, False: 1.82k]
  ------------------
 9943|    222|            if (opj_stream_get_number_byte_left(p_stream) == 0) {
  ------------------
  |  Branch (9943:17): [True: 39, False: 183]
  ------------------
 9944|     39|                p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;
 9945|     39|                opj_event_msg(p_manager, EVT_WARNING, "Stream does not end with EOC\n");
  ------------------
  |  |   67|     39|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 9946|     39|                return OPJ_TRUE;
  ------------------
  |  |  117|     39|#define OPJ_TRUE 1
  ------------------
 9947|     39|            }
 9948|    183|            opj_event_msg(p_manager, EVT_ERROR, "Stream too short, expected SOT\n");
  ------------------
  |  |   66|    183|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9949|    183|            return OPJ_FALSE;
  ------------------
  |  |  118|    183|#define OPJ_FALSE 0
  ------------------
 9950|    222|        }
 9951|  2.05k|    }
 9952|       |
 9953|  1.85k|    return OPJ_TRUE;
  ------------------
  |  |  117|  1.85k|#define OPJ_TRUE 1
  ------------------
 9954|  2.10k|}
opj_j2k_set_decode_area:
10290|  7.85k|{
10291|  7.85k|    opj_cp_t * l_cp = &(p_j2k->m_cp);
10292|  7.85k|    opj_image_t * l_image = p_j2k->m_private_image;
10293|  7.85k|    OPJ_BOOL ret;
10294|  7.85k|    OPJ_UINT32 it_comp;
10295|       |
10296|  7.85k|    if (p_j2k->m_cp.tw == 1 && p_j2k->m_cp.th == 1 &&
  ------------------
  |  Branch (10296:9): [True: 6.65k, False: 1.19k]
  |  Branch (10296:32): [True: 3.75k, False: 2.90k]
  ------------------
10297|  7.85k|            p_j2k->m_cp.tcps[0].m_data != NULL) {
  ------------------
  |  Branch (10297:13): [True: 0, False: 3.75k]
  ------------------
10298|       |        /* In the case of a single-tiled image whose codestream we have already */
10299|       |        /* ingested, go on */
10300|      0|    }
10301|       |    /* Check if we are read the main header */
10302|  7.85k|    else if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_TPHSOT) {
  ------------------
  |  Branch (10302:14): [True: 0, False: 7.85k]
  ------------------
10303|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10304|      0|                      "Need to decode the main header before begin to decode the remaining codestream.\n");
10305|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10306|      0|    }
10307|       |
10308|       |    /* Update the comps[].factor member of the output image with the one */
10309|       |    /* of m_reduce */
10310|  30.5k|    for (it_comp = 0; it_comp < p_image->numcomps; ++it_comp) {
  ------------------
  |  Branch (10310:23): [True: 22.6k, False: 7.85k]
  ------------------
10311|  22.6k|        p_image->comps[it_comp].factor = p_j2k->m_cp.m_specific_param.m_dec.m_reduce;
10312|  22.6k|    }
10313|       |
10314|  7.85k|    if (!p_start_x && !p_start_y && !p_end_x && !p_end_y) {
  ------------------
  |  Branch (10314:9): [True: 3.66k, False: 4.19k]
  |  Branch (10314:23): [True: 1.55k, False: 2.10k]
  |  Branch (10314:37): [True: 0, False: 1.55k]
  |  Branch (10314:49): [True: 0, False: 0]
  ------------------
10315|      0|        opj_event_msg(p_manager, EVT_INFO,
  ------------------
  |  |   68|      0|#define EVT_INFO    4   /**< Debug event type */
  ------------------
10316|      0|                      "No decoded area parameters, set the decoded area to the whole image\n");
10317|       |
10318|      0|        p_j2k->m_specific_param.m_decoder.m_start_tile_x = 0;
10319|      0|        p_j2k->m_specific_param.m_decoder.m_start_tile_y = 0;
10320|      0|        p_j2k->m_specific_param.m_decoder.m_end_tile_x = l_cp->tw;
10321|      0|        p_j2k->m_specific_param.m_decoder.m_end_tile_y = l_cp->th;
10322|       |
10323|      0|        p_image->x0 = l_image->x0;
10324|      0|        p_image->y0 = l_image->y0;
10325|      0|        p_image->x1 = l_image->x1;
10326|      0|        p_image->y1 = l_image->y1;
10327|       |
10328|      0|        return opj_j2k_update_image_dimensions(p_image, p_manager);
10329|      0|    }
10330|       |
10331|       |    /* ----- */
10332|       |    /* Check if the positions provided by the user are correct */
10333|       |
10334|       |    /* Left */
10335|  7.85k|    if (p_start_x < 0) {
  ------------------
  |  Branch (10335:9): [True: 12, False: 7.84k]
  ------------------
10336|     12|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     12|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10337|     12|                      "Left position of the decoded area (region_x0=%d) should be >= 0.\n",
10338|     12|                      p_start_x);
10339|     12|        return OPJ_FALSE;
  ------------------
  |  |  118|     12|#define OPJ_FALSE 0
  ------------------
10340|  7.84k|    } else if ((OPJ_UINT32)p_start_x > l_image->x1) {
  ------------------
  |  Branch (10340:16): [True: 0, False: 7.84k]
  ------------------
10341|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10342|      0|                      "Left position of the decoded area (region_x0=%d) is outside the image area (Xsiz=%d).\n",
10343|      0|                      p_start_x, l_image->x1);
10344|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10345|  7.84k|    } else if ((OPJ_UINT32)p_start_x < l_image->x0) {
  ------------------
  |  Branch (10345:16): [True: 0, False: 7.84k]
  ------------------
10346|      0|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
10347|      0|                      "Left position of the decoded area (region_x0=%d) is outside the image area (XOsiz=%d).\n",
10348|      0|                      p_start_x, l_image->x0);
10349|      0|        p_j2k->m_specific_param.m_decoder.m_start_tile_x = 0;
10350|      0|        p_image->x0 = l_image->x0;
10351|  7.84k|    } else {
10352|  7.84k|        p_j2k->m_specific_param.m_decoder.m_start_tile_x = ((OPJ_UINT32)p_start_x -
10353|  7.84k|                l_cp->tx0) / l_cp->tdx;
10354|  7.84k|        p_image->x0 = (OPJ_UINT32)p_start_x;
10355|  7.84k|    }
10356|       |
10357|       |    /* Up */
10358|  7.84k|    if (p_start_y < 0) {
  ------------------
  |  Branch (10358:9): [True: 23, False: 7.82k]
  ------------------
10359|     23|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     23|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10360|     23|                      "Up position of the decoded area (region_y0=%d) should be >= 0.\n",
10361|     23|                      p_start_y);
10362|     23|        return OPJ_FALSE;
  ------------------
  |  |  118|     23|#define OPJ_FALSE 0
  ------------------
10363|  7.82k|    } else if ((OPJ_UINT32)p_start_y > l_image->y1) {
  ------------------
  |  Branch (10363:16): [True: 0, False: 7.82k]
  ------------------
10364|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10365|      0|                      "Up position of the decoded area (region_y0=%d) is outside the image area (Ysiz=%d).\n",
10366|      0|                      p_start_y, l_image->y1);
10367|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10368|  7.82k|    } else if ((OPJ_UINT32)p_start_y < l_image->y0) {
  ------------------
  |  Branch (10368:16): [True: 0, False: 7.82k]
  ------------------
10369|      0|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
10370|      0|                      "Up position of the decoded area (region_y0=%d) is outside the image area (YOsiz=%d).\n",
10371|      0|                      p_start_y, l_image->y0);
10372|      0|        p_j2k->m_specific_param.m_decoder.m_start_tile_y = 0;
10373|      0|        p_image->y0 = l_image->y0;
10374|  7.82k|    } else {
10375|  7.82k|        p_j2k->m_specific_param.m_decoder.m_start_tile_y = ((OPJ_UINT32)p_start_y -
10376|  7.82k|                l_cp->ty0) / l_cp->tdy;
10377|  7.82k|        p_image->y0 = (OPJ_UINT32)p_start_y;
10378|  7.82k|    }
10379|       |
10380|       |    /* Right */
10381|  7.82k|    if (p_end_x <= 0) {
  ------------------
  |  Branch (10381:9): [True: 1, False: 7.81k]
  ------------------
10382|      1|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10383|      1|                      "Right position of the decoded area (region_x1=%d) should be > 0.\n",
10384|      1|                      p_end_x);
10385|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
10386|  7.81k|    } else if ((OPJ_UINT32)p_end_x < l_image->x0) {
  ------------------
  |  Branch (10386:16): [True: 0, False: 7.81k]
  ------------------
10387|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10388|      0|                      "Right position of the decoded area (region_x1=%d) is outside the image area (XOsiz=%d).\n",
10389|      0|                      p_end_x, l_image->x0);
10390|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10391|  7.81k|    } else if ((OPJ_UINT32)p_end_x > l_image->x1) {
  ------------------
  |  Branch (10391:16): [True: 0, False: 7.81k]
  ------------------
10392|      0|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
10393|      0|                      "Right position of the decoded area (region_x1=%d) is outside the image area (Xsiz=%d).\n",
10394|      0|                      p_end_x, l_image->x1);
10395|      0|        p_j2k->m_specific_param.m_decoder.m_end_tile_x = l_cp->tw;
10396|      0|        p_image->x1 = l_image->x1;
10397|  7.81k|    } else {
10398|  7.81k|        p_j2k->m_specific_param.m_decoder.m_end_tile_x = (OPJ_UINT32)opj_int_ceildiv(
10399|  7.81k|                    p_end_x - (OPJ_INT32)l_cp->tx0, (OPJ_INT32)l_cp->tdx);
10400|  7.81k|        p_image->x1 = (OPJ_UINT32)p_end_x;
10401|  7.81k|    }
10402|       |
10403|       |    /* Bottom */
10404|  7.81k|    if (p_end_y <= 0) {
  ------------------
  |  Branch (10404:9): [True: 1, False: 7.81k]
  ------------------
10405|      1|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10406|      1|                      "Bottom position of the decoded area (region_y1=%d) should be > 0.\n",
10407|      1|                      p_end_y);
10408|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
10409|  7.81k|    } else if ((OPJ_UINT32)p_end_y < l_image->y0) {
  ------------------
  |  Branch (10409:16): [True: 0, False: 7.81k]
  ------------------
10410|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10411|      0|                      "Bottom position of the decoded area (region_y1=%d) is outside the image area (YOsiz=%d).\n",
10412|      0|                      p_end_y, l_image->y0);
10413|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10414|      0|    }
10415|  7.81k|    if ((OPJ_UINT32)p_end_y > l_image->y1) {
  ------------------
  |  Branch (10415:9): [True: 0, False: 7.81k]
  ------------------
10416|      0|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
10417|      0|                      "Bottom position of the decoded area (region_y1=%d) is outside the image area (Ysiz=%d).\n",
10418|      0|                      p_end_y, l_image->y1);
10419|      0|        p_j2k->m_specific_param.m_decoder.m_end_tile_y = l_cp->th;
10420|      0|        p_image->y1 = l_image->y1;
10421|  7.81k|    } else {
10422|  7.81k|        p_j2k->m_specific_param.m_decoder.m_end_tile_y = (OPJ_UINT32)opj_int_ceildiv(
10423|  7.81k|                    p_end_y - (OPJ_INT32)l_cp->ty0, (OPJ_INT32)l_cp->tdy);
10424|  7.81k|        p_image->y1 = (OPJ_UINT32)p_end_y;
10425|  7.81k|    }
10426|       |    /* ----- */
10427|       |
10428|  7.81k|    p_j2k->m_specific_param.m_decoder.m_discard_tiles = 1;
10429|       |
10430|  7.81k|    ret = opj_j2k_update_image_dimensions(p_image, p_manager);
10431|       |
10432|  7.81k|    if (ret) {
  ------------------
  |  Branch (10432:9): [True: 7.81k, False: 0]
  ------------------
10433|  7.81k|        opj_event_msg(p_manager, EVT_INFO, "Setting decoding area to %d,%d,%d,%d\n",
  ------------------
  |  |   68|  7.81k|#define EVT_INFO    4   /**< Debug event type */
  ------------------
10434|  7.81k|                      p_image->x0, p_image->y0, p_image->x1, p_image->y1);
10435|  7.81k|    }
10436|       |
10437|  7.81k|    return ret;
10438|  7.81k|}
opj_j2k_create_decompress:
10441|  9.21k|{
10442|  9.21k|    opj_j2k_t *l_j2k = (opj_j2k_t*) opj_calloc(1, sizeof(opj_j2k_t));
10443|  9.21k|    if (!l_j2k) {
  ------------------
  |  Branch (10443:9): [True: 0, False: 9.21k]
  ------------------
10444|      0|        return 00;
10445|      0|    }
10446|       |
10447|  9.21k|    l_j2k->m_is_decoder = 1;
10448|  9.21k|    l_j2k->m_cp.m_is_decoder = 1;
10449|       |    /* in the absence of JP2 boxes, consider different bit depth / sign */
10450|       |    /* per component is allowed */
10451|  9.21k|    l_j2k->m_cp.allow_different_bit_depth_sign = 1;
10452|       |
10453|       |    /* Default to using strict mode. */
10454|  9.21k|    l_j2k->m_cp.strict = OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
10455|       |
10456|       |#ifdef OPJ_DISABLE_TPSOT_FIX
10457|       |    l_j2k->m_specific_param.m_decoder.m_nb_tile_parts_correction_checked = 1;
10458|       |#endif
10459|       |
10460|  9.21k|    l_j2k->m_specific_param.m_decoder.m_default_tcp = (opj_tcp_t*) opj_calloc(1,
10461|  9.21k|            sizeof(opj_tcp_t));
10462|  9.21k|    if (!l_j2k->m_specific_param.m_decoder.m_default_tcp) {
  ------------------
  |  Branch (10462:9): [True: 0, False: 9.21k]
  ------------------
10463|      0|        opj_j2k_destroy(l_j2k);
10464|      0|        return 00;
10465|      0|    }
10466|       |
10467|  9.21k|    l_j2k->m_specific_param.m_decoder.m_header_data = (OPJ_BYTE *) opj_calloc(1,
10468|  9.21k|            OPJ_J2K_DEFAULT_HEADER_SIZE);
  ------------------
  |  |  157|  9.21k|#define OPJ_J2K_DEFAULT_HEADER_SIZE         1000
  ------------------
10469|  9.21k|    if (! l_j2k->m_specific_param.m_decoder.m_header_data) {
  ------------------
  |  Branch (10469:9): [True: 0, False: 9.21k]
  ------------------
10470|      0|        opj_j2k_destroy(l_j2k);
10471|      0|        return 00;
10472|      0|    }
10473|       |
10474|  9.21k|    l_j2k->m_specific_param.m_decoder.m_header_data_size =
10475|  9.21k|        OPJ_J2K_DEFAULT_HEADER_SIZE;
  ------------------
  |  |  157|  9.21k|#define OPJ_J2K_DEFAULT_HEADER_SIZE         1000
  ------------------
10476|       |
10477|  9.21k|    l_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec = -1 ;
10478|       |
10479|  9.21k|    l_j2k->m_specific_param.m_decoder.m_last_sot_read_pos = 0 ;
10480|       |
10481|       |    /* codestream index creation */
10482|  9.21k|    l_j2k->cstr_index = opj_j2k_create_cstr_index();
10483|  9.21k|    if (!l_j2k->cstr_index) {
  ------------------
  |  Branch (10483:9): [True: 0, False: 9.21k]
  ------------------
10484|      0|        opj_j2k_destroy(l_j2k);
10485|      0|        return 00;
10486|      0|    }
10487|       |
10488|       |    /* validation list creation */
10489|  9.21k|    l_j2k->m_validation_list = opj_procedure_list_create();
10490|  9.21k|    if (! l_j2k->m_validation_list) {
  ------------------
  |  Branch (10490:9): [True: 0, False: 9.21k]
  ------------------
10491|      0|        opj_j2k_destroy(l_j2k);
10492|      0|        return 00;
10493|      0|    }
10494|       |
10495|       |    /* execution list creation */
10496|  9.21k|    l_j2k->m_procedure_list = opj_procedure_list_create();
10497|  9.21k|    if (! l_j2k->m_procedure_list) {
  ------------------
  |  Branch (10497:9): [True: 0, False: 9.21k]
  ------------------
10498|      0|        opj_j2k_destroy(l_j2k);
10499|      0|        return 00;
10500|      0|    }
10501|       |
10502|  9.21k|    l_j2k->m_tp = opj_thread_pool_create(opj_j2k_get_default_thread_count());
10503|  9.21k|    if (!l_j2k->m_tp) {
  ------------------
  |  Branch (10503:9): [True: 0, False: 9.21k]
  ------------------
10504|      0|        l_j2k->m_tp = opj_thread_pool_create(0);
10505|      0|    }
10506|  9.21k|    if (!l_j2k->m_tp) {
  ------------------
  |  Branch (10506:9): [True: 0, False: 9.21k]
  ------------------
10507|      0|        opj_j2k_destroy(l_j2k);
10508|      0|        return NULL;
10509|      0|    }
10510|       |
10511|  9.21k|    return l_j2k;
10512|  9.21k|}
opj_j2k_decode:
11995|  7.81k|{
11996|  7.81k|    if (!p_image) {
  ------------------
  |  Branch (11996:9): [True: 0, False: 7.81k]
  ------------------
11997|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
11998|      0|    }
11999|       |
12000|       |    /* Heuristics to detect sequence opj_read_header(), opj_set_decoded_resolution_factor() */
12001|       |    /* and finally opj_decode_image() without manual setting of comps[].factor */
12002|       |    /* We could potentially always execute it, if we don't allow people to do */
12003|       |    /* opj_read_header(), modify x0,y0,x1,y1 of returned image an call opj_decode_image() */
12004|  7.81k|    if (p_j2k->m_cp.m_specific_param.m_dec.m_reduce > 0 &&
  ------------------
  |  Branch (12004:9): [True: 0, False: 7.81k]
  ------------------
12005|  7.81k|            p_j2k->m_private_image != NULL &&
  ------------------
  |  Branch (12005:13): [True: 0, False: 0]
  ------------------
12006|  7.81k|            p_j2k->m_private_image->numcomps > 0 &&
  ------------------
  |  Branch (12006:13): [True: 0, False: 0]
  ------------------
12007|  7.81k|            p_j2k->m_private_image->comps[0].factor ==
  ------------------
  |  Branch (12007:13): [True: 0, False: 0]
  ------------------
12008|      0|            p_j2k->m_cp.m_specific_param.m_dec.m_reduce &&
12009|  7.81k|            p_image->numcomps > 0 &&
  ------------------
  |  Branch (12009:13): [True: 0, False: 0]
  ------------------
12010|  7.81k|            p_image->comps[0].factor == 0 &&
  ------------------
  |  Branch (12010:13): [True: 0, False: 0]
  ------------------
12011|       |            /* Don't mess with image dimension if the user has allocated it */
12012|  7.81k|            p_image->comps[0].data == NULL) {
  ------------------
  |  Branch (12012:13): [True: 0, False: 0]
  ------------------
12013|      0|        OPJ_UINT32 it_comp;
12014|       |
12015|       |        /* Update the comps[].factor member of the output image with the one */
12016|       |        /* of m_reduce */
12017|      0|        for (it_comp = 0; it_comp < p_image->numcomps; ++it_comp) {
  ------------------
  |  Branch (12017:27): [True: 0, False: 0]
  ------------------
12018|      0|            p_image->comps[it_comp].factor = p_j2k->m_cp.m_specific_param.m_dec.m_reduce;
12019|      0|        }
12020|      0|        if (!opj_j2k_update_image_dimensions(p_image, p_manager)) {
  ------------------
  |  Branch (12020:13): [True: 0, False: 0]
  ------------------
12021|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
12022|      0|        }
12023|      0|    }
12024|       |
12025|  7.81k|    if (p_j2k->m_output_image == NULL) {
  ------------------
  |  Branch (12025:9): [True: 7.81k, False: 0]
  ------------------
12026|  7.81k|        p_j2k->m_output_image = opj_image_create0();
12027|  7.81k|        if (!(p_j2k->m_output_image)) {
  ------------------
  |  Branch (12027:13): [True: 0, False: 7.81k]
  ------------------
12028|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
12029|      0|        }
12030|  7.81k|    }
12031|  7.81k|    opj_copy_image_header(p_image, p_j2k->m_output_image);
12032|       |
12033|       |    /* customization of the decoding */
12034|  7.81k|    if (!opj_j2k_setup_decoding(p_j2k, p_manager)) {
  ------------------
  |  Branch (12034:9): [True: 0, False: 7.81k]
  ------------------
12035|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
12036|      0|    }
12037|       |
12038|       |    /* Decode the codestream */
12039|  7.81k|    if (! opj_j2k_exec(p_j2k, p_j2k->m_procedure_list, p_stream, p_manager)) {
  ------------------
  |  Branch (12039:9): [True: 2.21k, False: 5.60k]
  ------------------
12040|  2.21k|        opj_image_destroy(p_j2k->m_private_image);
12041|  2.21k|        p_j2k->m_private_image = NULL;
12042|  2.21k|        return OPJ_FALSE;
  ------------------
  |  |  118|  2.21k|#define OPJ_FALSE 0
  ------------------
12043|  2.21k|    }
12044|       |
12045|       |    /* Move data and copy one information from codec to output image*/
12046|  5.60k|    return opj_j2k_move_data_from_codec_to_output_image(p_j2k, p_image);
12047|  7.81k|}
j2k.c:opj_j2k_get_default_thread_count:
 6730|  9.21k|{
 6731|  9.21k|    const char* num_threads_str = getenv("OPJ_NUM_THREADS");
 6732|  9.21k|    int num_cpus;
 6733|  9.21k|    int num_threads;
 6734|       |
 6735|  9.21k|    if (num_threads_str == NULL || !opj_has_thread_support()) {
  ------------------
  |  Branch (6735:9): [True: 9.21k, False: 0]
  |  Branch (6735:36): [True: 0, False: 0]
  ------------------
 6736|  9.21k|        return 0;
 6737|  9.21k|    }
 6738|      0|    num_cpus = opj_get_num_cpus();
 6739|      0|    if (strcmp(num_threads_str, "ALL_CPUS") == 0) {
  ------------------
  |  Branch (6739:9): [True: 0, False: 0]
  ------------------
 6740|      0|        return num_cpus;
 6741|      0|    }
 6742|      0|    if (num_cpus == 0) {
  ------------------
  |  Branch (6742:9): [True: 0, False: 0]
  ------------------
 6743|      0|        num_cpus = 32;
 6744|      0|    }
 6745|      0|    num_threads = atoi(num_threads_str);
 6746|      0|    if (num_threads < 0) {
  ------------------
  |  Branch (6746:9): [True: 0, False: 0]
  ------------------
 6747|      0|        num_threads = 0;
 6748|      0|    } else if (num_threads > 2 * num_cpus) {
  ------------------
  |  Branch (6748:16): [True: 0, False: 0]
  ------------------
 6749|      0|        num_threads = 2 * num_cpus;
 6750|      0|    }
 6751|      0|    return num_threads;
 6752|      0|}
j2k.c:opj_j2k_setup_header_reading:
 8483|  9.21k|{
 8484|       |    /* preconditions*/
 8485|  9.21k|    assert(p_j2k != 00);
 8486|  9.21k|    assert(p_manager != 00);
 8487|       |
 8488|  9.21k|    if (! opj_procedure_list_add_procedure(p_j2k->m_procedure_list,
  ------------------
  |  Branch (8488:9): [True: 0, False: 9.21k]
  ------------------
 8489|  9.21k|                                           (opj_procedure)opj_j2k_read_header_procedure, p_manager)) {
 8490|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8491|      0|    }
 8492|       |
 8493|       |    /* DEVELOPER CORNER, add your custom procedures */
 8494|  9.21k|    if (! opj_procedure_list_add_procedure(p_j2k->m_procedure_list,
  ------------------
  |  Branch (8494:9): [True: 0, False: 9.21k]
  ------------------
 8495|  9.21k|                                           (opj_procedure)opj_j2k_copy_default_tcp_and_create_tcd, p_manager))  {
 8496|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8497|      0|    }
 8498|       |
 8499|  9.21k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
 8500|  9.21k|}
j2k.c:opj_j2k_read_header_procedure:
 8832|  9.21k|{
 8833|  9.21k|    OPJ_UINT32 l_current_marker;
 8834|  9.21k|    OPJ_UINT32 l_marker_size;
 8835|  9.21k|    const opj_dec_memory_marker_handler_t * l_marker_handler = 00;
 8836|  9.21k|    OPJ_BOOL l_has_siz = 0;
 8837|  9.21k|    OPJ_BOOL l_has_cod = 0;
 8838|  9.21k|    OPJ_BOOL l_has_qcd = 0;
 8839|       |
 8840|       |    /* preconditions */
 8841|  9.21k|    assert(p_stream != 00);
 8842|  9.21k|    assert(p_j2k != 00);
 8843|  9.21k|    assert(p_manager != 00);
 8844|       |
 8845|       |    /*  We enter in the main header */
 8846|  9.21k|    p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_MHSOC;
 8847|       |
 8848|       |    /* Try to read the SOC marker, the codestream must begin with SOC marker */
 8849|  9.21k|    if (! opj_j2k_read_soc(p_j2k, p_stream, p_manager)) {
  ------------------
  |  Branch (8849:9): [True: 0, False: 9.21k]
  ------------------
 8850|      0|        opj_event_msg(p_manager, EVT_ERROR, "Expected a SOC marker \n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8851|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8852|      0|    }
 8853|       |
 8854|       |    /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer */
 8855|  9.21k|    if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (8855:9): [True: 2, False: 9.21k]
  ------------------
 8856|  9.21k|                             p_j2k->m_specific_param.m_decoder.m_header_data, 2, p_manager) != 2) {
 8857|      2|        opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8858|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 8859|      2|    }
 8860|       |
 8861|       |    /* Read 2 bytes as the new marker ID */
 8862|  9.21k|    opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,
  ------------------
  |  |   65|  9.21k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 8863|  9.21k|                   &l_current_marker, 2);
 8864|       |
 8865|       |    /* Try to read until the SOT is detected */
 8866|   103k|    while (l_current_marker != J2K_MS_SOT) {
  ------------------
  |  |   73|   103k|#define J2K_MS_SOT 0xff90   /**< SOT marker value */
  ------------------
  |  Branch (8866:12): [True: 96.3k, False: 7.06k]
  ------------------
 8867|       |
 8868|       |        /* Check if the current marker ID is valid */
 8869|  96.3k|        if (l_current_marker < 0xff00) {
  ------------------
  |  Branch (8869:13): [True: 156, False: 96.1k]
  ------------------
 8870|    156|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    156|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8871|    156|                          "A marker ID was expected (0xff--) instead of %.8x\n", l_current_marker);
 8872|    156|            return OPJ_FALSE;
  ------------------
  |  |  118|    156|#define OPJ_FALSE 0
  ------------------
 8873|    156|        }
 8874|       |
 8875|       |        /* Get the marker handler from the marker ID */
 8876|  96.1k|        l_marker_handler = opj_j2k_get_marker_handler(l_current_marker);
 8877|       |
 8878|       |        /* Manage case where marker is unknown */
 8879|  96.1k|        if (l_marker_handler->id == J2K_MS_UNK) {
  ------------------
  |  |   99|  96.1k|#define J2K_MS_UNK 0        /**< UNKNOWN marker value */
  ------------------
  |  Branch (8879:13): [True: 56.6k, False: 39.4k]
  ------------------
 8880|  56.6k|            if (! opj_j2k_read_unk(p_j2k, p_stream, &l_current_marker, p_manager)) {
  ------------------
  |  Branch (8880:17): [True: 159, False: 56.5k]
  ------------------
 8881|    159|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    159|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8882|    159|                              "Unknown marker has been detected and generated error.\n");
 8883|    159|                return OPJ_FALSE;
  ------------------
  |  |  118|    159|#define OPJ_FALSE 0
  ------------------
 8884|    159|            }
 8885|       |
 8886|  56.5k|            if (l_current_marker == J2K_MS_SOT) {
  ------------------
  |  |   73|  56.5k|#define J2K_MS_SOT 0xff90   /**< SOT marker value */
  ------------------
  |  Branch (8886:17): [True: 860, False: 55.6k]
  ------------------
 8887|    860|                break;    /* SOT marker is detected main header is completely read */
 8888|  55.6k|            } else { /* Get the marker handler from the marker ID */
 8889|  55.6k|                l_marker_handler = opj_j2k_get_marker_handler(l_current_marker);
 8890|  55.6k|            }
 8891|  56.5k|        }
 8892|       |
 8893|  95.1k|        if (l_marker_handler->id == J2K_MS_SIZ) {
  ------------------
  |  |   77|  95.1k|#define J2K_MS_SIZ 0xff51   /**< SIZ marker value */
  ------------------
  |  Branch (8893:13): [True: 9.14k, False: 86.0k]
  ------------------
 8894|       |            /* Mark required SIZ marker as found */
 8895|  9.14k|            l_has_siz = 1;
 8896|  9.14k|        }
 8897|  95.1k|        if (l_marker_handler->id == J2K_MS_COD) {
  ------------------
  |  |   78|  95.1k|#define J2K_MS_COD 0xff52   /**< COD marker value */
  ------------------
  |  Branch (8897:13): [True: 9.79k, False: 85.3k]
  ------------------
 8898|       |            /* Mark required COD marker as found */
 8899|  9.79k|            l_has_cod = 1;
 8900|  9.79k|        }
 8901|  95.1k|        if (l_marker_handler->id == J2K_MS_QCD) {
  ------------------
  |  |   82|  95.1k|#define J2K_MS_QCD 0xff5c   /**< QCD marker value */
  ------------------
  |  Branch (8901:13): [True: 10.2k, False: 84.9k]
  ------------------
 8902|       |            /* Mark required QCD marker as found */
 8903|  10.2k|            l_has_qcd = 1;
 8904|  10.2k|        }
 8905|       |
 8906|       |        /* Check if the marker is known and if it is the right place to find it */
 8907|  95.1k|        if (!(p_j2k->m_specific_param.m_decoder.m_state & l_marker_handler->states)) {
  ------------------
  |  Branch (8907:13): [True: 10, False: 95.1k]
  ------------------
 8908|     10|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     10|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8909|     10|                          "Marker is not compliant with its position\n");
 8910|     10|            return OPJ_FALSE;
  ------------------
  |  |  118|     10|#define OPJ_FALSE 0
  ------------------
 8911|     10|        }
 8912|       |
 8913|       |        /* Try to read 2 bytes (the marker size) from stream and copy them into the buffer */
 8914|  95.1k|        if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (8914:13): [True: 51, False: 95.0k]
  ------------------
 8915|  95.1k|                                 p_j2k->m_specific_param.m_decoder.m_header_data, 2, p_manager) != 2) {
 8916|     51|            opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|     51|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8917|     51|            return OPJ_FALSE;
  ------------------
  |  |  118|     51|#define OPJ_FALSE 0
  ------------------
 8918|     51|        }
 8919|       |
 8920|       |        /* read 2 bytes as the marker size */
 8921|  95.0k|        opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data, &l_marker_size,
  ------------------
  |  |   65|  95.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 8922|  95.0k|                       2);
 8923|  95.0k|        if (l_marker_size < 2) {
  ------------------
  |  Branch (8923:13): [True: 10, False: 95.0k]
  ------------------
 8924|     10|            opj_event_msg(p_manager, EVT_ERROR, "Invalid marker size\n");
  ------------------
  |  |   66|     10|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8925|     10|            return OPJ_FALSE;
  ------------------
  |  |  118|     10|#define OPJ_FALSE 0
  ------------------
 8926|     10|        }
 8927|  95.0k|        l_marker_size -= 2; /* Subtract the size of the marker ID already read */
 8928|       |
 8929|       |        /* Check if the marker size is compatible with the header data size */
 8930|  95.0k|        if (l_marker_size > p_j2k->m_specific_param.m_decoder.m_header_data_size) {
  ------------------
  |  Branch (8930:13): [True: 96, False: 94.9k]
  ------------------
 8931|     96|            OPJ_BYTE *new_header_data = (OPJ_BYTE *) opj_realloc(
 8932|     96|                                            p_j2k->m_specific_param.m_decoder.m_header_data, l_marker_size);
 8933|     96|            if (! new_header_data) {
  ------------------
  |  Branch (8933:17): [True: 0, False: 96]
  ------------------
 8934|      0|                opj_free(p_j2k->m_specific_param.m_decoder.m_header_data);
 8935|      0|                p_j2k->m_specific_param.m_decoder.m_header_data = NULL;
 8936|      0|                p_j2k->m_specific_param.m_decoder.m_header_data_size = 0;
 8937|      0|                opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read header\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8938|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8939|      0|            }
 8940|     96|            p_j2k->m_specific_param.m_decoder.m_header_data = new_header_data;
 8941|     96|            p_j2k->m_specific_param.m_decoder.m_header_data_size = l_marker_size;
 8942|     96|        }
 8943|       |
 8944|       |        /* Try to read the rest of the marker segment from stream and copy them into the buffer */
 8945|  95.0k|        if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (8945:13): [True: 185, False: 94.8k]
  ------------------
 8946|  95.0k|                                 p_j2k->m_specific_param.m_decoder.m_header_data, l_marker_size,
 8947|  95.0k|                                 p_manager) != l_marker_size) {
 8948|    185|            opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|    185|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8949|    185|            return OPJ_FALSE;
  ------------------
  |  |  118|    185|#define OPJ_FALSE 0
  ------------------
 8950|    185|        }
 8951|       |
 8952|       |        /* Read the marker segment with the correct marker handler */
 8953|  94.8k|        if (!(*(l_marker_handler->handler))(p_j2k,
  ------------------
  |  Branch (8953:13): [True: 451, False: 94.4k]
  ------------------
 8954|  94.8k|                                            p_j2k->m_specific_param.m_decoder.m_header_data, l_marker_size, p_manager)) {
 8955|    451|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    451|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8956|    451|                          "Marker handler function failed to read the marker segment\n");
 8957|    451|            return OPJ_FALSE;
  ------------------
  |  |  118|    451|#define OPJ_FALSE 0
  ------------------
 8958|    451|        }
 8959|       |
 8960|       |        /* Add the marker to the codestream index*/
 8961|  94.4k|        if (OPJ_FALSE == opj_j2k_add_mhmarker(
  ------------------
  |  |  118|  94.4k|#define OPJ_FALSE 0
  ------------------
  |  Branch (8961:13): [True: 0, False: 94.4k]
  ------------------
 8962|  94.4k|                    p_j2k->cstr_index,
 8963|  94.4k|                    l_marker_handler->id,
 8964|  94.4k|                    (OPJ_UINT32) opj_stream_tell(p_stream) - l_marker_size - 4,
 8965|  94.4k|                    l_marker_size + 4)) {
 8966|      0|            opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to add mh marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8967|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8968|      0|        }
 8969|       |
 8970|       |        /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer */
 8971|  94.4k|        if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (8971:13): [True: 267, False: 94.1k]
  ------------------
 8972|  94.4k|                                 p_j2k->m_specific_param.m_decoder.m_header_data, 2, p_manager) != 2) {
 8973|    267|            opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|    267|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8974|    267|            return OPJ_FALSE;
  ------------------
  |  |  118|    267|#define OPJ_FALSE 0
  ------------------
 8975|    267|        }
 8976|       |
 8977|       |        /* read 2 bytes as the new marker ID */
 8978|  94.1k|        opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,
  ------------------
  |  |   65|  94.1k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 8979|  94.1k|                       &l_current_marker, 2);
 8980|  94.1k|    }
 8981|       |
 8982|  7.92k|    if (l_has_siz == 0) {
  ------------------
  |  Branch (8982:9): [True: 1, False: 7.92k]
  ------------------
 8983|      1|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8984|      1|                      "required SIZ marker not found in main header\n");
 8985|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 8986|      1|    }
 8987|  7.92k|    if (l_has_cod == 0) {
  ------------------
  |  Branch (8987:9): [True: 4, False: 7.92k]
  ------------------
 8988|      4|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      4|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8989|      4|                      "required COD marker not found in main header\n");
 8990|      4|        return OPJ_FALSE;
  ------------------
  |  |  118|      4|#define OPJ_FALSE 0
  ------------------
 8991|      4|    }
 8992|  7.92k|    if (l_has_qcd == 0) {
  ------------------
  |  Branch (8992:9): [True: 3, False: 7.91k]
  ------------------
 8993|      3|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 8994|      3|                      "required QCD marker not found in main header\n");
 8995|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 8996|      3|    }
 8997|       |
 8998|  7.91k|    if (! opj_j2k_merge_ppm(&(p_j2k->m_cp), p_manager)) {
  ------------------
  |  Branch (8998:9): [True: 62, False: 7.85k]
  ------------------
 8999|     62|        opj_event_msg(p_manager, EVT_ERROR, "Failed to merge PPM data\n");
  ------------------
  |  |   66|     62|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9000|     62|        return OPJ_FALSE;
  ------------------
  |  |  118|     62|#define OPJ_FALSE 0
  ------------------
 9001|     62|    }
 9002|       |
 9003|  7.85k|    opj_event_msg(p_manager, EVT_INFO, "Main header has been correctly decoded.\n");
  ------------------
  |  |   68|  7.85k|#define EVT_INFO    4   /**< Debug event type */
  ------------------
 9004|       |
 9005|       |    /* Position of the last element if the main header */
 9006|  7.85k|    p_j2k->cstr_index->main_head_end = (OPJ_UINT32) opj_stream_tell(p_stream) - 2;
 9007|       |
 9008|       |    /* Next step: read a tile-part header */
 9009|  7.85k|    p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPHSOT;
 9010|       |
 9011|  7.85k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.85k|#define OPJ_TRUE 1
  ------------------
 9012|  7.91k|}
j2k.c:opj_j2k_read_soc:
 1931|  9.21k|{
 1932|  9.21k|    OPJ_BYTE l_data [2];
 1933|  9.21k|    OPJ_UINT32 l_marker;
 1934|       |
 1935|       |    /* preconditions */
 1936|  9.21k|    assert(p_j2k != 00);
 1937|  9.21k|    assert(p_manager != 00);
 1938|  9.21k|    assert(p_stream != 00);
 1939|       |
 1940|  9.21k|    if (opj_stream_read_data(p_stream, l_data, 2, p_manager) != 2) {
  ------------------
  |  Branch (1940:9): [True: 0, False: 9.21k]
  ------------------
 1941|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1942|      0|    }
 1943|       |
 1944|  9.21k|    opj_read_bytes(l_data, &l_marker, 2);
  ------------------
  |  |   65|  9.21k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 1945|  9.21k|    if (l_marker != J2K_MS_SOC) {
  ------------------
  |  |   72|  9.21k|#define J2K_MS_SOC 0xff4f   /**< SOC marker value */
  ------------------
  |  Branch (1945:9): [True: 0, False: 9.21k]
  ------------------
 1946|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1947|      0|    }
 1948|       |
 1949|       |    /* Next marker should be a SIZ marker in the main header */
 1950|  9.21k|    p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_MHSIZ;
 1951|       |
 1952|       |    /* FIXME move it in a index structure included in p_j2k*/
 1953|  9.21k|    p_j2k->cstr_index->main_head_start = opj_stream_tell(p_stream) - 2;
 1954|       |
 1955|  9.21k|    opj_event_msg(p_manager, EVT_INFO,
  ------------------
  |  |   68|  9.21k|#define EVT_INFO    4   /**< Debug event type */
  ------------------
 1956|  9.21k|                  "Start to read j2k main header (%" PRId64 ").\n",
 1957|  9.21k|                  p_j2k->cstr_index->main_head_start);
 1958|       |
 1959|       |    /* Add the marker to the codestream index*/
 1960|  9.21k|    if (OPJ_FALSE == opj_j2k_add_mhmarker(p_j2k->cstr_index, J2K_MS_SOC,
  ------------------
  |  |  118|  9.21k|#define OPJ_FALSE 0
  ------------------
                  if (OPJ_FALSE == opj_j2k_add_mhmarker(p_j2k->cstr_index, J2K_MS_SOC,
  ------------------
  |  |   72|  9.21k|#define J2K_MS_SOC 0xff4f   /**< SOC marker value */
  ------------------
  |  Branch (1960:9): [True: 0, False: 9.21k]
  ------------------
 1961|  9.21k|                                          p_j2k->cstr_index->main_head_start, 2)) {
 1962|      0|        opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to add mh marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1963|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1964|      0|    }
 1965|  9.21k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
 1966|  9.21k|}
j2k.c:opj_j2k_read_unk:
 5672|  56.6k|{
 5673|  56.6k|    OPJ_UINT32 l_unknown_marker;
 5674|  56.6k|    const opj_dec_memory_marker_handler_t * l_marker_handler;
 5675|  56.6k|    OPJ_UINT32 l_size_unk = 2;
 5676|       |
 5677|       |    /* preconditions*/
 5678|  56.6k|    assert(p_j2k != 00);
 5679|  56.6k|    assert(p_manager != 00);
 5680|  56.6k|    assert(p_stream != 00);
 5681|       |
 5682|  56.6k|    opj_event_msg(p_manager, EVT_WARNING, "Unknown marker\n");
  ------------------
  |  |   67|  56.6k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 5683|       |
 5684|   879k|    for (;;) {
 5685|       |        /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer*/
 5686|   879k|        if (opj_stream_read_data(p_stream,
  ------------------
  |  Branch (5686:13): [True: 143, False: 879k]
  ------------------
 5687|   879k|                                 p_j2k->m_specific_param.m_decoder.m_header_data, 2, p_manager) != 2) {
 5688|    143|            opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|    143|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5689|    143|            return OPJ_FALSE;
  ------------------
  |  |  118|    143|#define OPJ_FALSE 0
  ------------------
 5690|    143|        }
 5691|       |
 5692|       |        /* read 2 bytes as the new marker ID*/
 5693|   879k|        opj_read_bytes(p_j2k->m_specific_param.m_decoder.m_header_data,
  ------------------
  |  |   65|   879k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 5694|   879k|                       &l_unknown_marker, 2);
 5695|       |
 5696|   879k|        if (!(l_unknown_marker < 0xff00)) {
  ------------------
  |  Branch (5696:13): [True: 169k, False: 710k]
  ------------------
 5697|       |
 5698|       |            /* Get the marker handler from the marker ID*/
 5699|   169k|            l_marker_handler = opj_j2k_get_marker_handler(l_unknown_marker);
 5700|       |
 5701|   169k|            if (!(p_j2k->m_specific_param.m_decoder.m_state & l_marker_handler->states)) {
  ------------------
  |  Branch (5701:17): [True: 16, False: 169k]
  ------------------
 5702|     16|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     16|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5703|     16|                              "Marker is not compliant with its position\n");
 5704|     16|                return OPJ_FALSE;
  ------------------
  |  |  118|     16|#define OPJ_FALSE 0
  ------------------
 5705|   169k|            } else {
 5706|   169k|                if (l_marker_handler->id != J2K_MS_UNK) {
  ------------------
  |  |   99|   169k|#define J2K_MS_UNK 0        /**< UNKNOWN marker value */
  ------------------
  |  Branch (5706:21): [True: 56.5k, False: 112k]
  ------------------
 5707|       |                    /* Add the marker to the codestream index*/
 5708|  56.5k|                    if (l_marker_handler->id != J2K_MS_SOT) {
  ------------------
  |  |   73|  56.5k|#define J2K_MS_SOT 0xff90   /**< SOT marker value */
  ------------------
  |  Branch (5708:25): [True: 55.6k, False: 860]
  ------------------
 5709|  55.6k|                        OPJ_BOOL res = opj_j2k_add_mhmarker(p_j2k->cstr_index, J2K_MS_UNK,
  ------------------
  |  |   99|  55.6k|#define J2K_MS_UNK 0        /**< UNKNOWN marker value */
  ------------------
 5710|  55.6k|                                                            (OPJ_UINT32) opj_stream_tell(p_stream) - l_size_unk,
 5711|  55.6k|                                                            l_size_unk);
 5712|  55.6k|                        if (res == OPJ_FALSE) {
  ------------------
  |  |  118|  55.6k|#define OPJ_FALSE 0
  ------------------
  |  Branch (5712:29): [True: 0, False: 55.6k]
  ------------------
 5713|      0|                            opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to add mh marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5714|      0|                            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 5715|      0|                        }
 5716|  55.6k|                    }
 5717|  56.5k|                    break; /* next marker is known and well located */
 5718|   112k|                } else {
 5719|   112k|                    l_size_unk += 2;
 5720|   112k|                }
 5721|   169k|            }
 5722|   169k|        }
 5723|   879k|    }
 5724|       |
 5725|  56.5k|    *output_marker = l_marker_handler->id ;
 5726|       |
 5727|  56.5k|    return OPJ_TRUE;
  ------------------
  |  |  117|  56.5k|#define OPJ_TRUE 1
  ------------------
 5728|  56.6k|}
j2k.c:opj_j2k_add_mhmarker:
 8326|   159k|{
 8327|   159k|    assert(cstr_index != 00);
 8328|       |
 8329|       |    /* expand the list? */
 8330|   159k|    if ((cstr_index->marknum + 1) > cstr_index->maxmarknum) {
  ------------------
  |  Branch (8330:9): [True: 1.07k, False: 158k]
  ------------------
 8331|  1.07k|        opj_marker_info_t *new_marker;
 8332|  1.07k|        cstr_index->maxmarknum = (OPJ_UINT32)(100 + (OPJ_FLOAT32)
 8333|  1.07k|                                              cstr_index->maxmarknum);
 8334|  1.07k|        new_marker = (opj_marker_info_t *) opj_realloc(cstr_index->marker,
 8335|  1.07k|                     cstr_index->maxmarknum * sizeof(opj_marker_info_t));
 8336|  1.07k|        if (! new_marker) {
  ------------------
  |  Branch (8336:13): [True: 0, False: 1.07k]
  ------------------
 8337|      0|            opj_free(cstr_index->marker);
 8338|      0|            cstr_index->marker = NULL;
 8339|      0|            cstr_index->maxmarknum = 0;
 8340|      0|            cstr_index->marknum = 0;
 8341|       |            /* opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to add mh marker\n"); */
 8342|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8343|      0|        }
 8344|  1.07k|        cstr_index->marker = new_marker;
 8345|  1.07k|    }
 8346|       |
 8347|       |    /* add the marker */
 8348|   159k|    cstr_index->marker[cstr_index->marknum].type = (OPJ_UINT16)type;
 8349|   159k|    cstr_index->marker[cstr_index->marknum].pos = (OPJ_INT32)pos;
 8350|   159k|    cstr_index->marker[cstr_index->marknum].len = (OPJ_INT32)len;
 8351|   159k|    cstr_index->marknum++;
 8352|   159k|    return OPJ_TRUE;
  ------------------
  |  |  117|   159k|#define OPJ_TRUE 1
  ------------------
 8353|   159k|}
j2k.c:opj_j2k_merge_ppm:
 3923|  7.91k|{
 3924|  7.91k|    OPJ_UINT32 i, l_ppm_data_size, l_N_ppm_remaining;
 3925|       |
 3926|       |    /* preconditions */
 3927|  7.91k|    assert(p_cp != 00);
 3928|  7.91k|    assert(p_manager != 00);
 3929|  7.91k|    assert(p_cp->ppm_buffer == NULL);
 3930|       |
 3931|  7.91k|    if (p_cp->ppm == 0U) {
  ------------------
  |  Branch (3931:9): [True: 7.82k, False: 90]
  ------------------
 3932|  7.82k|        return OPJ_TRUE;
  ------------------
  |  |  117|  7.82k|#define OPJ_TRUE 1
  ------------------
 3933|  7.82k|    }
 3934|       |
 3935|     90|    l_ppm_data_size = 0U;
 3936|     90|    l_N_ppm_remaining = 0U;
 3937|  9.56k|    for (i = 0U; i < p_cp->ppm_markers_count; ++i) {
  ------------------
  |  Branch (3937:18): [True: 9.47k, False: 88]
  ------------------
 3938|  9.47k|        if (p_cp->ppm_markers[i].m_data !=
  ------------------
  |  Branch (3938:13): [True: 427, False: 9.04k]
  ------------------
 3939|  9.47k|                NULL) { /* standard doesn't seem to require contiguous Zppm */
 3940|    427|            OPJ_UINT32 l_N_ppm;
 3941|    427|            OPJ_UINT32 l_data_size = p_cp->ppm_markers[i].m_data_size;
 3942|    427|            const OPJ_BYTE* l_data = p_cp->ppm_markers[i].m_data;
 3943|       |
 3944|    427|            if (l_N_ppm_remaining >= l_data_size) {
  ------------------
  |  Branch (3944:17): [True: 228, False: 199]
  ------------------
 3945|    228|                l_N_ppm_remaining -= l_data_size;
 3946|    228|                l_data_size = 0U;
 3947|    228|            } else {
 3948|    199|                l_data += l_N_ppm_remaining;
 3949|    199|                l_data_size -= l_N_ppm_remaining;
 3950|    199|                l_N_ppm_remaining = 0U;
 3951|    199|            }
 3952|       |
 3953|    427|            if (l_data_size > 0U) {
  ------------------
  |  Branch (3953:17): [True: 199, False: 228]
  ------------------
 3954|    635|                do {
 3955|       |                    /* read Nppm */
 3956|    635|                    if (l_data_size < 4U) {
  ------------------
  |  Branch (3956:25): [True: 2, False: 633]
  ------------------
 3957|       |                        /* clean up to be done on l_cp destruction */
 3958|      2|                        opj_event_msg(p_manager, EVT_ERROR, "Not enough bytes to read Nppm\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3959|      2|                        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 3960|      2|                    }
 3961|    633|                    opj_read_bytes(l_data, &l_N_ppm, 4);
  ------------------
  |  |   65|    633|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3962|    633|                    l_data += 4;
 3963|    633|                    l_data_size -= 4;
 3964|    633|                    l_ppm_data_size +=
 3965|    633|                        l_N_ppm; /* can't overflow, max 256 markers of max 65536 bytes, that is when PPM markers are not corrupted which is checked elsewhere */
 3966|       |
 3967|    633|                    if (l_data_size >= l_N_ppm) {
  ------------------
  |  Branch (3967:25): [True: 550, False: 83]
  ------------------
 3968|    550|                        l_data_size -= l_N_ppm;
 3969|    550|                        l_data += l_N_ppm;
 3970|    550|                    } else {
 3971|     83|                        l_N_ppm_remaining = l_N_ppm - l_data_size;
 3972|     83|                        l_data_size = 0U;
 3973|     83|                    }
 3974|    633|                } while (l_data_size > 0U);
  ------------------
  |  Branch (3974:26): [True: 436, False: 197]
  ------------------
 3975|    199|            }
 3976|    427|        }
 3977|  9.47k|    }
 3978|       |
 3979|     88|    if (l_N_ppm_remaining != 0U) {
  ------------------
  |  Branch (3979:9): [True: 59, False: 29]
  ------------------
 3980|       |        /* clean up to be done on l_cp destruction */
 3981|     59|        opj_event_msg(p_manager, EVT_ERROR, "Corrupted PPM markers\n");
  ------------------
  |  |   66|     59|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3982|     59|        return OPJ_FALSE;
  ------------------
  |  |  118|     59|#define OPJ_FALSE 0
  ------------------
 3983|     59|    }
 3984|       |
 3985|     29|    p_cp->ppm_buffer = (OPJ_BYTE *) opj_malloc(l_ppm_data_size);
 3986|     29|    if (p_cp->ppm_buffer == 00) {
  ------------------
  |  Branch (3986:9): [True: 1, False: 28]
  ------------------
 3987|      1|        opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPM marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3988|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3989|      1|    }
 3990|     28|    p_cp->ppm_len = l_ppm_data_size;
 3991|     28|    l_ppm_data_size = 0U;
 3992|     28|    l_N_ppm_remaining = 0U;
 3993|  2.72k|    for (i = 0U; i < p_cp->ppm_markers_count; ++i) {
  ------------------
  |  Branch (3993:18): [True: 2.69k, False: 28]
  ------------------
 3994|  2.69k|        if (p_cp->ppm_markers[i].m_data !=
  ------------------
  |  Branch (3994:13): [True: 121, False: 2.57k]
  ------------------
 3995|  2.69k|                NULL) { /* standard doesn't seem to require contiguous Zppm */
 3996|    121|            OPJ_UINT32 l_N_ppm;
 3997|    121|            OPJ_UINT32 l_data_size = p_cp->ppm_markers[i].m_data_size;
 3998|    121|            const OPJ_BYTE* l_data = p_cp->ppm_markers[i].m_data;
 3999|       |
 4000|    121|            if (l_N_ppm_remaining >= l_data_size) {
  ------------------
  |  Branch (4000:17): [True: 21, False: 100]
  ------------------
 4001|     21|                memcpy(p_cp->ppm_buffer + l_ppm_data_size, l_data, l_data_size);
 4002|     21|                l_ppm_data_size += l_data_size;
 4003|     21|                l_N_ppm_remaining -= l_data_size;
 4004|     21|                l_data_size = 0U;
 4005|    100|            } else {
 4006|    100|                memcpy(p_cp->ppm_buffer + l_ppm_data_size, l_data, l_N_ppm_remaining);
 4007|    100|                l_ppm_data_size += l_N_ppm_remaining;
 4008|    100|                l_data += l_N_ppm_remaining;
 4009|    100|                l_data_size -= l_N_ppm_remaining;
 4010|    100|                l_N_ppm_remaining = 0U;
 4011|    100|            }
 4012|       |
 4013|    121|            if (l_data_size > 0U) {
  ------------------
  |  Branch (4013:17): [True: 100, False: 21]
  ------------------
 4014|    185|                do {
 4015|       |                    /* read Nppm */
 4016|    185|                    if (l_data_size < 4U) {
  ------------------
  |  Branch (4016:25): [True: 0, False: 185]
  ------------------
 4017|       |                        /* clean up to be done on l_cp destruction */
 4018|      0|                        opj_event_msg(p_manager, EVT_ERROR, "Not enough bytes to read Nppm\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4019|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4020|      0|                    }
 4021|    185|                    opj_read_bytes(l_data, &l_N_ppm, 4);
  ------------------
  |  |   65|    185|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 4022|    185|                    l_data += 4;
 4023|    185|                    l_data_size -= 4;
 4024|       |
 4025|    185|                    if (l_data_size >= l_N_ppm) {
  ------------------
  |  Branch (4025:25): [True: 168, False: 17]
  ------------------
 4026|    168|                        memcpy(p_cp->ppm_buffer + l_ppm_data_size, l_data, l_N_ppm);
 4027|    168|                        l_ppm_data_size += l_N_ppm;
 4028|    168|                        l_data_size -= l_N_ppm;
 4029|    168|                        l_data += l_N_ppm;
 4030|    168|                    } else {
 4031|     17|                        memcpy(p_cp->ppm_buffer + l_ppm_data_size, l_data, l_data_size);
 4032|     17|                        l_ppm_data_size += l_data_size;
 4033|     17|                        l_N_ppm_remaining = l_N_ppm - l_data_size;
 4034|     17|                        l_data_size = 0U;
 4035|     17|                    }
 4036|    185|                } while (l_data_size > 0U);
  ------------------
  |  Branch (4036:26): [True: 85, False: 100]
  ------------------
 4037|    100|            }
 4038|    121|            opj_free(p_cp->ppm_markers[i].m_data);
 4039|    121|            p_cp->ppm_markers[i].m_data = NULL;
 4040|    121|            p_cp->ppm_markers[i].m_data_size = 0U;
 4041|    121|        }
 4042|  2.69k|    }
 4043|       |
 4044|     28|    p_cp->ppm_data = p_cp->ppm_buffer;
 4045|     28|    p_cp->ppm_data_size = p_cp->ppm_len;
 4046|       |
 4047|     28|    p_cp->ppm_markers_count = 0U;
 4048|     28|    opj_free(p_cp->ppm_markers);
 4049|     28|    p_cp->ppm_markers = NULL;
 4050|       |
 4051|     28|    return OPJ_TRUE;
  ------------------
  |  |  117|     28|#define OPJ_TRUE 1
  ------------------
 4052|     28|}
j2k.c:opj_j2k_copy_default_tcp_and_create_tcd:
 9049|  7.85k|{
 9050|  7.85k|    opj_tcp_t * l_tcp = 00;
 9051|  7.85k|    opj_tcp_t * l_default_tcp = 00;
 9052|  7.85k|    OPJ_UINT32 l_nb_tiles;
 9053|  7.85k|    OPJ_UINT32 i, j;
 9054|  7.85k|    opj_tccp_t *l_current_tccp = 00;
 9055|  7.85k|    OPJ_UINT32 l_tccp_size;
 9056|  7.85k|    OPJ_UINT32 l_mct_size;
 9057|  7.85k|    opj_image_t * l_image;
 9058|  7.85k|    OPJ_UINT32 l_mcc_records_size, l_mct_records_size;
 9059|  7.85k|    opj_mct_data_t * l_src_mct_rec, *l_dest_mct_rec;
 9060|  7.85k|    opj_simple_mcc_decorrelation_data_t * l_src_mcc_rec, *l_dest_mcc_rec;
 9061|  7.85k|    OPJ_UINT32 l_offset;
 9062|       |
 9063|       |    /* preconditions */
 9064|  7.85k|    assert(p_j2k != 00);
 9065|  7.85k|    assert(p_stream != 00);
 9066|  7.85k|    assert(p_manager != 00);
 9067|       |
 9068|  7.85k|    OPJ_UNUSED(p_stream);
  ------------------
  |  |  219|  7.85k|#define OPJ_UNUSED(x) (void)x
  ------------------
 9069|       |
 9070|  7.85k|    l_image = p_j2k->m_private_image;
 9071|  7.85k|    l_nb_tiles = p_j2k->m_cp.th * p_j2k->m_cp.tw;
 9072|  7.85k|    l_tcp = p_j2k->m_cp.tcps;
 9073|  7.85k|    l_tccp_size = l_image->numcomps * (OPJ_UINT32)sizeof(opj_tccp_t);
 9074|  7.85k|    l_default_tcp = p_j2k->m_specific_param.m_decoder.m_default_tcp;
 9075|  7.85k|    l_mct_size = l_image->numcomps * l_image->numcomps * (OPJ_UINT32)sizeof(
 9076|  7.85k|                     OPJ_FLOAT32);
 9077|       |
 9078|       |    /* For each tile */
 9079|  16.7M|    for (i = 0; i < l_nb_tiles; ++i) {
  ------------------
  |  Branch (9079:17): [True: 16.7M, False: 7.85k]
  ------------------
 9080|       |        /* keep the tile-compo coding parameters pointer of the current tile coding parameters*/
 9081|  16.7M|        l_current_tccp = l_tcp->tccps;
 9082|       |        /*Copy default coding parameters into the current tile coding parameters*/
 9083|  16.7M|        memcpy(l_tcp, l_default_tcp, sizeof(opj_tcp_t));
 9084|       |        /* Initialize some values of the current tile coding parameters*/
 9085|  16.7M|        l_tcp->cod = 0;
 9086|  16.7M|        l_tcp->ppt = 0;
 9087|  16.7M|        l_tcp->ppt_data = 00;
 9088|  16.7M|        l_tcp->m_current_tile_part_number = -1;
 9089|       |        /* Remove memory not owned by this tile in case of early error return. */
 9090|  16.7M|        l_tcp->m_mct_decoding_matrix = 00;
 9091|  16.7M|        l_tcp->m_nb_max_mct_records = 0;
 9092|  16.7M|        l_tcp->m_mct_records = 00;
 9093|  16.7M|        l_tcp->m_nb_max_mcc_records = 0;
 9094|  16.7M|        l_tcp->m_mcc_records = 00;
 9095|       |        /* Reconnect the tile-compo coding parameters pointer to the current tile coding parameters*/
 9096|  16.7M|        l_tcp->tccps = l_current_tccp;
 9097|       |
 9098|       |        /* Get the mct_decoding_matrix of the dflt_tile_cp and copy them into the current tile cp*/
 9099|  16.7M|        if (l_default_tcp->m_mct_decoding_matrix) {
  ------------------
  |  Branch (9099:13): [True: 237, False: 16.7M]
  ------------------
 9100|    237|            l_tcp->m_mct_decoding_matrix = (OPJ_FLOAT32*)opj_malloc(l_mct_size);
 9101|    237|            if (! l_tcp->m_mct_decoding_matrix) {
  ------------------
  |  Branch (9101:17): [True: 0, False: 237]
  ------------------
 9102|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9103|      0|            }
 9104|    237|            memcpy(l_tcp->m_mct_decoding_matrix, l_default_tcp->m_mct_decoding_matrix,
 9105|    237|                   l_mct_size);
 9106|    237|        }
 9107|       |
 9108|       |        /* Get the mct_record of the dflt_tile_cp and copy them into the current tile cp*/
 9109|  16.7M|        l_mct_records_size = l_default_tcp->m_nb_max_mct_records * (OPJ_UINT32)sizeof(
 9110|  16.7M|                                 opj_mct_data_t);
 9111|  16.7M|        l_tcp->m_mct_records = (opj_mct_data_t*)opj_malloc(l_mct_records_size);
 9112|  16.7M|        if (! l_tcp->m_mct_records) {
  ------------------
  |  Branch (9112:13): [True: 0, False: 16.7M]
  ------------------
 9113|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9114|      0|        }
 9115|  16.7M|        memcpy(l_tcp->m_mct_records, l_default_tcp->m_mct_records, l_mct_records_size);
 9116|       |
 9117|       |        /* Copy the mct record data from dflt_tile_cp to the current tile*/
 9118|  16.7M|        l_src_mct_rec = l_default_tcp->m_mct_records;
 9119|  16.7M|        l_dest_mct_rec = l_tcp->m_mct_records;
 9120|       |
 9121|  16.7M|        for (j = 0; j < l_default_tcp->m_nb_mct_records; ++j) {
  ------------------
  |  Branch (9121:21): [True: 8.68k, False: 16.7M]
  ------------------
 9122|       |
 9123|  8.68k|            if (l_src_mct_rec->m_data) {
  ------------------
  |  Branch (9123:17): [True: 7.17k, False: 1.51k]
  ------------------
 9124|       |
 9125|  7.17k|                l_dest_mct_rec->m_data = (OPJ_BYTE*) opj_malloc(l_src_mct_rec->m_data_size);
 9126|  7.17k|                if (! l_dest_mct_rec->m_data) {
  ------------------
  |  Branch (9126:21): [True: 0, False: 7.17k]
  ------------------
 9127|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9128|      0|                }
 9129|  7.17k|                memcpy(l_dest_mct_rec->m_data, l_src_mct_rec->m_data,
 9130|  7.17k|                       l_src_mct_rec->m_data_size);
 9131|  7.17k|            }
 9132|       |
 9133|  8.68k|            ++l_src_mct_rec;
 9134|  8.68k|            ++l_dest_mct_rec;
 9135|       |            /* Update with each pass to free exactly what has been allocated on early return. */
 9136|  8.68k|            l_tcp->m_nb_max_mct_records += 1;
 9137|  8.68k|        }
 9138|       |
 9139|       |        /* Get the mcc_record of the dflt_tile_cp and copy them into the current tile cp*/
 9140|  16.7M|        l_mcc_records_size = l_default_tcp->m_nb_max_mcc_records * (OPJ_UINT32)sizeof(
 9141|  16.7M|                                 opj_simple_mcc_decorrelation_data_t);
 9142|  16.7M|        l_tcp->m_mcc_records = (opj_simple_mcc_decorrelation_data_t*) opj_malloc(
 9143|  16.7M|                                   l_mcc_records_size);
 9144|  16.7M|        if (! l_tcp->m_mcc_records) {
  ------------------
  |  Branch (9144:13): [True: 0, False: 16.7M]
  ------------------
 9145|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9146|      0|        }
 9147|  16.7M|        memcpy(l_tcp->m_mcc_records, l_default_tcp->m_mcc_records, l_mcc_records_size);
 9148|  16.7M|        l_tcp->m_nb_max_mcc_records = l_default_tcp->m_nb_max_mcc_records;
 9149|       |
 9150|       |        /* Copy the mcc record data from dflt_tile_cp to the current tile*/
 9151|  16.7M|        l_src_mcc_rec = l_default_tcp->m_mcc_records;
 9152|  16.7M|        l_dest_mcc_rec = l_tcp->m_mcc_records;
 9153|       |
 9154|   184M|        for (j = 0; j < l_default_tcp->m_nb_max_mcc_records; ++j) {
  ------------------
  |  Branch (9154:21): [True: 167M, False: 16.7M]
  ------------------
 9155|       |
 9156|   167M|            if (l_src_mcc_rec->m_decorrelation_array) {
  ------------------
  |  Branch (9156:17): [True: 588, False: 167M]
  ------------------
 9157|    588|                l_offset = (OPJ_UINT32)(l_src_mcc_rec->m_decorrelation_array -
 9158|    588|                                        l_default_tcp->m_mct_records);
 9159|    588|                l_dest_mcc_rec->m_decorrelation_array = l_tcp->m_mct_records + l_offset;
 9160|    588|            }
 9161|       |
 9162|   167M|            if (l_src_mcc_rec->m_offset_array) {
  ------------------
  |  Branch (9162:17): [True: 421, False: 167M]
  ------------------
 9163|    421|                l_offset = (OPJ_UINT32)(l_src_mcc_rec->m_offset_array -
 9164|    421|                                        l_default_tcp->m_mct_records);
 9165|    421|                l_dest_mcc_rec->m_offset_array = l_tcp->m_mct_records + l_offset;
 9166|    421|            }
 9167|       |
 9168|   167M|            ++l_src_mcc_rec;
 9169|   167M|            ++l_dest_mcc_rec;
 9170|   167M|        }
 9171|       |
 9172|       |        /* Copy all the dflt_tile_compo_cp to the current tile cp */
 9173|  16.7M|        memcpy(l_current_tccp, l_default_tcp->tccps, l_tccp_size);
 9174|       |
 9175|       |        /* Move to next tile cp*/
 9176|  16.7M|        ++l_tcp;
 9177|  16.7M|    }
 9178|       |
 9179|       |    /* Create the current tile decoder*/
 9180|  7.85k|    p_j2k->m_tcd = opj_tcd_create(OPJ_TRUE);
  ------------------
  |  |  117|  7.85k|#define OPJ_TRUE 1
  ------------------
 9181|  7.85k|    if (! p_j2k->m_tcd) {
  ------------------
  |  Branch (9181:9): [True: 0, False: 7.85k]
  ------------------
 9182|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9183|      0|    }
 9184|       |
 9185|  7.85k|    if (!opj_tcd_init(p_j2k->m_tcd, l_image, &(p_j2k->m_cp), p_j2k->m_tp)) {
  ------------------
  |  Branch (9185:9): [True: 0, False: 7.85k]
  ------------------
 9186|      0|        opj_tcd_destroy(p_j2k->m_tcd);
 9187|      0|        p_j2k->m_tcd = 00;
 9188|      0|        opj_event_msg(p_manager, EVT_ERROR, "Cannot decode tile, memory error\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9189|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9190|      0|    }
 9191|       |
 9192|  7.85k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.85k|#define OPJ_TRUE 1
  ------------------
 9193|  7.85k|}
j2k.c:opj_j2k_setup_decoding_validation:
 8504|  9.21k|{
 8505|       |    /* preconditions*/
 8506|  9.21k|    assert(p_j2k != 00);
 8507|  9.21k|    assert(p_manager != 00);
 8508|       |
 8509|  9.21k|    if (! opj_procedure_list_add_procedure(p_j2k->m_validation_list,
  ------------------
  |  Branch (8509:9): [True: 0, False: 9.21k]
  ------------------
 8510|  9.21k|                                           (opj_procedure)opj_j2k_build_decoder, p_manager)) {
 8511|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8512|      0|    }
 8513|  9.21k|    if (! opj_procedure_list_add_procedure(p_j2k->m_validation_list,
  ------------------
  |  Branch (8513:9): [True: 0, False: 9.21k]
  ------------------
 8514|  9.21k|                                           (opj_procedure)opj_j2k_decoding_validation, p_manager)) {
 8515|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8516|      0|    }
 8517|       |
 8518|       |    /* DEVELOPER CORNER, add your custom validation procedure */
 8519|  9.21k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
 8520|  9.21k|}
j2k.c:opj_j2k_build_decoder:
 8724|  9.21k|{
 8725|       |    /* add here initialization of cp
 8726|       |       copy paste of setup_decoder */
 8727|  9.21k|    (void)p_j2k;
 8728|  9.21k|    (void)p_stream;
 8729|  9.21k|    (void)p_manager;
 8730|  9.21k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
 8731|  9.21k|}
j2k.c:opj_j2k_decoding_validation:
 8800|  9.21k|{
 8801|  9.21k|    OPJ_BOOL l_is_valid = OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
 8802|       |
 8803|       |    /* preconditions*/
 8804|  9.21k|    assert(p_j2k != 00);
 8805|  9.21k|    assert(p_stream != 00);
 8806|  9.21k|    assert(p_manager != 00);
 8807|       |
 8808|  9.21k|    OPJ_UNUSED(p_stream);
  ------------------
  |  |  219|  9.21k|#define OPJ_UNUSED(x) (void)x
  ------------------
 8809|  9.21k|    OPJ_UNUSED(p_manager);
  ------------------
  |  |  219|  9.21k|#define OPJ_UNUSED(x) (void)x
  ------------------
 8810|       |
 8811|       |    /* STATE checking */
 8812|       |    /* make sure the state is at 0 */
 8813|       |#ifdef TODO_MSD
 8814|       |    l_is_valid &= (p_j2k->m_specific_param.m_decoder.m_state == J2K_DEC_STATE_NONE);
 8815|       |#endif
 8816|  9.21k|    l_is_valid &= (p_j2k->m_specific_param.m_decoder.m_state == 0x0000);
 8817|       |
 8818|       |    /* POINTER validation */
 8819|       |    /* make sure a p_j2k codec is present */
 8820|       |    /* make sure a procedure list is present */
 8821|  9.21k|    l_is_valid &= (p_j2k->m_procedure_list != 00);
 8822|       |    /* make sure a validation list is present */
 8823|  9.21k|    l_is_valid &= (p_j2k->m_validation_list != 00);
 8824|       |
 8825|       |    /* PARAMETER VALIDATION */
 8826|  9.21k|    return l_is_valid;
 8827|  9.21k|}
j2k.c:opj_j2k_exec:
 9018|  26.2k|{
 9019|  26.2k|    OPJ_BOOL(** l_procedure)(opj_j2k_t *, opj_stream_private_t *,
 9020|  26.2k|                             opj_event_mgr_t *) = 00;
 9021|  26.2k|    OPJ_BOOL l_result = OPJ_TRUE;
  ------------------
  |  |  117|  26.2k|#define OPJ_TRUE 1
  ------------------
 9022|  26.2k|    OPJ_UINT32 l_nb_proc, i;
 9023|       |
 9024|       |    /* preconditions*/
 9025|  26.2k|    assert(p_procedure_list != 00);
 9026|  26.2k|    assert(p_j2k != 00);
 9027|  26.2k|    assert(p_stream != 00);
 9028|  26.2k|    assert(p_manager != 00);
 9029|       |
 9030|  26.2k|    l_nb_proc = opj_procedure_list_get_nb_procedures(p_procedure_list);
 9031|  26.2k|    l_procedure = (OPJ_BOOL(**)(opj_j2k_t *, opj_stream_private_t *,
 9032|  26.2k|                                opj_event_mgr_t *)) opj_procedure_list_get_first_procedure(p_procedure_list);
 9033|       |
 9034|  70.9k|    for (i = 0; i < l_nb_proc; ++i) {
  ------------------
  |  Branch (9034:17): [True: 44.6k, False: 26.2k]
  ------------------
 9035|  44.6k|        l_result = l_result && ((*l_procedure)(p_j2k, p_stream, p_manager));
  ------------------
  |  Branch (9035:20): [True: 43.3k, False: 1.36k]
  |  Branch (9035:32): [True: 39.7k, False: 3.57k]
  ------------------
 9036|  44.6k|        ++l_procedure;
 9037|  44.6k|    }
 9038|       |
 9039|       |    /* and clear the procedure list at the end.*/
 9040|  26.2k|    opj_procedure_list_clear(p_procedure_list);
 9041|  26.2k|    return l_result;
 9042|  26.2k|}
j2k.c:opj_j2k_tcp_destroy:
 9317|  18.0M|{
 9318|  18.0M|    if (p_tcp == 00) {
  ------------------
  |  Branch (9318:9): [True: 0, False: 18.0M]
  ------------------
 9319|      0|        return;
 9320|      0|    }
 9321|       |
 9322|  18.0M|    if (p_tcp->ppt_markers != 00) {
  ------------------
  |  Branch (9322:9): [True: 71, False: 18.0M]
  ------------------
 9323|     71|        OPJ_UINT32 i;
 9324|  4.18k|        for (i = 0U; i < p_tcp->ppt_markers_count; ++i) {
  ------------------
  |  Branch (9324:22): [True: 4.11k, False: 71]
  ------------------
 9325|  4.11k|            if (p_tcp->ppt_markers[i].m_data != NULL) {
  ------------------
  |  Branch (9325:17): [True: 99, False: 4.01k]
  ------------------
 9326|     99|                opj_free(p_tcp->ppt_markers[i].m_data);
 9327|     99|            }
 9328|  4.11k|        }
 9329|     71|        p_tcp->ppt_markers_count = 0U;
 9330|     71|        opj_free(p_tcp->ppt_markers);
 9331|     71|        p_tcp->ppt_markers = NULL;
 9332|     71|    }
 9333|       |
 9334|  18.0M|    if (p_tcp->ppt_buffer != 00) {
  ------------------
  |  Branch (9334:9): [True: 79, False: 18.0M]
  ------------------
 9335|     79|        opj_free(p_tcp->ppt_buffer);
 9336|     79|        p_tcp->ppt_buffer = 00;
 9337|     79|    }
 9338|       |
 9339|  18.0M|    if (p_tcp->tccps != 00) {
  ------------------
  |  Branch (9339:9): [True: 18.0M, False: 1.53k]
  ------------------
 9340|  18.0M|        opj_free(p_tcp->tccps);
 9341|  18.0M|        p_tcp->tccps = 00;
 9342|  18.0M|    }
 9343|       |
 9344|  18.0M|    if (p_tcp->m_mct_coding_matrix != 00) {
  ------------------
  |  Branch (9344:9): [True: 0, False: 18.0M]
  ------------------
 9345|      0|        opj_free(p_tcp->m_mct_coding_matrix);
 9346|      0|        p_tcp->m_mct_coding_matrix = 00;
 9347|      0|    }
 9348|       |
 9349|  18.0M|    if (p_tcp->m_mct_decoding_matrix != 00) {
  ------------------
  |  Branch (9349:9): [True: 298, False: 18.0M]
  ------------------
 9350|    298|        opj_free(p_tcp->m_mct_decoding_matrix);
 9351|    298|        p_tcp->m_mct_decoding_matrix = 00;
 9352|    298|    }
 9353|       |
 9354|  18.0M|    if (p_tcp->m_mcc_records) {
  ------------------
  |  Branch (9354:9): [True: 16.7M, False: 1.26M]
  ------------------
 9355|  16.7M|        opj_free(p_tcp->m_mcc_records);
 9356|  16.7M|        p_tcp->m_mcc_records = 00;
 9357|  16.7M|        p_tcp->m_nb_max_mcc_records = 0;
 9358|  16.7M|        p_tcp->m_nb_mcc_records = 0;
 9359|  16.7M|    }
 9360|       |
 9361|  18.0M|    if (p_tcp->m_mct_records) {
  ------------------
  |  Branch (9361:9): [True: 16.7M, False: 1.26M]
  ------------------
 9362|  16.7M|        opj_mct_data_t * l_mct_data = p_tcp->m_mct_records;
 9363|  16.7M|        OPJ_UINT32 i;
 9364|       |
 9365|  16.7M|        for (i = 0; i < p_tcp->m_nb_mct_records; ++i) {
  ------------------
  |  Branch (9365:21): [True: 9.42k, False: 16.7M]
  ------------------
 9366|  9.42k|            if (l_mct_data->m_data) {
  ------------------
  |  Branch (9366:17): [True: 7.42k, False: 1.99k]
  ------------------
 9367|  7.42k|                opj_free(l_mct_data->m_data);
 9368|  7.42k|                l_mct_data->m_data = 00;
 9369|  7.42k|            }
 9370|       |
 9371|  9.42k|            ++l_mct_data;
 9372|  9.42k|        }
 9373|       |
 9374|  16.7M|        opj_free(p_tcp->m_mct_records);
 9375|  16.7M|        p_tcp->m_mct_records = 00;
 9376|  16.7M|    }
 9377|       |
 9378|  18.0M|    if (p_tcp->mct_norms != 00) {
  ------------------
  |  Branch (9378:9): [True: 0, False: 18.0M]
  ------------------
 9379|      0|        opj_free(p_tcp->mct_norms);
 9380|      0|        p_tcp->mct_norms = 00;
 9381|      0|    }
 9382|       |
 9383|  18.0M|    opj_j2k_tcp_data_destroy(p_tcp);
 9384|       |
 9385|  18.0M|}
j2k.c:opj_j2k_cp_destroy:
 9397|  9.21k|{
 9398|  9.21k|    OPJ_UINT32 l_nb_tiles;
 9399|  9.21k|    opj_tcp_t * l_current_tile = 00;
 9400|       |
 9401|  9.21k|    if (p_cp == 00) {
  ------------------
  |  Branch (9401:9): [True: 0, False: 9.21k]
  ------------------
 9402|      0|        return;
 9403|      0|    }
 9404|  9.21k|    if (p_cp->tcps != 00) {
  ------------------
  |  Branch (9404:9): [True: 8.81k, False: 405]
  ------------------
 9405|  8.81k|        OPJ_UINT32 i;
 9406|  8.81k|        l_current_tile = p_cp->tcps;
 9407|  8.81k|        l_nb_tiles = p_cp->th * p_cp->tw;
 9408|       |
 9409|  18.0M|        for (i = 0U; i < l_nb_tiles; ++i) {
  ------------------
  |  Branch (9409:22): [True: 18.0M, False: 8.81k]
  ------------------
 9410|  18.0M|            opj_j2k_tcp_destroy(l_current_tile);
 9411|  18.0M|            ++l_current_tile;
 9412|  18.0M|        }
 9413|  8.81k|        opj_free(p_cp->tcps);
 9414|  8.81k|        p_cp->tcps = 00;
 9415|  8.81k|    }
 9416|  9.21k|    if (p_cp->ppm_markers != 00) {
  ------------------
  |  Branch (9416:9): [True: 87, False: 9.12k]
  ------------------
 9417|     87|        OPJ_UINT32 i;
 9418|  10.3k|        for (i = 0U; i < p_cp->ppm_markers_count; ++i) {
  ------------------
  |  Branch (9418:22): [True: 10.2k, False: 87]
  ------------------
 9419|  10.2k|            if (p_cp->ppm_markers[i].m_data != NULL) {
  ------------------
  |  Branch (9419:17): [True: 430, False: 9.85k]
  ------------------
 9420|    430|                opj_free(p_cp->ppm_markers[i].m_data);
 9421|    430|            }
 9422|  10.2k|        }
 9423|     87|        p_cp->ppm_markers_count = 0U;
 9424|     87|        opj_free(p_cp->ppm_markers);
 9425|     87|        p_cp->ppm_markers = NULL;
 9426|     87|    }
 9427|  9.21k|    opj_free(p_cp->ppm_buffer);
 9428|  9.21k|    p_cp->ppm_buffer = 00;
 9429|  9.21k|    p_cp->ppm_data =
 9430|  9.21k|        NULL; /* ppm_data belongs to the allocated buffer pointed by ppm_buffer */
 9431|  9.21k|    opj_free(p_cp->comment);
 9432|  9.21k|    p_cp->comment = 00;
 9433|  9.21k|    if (! p_cp->m_is_decoder) {
  ------------------
  |  Branch (9433:9): [True: 0, False: 9.21k]
  ------------------
 9434|      0|        opj_free(p_cp->m_specific_param.m_enc.m_matrice);
 9435|      0|        p_cp->m_specific_param.m_enc.m_matrice = 00;
 9436|      0|    }
 9437|  9.21k|}
j2k.c:opj_j2k_get_marker_handler:
 9197|   335k|{
 9198|   335k|    const opj_dec_memory_marker_handler_t *e;
 9199|  6.50M|    for (e = j2k_memory_marker_handler_tab; e->id != 0; ++e) {
  ------------------
  |  Branch (9199:45): [True: 6.33M, False: 169k]
  ------------------
 9200|  6.33M|        if (e->id == p_id) {
  ------------------
  |  Branch (9200:13): [True: 166k, False: 6.16M]
  ------------------
 9201|   166k|            break; /* we find a handler corresponding to the marker ID*/
 9202|   166k|        }
 9203|  6.33M|    }
 9204|   335k|    return e;
 9205|   335k|}
j2k.c:opj_j2k_read_sot:
 4378|  9.89k|{
 4379|  9.89k|    opj_cp_t *l_cp = 00;
 4380|  9.89k|    opj_tcp_t *l_tcp = 00;
 4381|  9.89k|    OPJ_UINT32 l_tot_len, l_num_parts = 0;
 4382|  9.89k|    OPJ_UINT32 l_current_part;
 4383|  9.89k|    OPJ_UINT32 l_tile_x, l_tile_y;
 4384|       |
 4385|       |    /* preconditions */
 4386|       |
 4387|  9.89k|    assert(p_j2k != 00);
 4388|  9.89k|    assert(p_manager != 00);
 4389|       |
 4390|  9.89k|    if (! opj_j2k_get_sot_values(p_header_data, p_header_size,
  ------------------
  |  Branch (4390:9): [True: 2, False: 9.88k]
  ------------------
 4391|  9.89k|                                 &(p_j2k->m_current_tile_number), &l_tot_len, &l_current_part, &l_num_parts,
 4392|  9.89k|                                 p_manager)) {
 4393|      2|        opj_event_msg(p_manager, EVT_ERROR, "Error reading SOT marker\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4394|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 4395|      2|    }
 4396|       |#ifdef DEBUG_VERBOSE
 4397|       |    fprintf(stderr, "SOT %d %d %d %d\n",
 4398|       |            p_j2k->m_current_tile_number, l_tot_len, l_current_part, l_num_parts);
 4399|       |#endif
 4400|       |
 4401|  9.88k|    l_cp = &(p_j2k->m_cp);
 4402|       |
 4403|       |    /* testcase 2.pdf.SIGFPE.706.1112 */
 4404|  9.88k|    if (p_j2k->m_current_tile_number >= l_cp->tw * l_cp->th) {
  ------------------
  |  Branch (4404:9): [True: 49, False: 9.83k]
  ------------------
 4405|     49|        opj_event_msg(p_manager, EVT_ERROR, "Invalid tile number %d\n",
  ------------------
  |  |   66|     49|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4406|     49|                      p_j2k->m_current_tile_number);
 4407|     49|        return OPJ_FALSE;
  ------------------
  |  |  118|     49|#define OPJ_FALSE 0
  ------------------
 4408|     49|    }
 4409|       |
 4410|  9.83k|    l_tcp = &l_cp->tcps[p_j2k->m_current_tile_number];
 4411|  9.83k|    l_tile_x = p_j2k->m_current_tile_number % l_cp->tw;
 4412|  9.83k|    l_tile_y = p_j2k->m_current_tile_number / l_cp->tw;
 4413|       |
 4414|  9.83k|    if (p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec < 0 ||
  ------------------
  |  Branch (4414:9): [True: 9.83k, False: 0]
  ------------------
 4415|  9.83k|            p_j2k->m_current_tile_number == (OPJ_UINT32)
  ------------------
  |  Branch (4415:13): [True: 0, False: 0]
  ------------------
 4416|  9.83k|            p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec) {
 4417|       |        /* Do only this check if we decode all tile part headers, or if */
 4418|       |        /* we decode one precise tile. Otherwise the m_current_tile_part_number */
 4419|       |        /* might not be valid */
 4420|       |        /* Fixes issue with id_000020,sig_06,src_001958,op_flip4,pos_149 */
 4421|       |        /* of https://github.com/uclouvain/openjpeg/issues/939 */
 4422|       |        /* We must avoid reading twice the same tile part number for a given tile */
 4423|       |        /* so as to avoid various issues, like opj_j2k_merge_ppt being called */
 4424|       |        /* several times. */
 4425|       |        /* ISO 15444-1 A.4.2 Start of tile-part (SOT) mandates that tile parts */
 4426|       |        /* should appear in increasing order. */
 4427|  9.83k|        if (l_tcp->m_current_tile_part_number + 1 != (OPJ_INT32)l_current_part) {
  ------------------
  |  Branch (4427:13): [True: 84, False: 9.75k]
  ------------------
 4428|     84|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     84|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4429|     84|                          "Invalid tile part index for tile number %d. "
 4430|     84|                          "Got %d, expected %d\n",
 4431|     84|                          p_j2k->m_current_tile_number,
 4432|     84|                          l_current_part,
 4433|     84|                          l_tcp->m_current_tile_part_number + 1);
 4434|     84|            return OPJ_FALSE;
  ------------------
  |  |  118|     84|#define OPJ_FALSE 0
  ------------------
 4435|     84|        }
 4436|  9.83k|    }
 4437|       |
 4438|  9.75k|    l_tcp->m_current_tile_part_number = (OPJ_INT32) l_current_part;
 4439|       |
 4440|       |#ifdef USE_JPWL
 4441|       |    if (l_cp->correct) {
 4442|       |
 4443|       |        OPJ_UINT32 tileno = p_j2k->m_current_tile_number;
 4444|       |        static OPJ_UINT32 backup_tileno = 0;
 4445|       |
 4446|       |        /* tileno is negative or larger than the number of tiles!!! */
 4447|       |        if (tileno > (l_cp->tw * l_cp->th)) {
 4448|       |            opj_event_msg(p_manager, EVT_ERROR,
 4449|       |                          "JPWL: bad tile number (%d out of a maximum of %d)\n",
 4450|       |                          tileno, (l_cp->tw * l_cp->th));
 4451|       |            if (!JPWL_ASSUME) {
 4452|       |                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 4453|       |                return OPJ_FALSE;
 4454|       |            }
 4455|       |            /* we try to correct */
 4456|       |            tileno = backup_tileno;
 4457|       |            opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n"
 4458|       |                          "- setting tile number to %d\n",
 4459|       |                          tileno);
 4460|       |        }
 4461|       |
 4462|       |        /* keep your private count of tiles */
 4463|       |        backup_tileno++;
 4464|       |    };
 4465|       |#endif /* USE_JPWL */
 4466|       |
 4467|       |    /* look for the tile in the list of already processed tile (in parts). */
 4468|       |    /* Optimization possible here with a more complex data structure and with the removing of tiles */
 4469|       |    /* since the time taken by this function can only grow at the time */
 4470|       |
 4471|       |    /* PSot should be equal to zero or >=14 or <= 2^32-1 */
 4472|  9.75k|    if ((l_tot_len != 0) && (l_tot_len < 14)) {
  ------------------
  |  Branch (4472:9): [True: 2.95k, False: 6.79k]
  |  Branch (4472:29): [True: 3, False: 2.95k]
  ------------------
 4473|      3|        if (l_tot_len ==
  ------------------
  |  Branch (4473:13): [True: 1, False: 2]
  ------------------
 4474|      3|                12) { /* MSD: Special case for the PHR data which are read by kakadu*/
 4475|      1|            opj_event_msg(p_manager, EVT_WARNING, "Empty SOT marker detected: Psot=%d.\n",
  ------------------
  |  |   67|      1|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 4476|      1|                          l_tot_len);
 4477|      2|        } else {
 4478|      2|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4479|      2|                          "Psot value is not correct regards to the JPEG2000 norm: %d.\n", l_tot_len);
 4480|      2|            return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 4481|      2|        }
 4482|      3|    }
 4483|       |
 4484|       |#ifdef USE_JPWL
 4485|       |    if (l_cp->correct) {
 4486|       |
 4487|       |        /* totlen is negative or larger than the bytes left!!! */
 4488|       |        if (/*(l_tot_len < 0) ||*/ (l_tot_len >
 4489|       |                                    p_header_size)) {   /* FIXME it seems correct; for info in V1 -> (p_stream_numbytesleft(p_stream) + 8))) { */
 4490|       |            opj_event_msg(p_manager, EVT_ERROR,
 4491|       |                          "JPWL: bad tile byte size (%d bytes against %d bytes left)\n",
 4492|       |                          l_tot_len,
 4493|       |                          p_header_size);  /* FIXME it seems correct; for info in V1 -> p_stream_numbytesleft(p_stream) + 8); */
 4494|       |            if (!JPWL_ASSUME) {
 4495|       |                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 4496|       |                return OPJ_FALSE;
 4497|       |            }
 4498|       |            /* we try to correct */
 4499|       |            l_tot_len = 0;
 4500|       |            opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n"
 4501|       |                          "- setting Psot to %d => assuming it is the last tile\n",
 4502|       |                          l_tot_len);
 4503|       |        }
 4504|       |    };
 4505|       |#endif /* USE_JPWL */
 4506|       |
 4507|       |    /* Ref A.4.2: Psot could be equal zero if it is the last tile-part of the codestream.*/
 4508|  9.75k|    if (!l_tot_len) {
  ------------------
  |  Branch (4508:9): [True: 6.79k, False: 2.95k]
  ------------------
 4509|  6.79k|        opj_event_msg(p_manager, EVT_INFO,
  ------------------
  |  |   68|  6.79k|#define EVT_INFO    4   /**< Debug event type */
  ------------------
 4510|  6.79k|                      "Psot value of the current tile-part is equal to zero, "
 4511|  6.79k|                      "we assuming it is the last tile-part of the codestream.\n");
 4512|  6.79k|        p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;
 4513|  6.79k|    }
 4514|       |
 4515|  9.75k|    if (l_tcp->m_nb_tile_parts != 0 && l_current_part >= l_tcp->m_nb_tile_parts) {
  ------------------
  |  Branch (4515:9): [True: 33, False: 9.72k]
  |  Branch (4515:40): [True: 2, False: 31]
  ------------------
 4516|       |        /* Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2851 */
 4517|      2|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4518|      2|                      "In SOT marker, TPSot (%d) is not valid regards to the previous "
 4519|      2|                      "number of tile-part (%d), giving up\n", l_current_part,
 4520|      2|                      l_tcp->m_nb_tile_parts);
 4521|      2|        p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;
 4522|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 4523|      2|    }
 4524|       |
 4525|  9.75k|    if (l_num_parts !=
  ------------------
  |  Branch (4525:9): [True: 9.61k, False: 138]
  ------------------
 4526|  9.75k|            0) { /* Number of tile-part header is provided by this tile-part header */
 4527|  9.61k|        l_num_parts += p_j2k->m_specific_param.m_decoder.m_nb_tile_parts_correction;
 4528|       |        /* Useful to manage the case of textGBR.jp2 file because two values of TNSot are allowed: the correct numbers of
 4529|       |         * tile-parts for that tile and zero (A.4.2 of 15444-1 : 2002). */
 4530|  9.61k|        if (l_tcp->m_nb_tile_parts) {
  ------------------
  |  Branch (4530:13): [True: 30, False: 9.58k]
  ------------------
 4531|     30|            if (l_current_part >= l_tcp->m_nb_tile_parts) {
  ------------------
  |  Branch (4531:17): [True: 0, False: 30]
  ------------------
 4532|      0|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4533|      0|                              "In SOT marker, TPSot (%d) is not valid regards to the current "
 4534|      0|                              "number of tile-part (%d), giving up\n", l_current_part,
 4535|      0|                              l_tcp->m_nb_tile_parts);
 4536|      0|                p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;
 4537|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4538|      0|            }
 4539|     30|        }
 4540|  9.61k|        if (l_current_part >= l_num_parts) {
  ------------------
  |  Branch (4540:13): [True: 1, False: 9.61k]
  ------------------
 4541|       |            /* testcase 451.pdf.SIGSEGV.ce9.3723 */
 4542|      1|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4543|      1|                          "In SOT marker, TPSot (%d) is not valid regards to the current "
 4544|      1|                          "number of tile-part (header) (%d), giving up\n", l_current_part, l_num_parts);
 4545|      1|            p_j2k->m_specific_param.m_decoder.m_last_tile_part = 1;
 4546|      1|            return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 4547|      1|        }
 4548|  9.61k|        l_tcp->m_nb_tile_parts = l_num_parts;
 4549|  9.61k|    }
 4550|       |
 4551|       |    /* If know the number of tile part header we will check if we didn't read the last*/
 4552|  9.75k|    if (l_tcp->m_nb_tile_parts) {
  ------------------
  |  Branch (4552:9): [True: 9.61k, False: 137]
  ------------------
 4553|  9.61k|        if (l_tcp->m_nb_tile_parts == (l_current_part + 1)) {
  ------------------
  |  Branch (4553:13): [True: 2.54k, False: 7.06k]
  ------------------
 4554|  2.54k|            p_j2k->m_specific_param.m_decoder.m_can_decode =
 4555|  2.54k|                1; /* Process the last tile-part header*/
 4556|  2.54k|        }
 4557|  9.61k|    }
 4558|       |
 4559|  9.75k|    if (!p_j2k->m_specific_param.m_decoder.m_last_tile_part) {
  ------------------
  |  Branch (4559:9): [True: 2.95k, False: 6.79k]
  ------------------
 4560|       |        /* Keep the size of data to skip after this marker */
 4561|  2.95k|        p_j2k->m_specific_param.m_decoder.m_sot_length = l_tot_len -
 4562|  2.95k|                12; /* SOT_marker_size = 12 */
 4563|  6.79k|    } else {
 4564|       |        /* FIXME: need to be computed from the number of bytes remaining in the codestream */
 4565|  6.79k|        p_j2k->m_specific_param.m_decoder.m_sot_length = 0;
 4566|  6.79k|    }
 4567|       |
 4568|  9.75k|    p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPH;
 4569|       |
 4570|       |    /* Check if the current tile is outside the area we want decode or not corresponding to the tile index*/
 4571|  9.75k|    if (p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec == -1) {
  ------------------
  |  Branch (4571:9): [True: 9.75k, False: 0]
  ------------------
 4572|  9.75k|        p_j2k->m_specific_param.m_decoder.m_skip_data =
 4573|  9.75k|            (l_tile_x < p_j2k->m_specific_param.m_decoder.m_start_tile_x)
  ------------------
  |  Branch (4573:13): [True: 0, False: 9.75k]
  ------------------
 4574|  9.75k|            || (l_tile_x >= p_j2k->m_specific_param.m_decoder.m_end_tile_x)
  ------------------
  |  Branch (4574:16): [True: 181, False: 9.56k]
  ------------------
 4575|  9.75k|            || (l_tile_y < p_j2k->m_specific_param.m_decoder.m_start_tile_y)
  ------------------
  |  Branch (4575:16): [True: 0, False: 9.56k]
  ------------------
 4576|  9.75k|            || (l_tile_y >= p_j2k->m_specific_param.m_decoder.m_end_tile_y);
  ------------------
  |  Branch (4576:16): [True: 148, False: 9.42k]
  ------------------
 4577|  9.75k|    } else {
 4578|      0|        assert(p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec >= 0);
 4579|      0|        p_j2k->m_specific_param.m_decoder.m_skip_data =
 4580|      0|            (p_j2k->m_current_tile_number != (OPJ_UINT32)
 4581|      0|             p_j2k->m_specific_param.m_decoder.m_tile_ind_to_dec);
 4582|      0|    }
 4583|       |
 4584|       |    /* Index */
 4585|  9.75k|    if (p_j2k->cstr_index) {
  ------------------
  |  Branch (4585:9): [True: 9.75k, False: 0]
  ------------------
 4586|  9.75k|        assert(p_j2k->cstr_index->tile_index != 00);
 4587|  9.75k|        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tileno =
 4588|  9.75k|            p_j2k->m_current_tile_number;
 4589|  9.75k|        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_tpsno =
 4590|  9.75k|            l_current_part;
 4591|       |
 4592|  9.75k|        if (l_num_parts != 0) {
  ------------------
  |  Branch (4592:13): [True: 9.61k, False: 138]
  ------------------
 4593|  9.61k|            p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].nb_tps =
 4594|  9.61k|                l_num_parts;
 4595|  9.61k|            p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps =
 4596|  9.61k|                l_num_parts;
 4597|       |
 4598|  9.61k|            if (!p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index) {
  ------------------
  |  Branch (4598:17): [True: 9.58k, False: 29]
  ------------------
 4599|  9.58k|                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index =
 4600|  9.58k|                    (opj_tp_index_t*)opj_calloc(l_num_parts, sizeof(opj_tp_index_t));
 4601|  9.58k|                if (!p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index) {
  ------------------
  |  Branch (4601:21): [True: 0, False: 9.58k]
  ------------------
 4602|      0|                    opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4603|      0|                                  "Not enough memory to read SOT marker. Tile index allocation failed\n");
 4604|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4605|      0|                }
 4606|  9.58k|            } else {
 4607|     29|                opj_tp_index_t *new_tp_index = (opj_tp_index_t *) opj_realloc(
 4608|     29|                                                   p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index,
 4609|     29|                                                   l_num_parts * sizeof(opj_tp_index_t));
 4610|     29|                if (! new_tp_index) {
  ------------------
  |  Branch (4610:21): [True: 0, False: 29]
  ------------------
 4611|      0|                    opj_free(p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index);
 4612|      0|                    p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index = NULL;
 4613|      0|                    opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4614|      0|                                  "Not enough memory to read SOT marker. Tile index allocation failed\n");
 4615|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4616|      0|                }
 4617|     29|                p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index =
 4618|     29|                    new_tp_index;
 4619|     29|            }
 4620|  9.61k|        } else {
 4621|    138|            /*if (!p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index)*/ {
 4622|       |
 4623|    138|                if (!p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index) {
  ------------------
  |  Branch (4623:21): [True: 137, False: 1]
  ------------------
 4624|    137|                    p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps = 10;
 4625|    137|                    p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index =
 4626|    137|                        (opj_tp_index_t*)opj_calloc(
 4627|    137|                            p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps,
 4628|    137|                            sizeof(opj_tp_index_t));
 4629|    137|                    if (!p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index) {
  ------------------
  |  Branch (4629:25): [True: 0, False: 137]
  ------------------
 4630|      0|                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps = 0;
 4631|      0|                        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4632|      0|                                      "Not enough memory to read SOT marker. Tile index allocation failed\n");
 4633|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4634|      0|                    }
 4635|    137|                }
 4636|       |
 4637|    138|                if (l_current_part >=
  ------------------
  |  Branch (4637:21): [True: 0, False: 138]
  ------------------
 4638|    138|                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps) {
 4639|      0|                    opj_tp_index_t *new_tp_index;
 4640|      0|                    p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps =
 4641|      0|                        l_current_part + 1;
 4642|      0|                    new_tp_index = (opj_tp_index_t *) opj_realloc(
 4643|      0|                                       p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index,
 4644|      0|                                       p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps *
 4645|      0|                                       sizeof(opj_tp_index_t));
 4646|      0|                    if (! new_tp_index) {
  ------------------
  |  Branch (4646:25): [True: 0, False: 0]
  ------------------
 4647|      0|                        opj_free(p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index);
 4648|      0|                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index = NULL;
 4649|      0|                        p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].current_nb_tps = 0;
 4650|      0|                        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4651|      0|                                      "Not enough memory to read SOT marker. Tile index allocation failed\n");
 4652|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4653|      0|                    }
 4654|      0|                    p_j2k->cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index =
 4655|      0|                        new_tp_index;
 4656|      0|                }
 4657|    138|            }
 4658|       |
 4659|    138|        }
 4660|       |
 4661|  9.75k|    }
 4662|       |
 4663|       |    /* FIXME move this onto a separate method to call before reading any SOT, remove part about main_end header, use a index struct inside p_j2k */
 4664|       |    /* if (p_j2k->cstr_info) {
 4665|       |       if (l_tcp->first) {
 4666|       |       if (tileno == 0) {
 4667|       |       p_j2k->cstr_info->main_head_end = p_stream_tell(p_stream) - 13;
 4668|       |       }
 4669|       |
 4670|       |       p_j2k->cstr_info->tile[tileno].tileno = tileno;
 4671|       |       p_j2k->cstr_info->tile[tileno].start_pos = p_stream_tell(p_stream) - 12;
 4672|       |       p_j2k->cstr_info->tile[tileno].end_pos = p_j2k->cstr_info->tile[tileno].start_pos + totlen - 1;
 4673|       |       p_j2k->cstr_info->tile[tileno].num_tps = numparts;
 4674|       |
 4675|       |       if (numparts) {
 4676|       |       p_j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_malloc(numparts * sizeof(opj_tp_info_t));
 4677|       |       }
 4678|       |       else {
 4679|       |       p_j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_malloc(10 * sizeof(opj_tp_info_t)); // Fixme (10)
 4680|       |       }
 4681|       |       }
 4682|       |       else {
 4683|       |       p_j2k->cstr_info->tile[tileno].end_pos += totlen;
 4684|       |       }
 4685|       |
 4686|       |       p_j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos = p_stream_tell(p_stream) - 12;
 4687|       |       p_j2k->cstr_info->tile[tileno].tp[partno].tp_end_pos =
 4688|       |       p_j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos + totlen - 1;
 4689|       |       }*/
 4690|  9.75k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.75k|#define OPJ_TRUE 1
  ------------------
 4691|  9.75k|}
j2k.c:opj_j2k_get_sot_values:
 4352|  13.0k|{
 4353|       |    /* preconditions */
 4354|  13.0k|    assert(p_header_data != 00);
 4355|  13.0k|    assert(p_manager != 00);
 4356|       |
 4357|       |    /* Size of this marker is fixed = 12 (we have already read marker and its size)*/
 4358|  13.0k|    if (p_header_size != 8) {
  ------------------
  |  Branch (4358:9): [True: 2, False: 13.0k]
  ------------------
 4359|      2|        opj_event_msg(p_manager, EVT_ERROR, "Error reading SOT marker\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4360|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 4361|      2|    }
 4362|       |
 4363|  13.0k|    opj_read_bytes(p_header_data, p_tile_no, 2);    /* Isot */
  ------------------
  |  |   65|  13.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 4364|  13.0k|    p_header_data += 2;
 4365|  13.0k|    opj_read_bytes(p_header_data, p_tot_len, 4);    /* Psot */
  ------------------
  |  |   65|  13.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 4366|  13.0k|    p_header_data += 4;
 4367|  13.0k|    opj_read_bytes(p_header_data, p_current_part, 1); /* TPsot */
  ------------------
  |  |   65|  13.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 4368|  13.0k|    ++p_header_data;
 4369|  13.0k|    opj_read_bytes(p_header_data, p_num_parts, 1);  /* TNsot */
  ------------------
  |  |   65|  13.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 4370|  13.0k|    ++p_header_data;
 4371|  13.0k|    return OPJ_TRUE;
  ------------------
  |  |  117|  13.0k|#define OPJ_TRUE 1
  ------------------
 4372|  13.0k|}
j2k.c:opj_j2k_read_cod:
 2667|  9.81k|{
 2668|       |    /* loop */
 2669|  9.81k|    OPJ_UINT32 i;
 2670|  9.81k|    OPJ_UINT32 l_tmp;
 2671|  9.81k|    opj_cp_t *l_cp = 00;
 2672|  9.81k|    opj_tcp_t *l_tcp = 00;
 2673|  9.81k|    opj_image_t *l_image = 00;
 2674|       |
 2675|       |    /* preconditions */
 2676|  9.81k|    assert(p_header_data != 00);
 2677|  9.81k|    assert(p_j2k != 00);
 2678|  9.81k|    assert(p_manager != 00);
 2679|       |
 2680|  9.81k|    l_image = p_j2k->m_private_image;
 2681|  9.81k|    l_cp = &(p_j2k->m_cp);
 2682|       |
 2683|       |    /* If we are in the first tile-part header of the current tile */
 2684|  9.81k|    l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ?
  ------------------
  |  Branch (2684:13): [True: 47, False: 9.76k]
  ------------------
 2685|     47|            &l_cp->tcps[p_j2k->m_current_tile_number] :
 2686|  9.81k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
 2687|       |
 2688|       |#if 0
 2689|       |    /* This check was added per https://github.com/uclouvain/openjpeg/commit/daed8cc9195555e101ab708a501af2dfe6d5e001 */
 2690|       |    /* but this is no longer necessary to handle issue476.jp2 */
 2691|       |    /* and this actually cause issues on legit files. See https://github.com/uclouvain/openjpeg/issues/1043 */
 2692|       |    /* Only one COD per tile */
 2693|       |    if (l_tcp->cod) {
 2694|       |        opj_event_msg(p_manager, EVT_ERROR,
 2695|       |                      "COD marker already read. No more than one COD marker per tile.\n");
 2696|       |        return OPJ_FALSE;
 2697|       |    }
 2698|       |#endif
 2699|  9.81k|    l_tcp->cod = 1;
 2700|       |
 2701|       |    /* Make sure room is sufficient */
 2702|  9.81k|    if (p_header_size < 5) {
  ------------------
  |  Branch (2702:9): [True: 3, False: 9.81k]
  ------------------
 2703|      3|        opj_event_msg(p_manager, EVT_ERROR, "Error reading COD marker\n");
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2704|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 2705|      3|    }
 2706|       |
 2707|  9.81k|    opj_read_bytes(p_header_data, &l_tcp->csty, 1);         /* Scod */
  ------------------
  |  |   65|  9.81k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2708|  9.81k|    ++p_header_data;
 2709|       |    /* Make sure we know how to decode this */
 2710|  9.81k|    if ((l_tcp->csty & ~(OPJ_UINT32)(J2K_CP_CSTY_PRT | J2K_CP_CSTY_SOP |
  ------------------
  |  |   54|  9.81k|#define J2K_CP_CSTY_PRT 0x01
  ------------------
                  if ((l_tcp->csty & ~(OPJ_UINT32)(J2K_CP_CSTY_PRT | J2K_CP_CSTY_SOP |
  ------------------
  |  |   55|  9.81k|#define J2K_CP_CSTY_SOP 0x02
  ------------------
  |  Branch (2710:9): [True: 3, False: 9.81k]
  ------------------
 2711|  9.81k|                                     J2K_CP_CSTY_EPH)) != 0U) {
  ------------------
  |  |   56|  9.81k|#define J2K_CP_CSTY_EPH 0x04
  ------------------
 2712|      3|        opj_event_msg(p_manager, EVT_ERROR, "Unknown Scod value in COD marker\n");
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2713|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 2714|      3|    }
 2715|  9.81k|    opj_read_bytes(p_header_data, &l_tmp, 1);                       /* SGcod (A) */
  ------------------
  |  |   65|  9.81k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2716|  9.81k|    ++p_header_data;
 2717|  9.81k|    l_tcp->prg = (OPJ_PROG_ORDER) l_tmp;
 2718|       |    /* Make sure progression order is valid */
 2719|  9.81k|    if (l_tcp->prg > OPJ_CPRL) {
  ------------------
  |  Branch (2719:9): [True: 611, False: 9.19k]
  ------------------
 2720|    611|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    611|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2721|    611|                      "Unknown progression order in COD marker\n");
 2722|    611|        l_tcp->prg = OPJ_PROG_UNKNOWN;
 2723|    611|    }
 2724|  9.81k|    opj_read_bytes(p_header_data, &l_tcp->numlayers, 2);    /* SGcod (B) */
  ------------------
  |  |   65|  9.81k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2725|  9.81k|    p_header_data += 2;
 2726|       |
 2727|  9.81k|    if ((l_tcp->numlayers < 1U) || (l_tcp->numlayers > 65535U)) {
  ------------------
  |  Branch (2727:9): [True: 3, False: 9.80k]
  |  Branch (2727:36): [True: 0, False: 9.80k]
  ------------------
 2728|      3|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2729|      3|                      "Invalid number of layers in COD marker : %d not in range [1-65535]\n",
 2730|      3|                      l_tcp->numlayers);
 2731|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 2732|      3|    }
 2733|       |
 2734|       |    /* If user didn't set a number layer to decode take the max specify in the codestream. */
 2735|  9.80k|    if (l_cp->m_specific_param.m_dec.m_layer) {
  ------------------
  |  Branch (2735:9): [True: 0, False: 9.80k]
  ------------------
 2736|      0|        l_tcp->num_layers_to_decode = l_cp->m_specific_param.m_dec.m_layer;
 2737|  9.80k|    } else {
 2738|  9.80k|        l_tcp->num_layers_to_decode = l_tcp->numlayers;
 2739|  9.80k|    }
 2740|       |
 2741|  9.80k|    opj_read_bytes(p_header_data, &l_tcp->mct, 1);          /* SGcod (C) */
  ------------------
  |  |   65|  9.80k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2742|  9.80k|    ++p_header_data;
 2743|       |
 2744|  9.80k|    if (l_tcp->mct > 1) {
  ------------------
  |  Branch (2744:9): [True: 9, False: 9.79k]
  ------------------
 2745|      9|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      9|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2746|      9|                      "Invalid multiple component transformation\n");
 2747|      9|        return OPJ_FALSE;
  ------------------
  |  |  118|      9|#define OPJ_FALSE 0
  ------------------
 2748|      9|    }
 2749|       |
 2750|  9.79k|    p_header_size -= 5;
 2751|  48.8k|    for (i = 0; i < l_image->numcomps; ++i) {
  ------------------
  |  Branch (2751:17): [True: 39.0k, False: 9.79k]
  ------------------
 2752|  39.0k|        l_tcp->tccps[i].csty = l_tcp->csty & J2K_CCP_CSTY_PRT;
  ------------------
  |  |   57|  39.0k|#define J2K_CCP_CSTY_PRT 0x01
  ------------------
 2753|  39.0k|    }
 2754|       |
 2755|  9.79k|    if (! opj_j2k_read_SPCod_SPCoc(p_j2k, 0, p_header_data, &p_header_size,
  ------------------
  |  Branch (2755:9): [True: 31, False: 9.76k]
  ------------------
 2756|  9.79k|                                   p_manager)) {
 2757|     31|        opj_event_msg(p_manager, EVT_ERROR, "Error reading COD marker\n");
  ------------------
  |  |   66|     31|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2758|     31|        return OPJ_FALSE;
  ------------------
  |  |  118|     31|#define OPJ_FALSE 0
  ------------------
 2759|     31|    }
 2760|       |
 2761|  9.76k|    if (p_header_size != 0) {
  ------------------
  |  Branch (2761:9): [True: 2, False: 9.76k]
  ------------------
 2762|      2|        opj_event_msg(p_manager, EVT_ERROR, "Error reading COD marker\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2763|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 2764|      2|    }
 2765|       |
 2766|       |    /* Apply the coding style to other components of the current tile or the m_default_tcp*/
 2767|  9.76k|    opj_j2k_copy_tile_component_parameters(p_j2k);
 2768|       |
 2769|       |    /* Index */
 2770|       |#ifdef WIP_REMOVE_MSD
 2771|       |    if (p_j2k->cstr_info) {
 2772|       |        /*opj_codestream_info_t *l_cstr_info = p_j2k->cstr_info;*/
 2773|       |        p_j2k->cstr_info->prog = l_tcp->prg;
 2774|       |        p_j2k->cstr_info->numlayers = l_tcp->numlayers;
 2775|       |        p_j2k->cstr_info->numdecompos = (OPJ_INT32*) opj_malloc(
 2776|       |                                            l_image->numcomps * sizeof(OPJ_UINT32));
 2777|       |        if (!p_j2k->cstr_info->numdecompos) {
 2778|       |            return OPJ_FALSE;
 2779|       |        }
 2780|       |        for (i = 0; i < l_image->numcomps; ++i) {
 2781|       |            p_j2k->cstr_info->numdecompos[i] = l_tcp->tccps[i].numresolutions - 1;
 2782|       |        }
 2783|       |    }
 2784|       |#endif
 2785|       |
 2786|  9.76k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.76k|#define OPJ_TRUE 1
  ------------------
 2787|  9.76k|}
j2k.c:opj_j2k_read_SPCod_SPCoc:
10683|  10.0k|{
10684|  10.0k|    OPJ_UINT32 i, l_tmp;
10685|  10.0k|    opj_cp_t *l_cp = NULL;
10686|  10.0k|    opj_tcp_t *l_tcp = NULL;
10687|  10.0k|    opj_tccp_t *l_tccp = NULL;
10688|  10.0k|    OPJ_BYTE * l_current_ptr = NULL;
10689|       |
10690|       |    /* preconditions */
10691|  10.0k|    assert(p_j2k != 00);
10692|  10.0k|    assert(p_manager != 00);
10693|  10.0k|    assert(p_header_data != 00);
10694|       |
10695|  10.0k|    l_cp = &(p_j2k->m_cp);
10696|  10.0k|    l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ?
  ------------------
  |  Branch (10696:13): [True: 66, False: 9.96k]
  ------------------
10697|     66|            &l_cp->tcps[p_j2k->m_current_tile_number] :
10698|  10.0k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
10699|       |
10700|       |    /* precondition again */
10701|  10.0k|    assert(compno < p_j2k->m_private_image->numcomps);
10702|       |
10703|  10.0k|    l_tccp = &l_tcp->tccps[compno];
10704|  10.0k|    l_current_ptr = p_header_data;
10705|       |
10706|       |    /* make sure room is sufficient */
10707|  10.0k|    if (*p_header_size < 5) {
  ------------------
  |  Branch (10707:9): [True: 6, False: 10.0k]
  ------------------
10708|      6|        opj_event_msg(p_manager, EVT_ERROR, "Error reading SPCod SPCoc element\n");
  ------------------
  |  |   66|      6|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10709|      6|        return OPJ_FALSE;
  ------------------
  |  |  118|      6|#define OPJ_FALSE 0
  ------------------
10710|      6|    }
10711|       |
10712|       |    /* SPcod (D) / SPcoc (A) */
10713|  10.0k|    opj_read_bytes(l_current_ptr, &l_tccp->numresolutions, 1);
  ------------------
  |  |   65|  10.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
10714|  10.0k|    ++l_tccp->numresolutions;  /* tccp->numresolutions = read() + 1 */
10715|  10.0k|    if (l_tccp->numresolutions > OPJ_J2K_MAXRLVLS) {
  ------------------
  |  |  152|  10.0k|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  ------------------
  |  Branch (10715:9): [True: 5, False: 10.0k]
  ------------------
10716|      5|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      5|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10717|      5|                      "Invalid value for numresolutions : %d, max value is set in openjpeg.h at %d\n",
10718|      5|                      l_tccp->numresolutions, OPJ_J2K_MAXRLVLS);
  ------------------
  |  |  152|      5|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  ------------------
10719|      5|        return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
10720|      5|    }
10721|  10.0k|    ++l_current_ptr;
10722|       |
10723|       |    /* If user wants to remove more resolutions than the codestream contains, return error */
10724|  10.0k|    if (l_cp->m_specific_param.m_dec.m_reduce >= l_tccp->numresolutions) {
  ------------------
  |  Branch (10724:9): [True: 0, False: 10.0k]
  ------------------
10725|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10726|      0|                      "Error decoding component %d.\nThe number of resolutions "
10727|      0|                      "to remove (%d) is greater or equal than the number "
10728|      0|                      "of resolutions of this component (%d)\nModify the cp_reduce parameter.\n\n",
10729|      0|                      compno, l_cp->m_specific_param.m_dec.m_reduce, l_tccp->numresolutions);
10730|      0|        p_j2k->m_specific_param.m_decoder.m_state |=
10731|      0|            0x8000;/* FIXME J2K_DEC_STATE_ERR;*/
10732|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10733|      0|    }
10734|       |
10735|       |    /* SPcod (E) / SPcoc (B) */
10736|  10.0k|    opj_read_bytes(l_current_ptr, &l_tccp->cblkw, 1);
  ------------------
  |  |   65|  10.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
10737|  10.0k|    ++l_current_ptr;
10738|  10.0k|    l_tccp->cblkw += 2;
10739|       |
10740|       |    /* SPcod (F) / SPcoc (C) */
10741|  10.0k|    opj_read_bytes(l_current_ptr, &l_tccp->cblkh, 1);
  ------------------
  |  |   65|  10.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
10742|  10.0k|    ++l_current_ptr;
10743|  10.0k|    l_tccp->cblkh += 2;
10744|       |
10745|  10.0k|    if ((l_tccp->cblkw > 10) || (l_tccp->cblkh > 10) ||
  ------------------
  |  Branch (10745:9): [True: 5, False: 10.0k]
  |  Branch (10745:33): [True: 8, False: 10.0k]
  ------------------
10746|  10.0k|            ((l_tccp->cblkw + l_tccp->cblkh) > 12)) {
  ------------------
  |  Branch (10746:13): [True: 1, False: 10.0k]
  ------------------
10747|     14|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     14|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10748|     14|                      "Error reading SPCod SPCoc element, Invalid cblkw/cblkh combination\n");
10749|     14|        return OPJ_FALSE;
  ------------------
  |  |  118|     14|#define OPJ_FALSE 0
  ------------------
10750|     14|    }
10751|       |
10752|       |    /* SPcod (G) / SPcoc (D) */
10753|  10.0k|    opj_read_bytes(l_current_ptr, &l_tccp->cblksty, 1);
  ------------------
  |  |   65|  10.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
10754|  10.0k|    ++l_current_ptr;
10755|  10.0k|    if ((l_tccp->cblksty & J2K_CCP_CBLKSTY_HTMIXED) != 0) {
  ------------------
  |  |   65|  10.0k|#define J2K_CCP_CBLKSTY_HTMIXED 0x80  /**< MIXED mode HT codeblocks */
  ------------------
  |  Branch (10755:9): [True: 2, False: 10.0k]
  ------------------
10756|       |        /* We do not support HT mixed mode yet.  For conformance, it should be supported.*/
10757|      2|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10758|      2|                      "Error reading SPCod SPCoc element. Unsupported Mixed HT code-block style found\n");
10759|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
10760|      2|    }
10761|       |
10762|       |    /* SPcod (H) / SPcoc (E) */
10763|  10.0k|    opj_read_bytes(l_current_ptr, &l_tccp->qmfbid, 1);
  ------------------
  |  |   65|  10.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
10764|  10.0k|    ++l_current_ptr;
10765|       |
10766|  10.0k|    if (l_tccp->qmfbid > 1) {
  ------------------
  |  Branch (10766:9): [True: 8, False: 9.99k]
  ------------------
10767|      8|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      8|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10768|      8|                      "Error reading SPCod SPCoc element, Invalid transformation found\n");
10769|      8|        return OPJ_FALSE;
  ------------------
  |  |  118|      8|#define OPJ_FALSE 0
  ------------------
10770|      8|    }
10771|       |
10772|  9.99k|    *p_header_size = *p_header_size - 5;
10773|       |
10774|       |    /* use custom precinct size ? */
10775|  9.99k|    if (l_tccp->csty & J2K_CCP_CSTY_PRT) {
  ------------------
  |  |   57|  9.99k|#define J2K_CCP_CSTY_PRT 0x01
  ------------------
  |  Branch (10775:9): [True: 5.36k, False: 4.63k]
  ------------------
10776|  5.36k|        if (*p_header_size < l_tccp->numresolutions) {
  ------------------
  |  Branch (10776:13): [True: 3, False: 5.36k]
  ------------------
10777|      3|            opj_event_msg(p_manager, EVT_ERROR, "Error reading SPCod SPCoc element\n");
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10778|      3|            return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
10779|      3|        }
10780|       |
10781|       |        /* SPcod (I_i) / SPcoc (F_i) */
10782|  12.7k|        for (i = 0; i < l_tccp->numresolutions; ++i) {
  ------------------
  |  Branch (10782:21): [True: 7.36k, False: 5.35k]
  ------------------
10783|  7.36k|            opj_read_bytes(l_current_ptr, &l_tmp, 1);
  ------------------
  |  |   65|  7.36k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
10784|  7.36k|            ++l_current_ptr;
10785|       |            /* Precinct exponent 0 is only allowed for lowest resolution level (Table A.21) */
10786|  7.36k|            if ((i != 0) && (((l_tmp & 0xf) == 0) || ((l_tmp >> 4) == 0))) {
  ------------------
  |  Branch (10786:17): [True: 2.00k, False: 5.36k]
  |  Branch (10786:30): [True: 4, False: 1.99k]
  |  Branch (10786:54): [True: 1, False: 1.99k]
  ------------------
10787|      5|                opj_event_msg(p_manager, EVT_ERROR, "Invalid precinct size\n");
  ------------------
  |  |   66|      5|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10788|      5|                return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
10789|      5|            }
10790|  7.35k|            l_tccp->prcw[i] = l_tmp & 0xf;
10791|  7.35k|            l_tccp->prch[i] = l_tmp >> 4;
10792|  7.35k|        }
10793|       |
10794|  5.35k|        *p_header_size = *p_header_size - l_tccp->numresolutions;
10795|  5.35k|    } else {
10796|       |        /* set default size for the precinct width and height */
10797|  34.5k|        for (i = 0; i < l_tccp->numresolutions; ++i) {
  ------------------
  |  Branch (10797:21): [True: 29.8k, False: 4.63k]
  ------------------
10798|  29.8k|            l_tccp->prcw[i] = 15;
10799|  29.8k|            l_tccp->prch[i] = 15;
10800|  29.8k|        }
10801|  4.63k|    }
10802|       |
10803|       |#ifdef WIP_REMOVE_MSD
10804|       |    /* INDEX >> */
10805|       |    if (p_j2k->cstr_info && compno == 0) {
10806|       |        OPJ_UINT32 l_data_size = l_tccp->numresolutions * sizeof(OPJ_UINT32);
10807|       |
10808|       |        p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblkh =
10809|       |            l_tccp->cblkh;
10810|       |        p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblkw =
10811|       |            l_tccp->cblkw;
10812|       |        p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].numresolutions
10813|       |            = l_tccp->numresolutions;
10814|       |        p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].cblksty =
10815|       |            l_tccp->cblksty;
10816|       |        p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].tccp_info[compno].qmfbid =
10817|       |            l_tccp->qmfbid;
10818|       |
10819|       |        memcpy(p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].pdx, l_tccp->prcw,
10820|       |               l_data_size);
10821|       |        memcpy(p_j2k->cstr_info->tile[p_j2k->m_current_tile_number].pdy, l_tccp->prch,
10822|       |               l_data_size);
10823|       |    }
10824|       |    /* << INDEX */
10825|       |#endif
10826|       |
10827|  9.99k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.99k|#define OPJ_TRUE 1
  ------------------
10828|  9.99k|}
j2k.c:opj_j2k_copy_tile_component_parameters:
10831|  9.76k|{
10832|       |    /* loop */
10833|  9.76k|    OPJ_UINT32 i;
10834|  9.76k|    opj_cp_t *l_cp = NULL;
10835|  9.76k|    opj_tcp_t *l_tcp = NULL;
10836|  9.76k|    opj_tccp_t *l_ref_tccp = NULL, *l_copied_tccp = NULL;
10837|  9.76k|    OPJ_UINT32 l_prc_size;
10838|       |
10839|       |    /* preconditions */
10840|  9.76k|    assert(p_j2k != 00);
10841|       |
10842|  9.76k|    l_cp = &(p_j2k->m_cp);
10843|  9.76k|    l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH)
  ------------------
  |  Branch (10843:13): [True: 43, False: 9.72k]
  ------------------
10844|  9.76k|            ?
10845|     43|            &l_cp->tcps[p_j2k->m_current_tile_number] :
10846|  9.76k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
10847|       |
10848|  9.76k|    l_ref_tccp = &l_tcp->tccps[0];
10849|  9.76k|    l_copied_tccp = l_ref_tccp + 1;
10850|  9.76k|    l_prc_size = l_ref_tccp->numresolutions * (OPJ_UINT32)sizeof(OPJ_UINT32);
10851|       |
10852|  38.9k|    for (i = 1; i < p_j2k->m_private_image->numcomps; ++i) {
  ------------------
  |  Branch (10852:17): [True: 29.2k, False: 9.76k]
  ------------------
10853|  29.2k|        l_copied_tccp->numresolutions = l_ref_tccp->numresolutions;
10854|  29.2k|        l_copied_tccp->cblkw = l_ref_tccp->cblkw;
10855|  29.2k|        l_copied_tccp->cblkh = l_ref_tccp->cblkh;
10856|  29.2k|        l_copied_tccp->cblksty = l_ref_tccp->cblksty;
10857|  29.2k|        l_copied_tccp->qmfbid = l_ref_tccp->qmfbid;
10858|  29.2k|        memcpy(l_copied_tccp->prcw, l_ref_tccp->prcw, l_prc_size);
10859|  29.2k|        memcpy(l_copied_tccp->prch, l_ref_tccp->prch, l_prc_size);
10860|  29.2k|        ++l_copied_tccp;
10861|  29.2k|    }
10862|  9.76k|}
j2k.c:opj_j2k_read_coc:
 2944|    244|{
 2945|    244|    opj_cp_t *l_cp = NULL;
 2946|    244|    opj_tcp_t *l_tcp = NULL;
 2947|    244|    opj_image_t *l_image = NULL;
 2948|    244|    OPJ_UINT32 l_comp_room;
 2949|    244|    OPJ_UINT32 l_comp_no;
 2950|       |
 2951|       |    /* preconditions */
 2952|    244|    assert(p_header_data != 00);
 2953|    244|    assert(p_j2k != 00);
 2954|    244|    assert(p_manager != 00);
 2955|       |
 2956|    244|    l_cp = &(p_j2k->m_cp);
 2957|    244|    l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH)
  ------------------
  |  Branch (2957:13): [True: 22, False: 222]
  ------------------
 2958|    244|            ?
 2959|     22|            &l_cp->tcps[p_j2k->m_current_tile_number] :
 2960|    244|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
 2961|    244|    l_image = p_j2k->m_private_image;
 2962|       |
 2963|    244|    l_comp_room = l_image->numcomps <= 256 ? 1 : 2;
  ------------------
  |  Branch (2963:19): [True: 112, False: 132]
  ------------------
 2964|       |
 2965|       |    /* make sure room is sufficient*/
 2966|    244|    if (p_header_size < l_comp_room + 1) {
  ------------------
  |  Branch (2966:9): [True: 3, False: 241]
  ------------------
 2967|      3|        opj_event_msg(p_manager, EVT_ERROR, "Error reading COC marker\n");
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2968|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 2969|      3|    }
 2970|    241|    p_header_size -= l_comp_room + 1;
 2971|       |
 2972|    241|    opj_read_bytes(p_header_data, &l_comp_no,
  ------------------
  |  |   65|    241|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2973|    241|                   l_comp_room);                 /* Ccoc */
 2974|    241|    p_header_data += l_comp_room;
 2975|    241|    if (l_comp_no >= l_image->numcomps) {
  ------------------
  |  Branch (2975:9): [True: 6, False: 235]
  ------------------
 2976|      6|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      6|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2977|      6|                      "Error reading COC marker (bad number of components)\n");
 2978|      6|        return OPJ_FALSE;
  ------------------
  |  |  118|      6|#define OPJ_FALSE 0
  ------------------
 2979|      6|    }
 2980|       |
 2981|    235|    opj_read_bytes(p_header_data, &l_tcp->tccps[l_comp_no].csty,
  ------------------
  |  |   65|    235|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2982|    235|                   1);                  /* Scoc */
 2983|    235|    ++p_header_data ;
 2984|       |
 2985|    235|    if (! opj_j2k_read_SPCod_SPCoc(p_j2k, l_comp_no, p_header_data, &p_header_size,
  ------------------
  |  Branch (2985:9): [True: 12, False: 223]
  ------------------
 2986|    235|                                   p_manager)) {
 2987|     12|        opj_event_msg(p_manager, EVT_ERROR, "Error reading COC marker\n");
  ------------------
  |  |   66|     12|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2988|     12|        return OPJ_FALSE;
  ------------------
  |  |  118|     12|#define OPJ_FALSE 0
  ------------------
 2989|     12|    }
 2990|       |
 2991|    223|    if (p_header_size != 0) {
  ------------------
  |  Branch (2991:9): [True: 4, False: 219]
  ------------------
 2992|      4|        opj_event_msg(p_manager, EVT_ERROR, "Error reading COC marker\n");
  ------------------
  |  |   66|      4|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2993|      4|        return OPJ_FALSE;
  ------------------
  |  |  118|      4|#define OPJ_FALSE 0
  ------------------
 2994|      4|    }
 2995|    219|    return OPJ_TRUE;
  ------------------
  |  |  117|    219|#define OPJ_TRUE 1
  ------------------
 2996|    223|}
j2k.c:opj_j2k_read_rgn:
 5180|  3.20k|{
 5181|  3.20k|    OPJ_UINT32 l_nb_comp;
 5182|  3.20k|    opj_image_t * l_image = 00;
 5183|       |
 5184|  3.20k|    opj_cp_t *l_cp = 00;
 5185|  3.20k|    opj_tcp_t *l_tcp = 00;
 5186|  3.20k|    OPJ_UINT32 l_comp_room, l_comp_no, l_roi_sty;
 5187|       |
 5188|       |    /* preconditions*/
 5189|  3.20k|    assert(p_header_data != 00);
 5190|  3.20k|    assert(p_j2k != 00);
 5191|  3.20k|    assert(p_manager != 00);
 5192|       |
 5193|  3.20k|    l_image = p_j2k->m_private_image;
 5194|  3.20k|    l_nb_comp = l_image->numcomps;
 5195|       |
 5196|  3.20k|    if (l_nb_comp <= 256) {
  ------------------
  |  Branch (5196:9): [True: 2.90k, False: 300]
  ------------------
 5197|  2.90k|        l_comp_room = 1;
 5198|  2.90k|    } else {
 5199|    300|        l_comp_room = 2;
 5200|    300|    }
 5201|       |
 5202|  3.20k|    if (p_header_size != 2 + l_comp_room) {
  ------------------
  |  Branch (5202:9): [True: 4, False: 3.19k]
  ------------------
 5203|      4|        opj_event_msg(p_manager, EVT_ERROR, "Error reading RGN marker\n");
  ------------------
  |  |   66|      4|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5204|      4|        return OPJ_FALSE;
  ------------------
  |  |  118|      4|#define OPJ_FALSE 0
  ------------------
 5205|      4|    }
 5206|       |
 5207|  3.19k|    l_cp = &(p_j2k->m_cp);
 5208|  3.19k|    l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ?
  ------------------
  |  Branch (5208:13): [True: 2.68k, False: 509]
  ------------------
 5209|  2.68k|            &l_cp->tcps[p_j2k->m_current_tile_number] :
 5210|  3.19k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
 5211|       |
 5212|  3.19k|    opj_read_bytes(p_header_data, &l_comp_no, l_comp_room);         /* Crgn */
  ------------------
  |  |   65|  3.19k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 5213|  3.19k|    p_header_data += l_comp_room;
 5214|  3.19k|    opj_read_bytes(p_header_data, &l_roi_sty,
  ------------------
  |  |   65|  3.19k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 5215|  3.19k|                   1);                                     /* Srgn */
 5216|  3.19k|    ++p_header_data;
 5217|       |
 5218|       |#ifdef USE_JPWL
 5219|       |    if (l_cp->correct) {
 5220|       |        /* totlen is negative or larger than the bytes left!!! */
 5221|       |        if (l_comp_room >= l_nb_comp) {
 5222|       |            opj_event_msg(p_manager, EVT_ERROR,
 5223|       |                          "JPWL: bad component number in RGN (%d when there are only %d)\n",
 5224|       |                          l_comp_room, l_nb_comp);
 5225|       |            if (!JPWL_ASSUME) {
 5226|       |                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 5227|       |                return OPJ_FALSE;
 5228|       |            }
 5229|       |        }
 5230|       |    };
 5231|       |#endif /* USE_JPWL */
 5232|       |
 5233|       |    /* testcase 3635.pdf.asan.77.2930 */
 5234|  3.19k|    if (l_comp_no >= l_nb_comp) {
  ------------------
  |  Branch (5234:9): [True: 2, False: 3.19k]
  ------------------
 5235|      2|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5236|      2|                      "bad component number in RGN (%d when there are only %d)\n",
 5237|      2|                      l_comp_no, l_nb_comp);
 5238|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 5239|      2|    }
 5240|       |
 5241|  3.19k|    opj_read_bytes(p_header_data,
  ------------------
  |  |   65|  3.19k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 5242|  3.19k|                   (OPJ_UINT32 *)(&(l_tcp->tccps[l_comp_no].roishift)), 1);  /* SPrgn */
 5243|  3.19k|    ++p_header_data;
 5244|       |
 5245|  3.19k|    return OPJ_TRUE;
  ------------------
  |  |  117|  3.19k|#define OPJ_TRUE 1
  ------------------
 5246|       |
 5247|  3.19k|}
j2k.c:opj_j2k_read_qcd:
 3071|  10.4k|{
 3072|       |    /* preconditions */
 3073|  10.4k|    assert(p_header_data != 00);
 3074|  10.4k|    assert(p_j2k != 00);
 3075|  10.4k|    assert(p_manager != 00);
 3076|       |
 3077|  10.4k|    if (! opj_j2k_read_SQcd_SQcc(p_j2k, 0, p_header_data, &p_header_size,
  ------------------
  |  Branch (3077:9): [True: 1, False: 10.4k]
  ------------------
 3078|  10.4k|                                 p_manager)) {
 3079|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading QCD marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3080|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3081|      1|    }
 3082|       |
 3083|  10.4k|    if (p_header_size != 0) {
  ------------------
  |  Branch (3083:9): [True: 17, False: 10.4k]
  ------------------
 3084|     17|        opj_event_msg(p_manager, EVT_ERROR, "Error reading QCD marker\n");
  ------------------
  |  |   66|     17|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3085|     17|        return OPJ_FALSE;
  ------------------
  |  |  118|     17|#define OPJ_FALSE 0
  ------------------
 3086|     17|    }
 3087|       |
 3088|       |    /* Apply the quantization parameters to other components of the current tile or the m_default_tcp */
 3089|  10.4k|    opj_j2k_copy_tile_quantization_parameters(p_j2k);
 3090|       |
 3091|  10.4k|    return OPJ_TRUE;
  ------------------
  |  |  117|  10.4k|#define OPJ_TRUE 1
  ------------------
 3092|  10.4k|}
j2k.c:opj_j2k_read_SQcd_SQcc:
11024|  11.8k|{
11025|       |    /* loop*/
11026|  11.8k|    OPJ_UINT32 l_band_no;
11027|  11.8k|    opj_cp_t *l_cp = 00;
11028|  11.8k|    opj_tcp_t *l_tcp = 00;
11029|  11.8k|    opj_tccp_t *l_tccp = 00;
11030|  11.8k|    OPJ_BYTE * l_current_ptr = 00;
11031|  11.8k|    OPJ_UINT32 l_tmp, l_num_band;
11032|       |
11033|       |    /* preconditions*/
11034|  11.8k|    assert(p_j2k != 00);
11035|  11.8k|    assert(p_manager != 00);
11036|  11.8k|    assert(p_header_data != 00);
11037|       |
11038|  11.8k|    l_cp = &(p_j2k->m_cp);
11039|       |    /* come from tile part header or main header ?*/
11040|  11.8k|    l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH)
  ------------------
  |  Branch (11040:13): [True: 273, False: 11.5k]
  ------------------
11041|  11.8k|            ?
11042|    273|            &l_cp->tcps[p_j2k->m_current_tile_number] :
11043|  11.8k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
11044|       |
11045|       |    /* precondition again*/
11046|  11.8k|    assert(p_comp_no <  p_j2k->m_private_image->numcomps);
11047|       |
11048|  11.8k|    l_tccp = &l_tcp->tccps[p_comp_no];
11049|  11.8k|    l_current_ptr = p_header_data;
11050|       |
11051|  11.8k|    if (*p_header_size < 1) {
  ------------------
  |  Branch (11051:9): [True: 4, False: 11.8k]
  ------------------
11052|      4|        opj_event_msg(p_manager, EVT_ERROR, "Error reading SQcd or SQcc element\n");
  ------------------
  |  |   66|      4|#define EVT_ERROR   1   /**< Error event type */
  ------------------
11053|      4|        return OPJ_FALSE;
  ------------------
  |  |  118|      4|#define OPJ_FALSE 0
  ------------------
11054|      4|    }
11055|  11.8k|    *p_header_size -= 1;
11056|       |
11057|  11.8k|    opj_read_bytes(l_current_ptr, &l_tmp, 1);                       /* Sqcx */
  ------------------
  |  |   65|  11.8k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
11058|  11.8k|    ++l_current_ptr;
11059|       |
11060|  11.8k|    l_tccp->qntsty = l_tmp & 0x1f;
11061|  11.8k|    l_tccp->numgbits = l_tmp >> 5;
11062|  11.8k|    if (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) {
  ------------------
  |  |   67|  11.8k|#define J2K_CCP_QNTSTY_SIQNT 1
  ------------------
  |  Branch (11062:9): [True: 782, False: 11.0k]
  ------------------
11063|    782|        l_num_band = 1;
11064|  11.0k|    } else {
11065|  11.0k|        l_num_band = (l_tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) ?
  ------------------
  |  |   66|  11.0k|#define J2K_CCP_QNTSTY_NOQNT 0
  ------------------
  |  Branch (11065:22): [True: 9.61k, False: 1.44k]
  ------------------
11066|  9.61k|                     (*p_header_size) :
11067|  11.0k|                     (*p_header_size) / 2;
11068|       |
11069|  11.0k|        if (l_num_band > OPJ_J2K_MAXBANDS) {
  ------------------
  |  |  153|  11.0k|#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
  |  |  ------------------
  |  |  |  |  152|  11.0k|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  |  |  ------------------
  ------------------
  |  Branch (11069:13): [True: 133, False: 10.9k]
  ------------------
11070|    133|            opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|    133|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
11071|    133|                          "While reading CCP_QNTSTY element inside QCD or QCC marker segment, "
11072|    133|                          "number of subbands (%d) is greater to OPJ_J2K_MAXBANDS (%d). So we limit the number of elements stored to "
11073|    133|                          "OPJ_J2K_MAXBANDS (%d) and skip the rest. \n", l_num_band, OPJ_J2K_MAXBANDS,
  ------------------
  |  |  153|    133|#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
  |  |  ------------------
  |  |  |  |  152|    133|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  |  |  ------------------
  ------------------
11074|    133|                          OPJ_J2K_MAXBANDS);
  ------------------
  |  |  153|    133|#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
  |  |  ------------------
  |  |  |  |  152|    133|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  |  |  ------------------
  ------------------
11075|       |            /*return OPJ_FALSE;*/
11076|    133|        }
11077|  11.0k|    }
11078|       |
11079|       |#ifdef USE_JPWL
11080|       |    if (l_cp->correct) {
11081|       |
11082|       |        /* if JPWL is on, we check whether there are too many subbands */
11083|       |        if (/*(l_num_band < 0) ||*/ (l_num_band >= OPJ_J2K_MAXBANDS)) {
11084|       |            opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
11085|       |                          "JPWL: bad number of subbands in Sqcx (%d)\n",
11086|       |                          l_num_band);
11087|       |            if (!JPWL_ASSUME) {
11088|       |                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
11089|       |                return OPJ_FALSE;
11090|       |            }
11091|       |            /* we try to correct */
11092|       |            l_num_band = 1;
11093|       |            opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust them\n"
11094|       |                          "- setting number of bands to %d => HYPOTHESIS!!!\n",
11095|       |                          l_num_band);
11096|       |        };
11097|       |
11098|       |    };
11099|       |#endif /* USE_JPWL */
11100|       |
11101|  11.8k|    if (l_tccp->qntsty == J2K_CCP_QNTSTY_NOQNT) {
  ------------------
  |  |   66|  11.8k|#define J2K_CCP_QNTSTY_NOQNT 0
  ------------------
  |  Branch (11101:9): [True: 9.61k, False: 2.22k]
  ------------------
11102|   136k|        for (l_band_no = 0; l_band_no < l_num_band; l_band_no++) {
  ------------------
  |  Branch (11102:29): [True: 127k, False: 9.61k]
  ------------------
11103|   127k|            opj_read_bytes(l_current_ptr, &l_tmp, 1);                       /* SPqcx_i */
  ------------------
  |  |   65|   127k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
11104|   127k|            ++l_current_ptr;
11105|   127k|            if (l_band_no < OPJ_J2K_MAXBANDS) {
  ------------------
  |  |  153|   127k|#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
  |  |  ------------------
  |  |  |  |  152|   127k|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  |  |  ------------------
  ------------------
  |  Branch (11105:17): [True: 48.7k, False: 78.3k]
  ------------------
11106|  48.7k|                l_tccp->stepsizes[l_band_no].expn = (OPJ_INT32)(l_tmp >> 3);
11107|  48.7k|                l_tccp->stepsizes[l_band_no].mant = 0;
11108|  48.7k|            }
11109|   127k|        }
11110|  9.61k|        *p_header_size = *p_header_size - l_num_band;
11111|  9.61k|    } else {
11112|  16.2k|        for (l_band_no = 0; l_band_no < l_num_band; l_band_no++) {
  ------------------
  |  Branch (11112:29): [True: 14.0k, False: 2.22k]
  ------------------
11113|  14.0k|            opj_read_bytes(l_current_ptr, &l_tmp, 2);                       /* SPqcx_i */
  ------------------
  |  |   65|  14.0k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
11114|  14.0k|            l_current_ptr += 2;
11115|  14.0k|            if (l_band_no < OPJ_J2K_MAXBANDS) {
  ------------------
  |  |  153|  14.0k|#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
  |  |  ------------------
  |  |  |  |  152|  14.0k|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  |  |  ------------------
  ------------------
  |  Branch (11115:17): [True: 7.97k, False: 6.04k]
  ------------------
11116|  7.97k|                l_tccp->stepsizes[l_band_no].expn = (OPJ_INT32)(l_tmp >> 11);
11117|  7.97k|                l_tccp->stepsizes[l_band_no].mant = l_tmp & 0x7ff;
11118|  7.97k|            }
11119|  14.0k|        }
11120|  2.22k|        *p_header_size = *p_header_size - 2 * l_num_band;
11121|  2.22k|    }
11122|       |
11123|       |    /* Add Antonin : if scalar_derived -> compute other stepsizes */
11124|  11.8k|    if (l_tccp->qntsty == J2K_CCP_QNTSTY_SIQNT) {
  ------------------
  |  |   67|  11.8k|#define J2K_CCP_QNTSTY_SIQNT 1
  ------------------
  |  Branch (11124:9): [True: 782, False: 11.0k]
  ------------------
11125|  75.8k|        for (l_band_no = 1; l_band_no < OPJ_J2K_MAXBANDS; l_band_no++) {
  ------------------
  |  |  153|  75.8k|#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
  |  |  ------------------
  |  |  |  |  152|  75.8k|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  |  |  ------------------
  ------------------
  |  Branch (11125:29): [True: 75.0k, False: 782]
  ------------------
11126|  75.0k|            l_tccp->stepsizes[l_band_no].expn =
11127|  75.0k|                ((OPJ_INT32)(l_tccp->stepsizes[0].expn) - (OPJ_INT32)((l_band_no - 1) / 3) > 0)
  ------------------
  |  Branch (11127:17): [True: 25.4k, False: 49.6k]
  ------------------
11128|  75.0k|                ?
11129|  49.6k|                (OPJ_INT32)(l_tccp->stepsizes[0].expn) - (OPJ_INT32)((l_band_no - 1) / 3) : 0;
11130|  75.0k|            l_tccp->stepsizes[l_band_no].mant = l_tccp->stepsizes[0].mant;
11131|  75.0k|        }
11132|    782|    }
11133|       |
11134|  11.8k|    return OPJ_TRUE;
  ------------------
  |  |  117|  11.8k|#define OPJ_TRUE 1
  ------------------
11135|  11.8k|}
j2k.c:opj_j2k_copy_tile_quantization_parameters:
11138|  10.4k|{
11139|  10.4k|    OPJ_UINT32 i;
11140|  10.4k|    opj_cp_t *l_cp = NULL;
11141|  10.4k|    opj_tcp_t *l_tcp = NULL;
11142|  10.4k|    opj_tccp_t *l_ref_tccp = NULL;
11143|  10.4k|    opj_tccp_t *l_copied_tccp = NULL;
11144|  10.4k|    OPJ_UINT32 l_size;
11145|       |
11146|       |    /* preconditions */
11147|  10.4k|    assert(p_j2k != 00);
11148|       |
11149|  10.4k|    l_cp = &(p_j2k->m_cp);
11150|  10.4k|    l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?
  ------------------
  |  Branch (11150:13): [True: 245, False: 10.1k]
  ------------------
11151|    245|            &l_cp->tcps[p_j2k->m_current_tile_number] :
11152|  10.4k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
11153|       |
11154|  10.4k|    l_ref_tccp = &l_tcp->tccps[0];
11155|  10.4k|    l_copied_tccp = l_ref_tccp + 1;
11156|  10.4k|    l_size = OPJ_J2K_MAXBANDS * sizeof(opj_stepsize_t);
  ------------------
  |  |  153|  10.4k|#define OPJ_J2K_MAXBANDS (3*OPJ_J2K_MAXRLVLS-2) /**< Number of maximum sub-band linked to number of resolution level */
  |  |  ------------------
  |  |  |  |  152|  10.4k|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  |  |  ------------------
  ------------------
11157|       |
11158|  84.5k|    for (i = 1; i < p_j2k->m_private_image->numcomps; ++i) {
  ------------------
  |  Branch (11158:17): [True: 74.1k, False: 10.4k]
  ------------------
11159|  74.1k|        l_copied_tccp->qntsty = l_ref_tccp->qntsty;
11160|  74.1k|        l_copied_tccp->numgbits = l_ref_tccp->numgbits;
11161|  74.1k|        memcpy(l_copied_tccp->stepsizes, l_ref_tccp->stepsizes, l_size);
11162|  74.1k|        ++l_copied_tccp;
11163|  74.1k|    }
11164|  10.4k|}
j2k.c:opj_j2k_read_qcc:
 3213|  1.41k|{
 3214|  1.41k|    OPJ_UINT32 l_num_comp, l_comp_no;
 3215|       |
 3216|       |    /* preconditions */
 3217|  1.41k|    assert(p_header_data != 00);
 3218|  1.41k|    assert(p_j2k != 00);
 3219|  1.41k|    assert(p_manager != 00);
 3220|       |
 3221|  1.41k|    l_num_comp = p_j2k->m_private_image->numcomps;
 3222|       |
 3223|  1.41k|    if (l_num_comp <= 256) {
  ------------------
  |  Branch (3223:9): [True: 583, False: 827]
  ------------------
 3224|    583|        if (p_header_size < 1) {
  ------------------
  |  Branch (3224:13): [True: 0, False: 583]
  ------------------
 3225|      0|            opj_event_msg(p_manager, EVT_ERROR, "Error reading QCC marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3226|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3227|      0|        }
 3228|    583|        opj_read_bytes(p_header_data, &l_comp_no, 1);
  ------------------
  |  |   65|    583|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3229|    583|        ++p_header_data;
 3230|    583|        --p_header_size;
 3231|    827|    } else {
 3232|    827|        if (p_header_size < 2) {
  ------------------
  |  Branch (3232:13): [True: 1, False: 826]
  ------------------
 3233|      1|            opj_event_msg(p_manager, EVT_ERROR, "Error reading QCC marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3234|      1|            return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3235|      1|        }
 3236|    826|        opj_read_bytes(p_header_data, &l_comp_no, 2);
  ------------------
  |  |   65|    826|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3237|    826|        p_header_data += 2;
 3238|    826|        p_header_size -= 2;
 3239|    826|    }
 3240|       |
 3241|       |#ifdef USE_JPWL
 3242|       |    if (p_j2k->m_cp.correct) {
 3243|       |
 3244|       |        static OPJ_UINT32 backup_compno = 0;
 3245|       |
 3246|       |        /* compno is negative or larger than the number of components!!! */
 3247|       |        if (/*(l_comp_no < 0) ||*/ (l_comp_no >= l_num_comp)) {
 3248|       |            opj_event_msg(p_manager, EVT_ERROR,
 3249|       |                          "JPWL: bad component number in QCC (%d out of a maximum of %d)\n",
 3250|       |                          l_comp_no, l_num_comp);
 3251|       |            if (!JPWL_ASSUME) {
 3252|       |                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 3253|       |                return OPJ_FALSE;
 3254|       |            }
 3255|       |            /* we try to correct */
 3256|       |            l_comp_no = backup_compno % l_num_comp;
 3257|       |            opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n"
 3258|       |                          "- setting component number to %d\n",
 3259|       |                          l_comp_no);
 3260|       |        }
 3261|       |
 3262|       |        /* keep your private count of tiles */
 3263|       |        backup_compno++;
 3264|       |    };
 3265|       |#endif /* USE_JPWL */
 3266|       |
 3267|  1.40k|    if (l_comp_no >= p_j2k->m_private_image->numcomps) {
  ------------------
  |  Branch (3267:9): [True: 16, False: 1.39k]
  ------------------
 3268|     16|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     16|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3269|     16|                      "Invalid component number: %d, regarding the number of components %d\n",
 3270|     16|                      l_comp_no, p_j2k->m_private_image->numcomps);
 3271|     16|        return OPJ_FALSE;
  ------------------
  |  |  118|     16|#define OPJ_FALSE 0
  ------------------
 3272|     16|    }
 3273|       |
 3274|  1.39k|    if (! opj_j2k_read_SQcd_SQcc(p_j2k, l_comp_no, p_header_data, &p_header_size,
  ------------------
  |  Branch (3274:9): [True: 3, False: 1.39k]
  ------------------
 3275|  1.39k|                                 p_manager)) {
 3276|      3|        opj_event_msg(p_manager, EVT_ERROR, "Error reading QCC marker\n");
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3277|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 3278|      3|    }
 3279|       |
 3280|  1.39k|    if (p_header_size != 0) {
  ------------------
  |  Branch (3280:9): [True: 6, False: 1.38k]
  ------------------
 3281|      6|        opj_event_msg(p_manager, EVT_ERROR, "Error reading QCC marker\n");
  ------------------
  |  |   66|      6|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3282|      6|        return OPJ_FALSE;
  ------------------
  |  |  118|      6|#define OPJ_FALSE 0
  ------------------
 3283|      6|    }
 3284|       |
 3285|  1.38k|    return OPJ_TRUE;
  ------------------
  |  |  117|  1.38k|#define OPJ_TRUE 1
  ------------------
 3286|  1.39k|}
j2k.c:opj_j2k_read_poc:
 3528|  1.21k|{
 3529|  1.21k|    OPJ_UINT32 i, l_nb_comp, l_tmp;
 3530|  1.21k|    opj_image_t * l_image = 00;
 3531|  1.21k|    OPJ_UINT32 l_old_poc_nb, l_current_poc_nb, l_current_poc_remaining;
 3532|  1.21k|    OPJ_UINT32 l_chunk_size, l_comp_room;
 3533|       |
 3534|  1.21k|    opj_cp_t *l_cp = 00;
 3535|  1.21k|    opj_tcp_t *l_tcp = 00;
 3536|  1.21k|    opj_poc_t *l_current_poc = 00;
 3537|       |
 3538|       |    /* preconditions */
 3539|  1.21k|    assert(p_header_data != 00);
 3540|  1.21k|    assert(p_j2k != 00);
 3541|  1.21k|    assert(p_manager != 00);
 3542|       |
 3543|  1.21k|    l_image = p_j2k->m_private_image;
 3544|  1.21k|    l_nb_comp = l_image->numcomps;
 3545|  1.21k|    if (l_nb_comp <= 256) {
  ------------------
  |  Branch (3545:9): [True: 1.14k, False: 64]
  ------------------
 3546|  1.14k|        l_comp_room = 1;
 3547|  1.14k|    } else {
 3548|     64|        l_comp_room = 2;
 3549|     64|    }
 3550|  1.21k|    l_chunk_size = 5 + 2 * l_comp_room;
 3551|  1.21k|    l_current_poc_nb = p_header_size / l_chunk_size;
 3552|  1.21k|    l_current_poc_remaining = p_header_size % l_chunk_size;
 3553|       |
 3554|  1.21k|    if ((l_current_poc_nb <= 0) || (l_current_poc_remaining != 0)) {
  ------------------
  |  Branch (3554:9): [True: 8, False: 1.20k]
  |  Branch (3554:36): [True: 1, False: 1.20k]
  ------------------
 3555|      9|        opj_event_msg(p_manager, EVT_ERROR, "Error reading POC marker\n");
  ------------------
  |  |   66|      9|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3556|      9|        return OPJ_FALSE;
  ------------------
  |  |  118|      9|#define OPJ_FALSE 0
  ------------------
 3557|      9|    }
 3558|       |
 3559|  1.20k|    l_cp = &(p_j2k->m_cp);
 3560|  1.20k|    l_tcp = (p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH) ?
  ------------------
  |  Branch (3560:13): [True: 42, False: 1.16k]
  ------------------
 3561|     42|            &l_cp->tcps[p_j2k->m_current_tile_number] :
 3562|  1.20k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
 3563|  1.20k|    l_old_poc_nb = l_tcp->POC ? l_tcp->numpocs + 1 : 0;
  ------------------
  |  Branch (3563:20): [True: 744, False: 459]
  ------------------
 3564|  1.20k|    l_current_poc_nb += l_old_poc_nb;
 3565|       |
 3566|  1.20k|    if (l_current_poc_nb >= J2K_MAX_POCS) {
  ------------------
  |  |  114|  1.20k|#define J2K_MAX_POCS    32      /**< Maximum number of POCs */
  ------------------
  |  Branch (3566:9): [True: 3, False: 1.20k]
  ------------------
 3567|      3|        opj_event_msg(p_manager, EVT_ERROR, "Too many POCs %d\n", l_current_poc_nb);
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3568|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 3569|      3|    }
 3570|       |
 3571|       |    /* now poc is in use.*/
 3572|  1.20k|    l_tcp->POC = 1;
 3573|       |
 3574|  1.20k|    l_current_poc = &l_tcp->pocs[l_old_poc_nb];
 3575|  5.52k|    for (i = l_old_poc_nb; i < l_current_poc_nb; ++i) {
  ------------------
  |  Branch (3575:28): [True: 4.32k, False: 1.20k]
  ------------------
 3576|  4.32k|        opj_read_bytes(p_header_data, &(l_current_poc->resno0),
  ------------------
  |  |   65|  4.32k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3577|  4.32k|                       1);                               /* RSpoc_i */
 3578|  4.32k|        ++p_header_data;
 3579|  4.32k|        opj_read_bytes(p_header_data, &(l_current_poc->compno0),
  ------------------
  |  |   65|  4.32k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3580|  4.32k|                       l_comp_room);  /* CSpoc_i */
 3581|  4.32k|        p_header_data += l_comp_room;
 3582|  4.32k|        opj_read_bytes(p_header_data, &(l_current_poc->layno1),
  ------------------
  |  |   65|  4.32k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3583|  4.32k|                       2);                               /* LYEpoc_i */
 3584|       |        /* make sure layer end is in acceptable bounds */
 3585|  4.32k|        l_current_poc->layno1 = opj_uint_min(l_current_poc->layno1, l_tcp->numlayers);
 3586|  4.32k|        p_header_data += 2;
 3587|  4.32k|        opj_read_bytes(p_header_data, &(l_current_poc->resno1),
  ------------------
  |  |   65|  4.32k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3588|  4.32k|                       1);                               /* REpoc_i */
 3589|  4.32k|        ++p_header_data;
 3590|  4.32k|        opj_read_bytes(p_header_data, &(l_current_poc->compno1),
  ------------------
  |  |   65|  4.32k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3591|  4.32k|                       l_comp_room);  /* CEpoc_i */
 3592|  4.32k|        p_header_data += l_comp_room;
 3593|  4.32k|        opj_read_bytes(p_header_data, &l_tmp,
  ------------------
  |  |   65|  4.32k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3594|  4.32k|                       1);                                                                 /* Ppoc_i */
 3595|  4.32k|        ++p_header_data;
 3596|  4.32k|        l_current_poc->prg = (OPJ_PROG_ORDER) l_tmp;
 3597|       |        /* make sure comp is in acceptable bounds */
 3598|  4.32k|        l_current_poc->compno1 = opj_uint_min(l_current_poc->compno1, l_nb_comp);
 3599|  4.32k|        ++l_current_poc;
 3600|  4.32k|    }
 3601|       |
 3602|  1.20k|    l_tcp->numpocs = l_current_poc_nb - 1;
 3603|  1.20k|    return OPJ_TRUE;
  ------------------
  |  |  117|  1.20k|#define OPJ_TRUE 1
  ------------------
 3604|  1.20k|}
j2k.c:opj_j2k_read_siz:
 2079|  9.08k|{
 2080|  9.08k|    OPJ_UINT32 i;
 2081|  9.08k|    OPJ_UINT32 l_nb_comp;
 2082|  9.08k|    OPJ_UINT32 l_nb_comp_remain;
 2083|  9.08k|    OPJ_UINT32 l_remaining_size;
 2084|  9.08k|    OPJ_UINT32 l_nb_tiles;
 2085|  9.08k|    OPJ_UINT32 l_tmp, l_tx1, l_ty1;
 2086|  9.08k|    OPJ_UINT32 l_prec0, l_sgnd0;
 2087|  9.08k|    opj_image_t *l_image = 00;
 2088|  9.08k|    opj_cp_t *l_cp = 00;
 2089|  9.08k|    opj_image_comp_t * l_img_comp = 00;
 2090|  9.08k|    opj_tcp_t * l_current_tile_param = 00;
 2091|       |
 2092|       |    /* preconditions */
 2093|  9.08k|    assert(p_j2k != 00);
 2094|  9.08k|    assert(p_manager != 00);
 2095|  9.08k|    assert(p_header_data != 00);
 2096|       |
 2097|  9.08k|    l_image = p_j2k->m_private_image;
 2098|  9.08k|    l_cp = &(p_j2k->m_cp);
 2099|       |
 2100|       |    /* minimum size == 39 - 3 (= minimum component parameter) */
 2101|  9.08k|    if (p_header_size < 36) {
  ------------------
  |  Branch (2101:9): [True: 7, False: 9.07k]
  ------------------
 2102|      7|        opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker size\n");
  ------------------
  |  |   66|      7|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2103|      7|        return OPJ_FALSE;
  ------------------
  |  |  118|      7|#define OPJ_FALSE 0
  ------------------
 2104|      7|    }
 2105|       |
 2106|  9.07k|    l_remaining_size = p_header_size - 36;
 2107|  9.07k|    l_nb_comp = l_remaining_size / 3;
 2108|  9.07k|    l_nb_comp_remain = l_remaining_size % 3;
 2109|  9.07k|    if (l_nb_comp_remain != 0) {
  ------------------
  |  Branch (2109:9): [True: 5, False: 9.07k]
  ------------------
 2110|      5|        opj_event_msg(p_manager, EVT_ERROR, "Error with SIZ marker size\n");
  ------------------
  |  |   66|      5|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2111|      5|        return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
 2112|      5|    }
 2113|       |
 2114|  9.07k|    opj_read_bytes(p_header_data, &l_tmp,
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2115|  9.07k|                   2);                                                /* Rsiz (capabilities) */
 2116|  9.07k|    p_header_data += 2;
 2117|  9.07k|    l_cp->rsiz = (OPJ_UINT16) l_tmp;
 2118|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->x1, 4);   /* Xsiz */
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2119|  9.07k|    p_header_data += 4;
 2120|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->y1, 4);   /* Ysiz */
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2121|  9.07k|    p_header_data += 4;
 2122|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->x0, 4);   /* X0siz */
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2123|  9.07k|    p_header_data += 4;
 2124|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_image->y0, 4);   /* Y0siz */
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2125|  9.07k|    p_header_data += 4;
 2126|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tdx,
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2127|  9.07k|                   4);             /* XTsiz */
 2128|  9.07k|    p_header_data += 4;
 2129|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tdy,
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2130|  9.07k|                   4);             /* YTsiz */
 2131|  9.07k|    p_header_data += 4;
 2132|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->tx0,
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2133|  9.07k|                   4);             /* XT0siz */
 2134|  9.07k|    p_header_data += 4;
 2135|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_cp->ty0,
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2136|  9.07k|                   4);             /* YT0siz */
 2137|  9.07k|    p_header_data += 4;
 2138|  9.07k|    opj_read_bytes(p_header_data, (OPJ_UINT32*) &l_tmp,
  ------------------
  |  |   65|  9.07k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2139|  9.07k|                   2);                 /* Csiz */
 2140|  9.07k|    p_header_data += 2;
 2141|  9.07k|    if (l_tmp < 16385) {
  ------------------
  |  Branch (2141:9): [True: 9.06k, False: 6]
  ------------------
 2142|  9.06k|        l_image->numcomps = (OPJ_UINT16) l_tmp;
 2143|  9.06k|    } else {
 2144|      6|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      6|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2145|      6|                      "Error with SIZ marker: number of component is illegal -> %d\n", l_tmp);
 2146|      6|        return OPJ_FALSE;
  ------------------
  |  |  118|      6|#define OPJ_FALSE 0
  ------------------
 2147|      6|    }
 2148|       |
 2149|  9.06k|    if (l_image->numcomps != l_nb_comp) {
  ------------------
  |  Branch (2149:9): [True: 29, False: 9.03k]
  ------------------
 2150|     29|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     29|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2151|     29|                      "Error with SIZ marker: number of component is not compatible with the remaining number of parameters ( %d vs %d)\n",
 2152|     29|                      l_image->numcomps, l_nb_comp);
 2153|     29|        return OPJ_FALSE;
  ------------------
  |  |  118|     29|#define OPJ_FALSE 0
  ------------------
 2154|     29|    }
 2155|       |
 2156|       |    /* testcase 4035.pdf.SIGSEGV.d8b.3375 */
 2157|       |    /* testcase issue427-null-image-size.jp2 */
 2158|  9.03k|    if ((l_image->x0 >= l_image->x1) || (l_image->y0 >= l_image->y1)) {
  ------------------
  |  Branch (2158:9): [True: 1, False: 9.03k]
  |  Branch (2158:41): [True: 4, False: 9.03k]
  ------------------
 2159|      5|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      5|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2160|      5|                      "Error with SIZ marker: negative or zero image size (%" PRId64 " x %" PRId64
 2161|      5|                      ")\n", (OPJ_INT64)l_image->x1 - l_image->x0,
 2162|      5|                      (OPJ_INT64)l_image->y1 - l_image->y0);
 2163|      5|        return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
 2164|      5|    }
 2165|       |    /* testcase 2539.pdf.SIGFPE.706.1712 (also 3622.pdf.SIGFPE.706.2916 and 4008.pdf.SIGFPE.706.3345 and maybe more) */
 2166|  9.03k|    if ((l_cp->tdx == 0U) || (l_cp->tdy == 0U)) {
  ------------------
  |  Branch (2166:9): [True: 2, False: 9.03k]
  |  Branch (2166:30): [True: 2, False: 9.02k]
  ------------------
 2167|      4|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      4|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2168|      4|                      "Error with SIZ marker: invalid tile size (tdx: %d, tdy: %d)\n", l_cp->tdx,
 2169|      4|                      l_cp->tdy);
 2170|      4|        return OPJ_FALSE;
  ------------------
  |  |  118|      4|#define OPJ_FALSE 0
  ------------------
 2171|      4|    }
 2172|       |
 2173|       |    /* testcase issue427-illegal-tile-offset.jp2 */
 2174|  9.02k|    l_tx1 = opj_uint_adds(l_cp->tx0, l_cp->tdx); /* manage overflow */
 2175|  9.02k|    l_ty1 = opj_uint_adds(l_cp->ty0, l_cp->tdy); /* manage overflow */
 2176|  9.02k|    if ((l_cp->tx0 > l_image->x0) || (l_cp->ty0 > l_image->y0) ||
  ------------------
  |  Branch (2176:9): [True: 34, False: 8.99k]
  |  Branch (2176:38): [True: 40, False: 8.95k]
  ------------------
 2177|  9.02k|            (l_tx1 <= l_image->x0) || (l_ty1 <= l_image->y0)) {
  ------------------
  |  Branch (2177:13): [True: 11, False: 8.94k]
  |  Branch (2177:39): [True: 9, False: 8.93k]
  ------------------
 2178|     94|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     94|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2179|     94|                      "Error with SIZ marker: illegal tile offset\n");
 2180|     94|        return OPJ_FALSE;
  ------------------
  |  |  118|     94|#define OPJ_FALSE 0
  ------------------
 2181|     94|    }
 2182|  8.93k|    if (!p_j2k->dump_state) {
  ------------------
  |  Branch (2182:9): [True: 8.93k, False: 0]
  ------------------
 2183|  8.93k|        OPJ_UINT32 siz_w, siz_h;
 2184|       |
 2185|  8.93k|        siz_w = l_image->x1 - l_image->x0;
 2186|  8.93k|        siz_h = l_image->y1 - l_image->y0;
 2187|       |
 2188|  8.93k|        if (p_j2k->ihdr_w > 0 && p_j2k->ihdr_h > 0
  ------------------
  |  Branch (2188:13): [True: 0, False: 8.93k]
  |  Branch (2188:34): [True: 0, False: 0]
  ------------------
 2189|  8.93k|                && (p_j2k->ihdr_w != siz_w || p_j2k->ihdr_h != siz_h)) {
  ------------------
  |  Branch (2189:21): [True: 0, False: 0]
  |  Branch (2189:47): [True: 0, False: 0]
  ------------------
 2190|      0|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2191|      0|                          "Error with SIZ marker: IHDR w(%u) h(%u) vs. SIZ w(%u) h(%u)\n", p_j2k->ihdr_w,
 2192|      0|                          p_j2k->ihdr_h, siz_w, siz_h);
 2193|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2194|      0|        }
 2195|  8.93k|    }
 2196|       |#ifdef USE_JPWL
 2197|       |    if (l_cp->correct) {
 2198|       |        /* if JPWL is on, we check whether TX errors have damaged
 2199|       |          too much the SIZ parameters */
 2200|       |        if (!(l_image->x1 * l_image->y1)) {
 2201|       |            opj_event_msg(p_manager, EVT_ERROR,
 2202|       |                          "JPWL: bad image size (%d x %d)\n",
 2203|       |                          l_image->x1, l_image->y1);
 2204|       |            if (!JPWL_ASSUME) {
 2205|       |                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 2206|       |                return OPJ_FALSE;
 2207|       |            }
 2208|       |        }
 2209|       |
 2210|       |        /* FIXME check previously in the function so why keep this piece of code ? Need by the norm ?
 2211|       |                if (l_image->numcomps != ((len - 38) / 3)) {
 2212|       |                        opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
 2213|       |                                "JPWL: Csiz is %d => space in SIZ only for %d comps.!!!\n",
 2214|       |                                l_image->numcomps, ((len - 38) / 3));
 2215|       |                        if (!JPWL_ASSUME) {
 2216|       |                                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 2217|       |                                return OPJ_FALSE;
 2218|       |                        }
 2219|       |        */              /* we try to correct */
 2220|       |        /*              opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust this\n");
 2221|       |                        if (l_image->numcomps < ((len - 38) / 3)) {
 2222|       |                                len = 38 + 3 * l_image->numcomps;
 2223|       |                                opj_event_msg(p_manager, EVT_WARNING, "- setting Lsiz to %d => HYPOTHESIS!!!\n",
 2224|       |                                        len);
 2225|       |                        } else {
 2226|       |                                l_image->numcomps = ((len - 38) / 3);
 2227|       |                                opj_event_msg(p_manager, EVT_WARNING, "- setting Csiz to %d => HYPOTHESIS!!!\n",
 2228|       |                                        l_image->numcomps);
 2229|       |                        }
 2230|       |                }
 2231|       |        */
 2232|       |
 2233|       |        /* update components number in the jpwl_exp_comps filed */
 2234|       |        l_cp->exp_comps = l_image->numcomps;
 2235|       |    }
 2236|       |#endif /* USE_JPWL */
 2237|       |
 2238|       |    /* Allocate the resulting image components */
 2239|  8.93k|    l_image->comps = (opj_image_comp_t*) opj_calloc(l_image->numcomps,
 2240|  8.93k|                     sizeof(opj_image_comp_t));
 2241|  8.93k|    if (l_image->comps == 00) {
  ------------------
  |  Branch (2241:9): [True: 31, False: 8.90k]
  ------------------
 2242|     31|        l_image->numcomps = 0;
 2243|     31|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     31|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2244|     31|                      "Not enough memory to take in charge SIZ marker\n");
 2245|     31|        return OPJ_FALSE;
  ------------------
  |  |  118|     31|#define OPJ_FALSE 0
  ------------------
 2246|     31|    }
 2247|       |
 2248|  8.90k|    l_img_comp = l_image->comps;
 2249|       |
 2250|  8.90k|    l_prec0 = 0;
 2251|  8.90k|    l_sgnd0 = 0;
 2252|       |    /* Read the component information */
 2253|  45.2k|    for (i = 0; i < l_image->numcomps; ++i) {
  ------------------
  |  Branch (2253:17): [True: 36.3k, False: 8.89k]
  ------------------
 2254|  36.3k|        OPJ_UINT32 tmp;
 2255|  36.3k|        opj_read_bytes(p_header_data, &tmp, 1); /* Ssiz_i */
  ------------------
  |  |   65|  36.3k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2256|  36.3k|        ++p_header_data;
 2257|  36.3k|        l_img_comp->prec = (tmp & 0x7f) + 1;
 2258|  36.3k|        l_img_comp->sgnd = tmp >> 7;
 2259|       |
 2260|  36.3k|        if (p_j2k->dump_state == 0) {
  ------------------
  |  Branch (2260:13): [True: 36.3k, False: 0]
  ------------------
 2261|  36.3k|            if (i == 0) {
  ------------------
  |  Branch (2261:17): [True: 8.90k, False: 27.4k]
  ------------------
 2262|  8.90k|                l_prec0 = l_img_comp->prec;
 2263|  8.90k|                l_sgnd0 = l_img_comp->sgnd;
 2264|  27.4k|            } else if (!l_cp->allow_different_bit_depth_sign
  ------------------
  |  Branch (2264:24): [True: 0, False: 27.4k]
  ------------------
 2265|  27.4k|                       && (l_img_comp->prec != l_prec0 || l_img_comp->sgnd != l_sgnd0)) {
  ------------------
  |  Branch (2265:28): [True: 0, False: 0]
  |  Branch (2265:59): [True: 0, False: 0]
  ------------------
 2266|      0|                opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 2267|      0|                              "Despite JP2 BPC!=255, precision and/or sgnd values for comp[%d] is different than comp[0]:\n"
 2268|      0|                              "        [0] prec(%d) sgnd(%d) [%d] prec(%d) sgnd(%d)\n", i, l_prec0, l_sgnd0,
 2269|      0|                              i, l_img_comp->prec, l_img_comp->sgnd);
 2270|      0|            }
 2271|       |            /* TODO: we should perhaps also check against JP2 BPCC values */
 2272|  36.3k|        }
 2273|  36.3k|        opj_read_bytes(p_header_data, &tmp, 1); /* XRsiz_i */
  ------------------
  |  |   65|  36.3k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2274|  36.3k|        ++p_header_data;
 2275|  36.3k|        l_img_comp->dx = (OPJ_UINT32)tmp; /* should be between 1 and 255 */
 2276|  36.3k|        opj_read_bytes(p_header_data, &tmp, 1); /* YRsiz_i */
  ------------------
  |  |   65|  36.3k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 2277|  36.3k|        ++p_header_data;
 2278|  36.3k|        l_img_comp->dy = (OPJ_UINT32)tmp; /* should be between 1 and 255 */
 2279|  36.3k|        if (l_img_comp->dx < 1 || l_img_comp->dx > 255 ||
  ------------------
  |  Branch (2279:13): [True: 1, False: 36.3k]
  |  Branch (2279:35): [True: 0, False: 36.3k]
  ------------------
 2280|  36.3k|                l_img_comp->dy < 1 || l_img_comp->dy > 255) {
  ------------------
  |  Branch (2280:17): [True: 2, False: 36.3k]
  |  Branch (2280:39): [True: 0, False: 36.3k]
  ------------------
 2281|      3|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2282|      3|                          "Invalid values for comp = %d : dx=%u dy=%u (should be between 1 and 255 according to the JPEG2000 norm)\n",
 2283|      3|                          i, l_img_comp->dx, l_img_comp->dy);
 2284|      3|            return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 2285|      3|        }
 2286|       |        /* Avoids later undefined shift in computation of */
 2287|       |        /* p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps[i].m_dc_level_shift = 1
 2288|       |                    << (l_image->comps[i].prec - 1); */
 2289|  36.3k|        if (l_img_comp->prec > 31) {
  ------------------
  |  Branch (2289:13): [True: 5, False: 36.3k]
  ------------------
 2290|      5|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      5|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2291|      5|                          "Invalid values for comp = %d : prec=%u (should be between 1 and 38 according to the JPEG2000 norm. OpenJpeg only supports up to 31)\n",
 2292|      5|                          i, l_img_comp->prec);
 2293|      5|            return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
 2294|      5|        }
 2295|       |#ifdef USE_JPWL
 2296|       |        if (l_cp->correct) {
 2297|       |            /* if JPWL is on, we check whether TX errors have damaged
 2298|       |                    too much the SIZ parameters, again */
 2299|       |            if (!(l_image->comps[i].dx * l_image->comps[i].dy)) {
 2300|       |                opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
 2301|       |                              "JPWL: bad XRsiz_%d/YRsiz_%d (%d x %d)\n",
 2302|       |                              i, i, l_image->comps[i].dx, l_image->comps[i].dy);
 2303|       |                if (!JPWL_ASSUME) {
 2304|       |                    opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 2305|       |                    return OPJ_FALSE;
 2306|       |                }
 2307|       |                /* we try to correct */
 2308|       |                opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust them\n");
 2309|       |                if (!l_image->comps[i].dx) {
 2310|       |                    l_image->comps[i].dx = 1;
 2311|       |                    opj_event_msg(p_manager, EVT_WARNING,
 2312|       |                                  "- setting XRsiz_%d to %d => HYPOTHESIS!!!\n",
 2313|       |                                  i, l_image->comps[i].dx);
 2314|       |                }
 2315|       |                if (!l_image->comps[i].dy) {
 2316|       |                    l_image->comps[i].dy = 1;
 2317|       |                    opj_event_msg(p_manager, EVT_WARNING,
 2318|       |                                  "- setting YRsiz_%d to %d => HYPOTHESIS!!!\n",
 2319|       |                                  i, l_image->comps[i].dy);
 2320|       |                }
 2321|       |            }
 2322|       |        }
 2323|       |#endif /* USE_JPWL */
 2324|  36.3k|        l_img_comp->resno_decoded =
 2325|  36.3k|            0;                                                          /* number of resolution decoded */
 2326|  36.3k|        l_img_comp->factor =
 2327|  36.3k|            l_cp->m_specific_param.m_dec.m_reduce; /* reducing factor per component */
 2328|  36.3k|        ++l_img_comp;
 2329|  36.3k|    }
 2330|       |
 2331|  8.89k|    if (l_cp->tdx == 0 || l_cp->tdy == 0) {
  ------------------
  |  Branch (2331:9): [True: 0, False: 8.89k]
  |  Branch (2331:27): [True: 0, False: 8.89k]
  ------------------
 2332|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2333|      0|    }
 2334|       |
 2335|       |    /* Compute the number of tiles */
 2336|  8.89k|    l_cp->tw = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(l_image->x1 - l_cp->tx0),
 2337|  8.89k|                                           (OPJ_INT32)l_cp->tdx);
 2338|  8.89k|    l_cp->th = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)(l_image->y1 - l_cp->ty0),
 2339|  8.89k|                                           (OPJ_INT32)l_cp->tdy);
 2340|       |
 2341|       |    /* Check that the number of tiles is valid */
 2342|  8.89k|    if (l_cp->tw == 0 || l_cp->th == 0 || l_cp->tw > 65535 / l_cp->th) {
  ------------------
  |  Branch (2342:9): [True: 8, False: 8.88k]
  |  Branch (2342:26): [True: 9, False: 8.87k]
  |  Branch (2342:43): [True: 68, False: 8.81k]
  ------------------
 2343|     85|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     85|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2344|     85|                      "Invalid number of tiles : %u x %u (maximum fixed by jpeg2000 norm is 65535 tiles)\n",
 2345|     85|                      l_cp->tw, l_cp->th);
 2346|     85|        return OPJ_FALSE;
  ------------------
  |  |  118|     85|#define OPJ_FALSE 0
  ------------------
 2347|     85|    }
 2348|  8.81k|    l_nb_tiles = l_cp->tw * l_cp->th;
 2349|       |
 2350|       |    /* Define the tiles which will be decoded */
 2351|  8.81k|    if (p_j2k->m_specific_param.m_decoder.m_discard_tiles) {
  ------------------
  |  Branch (2351:9): [True: 0, False: 8.81k]
  ------------------
 2352|      0|        p_j2k->m_specific_param.m_decoder.m_start_tile_x =
 2353|      0|            (p_j2k->m_specific_param.m_decoder.m_start_tile_x - l_cp->tx0) / l_cp->tdx;
 2354|      0|        p_j2k->m_specific_param.m_decoder.m_start_tile_y =
 2355|      0|            (p_j2k->m_specific_param.m_decoder.m_start_tile_y - l_cp->ty0) / l_cp->tdy;
 2356|      0|        p_j2k->m_specific_param.m_decoder.m_end_tile_x = (OPJ_UINT32)opj_int_ceildiv((
 2357|      0|                    OPJ_INT32)(p_j2k->m_specific_param.m_decoder.m_end_tile_x - l_cp->tx0),
 2358|      0|                (OPJ_INT32)l_cp->tdx);
 2359|      0|        p_j2k->m_specific_param.m_decoder.m_end_tile_y = (OPJ_UINT32)opj_int_ceildiv((
 2360|      0|                    OPJ_INT32)(p_j2k->m_specific_param.m_decoder.m_end_tile_y - l_cp->ty0),
 2361|      0|                (OPJ_INT32)l_cp->tdy);
 2362|  8.81k|    } else {
 2363|  8.81k|        p_j2k->m_specific_param.m_decoder.m_start_tile_x = 0;
 2364|  8.81k|        p_j2k->m_specific_param.m_decoder.m_start_tile_y = 0;
 2365|  8.81k|        p_j2k->m_specific_param.m_decoder.m_end_tile_x = l_cp->tw;
 2366|  8.81k|        p_j2k->m_specific_param.m_decoder.m_end_tile_y = l_cp->th;
 2367|  8.81k|    }
 2368|       |
 2369|       |#ifdef USE_JPWL
 2370|       |    if (l_cp->correct) {
 2371|       |        /* if JPWL is on, we check whether TX errors have damaged
 2372|       |          too much the SIZ parameters */
 2373|       |        if ((l_cp->tw < 1) || (l_cp->th < 1) || (l_cp->tw > l_cp->max_tiles) ||
 2374|       |                (l_cp->th > l_cp->max_tiles)) {
 2375|       |            opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
 2376|       |                          "JPWL: bad number of tiles (%d x %d)\n",
 2377|       |                          l_cp->tw, l_cp->th);
 2378|       |            if (!JPWL_ASSUME) {
 2379|       |                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 2380|       |                return OPJ_FALSE;
 2381|       |            }
 2382|       |            /* we try to correct */
 2383|       |            opj_event_msg(p_manager, EVT_WARNING, "- trying to adjust them\n");
 2384|       |            if (l_cp->tw < 1) {
 2385|       |                l_cp->tw = 1;
 2386|       |                opj_event_msg(p_manager, EVT_WARNING,
 2387|       |                              "- setting %d tiles in x => HYPOTHESIS!!!\n",
 2388|       |                              l_cp->tw);
 2389|       |            }
 2390|       |            if (l_cp->tw > l_cp->max_tiles) {
 2391|       |                l_cp->tw = 1;
 2392|       |                opj_event_msg(p_manager, EVT_WARNING,
 2393|       |                              "- too large x, increase expectance of %d\n"
 2394|       |                              "- setting %d tiles in x => HYPOTHESIS!!!\n",
 2395|       |                              l_cp->max_tiles, l_cp->tw);
 2396|       |            }
 2397|       |            if (l_cp->th < 1) {
 2398|       |                l_cp->th = 1;
 2399|       |                opj_event_msg(p_manager, EVT_WARNING,
 2400|       |                              "- setting %d tiles in y => HYPOTHESIS!!!\n",
 2401|       |                              l_cp->th);
 2402|       |            }
 2403|       |            if (l_cp->th > l_cp->max_tiles) {
 2404|       |                l_cp->th = 1;
 2405|       |                opj_event_msg(p_manager, EVT_WARNING,
 2406|       |                              "- too large y, increase expectance of %d to continue\n",
 2407|       |                              "- setting %d tiles in y => HYPOTHESIS!!!\n",
 2408|       |                              l_cp->max_tiles, l_cp->th);
 2409|       |            }
 2410|       |        }
 2411|       |    }
 2412|       |#endif /* USE_JPWL */
 2413|       |
 2414|       |    /* memory allocations */
 2415|  8.81k|    l_cp->tcps = (opj_tcp_t*) opj_calloc(l_nb_tiles, sizeof(opj_tcp_t));
 2416|  8.81k|    if (l_cp->tcps == 00) {
  ------------------
  |  Branch (2416:9): [True: 0, False: 8.81k]
  ------------------
 2417|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2418|      0|                      "Not enough memory to take in charge SIZ marker\n");
 2419|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2420|      0|    }
 2421|       |
 2422|       |#ifdef USE_JPWL
 2423|       |    if (l_cp->correct) {
 2424|       |        if (!l_cp->tcps) {
 2425|       |            opj_event_msg(p_manager, JPWL_ASSUME ? EVT_WARNING : EVT_ERROR,
 2426|       |                          "JPWL: could not alloc tcps field of cp\n");
 2427|       |            if (!JPWL_ASSUME) {
 2428|       |                opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 2429|       |                return OPJ_FALSE;
 2430|       |            }
 2431|       |        }
 2432|       |    }
 2433|       |#endif /* USE_JPWL */
 2434|       |
 2435|  8.81k|    p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps =
 2436|  8.81k|        (opj_tccp_t*) opj_calloc(l_image->numcomps, sizeof(opj_tccp_t));
 2437|  8.81k|    if (p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps  == 00) {
  ------------------
  |  Branch (2437:9): [True: 0, False: 8.81k]
  ------------------
 2438|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2439|      0|                      "Not enough memory to take in charge SIZ marker\n");
 2440|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2441|      0|    }
 2442|       |
 2443|  8.81k|    p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records =
 2444|  8.81k|        (opj_mct_data_t*)opj_calloc(OPJ_J2K_MCT_DEFAULT_NB_RECORDS,
  ------------------
  |  |  159|  8.81k|#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS      10
  ------------------
 2445|  8.81k|                                    sizeof(opj_mct_data_t));
 2446|       |
 2447|  8.81k|    if (! p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mct_records) {
  ------------------
  |  Branch (2447:9): [True: 0, False: 8.81k]
  ------------------
 2448|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2449|      0|                      "Not enough memory to take in charge SIZ marker\n");
 2450|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2451|      0|    }
 2452|  8.81k|    p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mct_records =
 2453|  8.81k|        OPJ_J2K_MCT_DEFAULT_NB_RECORDS;
  ------------------
  |  |  159|  8.81k|#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS      10
  ------------------
 2454|       |
 2455|  8.81k|    p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records =
 2456|  8.81k|        (opj_simple_mcc_decorrelation_data_t*)
 2457|  8.81k|        opj_calloc(OPJ_J2K_MCC_DEFAULT_NB_RECORDS,
  ------------------
  |  |  158|  8.81k|#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS      10
  ------------------
 2458|  8.81k|                   sizeof(opj_simple_mcc_decorrelation_data_t));
 2459|       |
 2460|  8.81k|    if (! p_j2k->m_specific_param.m_decoder.m_default_tcp->m_mcc_records) {
  ------------------
  |  Branch (2460:9): [True: 0, False: 8.81k]
  ------------------
 2461|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2462|      0|                      "Not enough memory to take in charge SIZ marker\n");
 2463|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2464|      0|    }
 2465|  8.81k|    p_j2k->m_specific_param.m_decoder.m_default_tcp->m_nb_max_mcc_records =
 2466|  8.81k|        OPJ_J2K_MCC_DEFAULT_NB_RECORDS;
  ------------------
  |  |  158|  8.81k|#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS      10
  ------------------
 2467|       |
 2468|       |    /* set up default dc level shift */
 2469|  44.9k|    for (i = 0; i < l_image->numcomps; ++i) {
  ------------------
  |  Branch (2469:17): [True: 36.1k, False: 8.81k]
  ------------------
 2470|  36.1k|        if (! l_image->comps[i].sgnd) {
  ------------------
  |  Branch (2470:13): [True: 28.9k, False: 7.24k]
  ------------------
 2471|  28.9k|            p_j2k->m_specific_param.m_decoder.m_default_tcp->tccps[i].m_dc_level_shift = 1
 2472|  28.9k|                    << (l_image->comps[i].prec - 1);
 2473|  28.9k|        }
 2474|  36.1k|    }
 2475|       |
 2476|  8.81k|    l_current_tile_param = l_cp->tcps;
 2477|  18.0M|    for (i = 0; i < l_nb_tiles; ++i) {
  ------------------
  |  Branch (2477:17): [True: 18.0M, False: 8.81k]
  ------------------
 2478|  18.0M|        l_current_tile_param->tccps = (opj_tccp_t*) opj_calloc(l_image->numcomps,
 2479|  18.0M|                                      sizeof(opj_tccp_t));
 2480|  18.0M|        if (l_current_tile_param->tccps == 00) {
  ------------------
  |  Branch (2480:13): [True: 0, False: 18.0M]
  ------------------
 2481|      0|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2482|      0|                          "Not enough memory to take in charge SIZ marker\n");
 2483|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2484|      0|        }
 2485|       |
 2486|  18.0M|        ++l_current_tile_param;
 2487|  18.0M|    }
 2488|       |
 2489|  8.81k|    p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_MH;
 2490|  8.81k|    opj_image_comp_header_update(l_image, l_cp);
 2491|       |
 2492|  8.81k|    return OPJ_TRUE;
  ------------------
  |  |  117|  8.81k|#define OPJ_TRUE 1
  ------------------
 2493|  8.81k|}
j2k.c:opj_j2k_read_tlm:
 3661|     60|{
 3662|     60|    OPJ_UINT32 l_Ztlm, l_Stlm, l_ST, l_SP, l_tot_num_tp_remaining, l_quotient,
 3663|     60|               l_Ptlm_size;
 3664|       |    /* preconditions */
 3665|     60|    assert(p_header_data != 00);
 3666|     60|    assert(p_j2k != 00);
 3667|     60|    assert(p_manager != 00);
 3668|       |
 3669|     60|    OPJ_UNUSED(p_j2k);
  ------------------
  |  |  219|     60|#define OPJ_UNUSED(x) (void)x
  ------------------
 3670|       |
 3671|     60|    if (p_header_size < 2) {
  ------------------
  |  Branch (3671:9): [True: 1, False: 59]
  ------------------
 3672|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading TLM marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3673|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3674|      1|    }
 3675|     59|    p_header_size -= 2;
 3676|       |
 3677|     59|    opj_read_bytes(p_header_data, &l_Ztlm,
  ------------------
  |  |   65|     59|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3678|     59|                   1);                              /* Ztlm */
 3679|     59|    ++p_header_data;
 3680|     59|    opj_read_bytes(p_header_data, &l_Stlm,
  ------------------
  |  |   65|     59|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3681|     59|                   1);                              /* Stlm */
 3682|     59|    ++p_header_data;
 3683|       |
 3684|     59|    l_ST = ((l_Stlm >> 4) & 0x3);
 3685|     59|    l_SP = (l_Stlm >> 6) & 0x1;
 3686|       |
 3687|     59|    l_Ptlm_size = (l_SP + 1) * 2;
 3688|     59|    l_quotient = l_Ptlm_size + l_ST;
 3689|       |
 3690|     59|    l_tot_num_tp_remaining = p_header_size % l_quotient;
 3691|       |
 3692|     59|    if (l_tot_num_tp_remaining != 0) {
  ------------------
  |  Branch (3692:9): [True: 1, False: 58]
  ------------------
 3693|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading TLM marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3694|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3695|      1|    }
 3696|       |    /* FIXME Do not care of this at the moment since only local variables are set here */
 3697|       |    /*
 3698|       |    for
 3699|       |            (i = 0; i < l_tot_num_tp; ++i)
 3700|       |    {
 3701|       |            opj_read_bytes(p_header_data,&l_Ttlm_i,l_ST);                           // Ttlm_i
 3702|       |            p_header_data += l_ST;
 3703|       |            opj_read_bytes(p_header_data,&l_Ptlm_i,l_Ptlm_size);            // Ptlm_i
 3704|       |            p_header_data += l_Ptlm_size;
 3705|       |    }*/
 3706|     58|    return OPJ_TRUE;
  ------------------
  |  |  117|     58|#define OPJ_TRUE 1
  ------------------
 3707|     59|}
j2k.c:opj_j2k_read_plm:
 3722|    130|{
 3723|       |    /* preconditions */
 3724|    130|    assert(p_header_data != 00);
 3725|    130|    assert(p_j2k != 00);
 3726|    130|    assert(p_manager != 00);
 3727|       |
 3728|    130|    OPJ_UNUSED(p_j2k);
  ------------------
  |  |  219|    130|#define OPJ_UNUSED(x) (void)x
  ------------------
 3729|    130|    OPJ_UNUSED(p_header_data);
  ------------------
  |  |  219|    130|#define OPJ_UNUSED(x) (void)x
  ------------------
 3730|       |
 3731|    130|    if (p_header_size < 1) {
  ------------------
  |  Branch (3731:9): [True: 1, False: 129]
  ------------------
 3732|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading PLM marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3733|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3734|      1|    }
 3735|       |    /* Do not care of this at the moment since only local variables are set here */
 3736|       |    /*
 3737|       |    opj_read_bytes(p_header_data,&l_Zplm,1);                                        // Zplm
 3738|       |    ++p_header_data;
 3739|       |    --p_header_size;
 3740|       |
 3741|       |    while
 3742|       |            (p_header_size > 0)
 3743|       |    {
 3744|       |            opj_read_bytes(p_header_data,&l_Nplm,1);                                // Nplm
 3745|       |            ++p_header_data;
 3746|       |            p_header_size -= (1+l_Nplm);
 3747|       |            if
 3748|       |                    (p_header_size < 0)
 3749|       |            {
 3750|       |                    opj_event_msg(p_manager, EVT_ERROR, "Error reading PLM marker\n");
 3751|       |                    return false;
 3752|       |            }
 3753|       |            for
 3754|       |                    (i = 0; i < l_Nplm; ++i)
 3755|       |            {
 3756|       |                    opj_read_bytes(p_header_data,&l_tmp,1);                         // Iplm_ij
 3757|       |                    ++p_header_data;
 3758|       |                    // take only the last seven bytes
 3759|       |                    l_packet_len |= (l_tmp & 0x7f);
 3760|       |                    if
 3761|       |                            (l_tmp & 0x80)
 3762|       |                    {
 3763|       |                            l_packet_len <<= 7;
 3764|       |                    }
 3765|       |                    else
 3766|       |                    {
 3767|       |            // store packet length and proceed to next packet
 3768|       |                            l_packet_len = 0;
 3769|       |                    }
 3770|       |            }
 3771|       |            if
 3772|       |                    (l_packet_len != 0)
 3773|       |            {
 3774|       |                    opj_event_msg(p_manager, EVT_ERROR, "Error reading PLM marker\n");
 3775|       |                    return false;
 3776|       |            }
 3777|       |    }
 3778|       |    */
 3779|    129|    return OPJ_TRUE;
  ------------------
  |  |  117|    129|#define OPJ_TRUE 1
  ------------------
 3780|    130|}
j2k.c:opj_j2k_read_plt:
 3795|    412|{
 3796|    412|    OPJ_UINT32 l_Zplt, l_tmp, l_packet_len = 0, i;
 3797|       |
 3798|       |    /* preconditions */
 3799|    412|    assert(p_header_data != 00);
 3800|    412|    assert(p_j2k != 00);
 3801|    412|    assert(p_manager != 00);
 3802|       |
 3803|    412|    OPJ_UNUSED(p_j2k);
  ------------------
  |  |  219|    412|#define OPJ_UNUSED(x) (void)x
  ------------------
 3804|       |
 3805|    412|    if (p_header_size < 1) {
  ------------------
  |  Branch (3805:9): [True: 1, False: 411]
  ------------------
 3806|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading PLT marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3807|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3808|      1|    }
 3809|       |
 3810|    411|    opj_read_bytes(p_header_data, &l_Zplt, 1);              /* Zplt */
  ------------------
  |  |   65|    411|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3811|    411|    ++p_header_data;
 3812|    411|    --p_header_size;
 3813|       |
 3814|  51.9k|    for (i = 0; i < p_header_size; ++i) {
  ------------------
  |  Branch (3814:17): [True: 51.5k, False: 411]
  ------------------
 3815|  51.5k|        opj_read_bytes(p_header_data, &l_tmp, 1);       /* Iplt_ij */
  ------------------
  |  |   65|  51.5k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3816|  51.5k|        ++p_header_data;
 3817|       |        /* take only the last seven bytes */
 3818|  51.5k|        l_packet_len |= (l_tmp & 0x7f);
 3819|  51.5k|        if (l_tmp & 0x80) {
  ------------------
  |  Branch (3819:13): [True: 16.1k, False: 35.3k]
  ------------------
 3820|  16.1k|            l_packet_len <<= 7;
 3821|  35.3k|        } else {
 3822|       |            /* store packet length and proceed to next packet */
 3823|  35.3k|            l_packet_len = 0;
 3824|  35.3k|        }
 3825|  51.5k|    }
 3826|       |
 3827|    411|    if (l_packet_len != 0) {
  ------------------
  |  Branch (3827:9): [True: 12, False: 399]
  ------------------
 3828|     12|        opj_event_msg(p_manager, EVT_ERROR, "Error reading PLT marker\n");
  ------------------
  |  |   66|     12|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3829|     12|        return OPJ_FALSE;
  ------------------
  |  |  118|     12|#define OPJ_FALSE 0
  ------------------
 3830|     12|    }
 3831|       |
 3832|    399|    return OPJ_TRUE;
  ------------------
  |  |  117|    399|#define OPJ_TRUE 1
  ------------------
 3833|    411|}
j2k.c:opj_j2k_read_ppm:
 3849|    553|{
 3850|    553|    opj_cp_t *l_cp = 00;
 3851|    553|    OPJ_UINT32 l_Z_ppm;
 3852|       |
 3853|       |    /* preconditions */
 3854|    553|    assert(p_header_data != 00);
 3855|    553|    assert(p_j2k != 00);
 3856|    553|    assert(p_manager != 00);
 3857|       |
 3858|       |    /* We need to have the Z_ppm element + 1 byte of Nppm/Ippm at minimum */
 3859|    553|    if (p_header_size < 2) {
  ------------------
  |  Branch (3859:9): [True: 1, False: 552]
  ------------------
 3860|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading PPM marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3861|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3862|      1|    }
 3863|       |
 3864|    552|    l_cp = &(p_j2k->m_cp);
 3865|    552|    l_cp->ppm = 1;
 3866|       |
 3867|    552|    opj_read_bytes(p_header_data, &l_Z_ppm, 1);             /* Z_ppm */
  ------------------
  |  |   65|    552|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 3868|    552|    ++p_header_data;
 3869|    552|    --p_header_size;
 3870|       |
 3871|       |    /* check allocation needed */
 3872|    552|    if (l_cp->ppm_markers == NULL) { /* first PPM marker */
  ------------------
  |  Branch (3872:9): [True: 115, False: 437]
  ------------------
 3873|    115|        OPJ_UINT32 l_newCount = l_Z_ppm + 1U; /* can't overflow, l_Z_ppm is UINT8 */
 3874|    115|        assert(l_cp->ppm_markers_count == 0U);
 3875|       |
 3876|    115|        l_cp->ppm_markers = (opj_ppx *) opj_calloc(l_newCount, sizeof(opj_ppx));
 3877|    115|        if (l_cp->ppm_markers == NULL) {
  ------------------
  |  Branch (3877:13): [True: 0, False: 115]
  ------------------
 3878|      0|            opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPM marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3879|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3880|      0|        }
 3881|    115|        l_cp->ppm_markers_count = l_newCount;
 3882|    437|    } else if (l_cp->ppm_markers_count <= l_Z_ppm) {
  ------------------
  |  Branch (3882:16): [True: 272, False: 165]
  ------------------
 3883|    272|        OPJ_UINT32 l_newCount = l_Z_ppm + 1U; /* can't overflow, l_Z_ppm is UINT8 */
 3884|    272|        opj_ppx *new_ppm_markers;
 3885|    272|        new_ppm_markers = (opj_ppx *) opj_realloc(l_cp->ppm_markers,
 3886|    272|                          l_newCount * sizeof(opj_ppx));
 3887|    272|        if (new_ppm_markers == NULL) {
  ------------------
  |  Branch (3887:13): [True: 0, False: 272]
  ------------------
 3888|       |            /* clean up to be done on l_cp destruction */
 3889|      0|            opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPM marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3890|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3891|      0|        }
 3892|    272|        l_cp->ppm_markers = new_ppm_markers;
 3893|    272|        memset(l_cp->ppm_markers + l_cp->ppm_markers_count, 0,
 3894|    272|               (l_newCount - l_cp->ppm_markers_count) * sizeof(opj_ppx));
 3895|    272|        l_cp->ppm_markers_count = l_newCount;
 3896|    272|    }
 3897|       |
 3898|    552|    if (l_cp->ppm_markers[l_Z_ppm].m_data != NULL) {
  ------------------
  |  Branch (3898:9): [True: 1, False: 551]
  ------------------
 3899|       |        /* clean up to be done on l_cp destruction */
 3900|      1|        opj_event_msg(p_manager, EVT_ERROR, "Zppm %u already read\n", l_Z_ppm);
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3901|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 3902|      1|    }
 3903|       |
 3904|    551|    l_cp->ppm_markers[l_Z_ppm].m_data = (OPJ_BYTE *) opj_malloc(p_header_size);
 3905|    551|    if (l_cp->ppm_markers[l_Z_ppm].m_data == NULL) {
  ------------------
  |  Branch (3905:9): [True: 0, False: 551]
  ------------------
 3906|       |        /* clean up to be done on l_cp destruction */
 3907|      0|        opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPM marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3908|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 3909|      0|    }
 3910|    551|    l_cp->ppm_markers[l_Z_ppm].m_data_size = p_header_size;
 3911|    551|    memcpy(l_cp->ppm_markers[l_Z_ppm].m_data, p_header_data, p_header_size);
 3912|       |
 3913|    551|    return OPJ_TRUE;
  ------------------
  |  |  117|    551|#define OPJ_TRUE 1
  ------------------
 3914|    551|}
j2k.c:opj_j2k_read_ppt:
 4067|    182|{
 4068|    182|    opj_cp_t *l_cp = 00;
 4069|    182|    opj_tcp_t *l_tcp = 00;
 4070|    182|    OPJ_UINT32 l_Z_ppt;
 4071|       |
 4072|       |    /* preconditions */
 4073|    182|    assert(p_header_data != 00);
 4074|    182|    assert(p_j2k != 00);
 4075|    182|    assert(p_manager != 00);
 4076|       |
 4077|       |    /* We need to have the Z_ppt element + 1 byte of Ippt at minimum */
 4078|    182|    if (p_header_size < 2) {
  ------------------
  |  Branch (4078:9): [True: 1, False: 181]
  ------------------
 4079|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading PPT marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4080|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 4081|      1|    }
 4082|       |
 4083|    181|    l_cp = &(p_j2k->m_cp);
 4084|    181|    if (l_cp->ppm) {
  ------------------
  |  Branch (4084:9): [True: 1, False: 180]
  ------------------
 4085|      1|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4086|      1|                      "Error reading PPT marker: packet header have been previously found in the main header (PPM marker).\n");
 4087|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 4088|      1|    }
 4089|       |
 4090|    180|    l_tcp = &(l_cp->tcps[p_j2k->m_current_tile_number]);
 4091|    180|    l_tcp->ppt = 1;
 4092|       |
 4093|    180|    opj_read_bytes(p_header_data, &l_Z_ppt, 1);             /* Z_ppt */
  ------------------
  |  |   65|    180|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 4094|    180|    ++p_header_data;
 4095|    180|    --p_header_size;
 4096|       |
 4097|       |    /* check allocation needed */
 4098|    180|    if (l_tcp->ppt_markers == NULL) { /* first PPT marker */
  ------------------
  |  Branch (4098:9): [True: 150, False: 30]
  ------------------
 4099|    150|        OPJ_UINT32 l_newCount = l_Z_ppt + 1U; /* can't overflow, l_Z_ppt is UINT8 */
 4100|    150|        assert(l_tcp->ppt_markers_count == 0U);
 4101|       |
 4102|    150|        l_tcp->ppt_markers = (opj_ppx *) opj_calloc(l_newCount, sizeof(opj_ppx));
 4103|    150|        if (l_tcp->ppt_markers == NULL) {
  ------------------
  |  Branch (4103:13): [True: 0, False: 150]
  ------------------
 4104|      0|            opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPT marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4105|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4106|      0|        }
 4107|    150|        l_tcp->ppt_markers_count = l_newCount;
 4108|    150|    } else if (l_tcp->ppt_markers_count <= l_Z_ppt) {
  ------------------
  |  Branch (4108:16): [True: 9, False: 21]
  ------------------
 4109|      9|        OPJ_UINT32 l_newCount = l_Z_ppt + 1U; /* can't overflow, l_Z_ppt is UINT8 */
 4110|      9|        opj_ppx *new_ppt_markers;
 4111|      9|        new_ppt_markers = (opj_ppx *) opj_realloc(l_tcp->ppt_markers,
 4112|      9|                          l_newCount * sizeof(opj_ppx));
 4113|      9|        if (new_ppt_markers == NULL) {
  ------------------
  |  Branch (4113:13): [True: 0, False: 9]
  ------------------
 4114|       |            /* clean up to be done on l_tcp destruction */
 4115|      0|            opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPT marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4116|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4117|      0|        }
 4118|      9|        l_tcp->ppt_markers = new_ppt_markers;
 4119|      9|        memset(l_tcp->ppt_markers + l_tcp->ppt_markers_count, 0,
 4120|      9|               (l_newCount - l_tcp->ppt_markers_count) * sizeof(opj_ppx));
 4121|      9|        l_tcp->ppt_markers_count = l_newCount;
 4122|      9|    }
 4123|       |
 4124|    180|    if (l_tcp->ppt_markers[l_Z_ppt].m_data != NULL) {
  ------------------
  |  Branch (4124:9): [True: 1, False: 179]
  ------------------
 4125|       |        /* clean up to be done on l_tcp destruction */
 4126|      1|        opj_event_msg(p_manager, EVT_ERROR, "Zppt %u already read\n", l_Z_ppt);
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4127|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 4128|      1|    }
 4129|       |
 4130|    179|    l_tcp->ppt_markers[l_Z_ppt].m_data = (OPJ_BYTE *) opj_malloc(p_header_size);
 4131|    179|    if (l_tcp->ppt_markers[l_Z_ppt].m_data == NULL) {
  ------------------
  |  Branch (4131:9): [True: 0, False: 179]
  ------------------
 4132|       |        /* clean up to be done on l_tcp destruction */
 4133|      0|        opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPT marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4134|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4135|      0|    }
 4136|    179|    l_tcp->ppt_markers[l_Z_ppt].m_data_size = p_header_size;
 4137|    179|    memcpy(l_tcp->ppt_markers[l_Z_ppt].m_data, p_header_data, p_header_size);
 4138|    179|    return OPJ_TRUE;
  ------------------
  |  |  117|    179|#define OPJ_TRUE 1
  ------------------
 4139|    179|}
j2k.c:opj_j2k_read_crg:
 3619|     70|{
 3620|     70|    OPJ_UINT32 l_nb_comp;
 3621|       |    /* preconditions */
 3622|     70|    assert(p_header_data != 00);
 3623|     70|    assert(p_j2k != 00);
 3624|     70|    assert(p_manager != 00);
 3625|       |
 3626|     70|    OPJ_UNUSED(p_header_data);
  ------------------
  |  |  219|     70|#define OPJ_UNUSED(x) (void)x
  ------------------
 3627|       |
 3628|     70|    l_nb_comp = p_j2k->m_private_image->numcomps;
 3629|       |
 3630|     70|    if (p_header_size != l_nb_comp * 4) {
  ------------------
  |  Branch (3630:9): [True: 2, False: 68]
  ------------------
 3631|      2|        opj_event_msg(p_manager, EVT_ERROR, "Error reading CRG marker\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 3632|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 3633|      2|    }
 3634|       |    /* Do not care of this at the moment since only local variables are set here */
 3635|       |    /*
 3636|       |    for
 3637|       |            (i = 0; i < l_nb_comp; ++i)
 3638|       |    {
 3639|       |            opj_read_bytes(p_header_data,&l_Xcrg_i,2);                              // Xcrg_i
 3640|       |            p_header_data+=2;
 3641|       |            opj_read_bytes(p_header_data,&l_Ycrg_i,2);                              // Xcrg_i
 3642|       |            p_header_data+=2;
 3643|       |    }
 3644|       |    */
 3645|     68|    return OPJ_TRUE;
  ------------------
  |  |  117|     68|#define OPJ_TRUE 1
  ------------------
 3646|     70|}
j2k.c:opj_j2k_read_com:
 2565|  2.83k|{
 2566|       |    /* preconditions */
 2567|  2.83k|    assert(p_j2k != 00);
 2568|  2.83k|    assert(p_manager != 00);
 2569|  2.83k|    assert(p_header_data != 00);
 2570|       |
 2571|  2.83k|    OPJ_UNUSED(p_j2k);
  ------------------
  |  |  219|  2.83k|#define OPJ_UNUSED(x) (void)x
  ------------------
 2572|  2.83k|    OPJ_UNUSED(p_header_data);
  ------------------
  |  |  219|  2.83k|#define OPJ_UNUSED(x) (void)x
  ------------------
 2573|  2.83k|    OPJ_UNUSED(p_header_size);
  ------------------
  |  |  219|  2.83k|#define OPJ_UNUSED(x) (void)x
  ------------------
 2574|  2.83k|    OPJ_UNUSED(p_manager);
  ------------------
  |  |  219|  2.83k|#define OPJ_UNUSED(x) (void)x
  ------------------
 2575|       |
 2576|  2.83k|    return OPJ_TRUE;
  ------------------
  |  |  117|  2.83k|#define OPJ_TRUE 1
  ------------------
 2577|  2.83k|}
j2k.c:opj_j2k_read_mct:
 5809|  8.63k|{
 5810|  8.63k|    OPJ_UINT32 i;
 5811|  8.63k|    opj_tcp_t *l_tcp = 00;
 5812|  8.63k|    OPJ_UINT32 l_tmp;
 5813|  8.63k|    OPJ_UINT32 l_indix;
 5814|  8.63k|    opj_mct_data_t * l_mct_data;
 5815|       |
 5816|       |    /* preconditions */
 5817|  8.63k|    assert(p_header_data != 00);
 5818|  8.63k|    assert(p_j2k != 00);
 5819|       |
 5820|  8.63k|    l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?
  ------------------
  |  Branch (5820:13): [True: 76, False: 8.55k]
  ------------------
 5821|     76|            &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number] :
 5822|  8.63k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
 5823|       |
 5824|  8.63k|    if (p_header_size < 2) {
  ------------------
  |  Branch (5824:9): [True: 3, False: 8.63k]
  ------------------
 5825|      3|        opj_event_msg(p_manager, EVT_ERROR, "Error reading MCT marker\n");
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5826|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 5827|      3|    }
 5828|       |
 5829|       |    /* first marker */
 5830|  8.63k|    opj_read_bytes(p_header_data, &l_tmp, 2);                       /* Zmct */
  ------------------
  |  |   65|  8.63k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 5831|  8.63k|    p_header_data += 2;
 5832|  8.63k|    if (l_tmp != 0) {
  ------------------
  |  Branch (5832:9): [True: 1.02k, False: 7.60k]
  ------------------
 5833|  1.02k|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  1.02k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 5834|  1.02k|                      "Cannot take in charge mct data within multiple MCT records\n");
 5835|  1.02k|        return OPJ_TRUE;
  ------------------
  |  |  117|  1.02k|#define OPJ_TRUE 1
  ------------------
 5836|  1.02k|    }
 5837|       |
 5838|  7.60k|    if (p_header_size <= 6) {
  ------------------
  |  Branch (5838:9): [True: 1, False: 7.60k]
  ------------------
 5839|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading MCT marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5840|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 5841|      1|    }
 5842|       |
 5843|       |    /* Imct -> no need for other values, take the first, type is double with decorrelation x0000 1101 0000 0000*/
 5844|  7.60k|    opj_read_bytes(p_header_data, &l_tmp, 2);                       /* Imct */
  ------------------
  |  |   65|  7.60k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 5845|  7.60k|    p_header_data += 2;
 5846|       |
 5847|  7.60k|    l_indix = l_tmp & 0xff;
 5848|  7.60k|    l_mct_data = l_tcp->m_mct_records;
 5849|       |
 5850|  31.9k|    for (i = 0; i < l_tcp->m_nb_mct_records; ++i) {
  ------------------
  |  Branch (5850:17): [True: 31.2k, False: 734]
  ------------------
 5851|  31.2k|        if (l_mct_data->m_index == l_indix) {
  ------------------
  |  Branch (5851:13): [True: 6.87k, False: 24.3k]
  ------------------
 5852|  6.87k|            break;
 5853|  6.87k|        }
 5854|  24.3k|        ++l_mct_data;
 5855|  24.3k|    }
 5856|       |
 5857|       |    /* NOT FOUND */
 5858|  7.60k|    if (i == l_tcp->m_nb_mct_records) {
  ------------------
  |  Branch (5858:9): [True: 734, False: 6.87k]
  ------------------
 5859|    734|        if (l_tcp->m_nb_mct_records == l_tcp->m_nb_max_mct_records) {
  ------------------
  |  Branch (5859:13): [True: 45, False: 689]
  ------------------
 5860|     45|            opj_mct_data_t *new_mct_records;
 5861|     45|            l_tcp->m_nb_max_mct_records += OPJ_J2K_MCT_DEFAULT_NB_RECORDS;
  ------------------
  |  |  159|     45|#define OPJ_J2K_MCT_DEFAULT_NB_RECORDS      10
  ------------------
 5862|       |
 5863|     45|            new_mct_records = (opj_mct_data_t *) opj_realloc(l_tcp->m_mct_records,
 5864|     45|                              l_tcp->m_nb_max_mct_records * sizeof(opj_mct_data_t));
 5865|     45|            if (! new_mct_records) {
  ------------------
  |  Branch (5865:17): [True: 0, False: 45]
  ------------------
 5866|      0|                opj_free(l_tcp->m_mct_records);
 5867|      0|                l_tcp->m_mct_records = NULL;
 5868|      0|                l_tcp->m_nb_max_mct_records = 0;
 5869|      0|                l_tcp->m_nb_mct_records = 0;
 5870|      0|                opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read MCT marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5871|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 5872|      0|            }
 5873|       |
 5874|       |            /* Update m_mcc_records[].m_offset_array and m_decorrelation_array
 5875|       |             * to point to the new addresses */
 5876|     45|            if (new_mct_records != l_tcp->m_mct_records) {
  ------------------
  |  Branch (5876:17): [True: 29, False: 16]
  ------------------
 5877|    138|                for (i = 0; i < l_tcp->m_nb_mcc_records; ++i) {
  ------------------
  |  Branch (5877:29): [True: 109, False: 29]
  ------------------
 5878|    109|                    opj_simple_mcc_decorrelation_data_t* l_mcc_record =
 5879|    109|                        &(l_tcp->m_mcc_records[i]);
 5880|    109|                    if (l_mcc_record->m_decorrelation_array) {
  ------------------
  |  Branch (5880:25): [True: 36, False: 73]
  ------------------
 5881|     36|                        l_mcc_record->m_decorrelation_array =
 5882|     36|                            new_mct_records +
 5883|     36|                            (l_mcc_record->m_decorrelation_array -
 5884|     36|                             l_tcp->m_mct_records);
 5885|     36|                    }
 5886|    109|                    if (l_mcc_record->m_offset_array) {
  ------------------
  |  Branch (5886:25): [True: 36, False: 73]
  ------------------
 5887|     36|                        l_mcc_record->m_offset_array =
 5888|     36|                            new_mct_records +
 5889|     36|                            (l_mcc_record->m_offset_array -
 5890|     36|                             l_tcp->m_mct_records);
 5891|     36|                    }
 5892|    109|                }
 5893|     29|            }
 5894|       |
 5895|     45|            l_tcp->m_mct_records = new_mct_records;
 5896|     45|            l_mct_data = l_tcp->m_mct_records + l_tcp->m_nb_mct_records;
 5897|     45|            memset(l_mct_data, 0, (l_tcp->m_nb_max_mct_records - l_tcp->m_nb_mct_records) *
 5898|     45|                   sizeof(opj_mct_data_t));
 5899|     45|        }
 5900|       |
 5901|    734|        l_mct_data = l_tcp->m_mct_records + l_tcp->m_nb_mct_records;
 5902|    734|        ++l_tcp->m_nb_mct_records;
 5903|    734|    }
 5904|       |
 5905|  7.60k|    if (l_mct_data->m_data) {
  ------------------
  |  Branch (5905:9): [True: 1.21k, False: 6.39k]
  ------------------
 5906|  1.21k|        opj_free(l_mct_data->m_data);
 5907|  1.21k|        l_mct_data->m_data = 00;
 5908|  1.21k|        l_mct_data->m_data_size = 0;
 5909|  1.21k|    }
 5910|       |
 5911|  7.60k|    l_mct_data->m_index = l_indix;
 5912|  7.60k|    l_mct_data->m_array_type = (J2K_MCT_ARRAY_TYPE)((l_tmp  >> 8) & 3);
 5913|  7.60k|    l_mct_data->m_element_type = (J2K_MCT_ELEMENT_TYPE)((l_tmp  >> 10) & 3);
 5914|       |
 5915|  7.60k|    opj_read_bytes(p_header_data, &l_tmp, 2);                       /* Ymct */
  ------------------
  |  |   65|  7.60k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 5916|  7.60k|    p_header_data += 2;
 5917|  7.60k|    if (l_tmp != 0) {
  ------------------
  |  Branch (5917:9): [True: 6.14k, False: 1.46k]
  ------------------
 5918|  6.14k|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  6.14k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 5919|  6.14k|                      "Cannot take in charge multiple MCT markers\n");
 5920|  6.14k|        return OPJ_TRUE;
  ------------------
  |  |  117|  6.14k|#define OPJ_TRUE 1
  ------------------
 5921|  6.14k|    }
 5922|       |
 5923|  1.46k|    p_header_size -= 6;
 5924|       |
 5925|  1.46k|    l_mct_data->m_data = (OPJ_BYTE*)opj_malloc(p_header_size);
 5926|  1.46k|    if (! l_mct_data->m_data) {
  ------------------
  |  Branch (5926:9): [True: 0, False: 1.46k]
  ------------------
 5927|      0|        opj_event_msg(p_manager, EVT_ERROR, "Error reading MCT marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5928|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 5929|      0|    }
 5930|  1.46k|    memcpy(l_mct_data->m_data, p_header_data, p_header_size);
 5931|       |
 5932|  1.46k|    l_mct_data->m_data_size = p_header_size;
 5933|       |
 5934|  1.46k|    return OPJ_TRUE;
  ------------------
  |  |  117|  1.46k|#define OPJ_TRUE 1
  ------------------
 5935|  1.46k|}
j2k.c:opj_j2k_read_cbd:
 6583|     94|{
 6584|     94|    OPJ_UINT32 l_nb_comp, l_num_comp;
 6585|     94|    OPJ_UINT32 l_comp_def;
 6586|     94|    OPJ_UINT32 i;
 6587|     94|    opj_image_comp_t * l_comp = 00;
 6588|       |
 6589|       |    /* preconditions */
 6590|     94|    assert(p_header_data != 00);
 6591|     94|    assert(p_j2k != 00);
 6592|     94|    assert(p_manager != 00);
 6593|       |
 6594|     94|    l_num_comp = p_j2k->m_private_image->numcomps;
 6595|       |
 6596|     94|    if (p_header_size != (p_j2k->m_private_image->numcomps + 2)) {
  ------------------
  |  Branch (6596:9): [True: 3, False: 91]
  ------------------
 6597|      3|        opj_event_msg(p_manager, EVT_ERROR, "Crror reading CBD marker\n");
  ------------------
  |  |   66|      3|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6598|      3|        return OPJ_FALSE;
  ------------------
  |  |  118|      3|#define OPJ_FALSE 0
  ------------------
 6599|      3|    }
 6600|       |
 6601|     91|    opj_read_bytes(p_header_data, &l_nb_comp,
  ------------------
  |  |   65|     91|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6602|     91|                   2);                           /* Ncbd */
 6603|     91|    p_header_data += 2;
 6604|       |
 6605|     91|    if (l_nb_comp != l_num_comp) {
  ------------------
  |  Branch (6605:9): [True: 2, False: 89]
  ------------------
 6606|      2|        opj_event_msg(p_manager, EVT_ERROR, "Crror reading CBD marker\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6607|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 6608|      2|    }
 6609|       |
 6610|     89|    l_comp = p_j2k->m_private_image->comps;
 6611|    418|    for (i = 0; i < l_num_comp; ++i) {
  ------------------
  |  Branch (6611:17): [True: 333, False: 85]
  ------------------
 6612|    333|        opj_read_bytes(p_header_data, &l_comp_def,
  ------------------
  |  |   65|    333|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6613|    333|                       1);                  /* Component bit depth */
 6614|    333|        ++p_header_data;
 6615|    333|        l_comp->sgnd = (l_comp_def >> 7) & 1;
 6616|    333|        l_comp->prec = (l_comp_def & 0x7f) + 1;
 6617|       |
 6618|    333|        if (l_comp->prec > 31) {
  ------------------
  |  Branch (6618:13): [True: 4, False: 329]
  ------------------
 6619|      4|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      4|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6620|      4|                          "Invalid values for comp = %d : prec=%u (should be between 1 and 38 according to the JPEG2000 norm. OpenJpeg only supports up to 31)\n",
 6621|      4|                          i, l_comp->prec);
 6622|      4|            return OPJ_FALSE;
  ------------------
  |  |  118|      4|#define OPJ_FALSE 0
  ------------------
 6623|      4|        }
 6624|    329|        ++l_comp;
 6625|    329|    }
 6626|       |
 6627|     85|    return OPJ_TRUE;
  ------------------
  |  |  117|     85|#define OPJ_TRUE 1
  ------------------
 6628|     89|}
j2k.c:opj_j2k_read_cap:
 6644|    112|{
 6645|       |    /* preconditions */
 6646|    112|    assert(p_header_data != 00);
 6647|    112|    assert(p_j2k != 00);
 6648|    112|    assert(p_manager != 00);
 6649|       |
 6650|    112|    (void)p_j2k;
 6651|    112|    (void)p_header_data;
 6652|    112|    (void)p_header_size;
 6653|    112|    (void)p_manager;
 6654|       |
 6655|    112|    return OPJ_TRUE;
  ------------------
  |  |  117|    112|#define OPJ_TRUE 1
  ------------------
 6656|    112|}
j2k.c:opj_j2k_read_cpf:
 6670|     55|{
 6671|       |    /* preconditions */
 6672|     55|    assert(p_header_data != 00);
 6673|     55|    assert(p_j2k != 00);
 6674|     55|    assert(p_manager != 00);
 6675|       |
 6676|     55|    (void)p_j2k;
 6677|     55|    (void)p_header_data;
 6678|     55|    (void)p_header_size;
 6679|     55|    (void)p_manager;
 6680|       |
 6681|     55|    return OPJ_TRUE;
  ------------------
  |  |  117|     55|#define OPJ_TRUE 1
  ------------------
 6682|     55|}
j2k.c:opj_j2k_read_mcc:
 6056|  8.69k|{
 6057|  8.69k|    OPJ_UINT32 i, j;
 6058|  8.69k|    OPJ_UINT32 l_tmp;
 6059|  8.69k|    OPJ_UINT32 l_indix;
 6060|  8.69k|    opj_tcp_t * l_tcp;
 6061|  8.69k|    opj_simple_mcc_decorrelation_data_t * l_mcc_record;
 6062|  8.69k|    opj_mct_data_t * l_mct_data;
 6063|  8.69k|    OPJ_UINT32 l_nb_collections;
 6064|  8.69k|    OPJ_UINT32 l_nb_comps;
 6065|  8.69k|    OPJ_UINT32 l_nb_bytes_by_comp;
 6066|  8.69k|    OPJ_BOOL l_new_mcc = OPJ_FALSE;
  ------------------
  |  |  118|  8.69k|#define OPJ_FALSE 0
  ------------------
 6067|       |
 6068|       |    /* preconditions */
 6069|  8.69k|    assert(p_header_data != 00);
 6070|  8.69k|    assert(p_j2k != 00);
 6071|  8.69k|    assert(p_manager != 00);
 6072|       |
 6073|  8.69k|    l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?
  ------------------
  |  Branch (6073:13): [True: 97, False: 8.59k]
  ------------------
 6074|     97|            &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number] :
 6075|  8.69k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
 6076|       |
 6077|  8.69k|    if (p_header_size < 2) {
  ------------------
  |  Branch (6077:9): [True: 2, False: 8.69k]
  ------------------
 6078|      2|        opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6079|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 6080|      2|    }
 6081|       |
 6082|       |    /* first marker */
 6083|  8.69k|    opj_read_bytes(p_header_data, &l_tmp, 2);                       /* Zmcc */
  ------------------
  |  |   65|  8.69k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6084|  8.69k|    p_header_data += 2;
 6085|  8.69k|    if (l_tmp != 0) {
  ------------------
  |  Branch (6085:9): [True: 728, False: 7.96k]
  ------------------
 6086|    728|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|    728|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6087|    728|                      "Cannot take in charge multiple data spanning\n");
 6088|    728|        return OPJ_TRUE;
  ------------------
  |  |  117|    728|#define OPJ_TRUE 1
  ------------------
 6089|    728|    }
 6090|       |
 6091|  7.96k|    if (p_header_size < 7) {
  ------------------
  |  Branch (6091:9): [True: 1, False: 7.96k]
  ------------------
 6092|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6093|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 6094|      1|    }
 6095|       |
 6096|  7.96k|    opj_read_bytes(p_header_data, &l_indix,
  ------------------
  |  |   65|  7.96k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6097|  7.96k|                   1); /* Imcc -> no need for other values, take the first */
 6098|  7.96k|    ++p_header_data;
 6099|       |
 6100|  7.96k|    l_mcc_record = l_tcp->m_mcc_records;
 6101|       |
 6102|  15.6k|    for (i = 0; i < l_tcp->m_nb_mcc_records; ++i) {
  ------------------
  |  Branch (6102:17): [True: 10.6k, False: 5.05k]
  ------------------
 6103|  10.6k|        if (l_mcc_record->m_index == l_indix) {
  ------------------
  |  Branch (6103:13): [True: 2.90k, False: 7.70k]
  ------------------
 6104|  2.90k|            break;
 6105|  2.90k|        }
 6106|  7.70k|        ++l_mcc_record;
 6107|  7.70k|    }
 6108|       |
 6109|       |    /** NOT FOUND */
 6110|  7.96k|    if (i == l_tcp->m_nb_mcc_records) {
  ------------------
  |  Branch (6110:9): [True: 5.05k, False: 2.90k]
  ------------------
 6111|  5.05k|        if (l_tcp->m_nb_mcc_records == l_tcp->m_nb_max_mcc_records) {
  ------------------
  |  Branch (6111:13): [True: 11, False: 5.04k]
  ------------------
 6112|     11|            opj_simple_mcc_decorrelation_data_t *new_mcc_records;
 6113|     11|            l_tcp->m_nb_max_mcc_records += OPJ_J2K_MCC_DEFAULT_NB_RECORDS;
  ------------------
  |  |  158|     11|#define OPJ_J2K_MCC_DEFAULT_NB_RECORDS      10
  ------------------
 6114|       |
 6115|     11|            new_mcc_records = (opj_simple_mcc_decorrelation_data_t *) opj_realloc(
 6116|     11|                                  l_tcp->m_mcc_records, l_tcp->m_nb_max_mcc_records * sizeof(
 6117|     11|                                      opj_simple_mcc_decorrelation_data_t));
 6118|     11|            if (! new_mcc_records) {
  ------------------
  |  Branch (6118:17): [True: 0, False: 11]
  ------------------
 6119|      0|                opj_free(l_tcp->m_mcc_records);
 6120|      0|                l_tcp->m_mcc_records = NULL;
 6121|      0|                l_tcp->m_nb_max_mcc_records = 0;
 6122|      0|                l_tcp->m_nb_mcc_records = 0;
 6123|      0|                opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read MCC marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6124|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 6125|      0|            }
 6126|     11|            l_tcp->m_mcc_records = new_mcc_records;
 6127|     11|            l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_records;
 6128|     11|            memset(l_mcc_record, 0, (l_tcp->m_nb_max_mcc_records - l_tcp->m_nb_mcc_records)
 6129|     11|                   * sizeof(opj_simple_mcc_decorrelation_data_t));
 6130|     11|        }
 6131|  5.05k|        l_mcc_record = l_tcp->m_mcc_records + l_tcp->m_nb_mcc_records;
 6132|  5.05k|        l_new_mcc = OPJ_TRUE;
  ------------------
  |  |  117|  5.05k|#define OPJ_TRUE 1
  ------------------
 6133|  5.05k|    }
 6134|  7.96k|    l_mcc_record->m_index = l_indix;
 6135|       |
 6136|       |    /* only one marker atm */
 6137|  7.96k|    opj_read_bytes(p_header_data, &l_tmp, 2);                       /* Ymcc */
  ------------------
  |  |   65|  7.96k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6138|  7.96k|    p_header_data += 2;
 6139|  7.96k|    if (l_tmp != 0) {
  ------------------
  |  Branch (6139:9): [True: 617, False: 7.34k]
  ------------------
 6140|    617|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|    617|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6141|    617|                      "Cannot take in charge multiple data spanning\n");
 6142|    617|        return OPJ_TRUE;
  ------------------
  |  |  117|    617|#define OPJ_TRUE 1
  ------------------
 6143|    617|    }
 6144|       |
 6145|  7.34k|    opj_read_bytes(p_header_data, &l_nb_collections,
  ------------------
  |  |   65|  7.34k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6146|  7.34k|                   2);                              /* Qmcc -> number of collections -> 1 */
 6147|  7.34k|    p_header_data += 2;
 6148|       |
 6149|  7.34k|    if (l_nb_collections > 1) {
  ------------------
  |  Branch (6149:9): [True: 2.40k, False: 4.94k]
  ------------------
 6150|  2.40k|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  2.40k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6151|  2.40k|                      "Cannot take in charge multiple collections\n");
 6152|  2.40k|        return OPJ_TRUE;
  ------------------
  |  |  117|  2.40k|#define OPJ_TRUE 1
  ------------------
 6153|  2.40k|    }
 6154|       |
 6155|  4.94k|    p_header_size -= 7;
 6156|       |
 6157|  6.60k|    for (i = 0; i < l_nb_collections; ++i) {
  ------------------
  |  Branch (6157:17): [True: 4.33k, False: 2.26k]
  ------------------
 6158|  4.33k|        if (p_header_size < 3) {
  ------------------
  |  Branch (6158:13): [True: 1, False: 4.33k]
  ------------------
 6159|      1|            opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6160|      1|            return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 6161|      1|        }
 6162|       |
 6163|  4.33k|        opj_read_bytes(p_header_data, &l_tmp,
  ------------------
  |  |   65|  4.33k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6164|  4.33k|                       1); /* Xmcci type of component transformation -> array based decorrelation */
 6165|  4.33k|        ++p_header_data;
 6166|       |
 6167|  4.33k|        if (l_tmp != 1) {
  ------------------
  |  Branch (6167:13): [True: 1.58k, False: 2.74k]
  ------------------
 6168|  1.58k|            opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  1.58k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6169|  1.58k|                          "Cannot take in charge collections other than array decorrelation\n");
 6170|  1.58k|            return OPJ_TRUE;
  ------------------
  |  |  117|  1.58k|#define OPJ_TRUE 1
  ------------------
 6171|  1.58k|        }
 6172|       |
 6173|  2.74k|        opj_read_bytes(p_header_data, &l_nb_comps, 2);
  ------------------
  |  |   65|  2.74k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6174|       |
 6175|  2.74k|        p_header_data += 2;
 6176|  2.74k|        p_header_size -= 3;
 6177|       |
 6178|  2.74k|        l_nb_bytes_by_comp = 1 + (l_nb_comps >> 15);
 6179|  2.74k|        l_mcc_record->m_nb_comps = l_nb_comps & 0x7fff;
 6180|       |
 6181|  2.74k|        if (p_header_size < (l_nb_bytes_by_comp * l_mcc_record->m_nb_comps + 2)) {
  ------------------
  |  Branch (6181:13): [True: 6, False: 2.74k]
  ------------------
 6182|      6|            opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n");
  ------------------
  |  |   66|      6|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6183|      6|            return OPJ_FALSE;
  ------------------
  |  |  118|      6|#define OPJ_FALSE 0
  ------------------
 6184|      6|        }
 6185|       |
 6186|  2.74k|        p_header_size -= (l_nb_bytes_by_comp * l_mcc_record->m_nb_comps + 2);
 6187|       |
 6188|  4.36k|        for (j = 0; j < l_mcc_record->m_nb_comps; ++j) {
  ------------------
  |  Branch (6188:21): [True: 2.24k, False: 2.12k]
  ------------------
 6189|  2.24k|            opj_read_bytes(p_header_data, &l_tmp,
  ------------------
  |  |   65|  2.24k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6190|  2.24k|                           l_nb_bytes_by_comp);      /* Cmccij Component offset*/
 6191|  2.24k|            p_header_data += l_nb_bytes_by_comp;
 6192|       |
 6193|  2.24k|            if (l_tmp != j) {
  ------------------
  |  Branch (6193:17): [True: 621, False: 1.62k]
  ------------------
 6194|    621|                opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|    621|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6195|    621|                              "Cannot take in charge collections with indix shuffle\n");
 6196|    621|                return OPJ_TRUE;
  ------------------
  |  |  117|    621|#define OPJ_TRUE 1
  ------------------
 6197|    621|            }
 6198|  2.24k|        }
 6199|       |
 6200|  2.12k|        opj_read_bytes(p_header_data, &l_nb_comps, 2);
  ------------------
  |  |   65|  2.12k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6201|  2.12k|        p_header_data += 2;
 6202|       |
 6203|  2.12k|        l_nb_bytes_by_comp = 1 + (l_nb_comps >> 15);
 6204|  2.12k|        l_nb_comps &= 0x7fff;
 6205|       |
 6206|  2.12k|        if (l_nb_comps != l_mcc_record->m_nb_comps) {
  ------------------
  |  Branch (6206:13): [True: 402, False: 1.71k]
  ------------------
 6207|    402|            opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|    402|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6208|    402|                          "Cannot take in charge collections without same number of indixes\n");
 6209|    402|            return OPJ_TRUE;
  ------------------
  |  |  117|    402|#define OPJ_TRUE 1
  ------------------
 6210|    402|        }
 6211|       |
 6212|  1.71k|        if (p_header_size < (l_nb_bytes_by_comp * l_mcc_record->m_nb_comps + 3)) {
  ------------------
  |  Branch (6212:13): [True: 1, False: 1.71k]
  ------------------
 6213|      1|            opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6214|      1|            return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 6215|      1|        }
 6216|       |
 6217|  1.71k|        p_header_size -= (l_nb_bytes_by_comp * l_mcc_record->m_nb_comps + 3);
 6218|       |
 6219|  2.00k|        for (j = 0; j < l_mcc_record->m_nb_comps; ++j) {
  ------------------
  |  Branch (6219:21): [True: 328, False: 1.67k]
  ------------------
 6220|    328|            opj_read_bytes(p_header_data, &l_tmp,
  ------------------
  |  |   65|    328|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6221|    328|                           l_nb_bytes_by_comp);      /* Wmccij Component offset*/
 6222|    328|            p_header_data += l_nb_bytes_by_comp;
 6223|       |
 6224|    328|            if (l_tmp != j) {
  ------------------
  |  Branch (6224:17): [True: 44, False: 284]
  ------------------
 6225|     44|                opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|     44|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6226|     44|                              "Cannot take in charge collections with indix shuffle\n");
 6227|     44|                return OPJ_TRUE;
  ------------------
  |  |  117|     44|#define OPJ_TRUE 1
  ------------------
 6228|     44|            }
 6229|    328|        }
 6230|       |
 6231|  1.67k|        opj_read_bytes(p_header_data, &l_tmp, 3); /* Wmccij Component offset*/
  ------------------
  |  |   65|  1.67k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6232|  1.67k|        p_header_data += 3;
 6233|       |
 6234|  1.67k|        l_mcc_record->m_is_irreversible = !((l_tmp >> 16) & 1);
 6235|  1.67k|        l_mcc_record->m_decorrelation_array = 00;
 6236|  1.67k|        l_mcc_record->m_offset_array = 00;
 6237|       |
 6238|  1.67k|        l_indix = l_tmp & 0xff;
 6239|  1.67k|        if (l_indix != 0) {
  ------------------
  |  Branch (6239:13): [True: 1.51k, False: 159]
  ------------------
 6240|  1.51k|            l_mct_data = l_tcp->m_mct_records;
 6241|  6.71k|            for (j = 0; j < l_tcp->m_nb_mct_records; ++j) {
  ------------------
  |  Branch (6241:25): [True: 6.70k, False: 8]
  ------------------
 6242|  6.70k|                if (l_mct_data->m_index == l_indix) {
  ------------------
  |  Branch (6242:21): [True: 1.50k, False: 5.19k]
  ------------------
 6243|  1.50k|                    l_mcc_record->m_decorrelation_array = l_mct_data;
 6244|  1.50k|                    break;
 6245|  1.50k|                }
 6246|  5.19k|                ++l_mct_data;
 6247|  5.19k|            }
 6248|       |
 6249|  1.51k|            if (l_mcc_record->m_decorrelation_array == 00) {
  ------------------
  |  Branch (6249:17): [True: 8, False: 1.50k]
  ------------------
 6250|      8|                opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n");
  ------------------
  |  |   66|      8|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6251|      8|                return OPJ_FALSE;
  ------------------
  |  |  118|      8|#define OPJ_FALSE 0
  ------------------
 6252|      8|            }
 6253|  1.51k|        }
 6254|       |
 6255|  1.66k|        l_indix = (l_tmp >> 8) & 0xff;
 6256|  1.66k|        if (l_indix != 0) {
  ------------------
  |  Branch (6256:13): [True: 1.47k, False: 194]
  ------------------
 6257|  1.47k|            l_mct_data = l_tcp->m_mct_records;
 6258|  6.67k|            for (j = 0; j < l_tcp->m_nb_mct_records; ++j) {
  ------------------
  |  Branch (6258:25): [True: 6.66k, False: 9]
  ------------------
 6259|  6.66k|                if (l_mct_data->m_index == l_indix) {
  ------------------
  |  Branch (6259:21): [True: 1.46k, False: 5.20k]
  ------------------
 6260|  1.46k|                    l_mcc_record->m_offset_array = l_mct_data;
 6261|  1.46k|                    break;
 6262|  1.46k|                }
 6263|  5.20k|                ++l_mct_data;
 6264|  5.20k|            }
 6265|       |
 6266|  1.47k|            if (l_mcc_record->m_offset_array == 00) {
  ------------------
  |  Branch (6266:17): [True: 9, False: 1.46k]
  ------------------
 6267|      9|                opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n");
  ------------------
  |  |   66|      9|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6268|      9|                return OPJ_FALSE;
  ------------------
  |  |  118|      9|#define OPJ_FALSE 0
  ------------------
 6269|      9|            }
 6270|  1.47k|        }
 6271|  1.66k|    }
 6272|       |
 6273|  2.26k|    if (p_header_size != 0) {
  ------------------
  |  Branch (6273:9): [True: 1, False: 2.26k]
  ------------------
 6274|      1|        opj_event_msg(p_manager, EVT_ERROR, "Error reading MCC marker\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6275|      1|        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 6276|      1|    }
 6277|       |
 6278|  2.26k|    if (l_new_mcc) {
  ------------------
  |  Branch (6278:9): [True: 463, False: 1.80k]
  ------------------
 6279|    463|        ++l_tcp->m_nb_mcc_records;
 6280|    463|    }
 6281|       |
 6282|  2.26k|    return OPJ_TRUE;
  ------------------
  |  |  117|  2.26k|#define OPJ_TRUE 1
  ------------------
 6283|  2.26k|}
j2k.c:opj_j2k_read_mco:
 6361|  42.4k|{
 6362|  42.4k|    OPJ_UINT32 l_tmp, i;
 6363|  42.4k|    OPJ_UINT32 l_nb_stages;
 6364|  42.4k|    opj_tcp_t * l_tcp;
 6365|  42.4k|    opj_tccp_t * l_tccp;
 6366|  42.4k|    opj_image_t * l_image;
 6367|       |
 6368|       |    /* preconditions */
 6369|  42.4k|    assert(p_header_data != 00);
 6370|  42.4k|    assert(p_j2k != 00);
 6371|  42.4k|    assert(p_manager != 00);
 6372|       |
 6373|  42.4k|    l_image = p_j2k->m_private_image;
 6374|  42.4k|    l_tcp = p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_TPH ?
  ------------------
  |  Branch (6374:13): [True: 980, False: 41.5k]
  ------------------
 6375|    980|            &p_j2k->m_cp.tcps[p_j2k->m_current_tile_number] :
 6376|  42.4k|            p_j2k->m_specific_param.m_decoder.m_default_tcp;
 6377|       |
 6378|  42.4k|    if (p_header_size < 1) {
  ------------------
  |  Branch (6378:9): [True: 2, False: 42.4k]
  ------------------
 6379|      2|        opj_event_msg(p_manager, EVT_ERROR, "Error reading MCO marker\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 6380|      2|        return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 6381|      2|    }
 6382|       |
 6383|  42.4k|    opj_read_bytes(p_header_data, &l_nb_stages,
  ------------------
  |  |   65|  42.4k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6384|  42.4k|                   1);                         /* Nmco : only one transform stage*/
 6385|  42.4k|    ++p_header_data;
 6386|       |
 6387|  42.4k|    if (l_nb_stages > 1) {
  ------------------
  |  Branch (6387:9): [True: 37.8k, False: 4.59k]
  ------------------
 6388|  37.8k|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  37.8k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6389|  37.8k|                      "Cannot take in charge multiple transformation stages.\n");
 6390|  37.8k|        return OPJ_TRUE;
  ------------------
  |  |  117|  37.8k|#define OPJ_TRUE 1
  ------------------
 6391|  37.8k|    }
 6392|       |
 6393|  4.59k|    if (p_header_size != l_nb_stages + 1) {
  ------------------
  |  Branch (6393:9): [True: 4, False: 4.59k]
  ------------------
 6394|      4|        opj_event_msg(p_manager, EVT_WARNING, "Error reading MCO marker\n");
  ------------------
  |  |   67|      4|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 6395|      4|        return OPJ_FALSE;
  ------------------
  |  |  118|      4|#define OPJ_FALSE 0
  ------------------
 6396|      4|    }
 6397|       |
 6398|  4.59k|    l_tccp = l_tcp->tccps;
 6399|       |
 6400|  16.7k|    for (i = 0; i < l_image->numcomps; ++i) {
  ------------------
  |  Branch (6400:17): [True: 12.1k, False: 4.59k]
  ------------------
 6401|  12.1k|        l_tccp->m_dc_level_shift = 0;
 6402|  12.1k|        ++l_tccp;
 6403|  12.1k|    }
 6404|       |
 6405|  4.59k|    if (l_tcp->m_mct_decoding_matrix) {
  ------------------
  |  Branch (6405:9): [True: 1.83k, False: 2.75k]
  ------------------
 6406|  1.83k|        opj_free(l_tcp->m_mct_decoding_matrix);
 6407|  1.83k|        l_tcp->m_mct_decoding_matrix = 00;
 6408|  1.83k|    }
 6409|       |
 6410|  8.93k|    for (i = 0; i < l_nb_stages; ++i) {
  ------------------
  |  Branch (6410:17): [True: 4.35k, False: 4.58k]
  ------------------
 6411|  4.35k|        opj_read_bytes(p_header_data, &l_tmp, 1);
  ------------------
  |  |   65|  4.35k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 6412|  4.35k|        ++p_header_data;
 6413|       |
 6414|  4.35k|        if (! opj_j2k_add_mct(l_tcp, p_j2k->m_private_image, l_tmp)) {
  ------------------
  |  Branch (6414:13): [True: 5, False: 4.34k]
  ------------------
 6415|      5|            return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
 6416|      5|        }
 6417|  4.35k|    }
 6418|       |
 6419|  4.58k|    return OPJ_TRUE;
  ------------------
  |  |  117|  4.58k|#define OPJ_TRUE 1
  ------------------
 6420|  4.59k|}
j2k.c:opj_j2k_add_mct:
 6424|  4.35k|{
 6425|  4.35k|    OPJ_UINT32 i;
 6426|  4.35k|    opj_simple_mcc_decorrelation_data_t * l_mcc_record;
 6427|  4.35k|    opj_mct_data_t * l_deco_array, * l_offset_array;
 6428|  4.35k|    OPJ_UINT32 l_data_size, l_mct_size, l_offset_size;
 6429|  4.35k|    OPJ_UINT32 l_nb_elem;
 6430|  4.35k|    OPJ_UINT32 * l_offset_data, * l_current_offset_data;
 6431|  4.35k|    opj_tccp_t * l_tccp;
 6432|       |
 6433|       |    /* preconditions */
 6434|  4.35k|    assert(p_tcp != 00);
 6435|       |
 6436|  4.35k|    l_mcc_record = p_tcp->m_mcc_records;
 6437|       |
 6438|  4.86k|    for (i = 0; i < p_tcp->m_nb_mcc_records; ++i) {
  ------------------
  |  Branch (6438:17): [True: 3.12k, False: 1.73k]
  ------------------
 6439|  3.12k|        if (l_mcc_record->m_index == p_index) {
  ------------------
  |  Branch (6439:13): [True: 2.61k, False: 513]
  ------------------
 6440|  2.61k|            break;
 6441|  2.61k|        }
 6442|  3.12k|    }
 6443|       |
 6444|  4.35k|    if (i == p_tcp->m_nb_mcc_records) {
  ------------------
  |  Branch (6444:9): [True: 1.73k, False: 2.61k]
  ------------------
 6445|       |        /** element discarded **/
 6446|  1.73k|        return OPJ_TRUE;
  ------------------
  |  |  117|  1.73k|#define OPJ_TRUE 1
  ------------------
 6447|  1.73k|    }
 6448|       |
 6449|  2.61k|    if (l_mcc_record->m_nb_comps != p_image->numcomps) {
  ------------------
  |  Branch (6449:9): [True: 209, False: 2.40k]
  ------------------
 6450|       |        /** do not support number of comps != image */
 6451|    209|        return OPJ_TRUE;
  ------------------
  |  |  117|    209|#define OPJ_TRUE 1
  ------------------
 6452|    209|    }
 6453|       |
 6454|  2.40k|    l_deco_array = l_mcc_record->m_decorrelation_array;
 6455|       |
 6456|  2.40k|    if (l_deco_array) {
  ------------------
  |  Branch (6456:9): [True: 1.89k, False: 510]
  ------------------
 6457|  1.89k|        l_data_size = MCT_ELEMENT_SIZE[l_deco_array->m_element_type] * p_image->numcomps
 6458|  1.89k|                      * p_image->numcomps;
 6459|  1.89k|        if (l_deco_array->m_data_size != l_data_size) {
  ------------------
  |  Branch (6459:13): [True: 1, False: 1.89k]
  ------------------
 6460|      1|            return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 6461|      1|        }
 6462|       |
 6463|  1.89k|        l_nb_elem = p_image->numcomps * p_image->numcomps;
 6464|  1.89k|        l_mct_size = l_nb_elem * (OPJ_UINT32)sizeof(OPJ_FLOAT32);
 6465|  1.89k|        p_tcp->m_mct_decoding_matrix = (OPJ_FLOAT32*)opj_malloc(l_mct_size);
 6466|       |
 6467|  1.89k|        if (! p_tcp->m_mct_decoding_matrix) {
  ------------------
  |  Branch (6467:13): [True: 0, False: 1.89k]
  ------------------
 6468|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 6469|      0|        }
 6470|       |
 6471|  1.89k|        j2k_mct_read_functions_to_float[l_deco_array->m_element_type](
 6472|  1.89k|            l_deco_array->m_data, p_tcp->m_mct_decoding_matrix, l_nb_elem);
 6473|  1.89k|    }
 6474|       |
 6475|  2.40k|    l_offset_array = l_mcc_record->m_offset_array;
 6476|       |
 6477|  2.40k|    if (l_offset_array) {
  ------------------
  |  Branch (6477:9): [True: 651, False: 1.75k]
  ------------------
 6478|    651|        l_data_size = MCT_ELEMENT_SIZE[l_offset_array->m_element_type] *
 6479|    651|                      p_image->numcomps;
 6480|    651|        if (l_offset_array->m_data_size != l_data_size) {
  ------------------
  |  Branch (6480:13): [True: 4, False: 647]
  ------------------
 6481|      4|            return OPJ_FALSE;
  ------------------
  |  |  118|      4|#define OPJ_FALSE 0
  ------------------
 6482|      4|        }
 6483|       |
 6484|    647|        l_nb_elem = p_image->numcomps;
 6485|    647|        l_offset_size = l_nb_elem * (OPJ_UINT32)sizeof(OPJ_UINT32);
 6486|    647|        l_offset_data = (OPJ_UINT32*)opj_malloc(l_offset_size);
 6487|       |
 6488|    647|        if (! l_offset_data) {
  ------------------
  |  Branch (6488:13): [True: 0, False: 647]
  ------------------
 6489|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 6490|      0|        }
 6491|       |
 6492|    647|        j2k_mct_read_functions_to_int32[l_offset_array->m_element_type](
 6493|    647|            l_offset_array->m_data, l_offset_data, l_nb_elem);
 6494|       |
 6495|    647|        l_tccp = p_tcp->tccps;
 6496|    647|        l_current_offset_data = l_offset_data;
 6497|       |
 6498|  1.77k|        for (i = 0; i < p_image->numcomps; ++i) {
  ------------------
  |  Branch (6498:21): [True: 1.12k, False: 647]
  ------------------
 6499|  1.12k|            l_tccp->m_dc_level_shift = (OPJ_INT32) * (l_current_offset_data++);
 6500|  1.12k|            ++l_tccp;
 6501|  1.12k|        }
 6502|       |
 6503|    647|        opj_free(l_offset_data);
 6504|    647|    }
 6505|       |
 6506|  2.40k|    return OPJ_TRUE;
  ------------------
  |  |  117|  2.40k|#define OPJ_TRUE 1
  ------------------
 6507|  2.40k|}
j2k.c:opj_j2k_read_int16_to_float:
 1449|    533|{
 1450|    533|    OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;
 1451|    533|    OPJ_FLOAT32 * l_dest_data = (OPJ_FLOAT32 *) p_dest_data;
 1452|    533|    OPJ_UINT32 i;
 1453|    533|    OPJ_UINT32 l_temp;
 1454|       |
 1455|  2.64k|    for (i = 0; i < p_nb_elem; ++i) {
  ------------------
  |  Branch (1455:17): [True: 2.11k, False: 533]
  ------------------
 1456|  2.11k|        opj_read_bytes(l_src_data, &l_temp, 2);
  ------------------
  |  |   65|  2.11k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 1457|       |
 1458|  2.11k|        l_src_data += sizeof(OPJ_INT16);
 1459|       |
 1460|  2.11k|        *(l_dest_data++) = (OPJ_FLOAT32) l_temp;
 1461|  2.11k|    }
 1462|    533|}
j2k.c:opj_j2k_read_int32_to_float:
 1466|    585|{
 1467|    585|    OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;
 1468|    585|    OPJ_FLOAT32 * l_dest_data = (OPJ_FLOAT32 *) p_dest_data;
 1469|    585|    OPJ_UINT32 i;
 1470|    585|    OPJ_UINT32 l_temp;
 1471|       |
 1472|  2.73k|    for (i = 0; i < p_nb_elem; ++i) {
  ------------------
  |  Branch (1472:17): [True: 2.15k, False: 585]
  ------------------
 1473|  2.15k|        opj_read_bytes(l_src_data, &l_temp, 4);
  ------------------
  |  |   65|  2.15k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 1474|       |
 1475|  2.15k|        l_src_data += sizeof(OPJ_INT32);
 1476|       |
 1477|  2.15k|        *(l_dest_data++) = (OPJ_FLOAT32) l_temp;
 1478|  2.15k|    }
 1479|    585|}
j2k.c:opj_j2k_read_float32_to_float:
 1483|    411|{
 1484|    411|    OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;
 1485|    411|    OPJ_FLOAT32 * l_dest_data = (OPJ_FLOAT32 *) p_dest_data;
 1486|    411|    OPJ_UINT32 i;
 1487|    411|    OPJ_FLOAT32 l_temp;
 1488|       |
 1489|  1.84k|    for (i = 0; i < p_nb_elem; ++i) {
  ------------------
  |  Branch (1489:17): [True: 1.43k, False: 411]
  ------------------
 1490|  1.43k|        opj_read_float(l_src_data, &l_temp);
  ------------------
  |  |   69|  1.43k|#define opj_read_float      opj_read_float_LE
  ------------------
 1491|       |
 1492|  1.43k|        l_src_data += sizeof(OPJ_FLOAT32);
 1493|       |
 1494|  1.43k|        *(l_dest_data++) = l_temp;
 1495|  1.43k|    }
 1496|    411|}
j2k.c:opj_j2k_read_float64_to_float:
 1500|    366|{
 1501|    366|    OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;
 1502|    366|    OPJ_FLOAT32 * l_dest_data = (OPJ_FLOAT32 *) p_dest_data;
 1503|    366|    OPJ_UINT32 i;
 1504|    366|    OPJ_FLOAT64 l_temp;
 1505|       |
 1506|  1.81k|    for (i = 0; i < p_nb_elem; ++i) {
  ------------------
  |  Branch (1506:17): [True: 1.45k, False: 366]
  ------------------
 1507|  1.45k|        opj_read_double(l_src_data, &l_temp);
  ------------------
  |  |   67|  1.45k|#define opj_read_double     opj_read_double_LE
  ------------------
 1508|       |
 1509|  1.45k|        l_src_data += sizeof(OPJ_FLOAT64);
 1510|       |
 1511|  1.45k|        *(l_dest_data++) = (OPJ_FLOAT32) l_temp;
 1512|  1.45k|    }
 1513|    366|}
j2k.c:opj_j2k_read_int16_to_int32:
 1517|     47|{
 1518|     47|    OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;
 1519|     47|    OPJ_INT32 * l_dest_data = (OPJ_INT32 *) p_dest_data;
 1520|     47|    OPJ_UINT32 i;
 1521|     47|    OPJ_UINT32 l_temp;
 1522|       |
 1523|    134|    for (i = 0; i < p_nb_elem; ++i) {
  ------------------
  |  Branch (1523:17): [True: 87, False: 47]
  ------------------
 1524|     87|        opj_read_bytes(l_src_data, &l_temp, 2);
  ------------------
  |  |   65|     87|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 1525|       |
 1526|     87|        l_src_data += sizeof(OPJ_INT16);
 1527|       |
 1528|     87|        *(l_dest_data++) = (OPJ_INT32) l_temp;
 1529|     87|    }
 1530|     47|}
j2k.c:opj_j2k_read_int32_to_int32:
 1534|    133|{
 1535|    133|    OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;
 1536|    133|    OPJ_INT32 * l_dest_data = (OPJ_INT32 *) p_dest_data;
 1537|    133|    OPJ_UINT32 i;
 1538|    133|    OPJ_UINT32 l_temp;
 1539|       |
 1540|    340|    for (i = 0; i < p_nb_elem; ++i) {
  ------------------
  |  Branch (1540:17): [True: 207, False: 133]
  ------------------
 1541|    207|        opj_read_bytes(l_src_data, &l_temp, 4);
  ------------------
  |  |   65|    207|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 1542|       |
 1543|    207|        l_src_data += sizeof(OPJ_INT32);
 1544|       |
 1545|    207|        *(l_dest_data++) = (OPJ_INT32) l_temp;
 1546|    207|    }
 1547|    133|}
j2k.c:opj_j2k_read_float32_to_int32:
 1551|    392|{
 1552|    392|    OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;
 1553|    392|    OPJ_INT32 * l_dest_data = (OPJ_INT32 *) p_dest_data;
 1554|    392|    OPJ_UINT32 i;
 1555|    392|    OPJ_FLOAT32 l_temp;
 1556|       |
 1557|  1.07k|    for (i = 0; i < p_nb_elem; ++i) {
  ------------------
  |  Branch (1557:17): [True: 683, False: 392]
  ------------------
 1558|    683|        opj_read_float(l_src_data, &l_temp);
  ------------------
  |  |   69|    683|#define opj_read_float      opj_read_float_LE
  ------------------
 1559|       |
 1560|    683|        l_src_data += sizeof(OPJ_FLOAT32);
 1561|       |
 1562|    683|        *(l_dest_data++) = (OPJ_INT32) l_temp;
 1563|    683|    }
 1564|    392|}
j2k.c:opj_j2k_read_float64_to_int32:
 1568|     75|{
 1569|     75|    OPJ_BYTE * l_src_data = (OPJ_BYTE *) p_src_data;
 1570|     75|    OPJ_INT32 * l_dest_data = (OPJ_INT32 *) p_dest_data;
 1571|     75|    OPJ_UINT32 i;
 1572|     75|    OPJ_FLOAT64 l_temp;
 1573|       |
 1574|    222|    for (i = 0; i < p_nb_elem; ++i) {
  ------------------
  |  Branch (1574:17): [True: 147, False: 75]
  ------------------
 1575|    147|        opj_read_double(l_src_data, &l_temp);
  ------------------
  |  |   67|    147|#define opj_read_double     opj_read_double_LE
  ------------------
 1576|       |
 1577|    147|        l_src_data += sizeof(OPJ_FLOAT64);
 1578|       |
 1579|    147|        *(l_dest_data++) = (OPJ_INT32) l_temp;
 1580|    147|    }
 1581|     75|}
j2k.c:opj_j2k_add_tlmarker:
 8358|  26.2k|{
 8359|  26.2k|    assert(cstr_index != 00);
 8360|  26.2k|    assert(cstr_index->tile_index != 00);
 8361|       |
 8362|       |    /* expand the list? */
 8363|  26.2k|    if ((cstr_index->tile_index[tileno].marknum + 1) >
  ------------------
  |  Branch (8363:9): [True: 53, False: 26.2k]
  ------------------
 8364|  26.2k|            cstr_index->tile_index[tileno].maxmarknum) {
 8365|     53|        opj_marker_info_t *new_marker;
 8366|     53|        cstr_index->tile_index[tileno].maxmarknum = (OPJ_UINT32)(100 +
 8367|     53|                (OPJ_FLOAT32) cstr_index->tile_index[tileno].maxmarknum);
 8368|     53|        new_marker = (opj_marker_info_t *) opj_realloc(
 8369|     53|                         cstr_index->tile_index[tileno].marker,
 8370|     53|                         cstr_index->tile_index[tileno].maxmarknum * sizeof(opj_marker_info_t));
 8371|     53|        if (! new_marker) {
  ------------------
  |  Branch (8371:13): [True: 0, False: 53]
  ------------------
 8372|      0|            opj_free(cstr_index->tile_index[tileno].marker);
 8373|      0|            cstr_index->tile_index[tileno].marker = NULL;
 8374|      0|            cstr_index->tile_index[tileno].maxmarknum = 0;
 8375|      0|            cstr_index->tile_index[tileno].marknum = 0;
 8376|       |            /* opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to add tl marker\n"); */
 8377|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 8378|      0|        }
 8379|     53|        cstr_index->tile_index[tileno].marker = new_marker;
 8380|     53|    }
 8381|       |
 8382|       |    /* add the marker */
 8383|  26.2k|    cstr_index->tile_index[tileno].marker[cstr_index->tile_index[tileno].marknum].type
 8384|  26.2k|        = (OPJ_UINT16)type;
 8385|  26.2k|    cstr_index->tile_index[tileno].marker[cstr_index->tile_index[tileno].marknum].pos
 8386|  26.2k|        = (OPJ_INT32)pos;
 8387|  26.2k|    cstr_index->tile_index[tileno].marker[cstr_index->tile_index[tileno].marknum].len
 8388|  26.2k|        = (OPJ_INT32)len;
 8389|  26.2k|    cstr_index->tile_index[tileno].marknum++;
 8390|       |
 8391|  26.2k|    if (type == J2K_MS_SOT) {
  ------------------
  |  |   73|  26.2k|#define J2K_MS_SOT 0xff90   /**< SOT marker value */
  ------------------
  |  Branch (8391:9): [True: 9.75k, False: 16.5k]
  ------------------
 8392|  9.75k|        OPJ_UINT32 l_current_tile_part = cstr_index->tile_index[tileno].current_tpsno;
 8393|       |
 8394|  9.75k|        if (cstr_index->tile_index[tileno].tp_index) {
  ------------------
  |  Branch (8394:13): [True: 9.75k, False: 0]
  ------------------
 8395|  9.75k|            cstr_index->tile_index[tileno].tp_index[l_current_tile_part].start_pos = pos;
 8396|  9.75k|        }
 8397|       |
 8398|  9.75k|    }
 8399|  26.2k|    return OPJ_TRUE;
  ------------------
  |  |  117|  26.2k|#define OPJ_TRUE 1
  ------------------
 8400|  26.2k|}
j2k.c:opj_j2k_read_sod:
 4927|  11.8k|{
 4928|  11.8k|    OPJ_SIZE_T l_current_read_size;
 4929|  11.8k|    opj_codestream_index_t * l_cstr_index = 00;
 4930|  11.8k|    OPJ_BYTE ** l_current_data = 00;
 4931|  11.8k|    opj_tcp_t * l_tcp = 00;
 4932|  11.8k|    OPJ_UINT32 * l_tile_len = 00;
 4933|  11.8k|    OPJ_BOOL l_sot_length_pb_detected = OPJ_FALSE;
  ------------------
  |  |  118|  11.8k|#define OPJ_FALSE 0
  ------------------
 4934|       |
 4935|       |    /* preconditions */
 4936|  11.8k|    assert(p_j2k != 00);
 4937|  11.8k|    assert(p_manager != 00);
 4938|  11.8k|    assert(p_stream != 00);
 4939|       |
 4940|  11.8k|    l_tcp = &(p_j2k->m_cp.tcps[p_j2k->m_current_tile_number]);
 4941|       |
 4942|  11.8k|    if (p_j2k->m_specific_param.m_decoder.m_last_tile_part) {
  ------------------
  |  Branch (4942:9): [True: 6.69k, False: 5.14k]
  ------------------
 4943|       |        /* opj_stream_get_number_byte_left returns OPJ_OFF_T
 4944|       |        // but we are in the last tile part,
 4945|       |        // so its result will fit on OPJ_UINT32 unless we find
 4946|       |        // a file with a single tile part of more than 4 GB...*/
 4947|  6.69k|        p_j2k->m_specific_param.m_decoder.m_sot_length = (OPJ_UINT32)(
 4948|  6.69k|                    opj_stream_get_number_byte_left(p_stream) - 2);
 4949|  6.69k|    } else {
 4950|       |        /* Check to avoid pass the limit of OPJ_UINT32 */
 4951|  5.14k|        if (p_j2k->m_specific_param.m_decoder.m_sot_length >= 2) {
  ------------------
  |  Branch (4951:13): [True: 2.66k, False: 2.47k]
  ------------------
 4952|  2.66k|            p_j2k->m_specific_param.m_decoder.m_sot_length -= 2;
 4953|  2.66k|        } else {
 4954|       |            /* MSD: case commented to support empty SOT marker (PHR data) */
 4955|  2.47k|        }
 4956|  5.14k|    }
 4957|       |
 4958|  11.8k|    l_current_data = &(l_tcp->m_data);
 4959|  11.8k|    l_tile_len = &l_tcp->m_data_size;
 4960|       |
 4961|       |    /* Patch to support new PHR data */
 4962|  11.8k|    if (p_j2k->m_specific_param.m_decoder.m_sot_length) {
  ------------------
  |  Branch (4962:9): [True: 9.33k, False: 2.50k]
  ------------------
 4963|       |        /* If we are here, we'll try to read the data after allocation */
 4964|       |        /* Check enough bytes left in stream before allocation */
 4965|  9.33k|        if ((OPJ_OFF_T)p_j2k->m_specific_param.m_decoder.m_sot_length >
  ------------------
  |  Branch (4965:13): [True: 118, False: 9.21k]
  ------------------
 4966|  9.33k|                opj_stream_get_number_byte_left(p_stream)) {
 4967|    118|            if (p_j2k->m_cp.strict) {
  ------------------
  |  Branch (4967:17): [True: 118, False: 0]
  ------------------
 4968|    118|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    118|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4969|    118|                              "Tile part length size inconsistent with stream length\n");
 4970|    118|                return OPJ_FALSE;
  ------------------
  |  |  118|    118|#define OPJ_FALSE 0
  ------------------
 4971|    118|            } else {
 4972|      0|                opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 4973|      0|                              "Tile part length size inconsistent with stream length\n");
 4974|      0|            }
 4975|    118|        }
 4976|  9.21k|        if (p_j2k->m_specific_param.m_decoder.m_sot_length >
  ------------------
  |  Branch (4976:13): [True: 0, False: 9.21k]
  ------------------
 4977|  9.21k|                UINT_MAX - OPJ_COMMON_CBLK_DATA_EXTRA) {
  ------------------
  |  |   39|  9.21k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
 4978|      0|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4979|      0|                          "p_j2k->m_specific_param.m_decoder.m_sot_length > "
 4980|      0|                          "UINT_MAX - OPJ_COMMON_CBLK_DATA_EXTRA");
 4981|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4982|      0|        }
 4983|       |        /* Add a margin of OPJ_COMMON_CBLK_DATA_EXTRA to the allocation we */
 4984|       |        /* do so that opj_mqc_init_dec_common() can safely add a synthetic */
 4985|       |        /* 0xFFFF marker. */
 4986|  9.21k|        if (! *l_current_data) {
  ------------------
  |  Branch (4986:13): [True: 9.09k, False: 123]
  ------------------
 4987|       |            /* LH: oddly enough, in this path, l_tile_len!=0.
 4988|       |             * TODO: If this was consistent, we could simplify the code to only use realloc(), as realloc(0,...) default to malloc(0,...).
 4989|       |             */
 4990|  9.09k|            *l_current_data = (OPJ_BYTE*) opj_malloc(
 4991|  9.09k|                                  p_j2k->m_specific_param.m_decoder.m_sot_length + OPJ_COMMON_CBLK_DATA_EXTRA);
  ------------------
  |  |   39|  9.09k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
 4992|  9.09k|        } else {
 4993|    123|            OPJ_BYTE *l_new_current_data;
 4994|    123|            if (*l_tile_len > UINT_MAX - OPJ_COMMON_CBLK_DATA_EXTRA -
  ------------------
  |  |   39|    123|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
  |  Branch (4994:17): [True: 0, False: 123]
  ------------------
 4995|    123|                    p_j2k->m_specific_param.m_decoder.m_sot_length) {
 4996|      0|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4997|      0|                              "*l_tile_len > UINT_MAX - OPJ_COMMON_CBLK_DATA_EXTRA - "
 4998|      0|                              "p_j2k->m_specific_param.m_decoder.m_sot_length");
 4999|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 5000|      0|            }
 5001|       |
 5002|    123|            l_new_current_data = (OPJ_BYTE *) opj_realloc(*l_current_data,
 5003|    123|                                 *l_tile_len + p_j2k->m_specific_param.m_decoder.m_sot_length +
 5004|    123|                                 OPJ_COMMON_CBLK_DATA_EXTRA);
  ------------------
  |  |   39|    123|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
 5005|    123|            if (! l_new_current_data) {
  ------------------
  |  Branch (5005:17): [True: 0, False: 123]
  ------------------
 5006|      0|                opj_free(*l_current_data);
 5007|       |                /*nothing more is done as l_current_data will be set to null, and just
 5008|       |                  afterward we enter in the error path
 5009|       |                  and the actual tile_len is updated (committed) at the end of the
 5010|       |                  function. */
 5011|      0|            }
 5012|    123|            *l_current_data = l_new_current_data;
 5013|    123|        }
 5014|       |
 5015|  9.21k|        if (*l_current_data == 00) {
  ------------------
  |  Branch (5015:13): [True: 0, False: 9.21k]
  ------------------
 5016|      0|            opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to decode tile\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5017|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 5018|      0|        }
 5019|  9.21k|    } else {
 5020|  2.50k|        l_sot_length_pb_detected = OPJ_TRUE;
  ------------------
  |  |  117|  2.50k|#define OPJ_TRUE 1
  ------------------
 5021|  2.50k|    }
 5022|       |
 5023|       |    /* Index */
 5024|  11.7k|    l_cstr_index = p_j2k->cstr_index;
 5025|  11.7k|    if (l_cstr_index) {
  ------------------
  |  Branch (5025:9): [True: 11.7k, False: 0]
  ------------------
 5026|  11.7k|        OPJ_OFF_T l_current_pos = opj_stream_tell(p_stream) - 2;
 5027|       |
 5028|  11.7k|        OPJ_UINT32 l_current_tile_part =
 5029|  11.7k|            l_cstr_index->tile_index[p_j2k->m_current_tile_number].current_tpsno;
 5030|  11.7k|        l_cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index[l_current_tile_part].end_header
 5031|  11.7k|            =
 5032|  11.7k|                l_current_pos;
 5033|  11.7k|        l_cstr_index->tile_index[p_j2k->m_current_tile_number].tp_index[l_current_tile_part].end_pos
 5034|  11.7k|            =
 5035|  11.7k|                l_current_pos + p_j2k->m_specific_param.m_decoder.m_sot_length + 2;
 5036|       |
 5037|  11.7k|        if (OPJ_FALSE == opj_j2k_add_tlmarker(p_j2k->m_current_tile_number,
  ------------------
  |  |  118|  11.7k|#define OPJ_FALSE 0
  ------------------
  |  Branch (5037:13): [True: 0, False: 11.7k]
  ------------------
 5038|  11.7k|                                              l_cstr_index,
 5039|  11.7k|                                              J2K_MS_SOD,
  ------------------
  |  |   74|  11.7k|#define J2K_MS_SOD 0xff93   /**< SOD marker value */
  ------------------
 5040|  11.7k|                                              l_current_pos,
 5041|  11.7k|                                              p_j2k->m_specific_param.m_decoder.m_sot_length + 2)) {
 5042|      0|            opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to add tl marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 5043|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 5044|      0|        }
 5045|       |
 5046|       |        /*l_cstr_index->packno = 0;*/
 5047|  11.7k|    }
 5048|       |
 5049|       |    /* Patch to support new PHR data */
 5050|  11.7k|    if (!l_sot_length_pb_detected) {
  ------------------
  |  Branch (5050:9): [True: 9.21k, False: 2.50k]
  ------------------
 5051|  9.21k|        l_current_read_size = opj_stream_read_data(
 5052|  9.21k|                                  p_stream,
 5053|  9.21k|                                  *l_current_data + *l_tile_len,
 5054|  9.21k|                                  p_j2k->m_specific_param.m_decoder.m_sot_length,
 5055|  9.21k|                                  p_manager);
 5056|  9.21k|    } else {
 5057|  2.50k|        l_current_read_size = 0;
 5058|  2.50k|    }
 5059|       |
 5060|  11.7k|    if (l_current_read_size != p_j2k->m_specific_param.m_decoder.m_sot_length) {
  ------------------
  |  Branch (5060:9): [True: 0, False: 11.7k]
  ------------------
 5061|      0|        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;
 5062|  11.7k|    } else {
 5063|  11.7k|        p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPHSOT;
 5064|  11.7k|    }
 5065|       |
 5066|  11.7k|    *l_tile_len += (OPJ_UINT32)l_current_read_size;
 5067|       |
 5068|  11.7k|    return OPJ_TRUE;
  ------------------
  |  |  117|  11.7k|#define OPJ_TRUE 1
  ------------------
 5069|  11.7k|}
j2k.c:opj_j2k_need_nb_tile_parts_correction:
 9442|    714|{
 9443|    714|    OPJ_BYTE   l_header_data[10];
 9444|    714|    OPJ_OFF_T  l_stream_pos_backup;
 9445|    714|    OPJ_UINT32 l_current_marker;
 9446|    714|    OPJ_UINT32 l_marker_size;
 9447|    714|    OPJ_UINT32 l_tile_no, l_tot_len, l_current_part, l_num_parts;
 9448|       |
 9449|       |    /* initialize to no correction needed */
 9450|    714|    *p_correction_needed = OPJ_FALSE;
  ------------------
  |  |  118|    714|#define OPJ_FALSE 0
  ------------------
 9451|       |
 9452|    714|    if (!opj_stream_has_seek(p_stream)) {
  ------------------
  |  Branch (9452:9): [True: 0, False: 714]
  ------------------
 9453|       |        /* We can't do much in this case, seek is needed */
 9454|      0|        return OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
 9455|      0|    }
 9456|       |
 9457|    714|    l_stream_pos_backup = opj_stream_tell(p_stream);
 9458|    714|    if (l_stream_pos_backup == -1) {
  ------------------
  |  Branch (9458:9): [True: 0, False: 714]
  ------------------
 9459|       |        /* let's do nothing */
 9460|      0|        return OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
 9461|      0|    }
 9462|       |
 9463|  3.63k|    for (;;) {
 9464|       |        /* Try to read 2 bytes (the next marker ID) from stream and copy them into the buffer */
 9465|  3.63k|        if (opj_stream_read_data(p_stream, l_header_data, 2, p_manager) != 2) {
  ------------------
  |  Branch (9465:13): [True: 53, False: 3.58k]
  ------------------
 9466|       |            /* assume all is OK */
 9467|     53|            if (! opj_stream_seek(p_stream, l_stream_pos_backup, p_manager)) {
  ------------------
  |  Branch (9467:17): [True: 0, False: 53]
  ------------------
 9468|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9469|      0|            }
 9470|     53|            return OPJ_TRUE;
  ------------------
  |  |  117|     53|#define OPJ_TRUE 1
  ------------------
 9471|     53|        }
 9472|       |
 9473|       |        /* Read 2 bytes from buffer as the new marker ID */
 9474|  3.58k|        opj_read_bytes(l_header_data, &l_current_marker, 2);
  ------------------
  |  |   65|  3.58k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 9475|       |
 9476|  3.58k|        if (l_current_marker != J2K_MS_SOT) {
  ------------------
  |  |   73|  3.58k|#define J2K_MS_SOT 0xff90   /**< SOT marker value */
  ------------------
  |  Branch (9476:13): [True: 372, False: 3.21k]
  ------------------
 9477|       |            /* assume all is OK */
 9478|    372|            if (! opj_stream_seek(p_stream, l_stream_pos_backup, p_manager)) {
  ------------------
  |  Branch (9478:17): [True: 0, False: 372]
  ------------------
 9479|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9480|      0|            }
 9481|    372|            return OPJ_TRUE;
  ------------------
  |  |  117|    372|#define OPJ_TRUE 1
  ------------------
 9482|    372|        }
 9483|       |
 9484|       |        /* Try to read 2 bytes (the marker size) from stream and copy them into the buffer */
 9485|  3.21k|        if (opj_stream_read_data(p_stream, l_header_data, 2, p_manager) != 2) {
  ------------------
  |  Branch (9485:13): [True: 1, False: 3.21k]
  ------------------
 9486|      1|            opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9487|      1|            return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 9488|      1|        }
 9489|       |
 9490|       |        /* Read 2 bytes from the buffer as the marker size */
 9491|  3.21k|        opj_read_bytes(l_header_data, &l_marker_size, 2);
  ------------------
  |  |   65|  3.21k|#define opj_read_bytes      opj_read_bytes_LE
  ------------------
 9492|       |
 9493|       |        /* Check marker size for SOT Marker */
 9494|  3.21k|        if (l_marker_size != 10) {
  ------------------
  |  Branch (9494:13): [True: 1, False: 3.21k]
  ------------------
 9495|      1|            opj_event_msg(p_manager, EVT_ERROR, "Inconsistent marker size\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9496|      1|            return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 9497|      1|        }
 9498|  3.21k|        l_marker_size -= 2;
 9499|       |
 9500|  3.21k|        if (opj_stream_read_data(p_stream, l_header_data, l_marker_size,
  ------------------
  |  Branch (9500:13): [True: 1, False: 3.20k]
  ------------------
 9501|  3.21k|                                 p_manager) != l_marker_size) {
 9502|      1|            opj_event_msg(p_manager, EVT_ERROR, "Stream too short\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 9503|      1|            return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 9504|      1|        }
 9505|       |
 9506|  3.20k|        if (! opj_j2k_get_sot_values(l_header_data, l_marker_size, &l_tile_no,
  ------------------
  |  Branch (9506:13): [True: 0, False: 3.20k]
  ------------------
 9507|  3.20k|                                     &l_tot_len, &l_current_part, &l_num_parts, p_manager)) {
 9508|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9509|      0|        }
 9510|       |
 9511|  3.20k|        if (l_tile_no == tile_no) {
  ------------------
  |  Branch (9511:13): [True: 30, False: 3.17k]
  ------------------
 9512|       |            /* we found what we were looking for */
 9513|     30|            break;
 9514|     30|        }
 9515|       |
 9516|  3.17k|        if (l_tot_len < 14U) {
  ------------------
  |  Branch (9516:13): [True: 28, False: 3.15k]
  ------------------
 9517|       |            /* last SOT until EOC or invalid Psot value */
 9518|       |            /* assume all is OK */
 9519|     28|            if (! opj_stream_seek(p_stream, l_stream_pos_backup, p_manager)) {
  ------------------
  |  Branch (9519:17): [True: 0, False: 28]
  ------------------
 9520|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9521|      0|            }
 9522|     28|            return OPJ_TRUE;
  ------------------
  |  |  117|     28|#define OPJ_TRUE 1
  ------------------
 9523|     28|        }
 9524|  3.15k|        l_tot_len -= 12U;
 9525|       |        /* look for next SOT marker */
 9526|  3.15k|        if (opj_stream_skip(p_stream, (OPJ_OFF_T)(l_tot_len),
  ------------------
  |  Branch (9526:13): [True: 228, False: 2.92k]
  ------------------
 9527|  3.15k|                            p_manager) != (OPJ_OFF_T)(l_tot_len)) {
 9528|       |            /* assume all is OK */
 9529|    228|            if (! opj_stream_seek(p_stream, l_stream_pos_backup, p_manager)) {
  ------------------
  |  Branch (9529:17): [True: 0, False: 228]
  ------------------
 9530|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9531|      0|            }
 9532|    228|            return OPJ_TRUE;
  ------------------
  |  |  117|    228|#define OPJ_TRUE 1
  ------------------
 9533|    228|        }
 9534|  3.15k|    }
 9535|       |
 9536|       |    /* check for correction */
 9537|     30|    if (l_current_part == l_num_parts) {
  ------------------
  |  Branch (9537:9): [True: 21, False: 9]
  ------------------
 9538|     21|        *p_correction_needed = OPJ_TRUE;
  ------------------
  |  |  117|     21|#define OPJ_TRUE 1
  ------------------
 9539|     21|    }
 9540|       |
 9541|     30|    if (! opj_stream_seek(p_stream, l_stream_pos_backup, p_manager)) {
  ------------------
  |  Branch (9541:9): [True: 0, False: 30]
  ------------------
 9542|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 9543|      0|    }
 9544|     30|    return OPJ_TRUE;
  ------------------
  |  |  117|     30|#define OPJ_TRUE 1
  ------------------
 9545|     30|}
j2k.c:opj_j2k_merge_ppt:
 4148|  8.89k|{
 4149|  8.89k|    OPJ_UINT32 i, l_ppt_data_size;
 4150|       |    /* preconditions */
 4151|  8.89k|    assert(p_tcp != 00);
 4152|  8.89k|    assert(p_manager != 00);
 4153|       |
 4154|  8.89k|    if (p_tcp->ppt_buffer != NULL) {
  ------------------
  |  Branch (4154:9): [True: 0, False: 8.89k]
  ------------------
 4155|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4156|      0|                      "opj_j2k_merge_ppt() has already been called\n");
 4157|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4158|      0|    }
 4159|       |
 4160|  8.89k|    if (p_tcp->ppt == 0U) {
  ------------------
  |  Branch (4160:9): [True: 8.81k, False: 79]
  ------------------
 4161|  8.81k|        return OPJ_TRUE;
  ------------------
  |  |  117|  8.81k|#define OPJ_TRUE 1
  ------------------
 4162|  8.81k|    }
 4163|       |
 4164|     79|    l_ppt_data_size = 0U;
 4165|  3.81k|    for (i = 0U; i < p_tcp->ppt_markers_count; ++i) {
  ------------------
  |  Branch (4165:18): [True: 3.74k, False: 79]
  ------------------
 4166|  3.74k|        l_ppt_data_size +=
 4167|  3.74k|            p_tcp->ppt_markers[i].m_data_size; /* can't overflow, max 256 markers of max 65536 bytes */
 4168|  3.74k|    }
 4169|       |
 4170|     79|    p_tcp->ppt_buffer = (OPJ_BYTE *) opj_malloc(l_ppt_data_size);
 4171|     79|    if (p_tcp->ppt_buffer == 00) {
  ------------------
  |  Branch (4171:9): [True: 0, False: 79]
  ------------------
 4172|      0|        opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to read PPT marker\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 4173|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 4174|      0|    }
 4175|     79|    p_tcp->ppt_len = l_ppt_data_size;
 4176|     79|    l_ppt_data_size = 0U;
 4177|  3.81k|    for (i = 0U; i < p_tcp->ppt_markers_count; ++i) {
  ------------------
  |  Branch (4177:18): [True: 3.74k, False: 79]
  ------------------
 4178|  3.74k|        if (p_tcp->ppt_markers[i].m_data !=
  ------------------
  |  Branch (4178:13): [True: 80, False: 3.66k]
  ------------------
 4179|  3.74k|                NULL) { /* standard doesn't seem to require contiguous Zppt */
 4180|     80|            memcpy(p_tcp->ppt_buffer + l_ppt_data_size, p_tcp->ppt_markers[i].m_data,
 4181|     80|                   p_tcp->ppt_markers[i].m_data_size);
 4182|     80|            l_ppt_data_size +=
 4183|     80|                p_tcp->ppt_markers[i].m_data_size; /* can't overflow, max 256 markers of max 65536 bytes */
 4184|       |
 4185|     80|            opj_free(p_tcp->ppt_markers[i].m_data);
 4186|     80|            p_tcp->ppt_markers[i].m_data = NULL;
 4187|     80|            p_tcp->ppt_markers[i].m_data_size = 0U;
 4188|     80|        }
 4189|  3.74k|    }
 4190|       |
 4191|     79|    p_tcp->ppt_markers_count = 0U;
 4192|     79|    opj_free(p_tcp->ppt_markers);
 4193|     79|    p_tcp->ppt_markers = NULL;
 4194|       |
 4195|     79|    p_tcp->ppt_data = p_tcp->ppt_buffer;
 4196|     79|    p_tcp->ppt_data_size = p_tcp->ppt_len;
 4197|     79|    return OPJ_TRUE;
  ------------------
  |  |  117|     79|#define OPJ_TRUE 1
  ------------------
 4198|     79|}
j2k.c:opj_j2k_tcp_data_destroy:
 9388|  18.0M|{
 9389|  18.0M|    if (p_tcp->m_data) {
  ------------------
  |  Branch (9389:9): [True: 9.09k, False: 18.0M]
  ------------------
 9390|  9.09k|        opj_free(p_tcp->m_data);
 9391|  9.09k|        p_tcp->m_data = NULL;
 9392|  9.09k|        p_tcp->m_data_size = 0;
 9393|  9.09k|    }
 9394|  18.0M|}
j2k.c:opj_j2k_update_image_dimensions:
10175|  7.81k|{
10176|  7.81k|    OPJ_UINT32 it_comp;
10177|  7.81k|    OPJ_INT32 l_comp_x1, l_comp_y1;
10178|  7.81k|    opj_image_comp_t* l_img_comp = NULL;
10179|       |
10180|  7.81k|    l_img_comp = p_image->comps;
10181|  30.4k|    for (it_comp = 0; it_comp < p_image->numcomps; ++it_comp) {
  ------------------
  |  Branch (10181:23): [True: 22.6k, False: 7.81k]
  ------------------
10182|  22.6k|        OPJ_INT32 l_h, l_w;
10183|  22.6k|        if (p_image->x0 > (OPJ_UINT32)INT_MAX ||
  ------------------
  |  Branch (10183:13): [True: 0, False: 22.6k]
  ------------------
10184|  22.6k|                p_image->y0 > (OPJ_UINT32)INT_MAX ||
  ------------------
  |  Branch (10184:17): [True: 0, False: 22.6k]
  ------------------
10185|  22.6k|                p_image->x1 > (OPJ_UINT32)INT_MAX ||
  ------------------
  |  Branch (10185:17): [True: 0, False: 22.6k]
  ------------------
10186|  22.6k|                p_image->y1 > (OPJ_UINT32)INT_MAX) {
  ------------------
  |  Branch (10186:17): [True: 0, False: 22.6k]
  ------------------
10187|      0|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10188|      0|                          "Image coordinates above INT_MAX are not supported\n");
10189|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10190|      0|        }
10191|       |
10192|  22.6k|        l_img_comp->x0 = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)p_image->x0,
10193|  22.6k|                         (OPJ_INT32)l_img_comp->dx);
10194|  22.6k|        l_img_comp->y0 = (OPJ_UINT32)opj_int_ceildiv((OPJ_INT32)p_image->y0,
10195|  22.6k|                         (OPJ_INT32)l_img_comp->dy);
10196|  22.6k|        l_comp_x1 = opj_int_ceildiv((OPJ_INT32)p_image->x1, (OPJ_INT32)l_img_comp->dx);
10197|  22.6k|        l_comp_y1 = opj_int_ceildiv((OPJ_INT32)p_image->y1, (OPJ_INT32)l_img_comp->dy);
10198|       |
10199|  22.6k|        l_w = opj_int_ceildivpow2(l_comp_x1, (OPJ_INT32)l_img_comp->factor)
10200|  22.6k|              - opj_int_ceildivpow2((OPJ_INT32)l_img_comp->x0, (OPJ_INT32)l_img_comp->factor);
10201|  22.6k|        if (l_w < 0) {
  ------------------
  |  Branch (10201:13): [True: 0, False: 22.6k]
  ------------------
10202|      0|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10203|      0|                          "Size x of the decoded component image is incorrect (comp[%d].w=%d).\n",
10204|      0|                          it_comp, l_w);
10205|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10206|      0|        }
10207|  22.6k|        l_img_comp->w = (OPJ_UINT32)l_w;
10208|       |
10209|  22.6k|        l_h = opj_int_ceildivpow2(l_comp_y1, (OPJ_INT32)l_img_comp->factor)
10210|  22.6k|              - opj_int_ceildivpow2((OPJ_INT32)l_img_comp->y0, (OPJ_INT32)l_img_comp->factor);
10211|  22.6k|        if (l_h < 0) {
  ------------------
  |  Branch (10211:13): [True: 0, False: 22.6k]
  ------------------
10212|      0|            opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
10213|      0|                          "Size y of the decoded component image is incorrect (comp[%d].h=%d).\n",
10214|      0|                          it_comp, l_h);
10215|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10216|      0|        }
10217|  22.6k|        l_img_comp->h = (OPJ_UINT32)l_h;
10218|       |
10219|  22.6k|        l_img_comp++;
10220|  22.6k|    }
10221|       |
10222|  7.81k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.81k|#define OPJ_TRUE 1
  ------------------
10223|  7.81k|}
j2k.c:opj_j2k_create_cstr_index:
10515|  9.21k|{
10516|  9.21k|    opj_codestream_index_t* cstr_index = (opj_codestream_index_t*)
10517|  9.21k|                                         opj_calloc(1, sizeof(opj_codestream_index_t));
10518|  9.21k|    if (!cstr_index) {
  ------------------
  |  Branch (10518:9): [True: 0, False: 9.21k]
  ------------------
10519|      0|        return NULL;
10520|      0|    }
10521|       |
10522|  9.21k|    cstr_index->maxmarknum = 100;
10523|  9.21k|    cstr_index->marknum = 0;
10524|  9.21k|    cstr_index->marker = (opj_marker_info_t*)
10525|  9.21k|                         opj_calloc(cstr_index->maxmarknum, sizeof(opj_marker_info_t));
10526|  9.21k|    if (!cstr_index-> marker) {
  ------------------
  |  Branch (10526:9): [True: 0, False: 9.21k]
  ------------------
10527|      0|        opj_free(cstr_index);
10528|      0|        return NULL;
10529|      0|    }
10530|       |
10531|  9.21k|    cstr_index->tile_index = NULL;
10532|       |
10533|  9.21k|    return cstr_index;
10534|  9.21k|}
j2k.c:opj_j2k_allocate_tile_element_cstr_index:
11602|  7.85k|{
11603|  7.85k|    OPJ_UINT32 it_tile = 0;
11604|       |
11605|  7.85k|    p_j2k->cstr_index->nb_of_tiles = p_j2k->m_cp.tw * p_j2k->m_cp.th;
11606|  7.85k|    p_j2k->cstr_index->tile_index = (opj_tile_index_t*)opj_calloc(
11607|  7.85k|                                        p_j2k->cstr_index->nb_of_tiles, sizeof(opj_tile_index_t));
11608|  7.85k|    if (!p_j2k->cstr_index->tile_index) {
  ------------------
  |  Branch (11608:9): [True: 0, False: 7.85k]
  ------------------
11609|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
11610|      0|    }
11611|       |
11612|  16.7M|    for (it_tile = 0; it_tile < p_j2k->cstr_index->nb_of_tiles; it_tile++) {
  ------------------
  |  Branch (11612:23): [True: 16.7M, False: 7.85k]
  ------------------
11613|  16.7M|        p_j2k->cstr_index->tile_index[it_tile].maxmarknum = 100;
11614|  16.7M|        p_j2k->cstr_index->tile_index[it_tile].marknum = 0;
11615|  16.7M|        p_j2k->cstr_index->tile_index[it_tile].marker = (opj_marker_info_t*)
11616|  16.7M|                opj_calloc(p_j2k->cstr_index->tile_index[it_tile].maxmarknum,
11617|  16.7M|                           sizeof(opj_marker_info_t));
11618|  16.7M|        if (!p_j2k->cstr_index->tile_index[it_tile].marker) {
  ------------------
  |  Branch (11618:13): [True: 0, False: 16.7M]
  ------------------
11619|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
11620|      0|        }
11621|  16.7M|    }
11622|       |
11623|  7.85k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.85k|#define OPJ_TRUE 1
  ------------------
11624|  7.85k|}
j2k.c:opj_j2k_setup_decoding:
11785|  7.81k|{
11786|       |    /* preconditions*/
11787|  7.81k|    assert(p_j2k != 00);
11788|  7.81k|    assert(p_manager != 00);
11789|       |
11790|  7.81k|    if (! opj_procedure_list_add_procedure(p_j2k->m_procedure_list,
  ------------------
  |  Branch (11790:9): [True: 0, False: 7.81k]
  ------------------
11791|  7.81k|                                           (opj_procedure)opj_j2k_decode_tiles, p_manager)) {
11792|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
11793|      0|    }
11794|       |    /* DEVELOPER CORNER, add your custom procedures */
11795|       |
11796|  7.81k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.81k|#define OPJ_TRUE 1
  ------------------
11797|  7.81k|}
j2k.c:opj_j2k_decode_tiles:
11665|  7.81k|{
11666|  7.81k|    OPJ_BOOL l_go_on = OPJ_TRUE;
  ------------------
  |  |  117|  7.81k|#define OPJ_TRUE 1
  ------------------
11667|  7.81k|    OPJ_UINT32 l_current_tile_no;
11668|  7.81k|    OPJ_INT32 l_tile_x0, l_tile_y0, l_tile_x1, l_tile_y1;
11669|  7.81k|    OPJ_UINT32 l_nb_comps;
11670|  7.81k|    OPJ_UINT32 nr_tiles = 0;
11671|       |
11672|       |    /* Particular case for whole single tile decoding */
11673|       |    /* We can avoid allocating intermediate tile buffers */
11674|  7.81k|    if (p_j2k->m_cp.tw == 1 && p_j2k->m_cp.th == 1 &&
  ------------------
  |  Branch (11674:9): [True: 6.63k, False: 1.18k]
  |  Branch (11674:32): [True: 3.74k, False: 2.89k]
  ------------------
11675|  7.81k|            p_j2k->m_cp.tx0 == 0 && p_j2k->m_cp.ty0 == 0 &&
  ------------------
  |  Branch (11675:13): [True: 3.63k, False: 109]
  |  Branch (11675:37): [True: 3.36k, False: 265]
  ------------------
11676|  7.81k|            p_j2k->m_output_image->x0 == 0 &&
  ------------------
  |  Branch (11676:13): [True: 2.06k, False: 1.30k]
  ------------------
11677|  7.81k|            p_j2k->m_output_image->y0 == 0 &&
  ------------------
  |  Branch (11677:13): [True: 899, False: 1.17k]
  ------------------
11678|  7.81k|            p_j2k->m_output_image->x1 == p_j2k->m_cp.tdx &&
  ------------------
  |  Branch (11678:13): [True: 37, False: 862]
  ------------------
11679|  7.81k|            p_j2k->m_output_image->y1 == p_j2k->m_cp.tdy) {
  ------------------
  |  Branch (11679:13): [True: 7, False: 30]
  ------------------
11680|      7|        OPJ_UINT32 i;
11681|      7|        if (! opj_j2k_read_tile_header(p_j2k,
  ------------------
  |  Branch (11681:13): [True: 2, False: 5]
  ------------------
11682|      7|                                       &l_current_tile_no,
11683|      7|                                       NULL,
11684|      7|                                       &l_tile_x0, &l_tile_y0,
11685|      7|                                       &l_tile_x1, &l_tile_y1,
11686|      7|                                       &l_nb_comps,
11687|      7|                                       &l_go_on,
11688|      7|                                       p_stream,
11689|      7|                                       p_manager)) {
11690|      2|            return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
11691|      2|        }
11692|       |
11693|      5|        if (! opj_j2k_decode_tile(p_j2k, l_current_tile_no, NULL, 0,
  ------------------
  |  Branch (11693:13): [True: 2, False: 3]
  ------------------
11694|      5|                                  p_stream, p_manager)) {
11695|      2|            opj_event_msg(p_manager, EVT_ERROR, "Failed to decode tile 1/1\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
11696|      2|            return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
11697|      2|        }
11698|       |
11699|       |        /* Transfer TCD data to output image data */
11700|     11|        for (i = 0; i < p_j2k->m_output_image->numcomps; i++) {
  ------------------
  |  Branch (11700:21): [True: 8, False: 3]
  ------------------
11701|      8|            opj_image_data_free(p_j2k->m_output_image->comps[i].data);
11702|      8|            p_j2k->m_output_image->comps[i].data =
11703|      8|                p_j2k->m_tcd->tcd_image->tiles->comps[i].data;
11704|      8|            p_j2k->m_output_image->comps[i].resno_decoded =
11705|      8|                p_j2k->m_tcd->image->comps[i].resno_decoded;
11706|      8|            p_j2k->m_tcd->tcd_image->tiles->comps[i].data = NULL;
11707|      8|        }
11708|       |
11709|      3|        return OPJ_TRUE;
  ------------------
  |  |  117|      3|#define OPJ_TRUE 1
  ------------------
11710|      5|    }
11711|       |
11712|  9.64k|    for (;;) {
11713|  9.64k|        if (p_j2k->m_cp.tw == 1 && p_j2k->m_cp.th == 1 &&
  ------------------
  |  Branch (11713:13): [True: 7.32k, False: 2.32k]
  |  Branch (11713:36): [True: 3.73k, False: 3.58k]
  ------------------
11714|  9.64k|                p_j2k->m_cp.tcps[0].m_data != NULL) {
  ------------------
  |  Branch (11714:17): [True: 0, False: 3.73k]
  ------------------
11715|      0|            l_current_tile_no = 0;
11716|      0|            p_j2k->m_current_tile_number = 0;
11717|      0|            p_j2k->m_specific_param.m_decoder.m_state |= J2K_STATE_DATA;
11718|  9.64k|        } else {
11719|  9.64k|            if (! opj_j2k_read_tile_header(p_j2k,
  ------------------
  |  Branch (11719:17): [True: 738, False: 8.90k]
  ------------------
11720|  9.64k|                                           &l_current_tile_no,
11721|  9.64k|                                           NULL,
11722|  9.64k|                                           &l_tile_x0, &l_tile_y0,
11723|  9.64k|                                           &l_tile_x1, &l_tile_y1,
11724|  9.64k|                                           &l_nb_comps,
11725|  9.64k|                                           &l_go_on,
11726|  9.64k|                                           p_stream,
11727|  9.64k|                                           p_manager)) {
11728|    738|                return OPJ_FALSE;
  ------------------
  |  |  118|    738|#define OPJ_FALSE 0
  ------------------
11729|    738|            }
11730|       |
11731|  8.90k|            if (! l_go_on) {
  ------------------
  |  Branch (11731:17): [True: 64, False: 8.84k]
  ------------------
11732|     64|                break;
11733|     64|            }
11734|  8.90k|        }
11735|       |
11736|  8.84k|        if (! opj_j2k_decode_tile(p_j2k, l_current_tile_no, NULL, 0,
  ------------------
  |  Branch (11736:13): [True: 1.33k, False: 7.50k]
  ------------------
11737|  8.84k|                                  p_stream, p_manager)) {
11738|  1.33k|            opj_event_msg(p_manager, EVT_ERROR, "Failed to decode tile %d/%d\n",
  ------------------
  |  |   66|  1.33k|#define EVT_ERROR   1   /**< Error event type */
  ------------------
11739|  1.33k|                          l_current_tile_no + 1, p_j2k->m_cp.th * p_j2k->m_cp.tw);
11740|  1.33k|            return OPJ_FALSE;
  ------------------
  |  |  118|  1.33k|#define OPJ_FALSE 0
  ------------------
11741|  1.33k|        }
11742|       |
11743|  7.50k|        opj_event_msg(p_manager, EVT_INFO, "Tile %d/%d has been decoded.\n",
  ------------------
  |  |   68|  7.50k|#define EVT_INFO    4   /**< Debug event type */
  ------------------
11744|  7.50k|                      l_current_tile_no + 1, p_j2k->m_cp.th * p_j2k->m_cp.tw);
11745|       |
11746|  7.50k|        if (! opj_j2k_update_image_data(p_j2k->m_tcd,
  ------------------
  |  Branch (11746:13): [True: 31, False: 7.47k]
  ------------------
11747|  7.50k|                                        p_j2k->m_output_image)) {
11748|     31|            return OPJ_FALSE;
  ------------------
  |  |  118|     31|#define OPJ_FALSE 0
  ------------------
11749|     31|        }
11750|       |
11751|  7.47k|        if (p_j2k->m_cp.tw == 1 && p_j2k->m_cp.th == 1 &&
  ------------------
  |  Branch (11751:13): [True: 5.92k, False: 1.54k]
  |  Branch (11751:36): [True: 3.04k, False: 2.88k]
  ------------------
11752|  7.47k|                !(p_j2k->m_output_image->x0 == p_j2k->m_private_image->x0 &&
  ------------------
  |  Branch (11752:19): [True: 3.04k, False: 0]
  ------------------
11753|  3.04k|                  p_j2k->m_output_image->y0 == p_j2k->m_private_image->y0 &&
  ------------------
  |  Branch (11753:19): [True: 3.04k, False: 0]
  ------------------
11754|  3.04k|                  p_j2k->m_output_image->x1 == p_j2k->m_private_image->x1 &&
  ------------------
  |  Branch (11754:19): [True: 2.47k, False: 566]
  ------------------
11755|  3.04k|                  p_j2k->m_output_image->y1 == p_j2k->m_private_image->y1)) {
  ------------------
  |  Branch (11755:19): [True: 1.81k, False: 656]
  ------------------
11756|       |            /* Keep current tcp data */
11757|  6.25k|        } else {
11758|  6.25k|            opj_j2k_tcp_data_destroy(&p_j2k->m_cp.tcps[l_current_tile_no]);
11759|  6.25k|        }
11760|       |
11761|  7.47k|        opj_event_msg(p_manager, EVT_INFO,
  ------------------
  |  |   68|  7.47k|#define EVT_INFO    4   /**< Debug event type */
  ------------------
11762|  7.47k|                      "Image data has been updated with tile %d.\n\n", l_current_tile_no + 1);
11763|       |
11764|  7.47k|        if (opj_stream_get_number_byte_left(p_stream) == 0
  ------------------
  |  Branch (11764:13): [True: 5.64k, False: 1.82k]
  ------------------
11765|  7.47k|                && p_j2k->m_specific_param.m_decoder.m_state == J2K_STATE_NEOC) {
  ------------------
  |  Branch (11765:20): [True: 5.62k, False: 17]
  ------------------
11766|  5.62k|            break;
11767|  5.62k|        }
11768|  1.84k|        if (++nr_tiles ==  p_j2k->m_cp.th * p_j2k->m_cp.tw) {
  ------------------
  |  Branch (11768:13): [True: 12, False: 1.83k]
  ------------------
11769|     12|            break;
11770|     12|        }
11771|  1.84k|    }
11772|       |
11773|  5.70k|    if (! opj_j2k_are_all_used_components_decoded(p_j2k, p_manager)) {
  ------------------
  |  Branch (11773:9): [True: 99, False: 5.60k]
  ------------------
11774|     99|        return OPJ_FALSE;
  ------------------
  |  |  118|     99|#define OPJ_FALSE 0
  ------------------
11775|     99|    }
11776|       |
11777|  5.60k|    return OPJ_TRUE;
  ------------------
  |  |  117|  5.60k|#define OPJ_TRUE 1
  ------------------
11778|  5.70k|}
j2k.c:opj_j2k_update_image_data:
 9958|  7.50k|{
 9959|  7.50k|    OPJ_UINT32 i, j;
 9960|  7.50k|    OPJ_UINT32 l_width_src, l_height_src;
 9961|  7.50k|    OPJ_UINT32 l_width_dest, l_height_dest;
 9962|  7.50k|    OPJ_INT32 l_offset_x0_src, l_offset_y0_src, l_offset_x1_src, l_offset_y1_src;
 9963|  7.50k|    OPJ_SIZE_T l_start_offset_src;
 9964|  7.50k|    OPJ_UINT32 l_start_x_dest, l_start_y_dest;
 9965|  7.50k|    OPJ_UINT32 l_x0_dest, l_y0_dest, l_x1_dest, l_y1_dest;
 9966|  7.50k|    OPJ_SIZE_T l_start_offset_dest;
 9967|       |
 9968|  7.50k|    opj_image_comp_t * l_img_comp_src = 00;
 9969|  7.50k|    opj_image_comp_t * l_img_comp_dest = 00;
 9970|       |
 9971|  7.50k|    opj_tcd_tilecomp_t * l_tilec = 00;
 9972|  7.50k|    opj_image_t * l_image_src = 00;
 9973|  7.50k|    OPJ_INT32 * l_dest_ptr;
 9974|       |
 9975|  7.50k|    l_tilec = p_tcd->tcd_image->tiles->comps;
 9976|  7.50k|    l_image_src = p_tcd->image;
 9977|  7.50k|    l_img_comp_src = l_image_src->comps;
 9978|       |
 9979|  7.50k|    l_img_comp_dest = p_output_image->comps;
 9980|       |
 9981|  30.3k|    for (i = 0; i < l_image_src->numcomps;
  ------------------
  |  Branch (9981:17): [True: 22.8k, False: 7.47k]
  ------------------
 9982|  22.8k|            i++, ++l_img_comp_dest, ++l_img_comp_src,  ++l_tilec) {
 9983|  22.8k|        OPJ_INT32 res_x0, res_x1, res_y0, res_y1;
 9984|  22.8k|        OPJ_UINT32 src_data_stride;
 9985|  22.8k|        const OPJ_INT32* p_src_data;
 9986|       |
 9987|       |        /* Copy info from decoded comp image to output image */
 9988|  22.8k|        l_img_comp_dest->resno_decoded = l_img_comp_src->resno_decoded;
 9989|       |
 9990|  22.8k|        if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (9990:13): [True: 15.2k, False: 7.60k]
  ------------------
 9991|  15.2k|            opj_tcd_resolution_t* l_res = l_tilec->resolutions +
 9992|  15.2k|                                          l_img_comp_src->resno_decoded;
 9993|  15.2k|            res_x0 = l_res->x0;
 9994|  15.2k|            res_y0 = l_res->y0;
 9995|  15.2k|            res_x1 = l_res->x1;
 9996|  15.2k|            res_y1 = l_res->y1;
 9997|  15.2k|            src_data_stride = (OPJ_UINT32)(
 9998|  15.2k|                                  l_tilec->resolutions[l_tilec->minimum_num_resolutions - 1].x1 -
 9999|  15.2k|                                  l_tilec->resolutions[l_tilec->minimum_num_resolutions - 1].x0);
10000|  15.2k|            p_src_data = l_tilec->data;
10001|  15.2k|        } else {
10002|  7.60k|            opj_tcd_resolution_t* l_res = l_tilec->resolutions +
10003|  7.60k|                                          l_img_comp_src->resno_decoded;
10004|  7.60k|            res_x0 = (OPJ_INT32)l_res->win_x0;
10005|  7.60k|            res_y0 = (OPJ_INT32)l_res->win_y0;
10006|  7.60k|            res_x1 = (OPJ_INT32)l_res->win_x1;
10007|  7.60k|            res_y1 = (OPJ_INT32)l_res->win_y1;
10008|  7.60k|            src_data_stride = l_res->win_x1 - l_res->win_x0;
10009|  7.60k|            p_src_data = l_tilec->data_win;
10010|  7.60k|        }
10011|       |
10012|  22.8k|        if (p_src_data == NULL) {
  ------------------
  |  Branch (10012:13): [True: 4.12k, False: 18.7k]
  ------------------
10013|       |            /* Happens for partial component decoding */
10014|  4.12k|            continue;
10015|  4.12k|        }
10016|       |
10017|  18.7k|        l_width_src = (OPJ_UINT32)(res_x1 - res_x0);
10018|  18.7k|        l_height_src = (OPJ_UINT32)(res_y1 - res_y0);
10019|       |
10020|       |
10021|       |        /* Current tile component size*/
10022|       |        /*if (i == 0) {
10023|       |        fprintf(stdout, "SRC: l_res_x0=%d, l_res_x1=%d, l_res_y0=%d, l_res_y1=%d\n",
10024|       |                        res_x0, res_x1, res_y0, res_y1);
10025|       |        }*/
10026|       |
10027|       |
10028|       |        /* Border of the current output component*/
10029|  18.7k|        l_x0_dest = opj_uint_ceildivpow2(l_img_comp_dest->x0, l_img_comp_dest->factor);
10030|  18.7k|        l_y0_dest = opj_uint_ceildivpow2(l_img_comp_dest->y0, l_img_comp_dest->factor);
10031|  18.7k|        l_x1_dest = l_x0_dest +
10032|  18.7k|                    l_img_comp_dest->w; /* can't overflow given that image->x1 is uint32 */
10033|  18.7k|        l_y1_dest = l_y0_dest + l_img_comp_dest->h;
10034|       |
10035|       |        /*if (i == 0) {
10036|       |        fprintf(stdout, "DEST: l_x0_dest=%d, l_x1_dest=%d, l_y0_dest=%d, l_y1_dest=%d (%d)\n",
10037|       |                        l_x0_dest, l_x1_dest, l_y0_dest, l_y1_dest, l_img_comp_dest->factor );
10038|       |        }*/
10039|       |
10040|       |        /*-----*/
10041|       |        /* Compute the area (l_offset_x0_src, l_offset_y0_src, l_offset_x1_src, l_offset_y1_src)
10042|       |         * of the input buffer (decoded tile component) which will be move
10043|       |         * in the output buffer. Compute the area of the output buffer (l_start_x_dest,
10044|       |         * l_start_y_dest, l_width_dest, l_height_dest)  which will be modified
10045|       |         * by this input area.
10046|       |         * */
10047|  18.7k|        assert(res_x0 >= 0);
10048|  18.7k|        assert(res_x1 >= 0);
10049|  18.7k|        if (l_x0_dest < (OPJ_UINT32)res_x0) {
  ------------------
  |  Branch (10049:13): [True: 3.76k, False: 14.9k]
  ------------------
10050|  3.76k|            l_start_x_dest = (OPJ_UINT32)res_x0 - l_x0_dest;
10051|  3.76k|            l_offset_x0_src = 0;
10052|       |
10053|  3.76k|            if (l_x1_dest >= (OPJ_UINT32)res_x1) {
  ------------------
  |  Branch (10053:17): [True: 3.76k, False: 0]
  ------------------
10054|  3.76k|                l_width_dest = l_width_src;
10055|  3.76k|                l_offset_x1_src = 0;
10056|  3.76k|            } else {
10057|      0|                l_width_dest = l_x1_dest - (OPJ_UINT32)res_x0 ;
10058|      0|                l_offset_x1_src = (OPJ_INT32)(l_width_src - l_width_dest);
10059|      0|            }
10060|  14.9k|        } else {
10061|  14.9k|            l_start_x_dest = 0U;
10062|  14.9k|            l_offset_x0_src = (OPJ_INT32)l_x0_dest - res_x0;
10063|       |
10064|  14.9k|            if (l_x1_dest >= (OPJ_UINT32)res_x1) {
  ------------------
  |  Branch (10064:17): [True: 14.9k, False: 0]
  ------------------
10065|  14.9k|                l_width_dest = l_width_src - (OPJ_UINT32)l_offset_x0_src;
10066|  14.9k|                l_offset_x1_src = 0;
10067|  14.9k|            } else {
10068|      0|                l_width_dest = l_img_comp_dest->w ;
10069|      0|                l_offset_x1_src = res_x1 - (OPJ_INT32)l_x1_dest;
10070|      0|            }
10071|  14.9k|        }
10072|       |
10073|  18.7k|        if (l_y0_dest < (OPJ_UINT32)res_y0) {
  ------------------
  |  Branch (10073:13): [True: 3.77k, False: 14.9k]
  ------------------
10074|  3.77k|            l_start_y_dest = (OPJ_UINT32)res_y0 - l_y0_dest;
10075|  3.77k|            l_offset_y0_src = 0;
10076|       |
10077|  3.77k|            if (l_y1_dest >= (OPJ_UINT32)res_y1) {
  ------------------
  |  Branch (10077:17): [True: 3.77k, False: 0]
  ------------------
10078|  3.77k|                l_height_dest = l_height_src;
10079|  3.77k|                l_offset_y1_src = 0;
10080|  3.77k|            } else {
10081|      0|                l_height_dest = l_y1_dest - (OPJ_UINT32)res_y0 ;
10082|      0|                l_offset_y1_src = (OPJ_INT32)(l_height_src - l_height_dest);
10083|      0|            }
10084|  14.9k|        } else {
10085|  14.9k|            l_start_y_dest = 0U;
10086|  14.9k|            l_offset_y0_src = (OPJ_INT32)l_y0_dest - res_y0;
10087|       |
10088|  14.9k|            if (l_y1_dest >= (OPJ_UINT32)res_y1) {
  ------------------
  |  Branch (10088:17): [True: 14.9k, False: 0]
  ------------------
10089|  14.9k|                l_height_dest = l_height_src - (OPJ_UINT32)l_offset_y0_src;
10090|  14.9k|                l_offset_y1_src = 0;
10091|  14.9k|            } else {
10092|      0|                l_height_dest = l_img_comp_dest->h ;
10093|      0|                l_offset_y1_src = res_y1 - (OPJ_INT32)l_y1_dest;
10094|      0|            }
10095|  14.9k|        }
10096|       |
10097|  18.7k|        if ((l_offset_x0_src < 0) || (l_offset_y0_src < 0) || (l_offset_x1_src < 0) ||
  ------------------
  |  Branch (10097:13): [True: 0, False: 18.7k]
  |  Branch (10097:38): [True: 0, False: 18.7k]
  |  Branch (10097:63): [True: 0, False: 18.7k]
  ------------------
10098|  18.7k|                (l_offset_y1_src < 0)) {
  ------------------
  |  Branch (10098:17): [True: 0, False: 18.7k]
  ------------------
10099|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10100|      0|        }
10101|       |        /* testcase 2977.pdf.asan.67.2198 */
10102|  18.7k|        if ((OPJ_INT32)l_width_dest < 0 || (OPJ_INT32)l_height_dest < 0) {
  ------------------
  |  Branch (10102:13): [True: 26, False: 18.7k]
  |  Branch (10102:44): [True: 5, False: 18.7k]
  ------------------
10103|     31|            return OPJ_FALSE;
  ------------------
  |  |  118|     31|#define OPJ_FALSE 0
  ------------------
10104|     31|        }
10105|       |        /*-----*/
10106|       |
10107|       |        /* Compute the input buffer offset */
10108|  18.7k|        l_start_offset_src = (OPJ_SIZE_T)l_offset_x0_src + (OPJ_SIZE_T)l_offset_y0_src
10109|  18.7k|                             * (OPJ_SIZE_T)src_data_stride;
10110|       |
10111|       |        /* Compute the output buffer offset */
10112|  18.7k|        l_start_offset_dest = (OPJ_SIZE_T)l_start_x_dest + (OPJ_SIZE_T)l_start_y_dest
10113|  18.7k|                              * (OPJ_SIZE_T)l_img_comp_dest->w;
10114|       |
10115|       |        /* Allocate output component buffer if necessary */
10116|  18.7k|        if (l_img_comp_dest->data == NULL &&
  ------------------
  |  Branch (10116:13): [True: 13.7k, False: 4.92k]
  ------------------
10117|  18.7k|                l_start_offset_src == 0 && l_start_offset_dest == 0 &&
  ------------------
  |  Branch (10117:17): [True: 13.5k, False: 279]
  |  Branch (10117:44): [True: 11.0k, False: 2.45k]
  ------------------
10118|  18.7k|                src_data_stride == l_img_comp_dest->w &&
  ------------------
  |  Branch (10118:17): [True: 9.26k, False: 1.79k]
  ------------------
10119|  18.7k|                l_width_dest == l_img_comp_dest->w &&
  ------------------
  |  Branch (10119:17): [True: 9.25k, False: 7]
  ------------------
10120|  18.7k|                l_height_dest == l_img_comp_dest->h) {
  ------------------
  |  Branch (10120:17): [True: 6.43k, False: 2.82k]
  ------------------
10121|       |            /* If the final image matches the tile buffer, then borrow it */
10122|       |            /* directly to save a copy */
10123|  6.43k|            if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (10123:17): [True: 3.15k, False: 3.28k]
  ------------------
10124|  3.15k|                l_img_comp_dest->data = l_tilec->data;
10125|  3.15k|                l_tilec->data = NULL;
10126|  3.28k|            } else {
10127|  3.28k|                l_img_comp_dest->data = l_tilec->data_win;
10128|  3.28k|                l_tilec->data_win = NULL;
10129|  3.28k|            }
10130|  6.43k|            continue;
10131|  12.2k|        } else if (l_img_comp_dest->data == NULL) {
  ------------------
  |  Branch (10131:20): [True: 7.35k, False: 4.92k]
  ------------------
10132|  7.35k|            OPJ_SIZE_T l_width = l_img_comp_dest->w;
10133|  7.35k|            OPJ_SIZE_T l_height = l_img_comp_dest->h;
10134|       |
10135|  7.35k|            if ((l_height == 0U) || (l_width > (SIZE_MAX / l_height)) ||
  ------------------
  |  Branch (10135:17): [True: 0, False: 7.35k]
  |  Branch (10135:37): [True: 0, False: 7.35k]
  ------------------
10136|  7.35k|                    l_width * l_height > SIZE_MAX / sizeof(OPJ_INT32)) {
  ------------------
  |  Branch (10136:21): [True: 0, False: 7.35k]
  ------------------
10137|       |                /* would overflow */
10138|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10139|      0|            }
10140|  7.35k|            l_img_comp_dest->data = (OPJ_INT32*) opj_image_data_alloc(l_width * l_height *
10141|  7.35k|                                    sizeof(OPJ_INT32));
10142|  7.35k|            if (! l_img_comp_dest->data) {
  ------------------
  |  Branch (10142:17): [True: 0, False: 7.35k]
  ------------------
10143|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
10144|      0|            }
10145|       |
10146|  7.35k|            if (l_img_comp_dest->w != l_width_dest ||
  ------------------
  |  Branch (10146:17): [True: 3.99k, False: 3.36k]
  ------------------
10147|  7.35k|                    l_img_comp_dest->h != l_height_dest) {
  ------------------
  |  Branch (10147:21): [True: 3.36k, False: 0]
  ------------------
10148|  7.35k|                memset(l_img_comp_dest->data, 0,
10149|  7.35k|                       (OPJ_SIZE_T)l_img_comp_dest->w * l_img_comp_dest->h * sizeof(OPJ_INT32));
10150|  7.35k|            }
10151|  7.35k|        }
10152|       |
10153|       |        /* Move the output buffer to the first place where we will write*/
10154|  12.2k|        l_dest_ptr = l_img_comp_dest->data + l_start_offset_dest;
10155|       |
10156|  12.2k|        {
10157|  12.2k|            const OPJ_INT32 * l_src_ptr = p_src_data;
10158|  12.2k|            l_src_ptr += l_start_offset_src;
10159|       |
10160|  1.36M|            for (j = 0; j < l_height_dest; ++j) {
  ------------------
  |  Branch (10160:25): [True: 1.35M, False: 12.2k]
  ------------------
10161|  1.35M|                memcpy(l_dest_ptr, l_src_ptr, l_width_dest * sizeof(OPJ_INT32));
10162|  1.35M|                l_dest_ptr += l_img_comp_dest->w;
10163|  1.35M|                l_src_ptr += src_data_stride;
10164|  1.35M|            }
10165|  12.2k|        }
10166|       |
10167|       |
10168|  12.2k|    }
10169|       |
10170|  7.47k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.47k|#define OPJ_TRUE 1
  ------------------
10171|  7.50k|}
j2k.c:opj_j2k_are_all_used_components_decoded:
11628|  5.70k|{
11629|  5.70k|    OPJ_UINT32 compno;
11630|  5.70k|    OPJ_BOOL decoded_all_used_components = OPJ_TRUE;
  ------------------
  |  |  117|  5.70k|#define OPJ_TRUE 1
  ------------------
11631|       |
11632|  5.70k|    if (p_j2k->m_specific_param.m_decoder.m_numcomps_to_decode) {
  ------------------
  |  Branch (11632:9): [True: 0, False: 5.70k]
  ------------------
11633|      0|        for (compno = 0;
11634|      0|                compno < p_j2k->m_specific_param.m_decoder.m_numcomps_to_decode; compno++) {
  ------------------
  |  Branch (11634:17): [True: 0, False: 0]
  ------------------
11635|      0|            OPJ_UINT32 dec_compno =
11636|      0|                p_j2k->m_specific_param.m_decoder.m_comps_indices_to_decode[compno];
11637|      0|            if (p_j2k->m_output_image->comps[dec_compno].data == NULL) {
  ------------------
  |  Branch (11637:17): [True: 0, False: 0]
  ------------------
11638|      0|                opj_event_msg(p_manager, EVT_WARNING, "Failed to decode component %d\n",
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
11639|      0|                              dec_compno);
11640|      0|                decoded_all_used_components = OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
11641|      0|            }
11642|      0|        }
11643|  5.70k|    } else {
11644|  18.7k|        for (compno = 0; compno < p_j2k->m_output_image->numcomps; compno++) {
  ------------------
  |  Branch (11644:26): [True: 13.0k, False: 5.70k]
  ------------------
11645|  13.0k|            if (p_j2k->m_output_image->comps[compno].data == NULL) {
  ------------------
  |  Branch (11645:17): [True: 2.50k, False: 10.5k]
  ------------------
11646|  2.50k|                opj_event_msg(p_manager, EVT_WARNING, "Failed to decode component %d\n",
  ------------------
  |  |   67|  2.50k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
11647|  2.50k|                              compno);
11648|  2.50k|                decoded_all_used_components = OPJ_FALSE;
  ------------------
  |  |  118|  2.50k|#define OPJ_FALSE 0
  ------------------
11649|  2.50k|            }
11650|  13.0k|        }
11651|  5.70k|    }
11652|       |
11653|  5.70k|    if (decoded_all_used_components == OPJ_FALSE) {
  ------------------
  |  |  118|  5.70k|#define OPJ_FALSE 0
  ------------------
  |  Branch (11653:9): [True: 99, False: 5.60k]
  ------------------
11654|     99|        opj_event_msg(p_manager, EVT_ERROR, "Failed to decode all used components\n");
  ------------------
  |  |   66|     99|#define EVT_ERROR   1   /**< Error event type */
  ------------------
11655|     99|        return OPJ_FALSE;
  ------------------
  |  |  118|     99|#define OPJ_FALSE 0
  ------------------
11656|     99|    }
11657|       |
11658|  5.60k|    return OPJ_TRUE;
  ------------------
  |  |  117|  5.60k|#define OPJ_TRUE 1
  ------------------
11659|  5.70k|}
j2k.c:opj_j2k_move_data_from_codec_to_output_image:
11933|  5.60k|{
11934|  5.60k|    OPJ_UINT32 compno;
11935|       |
11936|       |    /* Move data and copy one information from codec to output image*/
11937|  5.60k|    if (p_j2k->m_specific_param.m_decoder.m_numcomps_to_decode > 0) {
  ------------------
  |  Branch (11937:9): [True: 0, False: 5.60k]
  ------------------
11938|      0|        opj_image_comp_t* newcomps =
11939|      0|            (opj_image_comp_t*) opj_malloc(
11940|      0|                p_j2k->m_specific_param.m_decoder.m_numcomps_to_decode *
11941|      0|                sizeof(opj_image_comp_t));
11942|      0|        if (newcomps == NULL) {
  ------------------
  |  Branch (11942:13): [True: 0, False: 0]
  ------------------
11943|      0|            opj_image_destroy(p_j2k->m_private_image);
11944|      0|            p_j2k->m_private_image = NULL;
11945|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
11946|      0|        }
11947|      0|        for (compno = 0; compno < p_image->numcomps; compno++) {
  ------------------
  |  Branch (11947:26): [True: 0, False: 0]
  ------------------
11948|      0|            opj_image_data_free(p_image->comps[compno].data);
11949|      0|            p_image->comps[compno].data = NULL;
11950|      0|        }
11951|      0|        for (compno = 0;
11952|      0|                compno < p_j2k->m_specific_param.m_decoder.m_numcomps_to_decode; compno++) {
  ------------------
  |  Branch (11952:17): [True: 0, False: 0]
  ------------------
11953|      0|            OPJ_UINT32 src_compno =
11954|      0|                p_j2k->m_specific_param.m_decoder.m_comps_indices_to_decode[compno];
11955|      0|            memcpy(&(newcomps[compno]),
11956|      0|                   &(p_j2k->m_output_image->comps[src_compno]),
11957|      0|                   sizeof(opj_image_comp_t));
11958|      0|            newcomps[compno].resno_decoded =
11959|      0|                p_j2k->m_output_image->comps[src_compno].resno_decoded;
11960|      0|            newcomps[compno].data = p_j2k->m_output_image->comps[src_compno].data;
11961|      0|            p_j2k->m_output_image->comps[src_compno].data = NULL;
11962|      0|        }
11963|      0|        for (compno = 0; compno < p_image->numcomps; compno++) {
  ------------------
  |  Branch (11963:26): [True: 0, False: 0]
  ------------------
11964|      0|            assert(p_j2k->m_output_image->comps[compno].data == NULL);
11965|      0|            opj_image_data_free(p_j2k->m_output_image->comps[compno].data);
11966|      0|            p_j2k->m_output_image->comps[compno].data = NULL;
11967|      0|        }
11968|      0|        p_image->numcomps = p_j2k->m_specific_param.m_decoder.m_numcomps_to_decode;
11969|      0|        opj_free(p_image->comps);
11970|      0|        p_image->comps = newcomps;
11971|  5.60k|    } else {
11972|  13.0k|        for (compno = 0; compno < p_image->numcomps; compno++) {
  ------------------
  |  Branch (11972:26): [True: 7.39k, False: 5.60k]
  ------------------
11973|  7.39k|            p_image->comps[compno].resno_decoded =
11974|  7.39k|                p_j2k->m_output_image->comps[compno].resno_decoded;
11975|  7.39k|            opj_image_data_free(p_image->comps[compno].data);
11976|  7.39k|            p_image->comps[compno].data = p_j2k->m_output_image->comps[compno].data;
11977|       |#if 0
11978|       |            char fn[256];
11979|       |            snprintf(fn, sizeof fn, "/tmp/%d.raw", compno);
11980|       |            FILE *debug = fopen(fn, "wb");
11981|       |            fwrite(p_image->comps[compno].data, sizeof(OPJ_INT32),
11982|       |                   p_image->comps[compno].w * p_image->comps[compno].h, debug);
11983|       |            fclose(debug);
11984|       |#endif
11985|  7.39k|            p_j2k->m_output_image->comps[compno].data = NULL;
11986|  7.39k|        }
11987|  5.60k|    }
11988|  5.60k|    return OPJ_TRUE;
  ------------------
  |  |  117|  5.60k|#define OPJ_TRUE 1
  ------------------
11989|  5.60k|}

opj_mct_decode:
  150|    359|{
  151|    359|    OPJ_SIZE_T i;
  152|    359|    const OPJ_SIZE_T len = n;
  153|       |
  154|   447k|    for (i = 0; i < (len & ~3U); i += 4) {
  ------------------
  |  Branch (154:17): [True: 447k, False: 359]
  ------------------
  155|   447k|        __m128i r, g, b;
  156|   447k|        __m128i y = _mm_load_si128((const __m128i *) & (c0[i]));
  157|   447k|        __m128i u = _mm_load_si128((const __m128i *) & (c1[i]));
  158|   447k|        __m128i v = _mm_load_si128((const __m128i *) & (c2[i]));
  159|   447k|        g = y;
  160|   447k|        g = _mm_sub_epi32(g, _mm_srai_epi32(_mm_add_epi32(u, v), 2));
  161|   447k|        r = _mm_add_epi32(v, g);
  162|   447k|        b = _mm_add_epi32(u, g);
  163|   447k|        _mm_store_si128((__m128i *) & (c0[i]), r);
  164|   447k|        _mm_store_si128((__m128i *) & (c1[i]), g);
  165|   447k|        _mm_store_si128((__m128i *) & (c2[i]), b);
  166|   447k|    }
  167|    883|    for (; i < len; ++i) {
  ------------------
  |  Branch (167:12): [True: 524, False: 359]
  ------------------
  168|    524|        OPJ_INT32 y = c0[i];
  169|    524|        OPJ_INT32 u = c1[i];
  170|    524|        OPJ_INT32 v = c2[i];
  171|    524|        OPJ_INT32 g = y - ((u + v) >> 2);
  172|    524|        OPJ_INT32 r = v + g;
  173|    524|        OPJ_INT32 b = u + g;
  174|    524|        c0[i] = r;
  175|    524|        c1[i] = g;
  176|    524|        c2[i] = b;
  177|    524|    }
  178|    359|}
opj_mct_decode_real:
  287|    940|{
  288|    940|    OPJ_SIZE_T i;
  289|    940|#ifdef __SSE__
  290|    940|    __m128 vrv, vgu, vgv, vbu;
  291|    940|    vrv = _mm_set1_ps(1.402f);
  292|    940|    vgu = _mm_set1_ps(0.34413f);
  293|    940|    vgv = _mm_set1_ps(0.71414f);
  294|    940|    vbu = _mm_set1_ps(1.772f);
  295|   140k|    for (i = 0; i < (n >> 3); ++i) {
  ------------------
  |  Branch (295:17): [True: 139k, False: 940]
  ------------------
  296|   139k|        __m128 vy, vu, vv;
  297|   139k|        __m128 vr, vg, vb;
  298|       |
  299|   139k|        vy = _mm_load_ps(c0);
  300|   139k|        vu = _mm_load_ps(c1);
  301|   139k|        vv = _mm_load_ps(c2);
  302|   139k|        vr = _mm_add_ps(vy, _mm_mul_ps(vv, vrv));
  303|   139k|        vg = _mm_sub_ps(_mm_sub_ps(vy, _mm_mul_ps(vu, vgu)), _mm_mul_ps(vv, vgv));
  304|   139k|        vb = _mm_add_ps(vy, _mm_mul_ps(vu, vbu));
  305|   139k|        _mm_store_ps(c0, vr);
  306|   139k|        _mm_store_ps(c1, vg);
  307|   139k|        _mm_store_ps(c2, vb);
  308|   139k|        c0 += 4;
  309|   139k|        c1 += 4;
  310|   139k|        c2 += 4;
  311|       |
  312|   139k|        vy = _mm_load_ps(c0);
  313|   139k|        vu = _mm_load_ps(c1);
  314|   139k|        vv = _mm_load_ps(c2);
  315|   139k|        vr = _mm_add_ps(vy, _mm_mul_ps(vv, vrv));
  316|   139k|        vg = _mm_sub_ps(_mm_sub_ps(vy, _mm_mul_ps(vu, vgu)), _mm_mul_ps(vv, vgv));
  317|   139k|        vb = _mm_add_ps(vy, _mm_mul_ps(vu, vbu));
  318|   139k|        _mm_store_ps(c0, vr);
  319|   139k|        _mm_store_ps(c1, vg);
  320|   139k|        _mm_store_ps(c2, vb);
  321|   139k|        c0 += 4;
  322|   139k|        c1 += 4;
  323|   139k|        c2 += 4;
  324|   139k|    }
  325|    940|    n &= 7;
  326|    940|#endif
  327|  3.70k|    for (i = 0; i < n; ++i) {
  ------------------
  |  Branch (327:17): [True: 2.76k, False: 940]
  ------------------
  328|  2.76k|        OPJ_FLOAT32 y = c0[i];
  329|  2.76k|        OPJ_FLOAT32 u = c1[i];
  330|  2.76k|        OPJ_FLOAT32 v = c2[i];
  331|  2.76k|        OPJ_FLOAT32 r = y + (v * 1.402f);
  332|  2.76k|        OPJ_FLOAT32 g = y - (u * 0.34413f) - (v * (0.71414f));
  333|  2.76k|        OPJ_FLOAT32 b = y + (u * 1.772f);
  334|  2.76k|        c0[i] = r;
  335|  2.76k|        c1[i] = g;
  336|  2.76k|        c2[i] = b;
  337|  2.76k|    }
  338|    940|}

opj_mqc_init_dec:
  441|   178k|{
  442|       |    /* Implements ISO 15444-1 C.3.5 Initialization of the decoder (INITDEC) */
  443|       |    /* Note: alternate "J.1 - Initialization of the software-conventions */
  444|       |    /* decoder" has been tried, but does */
  445|       |    /* not bring any improvement. */
  446|       |    /* See https://github.com/uclouvain/openjpeg/issues/921 */
  447|   178k|    opj_mqc_init_dec_common(mqc, bp, len, extra_writable_bytes);
  448|   178k|    opj_mqc_setcurctx(mqc, 0);
  ------------------
  |  |  139|   178k|#define opj_mqc_setcurctx(mqc, ctxno)   (mqc)->curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  ------------------
  449|   178k|    mqc->end_of_byte_stream_counter = 0;
  450|   178k|    if (len == 0) {
  ------------------
  |  Branch (450:9): [True: 50.5k, False: 127k]
  ------------------
  451|  50.5k|        mqc->c = 0xff << 16;
  452|   127k|    } else {
  453|   127k|        mqc->c = (OPJ_UINT32)(*mqc->bp << 16);
  454|   127k|    }
  455|       |
  456|   178k|    opj_mqc_bytein(mqc);
  457|   178k|    mqc->c <<= 7;
  458|   178k|    mqc->ct -= 7;
  459|   178k|    mqc->a = 0x8000;
  460|   178k|}
opj_mqc_raw_init_dec:
  465|  39.5k|{
  466|  39.5k|    opj_mqc_init_dec_common(mqc, bp, len, extra_writable_bytes);
  467|  39.5k|    mqc->c = 0;
  468|  39.5k|    mqc->ct = 0;
  469|  39.5k|}
opq_mqc_finish_dec:
  473|   217k|{
  474|       |    /* Restore the bytes overwritten by opj_mqc_init_dec_common() */
  475|   217k|    memcpy(mqc->end, mqc->backup, OPJ_COMMON_CBLK_DATA_EXTRA);
  ------------------
  |  |   39|   217k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
  476|   217k|}
opj_mqc_resetstates:
  479|  4.67M|{
  480|  4.67M|    OPJ_UINT32 i;
  481|  93.5M|    for (i = 0; i < MQC_NUMCTXS; i++) {
  ------------------
  |  |   69|  93.5M|#define MQC_NUMCTXS 19
  ------------------
  |  Branch (481:17): [True: 88.8M, False: 4.67M]
  ------------------
  482|  88.8M|        mqc->ctxs[i] = mqc_states;
  483|  88.8M|    }
  484|  4.67M|}
opj_mqc_setstate:
  488|  14.0M|{
  489|  14.0M|    mqc->ctxs[ctxno] = &mqc_states[msb + (OPJ_UINT32)(prob << 1)];
  490|  14.0M|}
mqc.c:opj_mqc_init_dec_common:
  424|   217k|{
  425|   217k|    (void)extra_writable_bytes;
  426|       |
  427|   217k|    assert(extra_writable_bytes >= OPJ_COMMON_CBLK_DATA_EXTRA);
  428|   217k|    mqc->start = bp;
  429|   217k|    mqc->end = bp + len;
  430|       |    /* Insert an artificial 0xFF 0xFF marker at end of the code block */
  431|       |    /* data so that the bytein routines stop on it. This saves us comparing */
  432|       |    /* the bp and end pointers */
  433|       |    /* But before inserting it, backup th bytes we will overwrite */
  434|   217k|    memcpy(mqc->backup, mqc->end, OPJ_COMMON_CBLK_DATA_EXTRA);
  ------------------
  |  |   39|   217k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
  435|   217k|    mqc->end[0] = 0xFF;
  436|   217k|    mqc->end[1] = 0xFF;
  437|   217k|    mqc->bp = bp;
  438|   217k|}

t1.c:opj_mqc_raw_decode:
   75|  15.6M|{
   76|  15.6M|    OPJ_UINT32 d;
   77|  15.6M|    if (mqc->ct == 0) {
  ------------------
  |  Branch (77:9): [True: 1.96M, False: 13.6M]
  ------------------
   78|       |        /* Given opj_mqc_raw_init_dec() we know that at some point we will */
   79|       |        /* have a 0xFF 0xFF artificial marker */
   80|  1.96M|        if (mqc->c == 0xff) {
  ------------------
  |  Branch (80:13): [True: 1.90M, False: 61.4k]
  ------------------
   81|  1.90M|            if (*mqc->bp  > 0x8f) {
  ------------------
  |  Branch (81:17): [True: 1.88M, False: 13.9k]
  ------------------
   82|  1.88M|                mqc->c = 0xff;
   83|  1.88M|                mqc->ct = 8;
   84|  1.88M|            } else {
   85|  13.9k|                mqc->c = *mqc->bp;
   86|  13.9k|                mqc->bp ++;
   87|  13.9k|                mqc->ct = 7;
   88|  13.9k|            }
   89|  1.90M|        } else {
   90|  61.4k|            mqc->c = *mqc->bp;
   91|  61.4k|            mqc->bp ++;
   92|  61.4k|            mqc->ct = 8;
   93|  61.4k|        }
   94|  1.96M|    }
   95|  15.6M|    mqc->ct--;
   96|  15.6M|    d = ((OPJ_UINT32)mqc->c >> mqc->ct) & 0x01U;
   97|       |
   98|  15.6M|    return d;
   99|  15.6M|}
mqc.c:opj_mqc_bytein:
  176|   178k|{
  177|   178k|    opj_mqc_bytein_macro(mqc, mqc->c, mqc->ct);
  ------------------
  |  |  102|   178k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  103|   178k|{ \
  |  |  104|   178k|        OPJ_UINT32 l_c;  \
  |  |  105|   178k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  106|   178k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  107|   178k|        l_c = *(mqc->bp + 1); \
  |  |  108|   178k|        if (*mqc->bp == 0xff) { \
  |  |  ------------------
  |  |  |  Branch (108:13): [True: 82.3k, False: 95.9k]
  |  |  ------------------
  |  |  109|  82.3k|            if (l_c > 0x8f) { \
  |  |  ------------------
  |  |  |  Branch (109:17): [True: 51.7k, False: 30.5k]
  |  |  ------------------
  |  |  110|  51.7k|                c += 0xff00; \
  |  |  111|  51.7k|                ct = 8; \
  |  |  112|  51.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  113|  51.7k|            } else { \
  |  |  114|  30.5k|                mqc->bp++; \
  |  |  115|  30.5k|                c += l_c << 9; \
  |  |  116|  30.5k|                ct = 7; \
  |  |  117|  30.5k|            } \
  |  |  118|  95.9k|        } else { \
  |  |  119|  95.9k|            mqc->bp++; \
  |  |  120|  95.9k|            c += l_c << 8; \
  |  |  121|  95.9k|            ct = 8; \
  |  |  122|  95.9k|        } \
  |  |  123|   178k|}
  ------------------
  178|   178k|}

opj_set_info_handler:
   47|  9.21k|{
   48|  9.21k|    opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
   49|  9.21k|    if (! l_codec) {
  ------------------
  |  Branch (49:9): [True: 0, False: 9.21k]
  ------------------
   50|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
   51|      0|    }
   52|       |
   53|  9.21k|    l_codec->m_event_mgr.info_handler = p_callback;
   54|  9.21k|    l_codec->m_event_mgr.m_info_data = p_user_data;
   55|       |
   56|  9.21k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
   57|  9.21k|}
opj_set_warning_handler:
   62|  9.21k|{
   63|  9.21k|    opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
   64|  9.21k|    if (! l_codec) {
  ------------------
  |  Branch (64:9): [True: 0, False: 9.21k]
  ------------------
   65|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
   66|      0|    }
   67|       |
   68|  9.21k|    l_codec->m_event_mgr.warning_handler = p_callback;
   69|  9.21k|    l_codec->m_event_mgr.m_warning_data = p_user_data;
   70|       |
   71|  9.21k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
   72|  9.21k|}
opj_set_error_handler:
   77|  9.21k|{
   78|  9.21k|    opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
   79|  9.21k|    if (! l_codec) {
  ------------------
  |  Branch (79:9): [True: 0, False: 9.21k]
  ------------------
   80|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
   81|      0|    }
   82|       |
   83|  9.21k|    l_codec->m_event_mgr.error_handler = p_callback;
   84|  9.21k|    l_codec->m_event_mgr.m_error_data = p_user_data;
   85|       |
   86|  9.21k|    return OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
   87|  9.21k|}
opj_create_decompress:
  185|  9.21k|{
  186|  9.21k|    opj_codec_private_t *l_codec = 00;
  187|       |
  188|  9.21k|    l_codec = (opj_codec_private_t*) opj_calloc(1, sizeof(opj_codec_private_t));
  189|  9.21k|    if (!l_codec) {
  ------------------
  |  Branch (189:9): [True: 0, False: 9.21k]
  ------------------
  190|      0|        return 00;
  191|      0|    }
  192|       |
  193|  9.21k|    l_codec->is_decompressor = 1;
  194|       |
  195|  9.21k|    switch (p_format) {
  196|  9.21k|    case OPJ_CODEC_J2K:
  ------------------
  |  Branch (196:5): [True: 9.21k, False: 0]
  ------------------
  197|  9.21k|        l_codec->opj_dump_codec = (void (*)(void*, OPJ_INT32, FILE*)) j2k_dump;
  198|       |
  199|  9.21k|        l_codec->opj_get_codec_info = (opj_codestream_info_v2_t* (*)(
  200|  9.21k|                                           void*)) j2k_get_cstr_info;
  201|       |
  202|  9.21k|        l_codec->opj_get_codec_index = (opj_codestream_index_t* (*)(
  203|  9.21k|                                            void*)) j2k_get_cstr_index;
  204|       |
  205|  9.21k|        l_codec->m_codec_data.m_decompression.opj_decode =
  206|  9.21k|            (OPJ_BOOL(*)(void *,
  207|  9.21k|                         struct opj_stream_private *,
  208|  9.21k|                         opj_image_t*, struct opj_event_mgr *)) opj_j2k_decode;
  209|       |
  210|  9.21k|        l_codec->m_codec_data.m_decompression.opj_end_decompress =
  211|  9.21k|            (OPJ_BOOL(*)(void *,
  212|  9.21k|                         struct opj_stream_private *,
  213|  9.21k|                         struct opj_event_mgr *)) opj_j2k_end_decompress;
  214|       |
  215|  9.21k|        l_codec->m_codec_data.m_decompression.opj_read_header =
  216|  9.21k|            (OPJ_BOOL(*)(struct opj_stream_private *,
  217|  9.21k|                         void *,
  218|  9.21k|                         opj_image_t **,
  219|  9.21k|                         struct opj_event_mgr *)) opj_j2k_read_header;
  220|       |
  221|  9.21k|        l_codec->m_codec_data.m_decompression.opj_destroy =
  222|  9.21k|            (void (*)(void *))opj_j2k_destroy;
  223|       |
  224|  9.21k|        l_codec->m_codec_data.m_decompression.opj_setup_decoder =
  225|  9.21k|            (void (*)(void *, opj_dparameters_t *)) opj_j2k_setup_decoder;
  226|       |
  227|  9.21k|        l_codec->m_codec_data.m_decompression.opj_decoder_set_strict_mode =
  228|  9.21k|            (void (*)(void *, OPJ_BOOL)) opj_j2k_decoder_set_strict_mode;
  229|       |
  230|       |
  231|  9.21k|        l_codec->m_codec_data.m_decompression.opj_read_tile_header =
  232|  9.21k|            (OPJ_BOOL(*)(void *,
  233|  9.21k|                         OPJ_UINT32*,
  234|  9.21k|                         OPJ_UINT32*,
  235|  9.21k|                         OPJ_INT32*, OPJ_INT32*,
  236|  9.21k|                         OPJ_INT32*, OPJ_INT32*,
  237|  9.21k|                         OPJ_UINT32*,
  238|  9.21k|                         OPJ_BOOL*,
  239|  9.21k|                         struct opj_stream_private *,
  240|  9.21k|                         struct opj_event_mgr *)) opj_j2k_read_tile_header;
  241|       |
  242|  9.21k|        l_codec->m_codec_data.m_decompression.opj_decode_tile_data =
  243|  9.21k|            (OPJ_BOOL(*)(void *,
  244|  9.21k|                         OPJ_UINT32,
  245|  9.21k|                         OPJ_BYTE*,
  246|  9.21k|                         OPJ_UINT32,
  247|  9.21k|                         struct opj_stream_private *,
  248|  9.21k|                         struct opj_event_mgr *)) opj_j2k_decode_tile;
  249|       |
  250|  9.21k|        l_codec->m_codec_data.m_decompression.opj_set_decode_area =
  251|  9.21k|            (OPJ_BOOL(*)(void *,
  252|  9.21k|                         opj_image_t*,
  253|  9.21k|                         OPJ_INT32, OPJ_INT32, OPJ_INT32, OPJ_INT32,
  254|  9.21k|                         struct opj_event_mgr *)) opj_j2k_set_decode_area;
  255|       |
  256|  9.21k|        l_codec->m_codec_data.m_decompression.opj_get_decoded_tile =
  257|  9.21k|            (OPJ_BOOL(*)(void *p_codec,
  258|  9.21k|                         opj_stream_private_t *p_cio,
  259|  9.21k|                         opj_image_t *p_image,
  260|  9.21k|                         struct opj_event_mgr * p_manager,
  261|  9.21k|                         OPJ_UINT32 tile_index)) opj_j2k_get_tile;
  262|       |
  263|  9.21k|        l_codec->m_codec_data.m_decompression.opj_set_decoded_resolution_factor =
  264|  9.21k|            (OPJ_BOOL(*)(void * p_codec,
  265|  9.21k|                         OPJ_UINT32 res_factor,
  266|  9.21k|                         struct opj_event_mgr * p_manager)) opj_j2k_set_decoded_resolution_factor;
  267|       |
  268|  9.21k|        l_codec->m_codec_data.m_decompression.opj_set_decoded_components =
  269|  9.21k|            (OPJ_BOOL(*)(void * p_codec,
  270|  9.21k|                         OPJ_UINT32 numcomps,
  271|  9.21k|                         const OPJ_UINT32 * comps_indices,
  272|  9.21k|                         struct opj_event_mgr * p_manager)) opj_j2k_set_decoded_components;
  273|       |
  274|  9.21k|        l_codec->opj_set_threads =
  275|  9.21k|            (OPJ_BOOL(*)(void * p_codec, OPJ_UINT32 num_threads)) opj_j2k_set_threads;
  276|       |
  277|  9.21k|        l_codec->m_codec = opj_j2k_create_decompress();
  278|       |
  279|  9.21k|        if (! l_codec->m_codec) {
  ------------------
  |  Branch (279:13): [True: 0, False: 9.21k]
  ------------------
  280|      0|            opj_free(l_codec);
  281|      0|            return NULL;
  282|      0|        }
  283|       |
  284|  9.21k|        break;
  285|       |
  286|  9.21k|    case OPJ_CODEC_JP2:
  ------------------
  |  Branch (286:5): [True: 0, False: 9.21k]
  ------------------
  287|       |        /* get a JP2 decoder handle */
  288|      0|        l_codec->opj_dump_codec = (void (*)(void*, OPJ_INT32, FILE*)) jp2_dump;
  289|       |
  290|      0|        l_codec->opj_get_codec_info = (opj_codestream_info_v2_t* (*)(
  291|      0|                                           void*)) jp2_get_cstr_info;
  292|       |
  293|      0|        l_codec->opj_get_codec_index = (opj_codestream_index_t* (*)(
  294|      0|                                            void*)) jp2_get_cstr_index;
  295|       |
  296|      0|        l_codec->m_codec_data.m_decompression.opj_decode =
  297|      0|            (OPJ_BOOL(*)(void *,
  298|      0|                         struct opj_stream_private *,
  299|      0|                         opj_image_t*,
  300|      0|                         struct opj_event_mgr *)) opj_jp2_decode;
  301|       |
  302|      0|        l_codec->m_codec_data.m_decompression.opj_end_decompress =
  303|      0|            (OPJ_BOOL(*)(void *,
  304|      0|                         struct opj_stream_private *,
  305|      0|                         struct opj_event_mgr *)) opj_jp2_end_decompress;
  306|       |
  307|      0|        l_codec->m_codec_data.m_decompression.opj_read_header =
  308|      0|            (OPJ_BOOL(*)(struct opj_stream_private *,
  309|      0|                         void *,
  310|      0|                         opj_image_t **,
  311|      0|                         struct opj_event_mgr *)) opj_jp2_read_header;
  312|       |
  313|      0|        l_codec->m_codec_data.m_decompression.opj_read_tile_header =
  314|      0|            (OPJ_BOOL(*)(void *,
  315|      0|                         OPJ_UINT32*,
  316|      0|                         OPJ_UINT32*,
  317|      0|                         OPJ_INT32*,
  318|      0|                         OPJ_INT32*,
  319|      0|                         OPJ_INT32 *,
  320|      0|                         OPJ_INT32 *,
  321|      0|                         OPJ_UINT32 *,
  322|      0|                         OPJ_BOOL *,
  323|      0|                         struct opj_stream_private *,
  324|      0|                         struct opj_event_mgr *)) opj_jp2_read_tile_header;
  325|       |
  326|      0|        l_codec->m_codec_data.m_decompression.opj_decode_tile_data =
  327|      0|            (OPJ_BOOL(*)(void *,
  328|      0|                         OPJ_UINT32, OPJ_BYTE*, OPJ_UINT32,
  329|      0|                         struct opj_stream_private *,
  330|      0|                         struct opj_event_mgr *)) opj_jp2_decode_tile;
  331|       |
  332|      0|        l_codec->m_codec_data.m_decompression.opj_destroy = (void (*)(
  333|      0|                    void *))opj_jp2_destroy;
  334|       |
  335|      0|        l_codec->m_codec_data.m_decompression.opj_setup_decoder =
  336|      0|            (void (*)(void *, opj_dparameters_t *)) opj_jp2_setup_decoder;
  337|       |
  338|      0|        l_codec->m_codec_data.m_decompression.opj_decoder_set_strict_mode =
  339|      0|            (void (*)(void *, OPJ_BOOL)) opj_jp2_decoder_set_strict_mode;
  340|       |
  341|      0|        l_codec->m_codec_data.m_decompression.opj_set_decode_area =
  342|      0|            (OPJ_BOOL(*)(void *,
  343|      0|                         opj_image_t*,
  344|      0|                         OPJ_INT32, OPJ_INT32, OPJ_INT32, OPJ_INT32,
  345|      0|                         struct opj_event_mgr *)) opj_jp2_set_decode_area;
  346|       |
  347|      0|        l_codec->m_codec_data.m_decompression.opj_get_decoded_tile =
  348|      0|            (OPJ_BOOL(*)(void *p_codec,
  349|      0|                         opj_stream_private_t *p_cio,
  350|      0|                         opj_image_t *p_image,
  351|      0|                         struct opj_event_mgr * p_manager,
  352|      0|                         OPJ_UINT32 tile_index)) opj_jp2_get_tile;
  353|       |
  354|      0|        l_codec->m_codec_data.m_decompression.opj_set_decoded_resolution_factor =
  355|      0|            (OPJ_BOOL(*)(void * p_codec,
  356|      0|                         OPJ_UINT32 res_factor,
  357|      0|                         opj_event_mgr_t * p_manager)) opj_jp2_set_decoded_resolution_factor;
  358|       |
  359|      0|        l_codec->m_codec_data.m_decompression.opj_set_decoded_components =
  360|      0|            (OPJ_BOOL(*)(void * p_codec,
  361|      0|                         OPJ_UINT32 numcomps,
  362|      0|                         const OPJ_UINT32 * comps_indices,
  363|      0|                         struct opj_event_mgr * p_manager)) opj_jp2_set_decoded_components;
  364|       |
  365|      0|        l_codec->opj_set_threads =
  366|      0|            (OPJ_BOOL(*)(void * p_codec, OPJ_UINT32 num_threads)) opj_jp2_set_threads;
  367|       |
  368|      0|        l_codec->m_codec = opj_jp2_create(OPJ_TRUE);
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
  369|       |
  370|      0|        if (! l_codec->m_codec) {
  ------------------
  |  Branch (370:13): [True: 0, False: 0]
  ------------------
  371|      0|            opj_free(l_codec);
  372|      0|            return 00;
  373|      0|        }
  374|       |
  375|      0|        break;
  376|      0|    case OPJ_CODEC_UNKNOWN:
  ------------------
  |  Branch (376:5): [True: 0, False: 9.21k]
  ------------------
  377|      0|    case OPJ_CODEC_JPT:
  ------------------
  |  Branch (377:5): [True: 0, False: 9.21k]
  ------------------
  378|      0|    default:
  ------------------
  |  Branch (378:5): [True: 0, False: 9.21k]
  ------------------
  379|      0|        opj_free(l_codec);
  380|      0|        return 00;
  381|  9.21k|    }
  382|       |
  383|  9.21k|    opj_set_default_event_handler(&(l_codec->m_event_mgr));
  384|  9.21k|    return (opj_codec_t*) l_codec;
  385|  9.21k|}
opj_set_default_decoder_parameters:
  389|  9.21k|{
  390|  9.21k|    if (parameters) {
  ------------------
  |  Branch (390:9): [True: 9.21k, False: 0]
  ------------------
  391|  9.21k|        memset(parameters, 0, sizeof(opj_dparameters_t));
  392|       |        /* default decoding parameters */
  393|  9.21k|        parameters->cp_layer = 0;
  394|  9.21k|        parameters->cp_reduce = 0;
  395|       |
  396|  9.21k|        parameters->decod_format = -1;
  397|  9.21k|        parameters->cod_format = -1;
  398|  9.21k|        parameters->flags = 0;
  399|       |        /* UniPG>> */
  400|       |#ifdef USE_JPWL
  401|       |        parameters->jpwl_correct = OPJ_FALSE;
  402|       |        parameters->jpwl_exp_comps = JPWL_EXPECTED_COMPONENTS;
  403|       |        parameters->jpwl_max_tiles = JPWL_MAXIMUM_TILES;
  404|       |#endif /* USE_JPWL */
  405|       |        /* <<UniPG */
  406|  9.21k|    }
  407|  9.21k|}
opj_setup_decoder:
  424|  9.21k|{
  425|  9.21k|    if (p_codec && parameters) {
  ------------------
  |  Branch (425:9): [True: 9.21k, False: 0]
  |  Branch (425:20): [True: 9.21k, False: 0]
  ------------------
  426|  9.21k|        opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
  427|       |
  428|  9.21k|        if (! l_codec->is_decompressor) {
  ------------------
  |  Branch (428:13): [True: 0, False: 9.21k]
  ------------------
  429|      0|            opj_event_msg(&(l_codec->m_event_mgr), EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  430|      0|                          "Codec provided to the opj_setup_decoder function is not a decompressor handler.\n");
  431|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  432|      0|        }
  433|       |
  434|  9.21k|        l_codec->m_codec_data.m_decompression.opj_setup_decoder(l_codec->m_codec,
  435|  9.21k|                parameters);
  436|  9.21k|        return OPJ_TRUE;
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
  437|  9.21k|    }
  438|      0|    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  439|  9.21k|}
opj_read_header:
  464|  9.21k|{
  465|  9.21k|    if (p_codec && p_stream) {
  ------------------
  |  Branch (465:9): [True: 9.21k, False: 0]
  |  Branch (465:20): [True: 9.21k, False: 0]
  ------------------
  466|  9.21k|        opj_codec_private_t* l_codec = (opj_codec_private_t*) p_codec;
  467|  9.21k|        opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
  468|       |
  469|  9.21k|        if (! l_codec->is_decompressor) {
  ------------------
  |  Branch (469:13): [True: 0, False: 9.21k]
  ------------------
  470|      0|            opj_event_msg(&(l_codec->m_event_mgr), EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  471|      0|                          "Codec provided to the opj_read_header function is not a decompressor handler.\n");
  472|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  473|      0|        }
  474|       |
  475|  9.21k|        return l_codec->m_codec_data.m_decompression.opj_read_header(l_stream,
  476|  9.21k|                l_codec->m_codec,
  477|  9.21k|                p_image,
  478|  9.21k|                &(l_codec->m_event_mgr));
  479|  9.21k|    }
  480|       |
  481|      0|    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  482|  9.21k|}
opj_decode:
  517|  7.81k|{
  518|  7.81k|    if (p_codec && p_stream) {
  ------------------
  |  Branch (518:9): [True: 7.81k, False: 0]
  |  Branch (518:20): [True: 7.81k, False: 0]
  ------------------
  519|  7.81k|        opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
  520|  7.81k|        opj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;
  521|       |
  522|  7.81k|        if (! l_codec->is_decompressor) {
  ------------------
  |  Branch (522:13): [True: 0, False: 7.81k]
  ------------------
  523|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  524|      0|        }
  525|       |
  526|  7.81k|        return l_codec->m_codec_data.m_decompression.opj_decode(l_codec->m_codec,
  527|  7.81k|                l_stream,
  528|  7.81k|                p_image,
  529|  7.81k|                &(l_codec->m_event_mgr));
  530|  7.81k|    }
  531|       |
  532|      0|    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  533|  7.81k|}
opj_set_decode_area:
  540|  7.85k|{
  541|  7.85k|    if (p_codec) {
  ------------------
  |  Branch (541:9): [True: 7.85k, False: 0]
  ------------------
  542|  7.85k|        opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
  543|       |
  544|  7.85k|        if (! l_codec->is_decompressor) {
  ------------------
  |  Branch (544:13): [True: 0, False: 7.85k]
  ------------------
  545|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  546|      0|        }
  547|       |
  548|  7.85k|        return  l_codec->m_codec_data.m_decompression.opj_set_decode_area(
  549|  7.85k|                    l_codec->m_codec,
  550|  7.85k|                    p_image,
  551|  7.85k|                    p_start_x, p_start_y,
  552|  7.85k|                    p_end_x, p_end_y,
  553|  7.85k|                    &(l_codec->m_event_mgr));
  554|  7.85k|    }
  555|      0|    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  556|  7.85k|}
opj_end_decompress:
  926|  7.85k|{
  927|  7.85k|    if (p_codec && p_stream) {
  ------------------
  |  Branch (927:9): [True: 7.85k, False: 0]
  |  Branch (927:20): [True: 7.85k, False: 0]
  ------------------
  928|  7.85k|        opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
  929|  7.85k|        opj_stream_private_t * l_stream = (opj_stream_private_t *) p_stream;
  930|       |
  931|  7.85k|        if (! l_codec->is_decompressor) {
  ------------------
  |  Branch (931:13): [True: 0, False: 7.85k]
  ------------------
  932|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  933|      0|        }
  934|       |
  935|  7.85k|        return l_codec->m_codec_data.m_decompression.opj_end_decompress(
  936|  7.85k|                   l_codec->m_codec,
  937|  7.85k|                   l_stream,
  938|  7.85k|                   &(l_codec->m_event_mgr));
  939|  7.85k|    }
  940|       |
  941|      0|    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  942|  7.85k|}
opj_destroy_codec:
 1002|  9.21k|{
 1003|  9.21k|    if (p_codec) {
  ------------------
  |  Branch (1003:9): [True: 9.21k, False: 0]
  ------------------
 1004|  9.21k|        opj_codec_private_t * l_codec = (opj_codec_private_t *) p_codec;
 1005|       |
 1006|  9.21k|        if (l_codec->is_decompressor) {
  ------------------
  |  Branch (1006:13): [True: 9.21k, False: 0]
  ------------------
 1007|  9.21k|            l_codec->m_codec_data.m_decompression.opj_destroy(l_codec->m_codec);
 1008|  9.21k|        } else {
 1009|      0|            l_codec->m_codec_data.m_compression.opj_destroy(l_codec->m_codec);
 1010|      0|        }
 1011|       |
 1012|  9.21k|        l_codec->m_codec = 00;
 1013|  9.21k|        opj_free(l_codec);
 1014|  9.21k|    }
 1015|  9.21k|}
opj_image_data_alloc:
 1134|  29.1k|{
 1135|  29.1k|    void* ret = opj_aligned_malloc(size);
 1136|       |    /* printf("opj_image_data_alloc %p\n", ret); */
 1137|  29.1k|    return ret;
 1138|  29.1k|}
opj_image_data_free:
 1141|  88.8k|{
 1142|       |    /* printf("opj_image_data_free %p\n", ptr); */
 1143|  88.8k|    opj_aligned_free(ptr);
 1144|  88.8k|}

tcd.c:opj_lrintf:
  175|  67.3M|{
  176|  67.3M|    return lrintf(f);
  177|  67.3M|}

image.c:opj_uint_max:
   84|  17.6k|{
   85|  17.6k|    return (a > b) ? a : b;
  ------------------
  |  Branch (85:12): [True: 0, False: 17.6k]
  ------------------
   86|  17.6k|}
image.c:opj_uint_min:
   66|  17.6k|{
   67|  17.6k|    return a < b ? a : b;
  ------------------
  |  Branch (67:12): [True: 648, False: 16.9k]
  ------------------
   68|  17.6k|}
image.c:opj_uint_adds:
   93|  17.6k|{
   94|  17.6k|    OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;
   95|  17.6k|    return (OPJ_UINT32)(-(OPJ_INT32)(sum >> 32)) | (OPJ_UINT32)sum;
   96|  17.6k|}
image.c:opj_uint_ceildiv:
  171|   144k|{
  172|   144k|    assert(b);
  173|   144k|    return (OPJ_UINT32)(((OPJ_UINT64)a + b - 1) / b);
  174|   144k|}
image.c:opj_uint_ceildivpow2:
  210|  72.3k|{
  211|  72.3k|    return (OPJ_UINT32)((a + ((OPJ_UINT64)1U << b) - 1U) >> b);
  212|  72.3k|}
j2k.c:opj_int_ceildiv:
  161|   123k|{
  162|   123k|    assert(b);
  163|   123k|    return (OPJ_INT32)(((OPJ_INT64)a + b - 1) / b);
  164|   123k|}
j2k.c:opj_uint_min:
   66|  8.64k|{
   67|  8.64k|    return a < b ? a : b;
  ------------------
  |  Branch (67:12): [True: 2.46k, False: 6.17k]
  ------------------
   68|  8.64k|}
j2k.c:opj_uint_adds:
   93|  18.0k|{
   94|  18.0k|    OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;
   95|  18.0k|    return (OPJ_UINT32)(-(OPJ_INT32)(sum >> 32)) | (OPJ_UINT32)sum;
   96|  18.0k|}
j2k.c:opj_uint_ceildivpow2:
  210|  37.4k|{
  211|  37.4k|    return (OPJ_UINT32)((a + ((OPJ_UINT64)1U << b) - 1U) >> b);
  212|  37.4k|}
j2k.c:opj_int_ceildivpow2:
  192|  90.4k|{
  193|  90.4k|    return (OPJ_INT32)((a + ((OPJ_INT64)1 << b) - 1) >> b);
  194|  90.4k|}
pi.c:opj_uint_max:
   84|  17.5k|{
   85|  17.5k|    return (a > b) ? a : b;
  ------------------
  |  Branch (85:12): [True: 2.15k, False: 15.4k]
  ------------------
   86|  17.5k|}
pi.c:opj_uint_min:
   66|  22.2M|{
   67|  22.2M|    return a < b ? a : b;
  ------------------
  |  Branch (67:12): [True: 423k, False: 21.8M]
  ------------------
   68|  22.2M|}
pi.c:opj_uint_adds:
   93|  17.5k|{
   94|  17.5k|    OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;
   95|  17.5k|    return (OPJ_UINT32)(-(OPJ_INT32)(sum >> 32)) | (OPJ_UINT32)sum;
   96|  17.5k|}
pi.c:opj_uint_ceildiv:
  171|   113k|{
  172|   113k|    assert(b);
  173|   113k|    return (OPJ_UINT32)(((OPJ_UINT64)a + b - 1) / b);
  174|   113k|}
pi.c:opj_uint_ceildivpow2:
  210|  1.42M|{
  211|  1.42M|    return (OPJ_UINT32)((a + ((OPJ_UINT64)1U << b) - 1U) >> b);
  212|  1.42M|}
pi.c:opj_uint_floordivpow2:
  228|  18.0M|{
  229|  18.0M|    return a >> b;
  230|  18.0M|}
pi.c:opj_uint64_ceildiv_res_uint32:
  182|  88.4M|{
  183|  88.4M|    assert(b);
  184|  88.4M|    return (OPJ_UINT32)((a + b - 1) / b);
  185|  88.4M|}
tcd.c:opj_int_ceildiv:
  161|   113k|{
  162|   113k|    assert(b);
  163|   113k|    return (OPJ_INT32)(((OPJ_INT64)a + b - 1) / b);
  164|   113k|}
tcd.c:opj_int_ceildivpow2:
  192|  72.8M|{
  193|  72.8M|    return (OPJ_INT32)((a + ((OPJ_INT64)1 << b) - 1) >> b);
  194|  72.8M|}
tcd.c:opj_int_floordivpow2:
  219|  71.3M|{
  220|  71.3M|    return a >> b;
  221|  71.3M|}
tcd.c:opj_int64_ceildivpow2:
  201|  2.51M|{
  202|  2.51M|    return (OPJ_INT32)((a + ((OPJ_INT64)1 << b) - 1) >> b);
  203|  2.51M|}
tcd.c:opj_int_max:
   75|   679M|{
   76|   679M|    return (a > b) ? a : b;
  ------------------
  |  Branch (76:12): [True: 372M, False: 306M]
  ------------------
   77|   679M|}
tcd.c:opj_int_min:
   57|   679M|{
   58|   679M|    return a < b ? a : b;
  ------------------
  |  Branch (58:12): [True: 372M, False: 307M]
  ------------------
   59|   679M|}
tcd.c:opj_uint_max:
   84|  1.54G|{
   85|  1.54G|    return (a > b) ? a : b;
  ------------------
  |  Branch (85:12): [True: 23.6M, False: 1.52G]
  ------------------
   86|  1.54G|}
tcd.c:opj_uint_ceildiv:
  171|  3.09G|{
  172|  3.09G|    assert(b);
  173|  3.09G|    return (OPJ_UINT32)(((OPJ_UINT64)a + b - 1) / b);
  174|  3.09G|}
tcd.c:opj_uint_min:
   66|  1.54G|{
   67|  1.54G|    return a < b ? a : b;
  ------------------
  |  Branch (67:12): [True: 512M, False: 1.03G]
  ------------------
   68|  1.54G|}
tcd.c:opj_uint_ceildivpow2:
  210|   335M|{
  211|   335M|    return (OPJ_UINT32)((a + ((OPJ_UINT64)1U << b) - 1U) >> b);
  212|   335M|}
tcd.c:opj_int_clamp:
  118|  1.03G|{
  119|  1.03G|    if (a < min) {
  ------------------
  |  Branch (119:9): [True: 6.87M, False: 1.03G]
  ------------------
  120|  6.87M|        return min;
  121|  6.87M|    }
  122|  1.03G|    if (a > max) {
  ------------------
  |  Branch (122:9): [True: 6.78M, False: 1.02G]
  ------------------
  123|  6.78M|        return max;
  124|  6.78M|    }
  125|  1.02G|    return a;
  126|  1.03G|}
tcd.c:opj_int64_clamp:
  139|  67.3M|{
  140|  67.3M|    if (a < min) {
  ------------------
  |  Branch (140:9): [True: 210k, False: 67.1M]
  ------------------
  141|   210k|        return min;
  142|   210k|    }
  143|  67.1M|    if (a > max) {
  ------------------
  |  Branch (143:9): [True: 212k, False: 66.8M]
  ------------------
  144|   212k|        return max;
  145|   212k|    }
  146|  66.8M|    return a;
  147|  67.1M|}
tcd.c:opj_uint_adds:
   93|  1.54G|{
   94|  1.54G|    OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;
   95|  1.54G|    return (OPJ_UINT32)(-(OPJ_INT32)(sum >> 32)) | (OPJ_UINT32)sum;
   96|  1.54G|}
dwt.c:opj_uint_min:
   66|  1.86M|{
   67|  1.86M|    return a < b ? a : b;
  ------------------
  |  Branch (67:12): [True: 692k, False: 1.17M]
  ------------------
   68|  1.86M|}
dwt.c:opj_int_min:
   57|  1.06M|{
   58|  1.06M|    return a < b ? a : b;
  ------------------
  |  Branch (58:12): [True: 0, False: 1.06M]
  ------------------
   59|  1.06M|}
dwt.c:opj_int_add_no_overflow:
  298|   120M|{
  299|   120M|    void* pa = &a;
  300|   120M|    void* pb = &b;
  301|   120M|    OPJ_UINT32* upa = (OPJ_UINT32*)pa;
  302|   120M|    OPJ_UINT32* upb = (OPJ_UINT32*)pb;
  303|   120M|    OPJ_UINT32 ures = *upa + *upb;
  304|   120M|    void* pures = &ures;
  305|   120M|    OPJ_INT32* ipres = (OPJ_INT32*)pures;
  306|   120M|    return *ipres;
  307|   120M|}
dwt.c:opj_int_sub_no_overflow:
  317|  15.9M|{
  318|  15.9M|    void* pa = &a;
  319|  15.9M|    void* pb = &b;
  320|  15.9M|    OPJ_UINT32* upa = (OPJ_UINT32*)pa;
  321|  15.9M|    OPJ_UINT32* upb = (OPJ_UINT32*)pb;
  322|  15.9M|    OPJ_UINT32 ures = *upa - *upb;
  323|  15.9M|    void* pures = &ures;
  324|  15.9M|    OPJ_INT32* ipres = (OPJ_INT32*)pures;
  325|  15.9M|    return *ipres;
  326|  15.9M|}
dwt.c:opj_uint_ceildivpow2:
  210|   171k|{
  211|   171k|    return (OPJ_UINT32)((a + ((OPJ_UINT64)1U << b) - 1U) >> b);
  212|   171k|}
dwt.c:opj_uint_subs:
  103|   456k|{
  104|   456k|    return (a >= b) ? a - b : 0;
  ------------------
  |  Branch (104:12): [True: 304k, False: 152k]
  ------------------
  105|   456k|}
dwt.c:opj_uint_adds:
   93|   152k|{
   94|   152k|    OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;
   95|   152k|    return (OPJ_UINT32)(-(OPJ_INT32)(sum >> 32)) | (OPJ_UINT32)sum;
   96|   152k|}
dwt.c:opj_uint_max:
   84|  76.1k|{
   85|  76.1k|    return (a > b) ? a : b;
  ------------------
  |  Branch (85:12): [True: 31.6k, False: 44.4k]
  ------------------
   86|  76.1k|}
t2.c:opj_uint_max:
   84|   106M|{
   85|   106M|    return (a > b) ? a : b;
  ------------------
  |  Branch (85:12): [True: 54.6k, False: 106M]
  ------------------
   86|   106M|}
t2.c:opj_uint_floorlog2:
  249|  1.00M|{
  250|  1.00M|    OPJ_UINT32  l;
  251|  4.31M|    for (l = 0; a > 1; ++l) {
  ------------------
  |  Branch (251:17): [True: 3.30M, False: 1.00M]
  ------------------
  252|  3.30M|        a >>= 1;
  253|  3.30M|    }
  254|  1.00M|    return l;
  255|  1.00M|}
t2.c:opj_int_min:
   57|   394k|{
   58|   394k|    return a < b ? a : b;
  ------------------
  |  Branch (58:12): [True: 159k, False: 235k]
  ------------------
   59|   394k|}
sparse_array.c:opj_uint_ceildiv:
  171|  14.5k|{
  172|  14.5k|    assert(b);
  173|  14.5k|    return (OPJ_UINT32)(((OPJ_UINT64)a + b - 1) / b);
  174|  14.5k|}
sparse_array.c:opj_uint_min:
   66|  22.0M|{
   67|  22.0M|    return a < b ? a : b;
  ------------------
  |  Branch (67:12): [True: 6.80M, False: 15.2M]
  ------------------
   68|  22.0M|}

opj_malloc:
  192|   764M|{
  193|   764M|    if (size == 0U) { /* prevent implementation defined behavior of realloc */
  ------------------
  |  Branch (193:9): [True: 1, False: 764M]
  ------------------
  194|      1|        return NULL;
  195|      1|    }
  196|   764M|    return malloc(size);
  197|   764M|}
opj_calloc:
  199|   441M|{
  200|   441M|    if (num == 0 || size == 0) {
  ------------------
  |  Branch (200:9): [True: 45, False: 441M]
  |  Branch (200:21): [True: 0, False: 441M]
  ------------------
  201|       |        /* prevent implementation defined behavior of realloc */
  202|     45|        return NULL;
  203|     45|    }
  204|   441M|    return calloc(num, size);
  205|   441M|}
opj_aligned_malloc:
  208|  1.50M|{
  209|  1.50M|    return opj_aligned_alloc_n(16U, size);
  210|  1.50M|}
opj_aligned_32_malloc:
  217|  7.83k|{
  218|  7.83k|    return opj_aligned_alloc_n(32U, size);
  219|  7.83k|}
opj_aligned_free:
  226|   304M|{
  227|   304M|#if defined(OPJ_HAVE_POSIX_MEMALIGN) || defined(OPJ_HAVE_MEMALIGN)
  228|   304M|    free(ptr);
  229|       |#elif defined(OPJ_HAVE__ALIGNED_MALLOC)
  230|       |    _aligned_free(ptr);
  231|       |#else
  232|       |    /* Generic implementation has malloced pointer stored in front of used area */
  233|       |    if (ptr != NULL) {
  234|       |        free(((void**) ptr)[-1]);
  235|       |    }
  236|       |#endif
  237|   304M|}
opj_realloc:
  240|   238k|{
  241|   238k|    if (new_size == 0U) { /* prevent implementation defined behavior of realloc */
  ------------------
  |  Branch (241:9): [True: 0, False: 238k]
  ------------------
  242|      0|        return NULL;
  243|      0|    }
  244|   238k|    return realloc(ptr, new_size);
  245|   238k|}
opj_free:
  247|  1.20G|{
  248|  1.20G|    free(ptr);
  249|  1.20G|}
opj_malloc.c:opj_aligned_alloc_n:
   44|  1.50M|{
   45|  1.50M|    void* ptr;
   46|       |
   47|       |    /* alignment shall be power of 2 */
   48|  1.50M|    assert((alignment != 0U) && ((alignment & (alignment - 1U)) == 0U));
   49|       |    /* alignment shall be at least sizeof(void*) */
   50|  1.50M|    assert(alignment >= sizeof(void*));
   51|       |
   52|  1.50M|    if (size == 0U) { /* prevent implementation defined behavior of realloc */
  ------------------
  |  Branch (52:9): [True: 3.54k, False: 1.50M]
  ------------------
   53|  3.54k|        return NULL;
   54|  3.54k|    }
   55|       |
   56|  1.50M|#if defined(OPJ_HAVE_POSIX_MEMALIGN)
   57|       |    /* aligned_alloc requires c11, restrict to posix_memalign for now. Quote:
   58|       |     * This function was introduced in POSIX 1003.1d. Although this function is
   59|       |     * superseded by aligned_alloc, it is more portable to older POSIX systems
   60|       |     * that do not support ISO C11.  */
   61|  1.50M|    if (posix_memalign(&ptr, alignment, size)) {
  ------------------
  |  Branch (61:9): [True: 0, False: 1.50M]
  ------------------
   62|      0|        ptr = NULL;
   63|      0|    }
   64|       |    /* older linux */
   65|       |#elif defined(OPJ_HAVE_MEMALIGN)
   66|       |    ptr = memalign(alignment, size);
   67|       |    /* _MSC_VER */
   68|       |#elif defined(OPJ_HAVE__ALIGNED_MALLOC)
   69|       |    ptr = _aligned_malloc(size, alignment);
   70|       |#else
   71|       |    /*
   72|       |     * Generic aligned malloc implementation.
   73|       |     * Uses size_t offset for the integer manipulation of the pointer,
   74|       |     * as uintptr_t is not available in C89 to do
   75|       |     * bitwise operations on the pointer itself.
   76|       |     */
   77|       |    alignment--;
   78|       |    {
   79|       |        size_t offset;
   80|       |        OPJ_UINT8 *mem;
   81|       |
   82|       |        /* Room for padding and extra pointer stored in front of allocated area */
   83|       |        size_t overhead = alignment + sizeof(void *);
   84|       |
   85|       |        /* let's be extra careful */
   86|       |        assert(alignment <= (SIZE_MAX - sizeof(void *)));
   87|       |
   88|       |        /* Avoid integer overflow */
   89|       |        if (size > (SIZE_MAX - overhead)) {
   90|       |            return NULL;
   91|       |        }
   92|       |
   93|       |        mem = (OPJ_UINT8*)malloc(size + overhead);
   94|       |        if (mem == NULL) {
   95|       |            return mem;
   96|       |        }
   97|       |        /* offset = ((alignment + 1U) - ((size_t)(mem + sizeof(void*)) & alignment)) & alignment; */
   98|       |        /* Use the fact that alignment + 1U is a power of 2 */
   99|       |        offset = ((alignment ^ ((size_t)(mem + sizeof(void*)) & alignment)) + 1U) &
  100|       |                 alignment;
  101|       |        ptr = (void *)(mem + sizeof(void*) + offset);
  102|       |        ((void**) ptr)[-1] = mem;
  103|       |    }
  104|       |#endif
  105|  1.50M|    return ptr;
  106|  1.50M|}

opj_pi_create_decode:
 1392|  8.79k|{
 1393|  8.79k|    OPJ_UINT32 numcomps = p_image->numcomps;
 1394|       |
 1395|       |    /* loop */
 1396|  8.79k|    OPJ_UINT32 pino;
 1397|  8.79k|    OPJ_UINT32 compno, resno;
 1398|       |
 1399|       |    /* to store w, h, dx and dy for all components and resolutions */
 1400|  8.79k|    OPJ_UINT32 * l_tmp_data;
 1401|  8.79k|    OPJ_UINT32 ** l_tmp_ptr;
 1402|       |
 1403|       |    /* encoding parameters to set */
 1404|  8.79k|    OPJ_UINT32 l_max_res;
 1405|  8.79k|    OPJ_UINT32 l_max_prec;
 1406|  8.79k|    OPJ_UINT32 l_tx0, l_tx1, l_ty0, l_ty1;
 1407|  8.79k|    OPJ_UINT32 l_dx_min, l_dy_min;
 1408|  8.79k|    OPJ_UINT32 l_bound;
 1409|  8.79k|    OPJ_UINT32 l_step_p, l_step_c, l_step_r, l_step_l ;
 1410|  8.79k|    OPJ_UINT32 l_data_stride;
 1411|       |
 1412|       |    /* pointers */
 1413|  8.79k|    opj_pi_iterator_t *l_pi = 00;
 1414|  8.79k|    opj_tcp_t *l_tcp = 00;
 1415|  8.79k|    const opj_tccp_t *l_tccp = 00;
 1416|  8.79k|    opj_pi_comp_t *l_current_comp = 00;
 1417|  8.79k|    opj_image_comp_t * l_img_comp = 00;
 1418|  8.79k|    opj_pi_iterator_t * l_current_pi = 00;
 1419|  8.79k|    OPJ_UINT32 * l_encoding_value_ptr = 00;
 1420|       |
 1421|       |    /* preconditions in debug */
 1422|  8.79k|    assert(p_cp != 00);
 1423|  8.79k|    assert(p_image != 00);
 1424|  8.79k|    assert(p_tile_no < p_cp->tw * p_cp->th);
 1425|       |
 1426|       |    /* initializations */
 1427|  8.79k|    l_tcp = &p_cp->tcps[p_tile_no];
 1428|  8.79k|    l_bound = l_tcp->numpocs + 1;
 1429|       |
 1430|  8.79k|    l_data_stride = 4 * OPJ_J2K_MAXRLVLS;
  ------------------
  |  |  152|  8.79k|#define OPJ_J2K_MAXRLVLS 33                 /**< Number of maximum resolution level authorized */
  ------------------
 1431|  8.79k|    l_tmp_data = (OPJ_UINT32*)opj_malloc(
 1432|  8.79k|                     l_data_stride * numcomps * sizeof(OPJ_UINT32));
 1433|  8.79k|    if
 1434|  8.79k|    (! l_tmp_data) {
  ------------------
  |  Branch (1434:6): [True: 0, False: 8.79k]
  ------------------
 1435|      0|        return 00;
 1436|      0|    }
 1437|  8.79k|    l_tmp_ptr = (OPJ_UINT32**)opj_malloc(
 1438|  8.79k|                    numcomps * sizeof(OPJ_UINT32 *));
 1439|  8.79k|    if
 1440|  8.79k|    (! l_tmp_ptr) {
  ------------------
  |  Branch (1440:6): [True: 0, False: 8.79k]
  ------------------
 1441|      0|        opj_free(l_tmp_data);
 1442|      0|        return 00;
 1443|      0|    }
 1444|       |
 1445|       |    /* memory allocation for pi */
 1446|  8.79k|    l_pi = opj_pi_create(p_image, p_cp, p_tile_no, manager);
 1447|  8.79k|    if (!l_pi) {
  ------------------
  |  Branch (1447:9): [True: 0, False: 8.79k]
  ------------------
 1448|      0|        opj_free(l_tmp_data);
 1449|      0|        opj_free(l_tmp_ptr);
 1450|      0|        return 00;
 1451|      0|    }
 1452|       |
 1453|  8.79k|    l_encoding_value_ptr = l_tmp_data;
 1454|       |    /* update pointer array */
 1455|  8.79k|    for
 1456|  37.1k|    (compno = 0; compno < numcomps; ++compno) {
  ------------------
  |  Branch (1456:18): [True: 28.4k, False: 8.79k]
  ------------------
 1457|  28.4k|        l_tmp_ptr[compno] = l_encoding_value_ptr;
 1458|  28.4k|        l_encoding_value_ptr += l_data_stride;
 1459|  28.4k|    }
 1460|       |    /* get encoding parameters */
 1461|  8.79k|    opj_get_all_encoding_parameters(p_image, p_cp, p_tile_no, &l_tx0, &l_tx1,
 1462|  8.79k|                                    &l_ty0, &l_ty1, &l_dx_min, &l_dy_min, &l_max_prec, &l_max_res, l_tmp_ptr);
 1463|       |
 1464|       |    /* step calculations */
 1465|  8.79k|    l_step_p = 1;
 1466|  8.79k|    l_step_c = l_max_prec * l_step_p;
 1467|  8.79k|    l_step_r = numcomps * l_step_c;
 1468|  8.79k|    l_step_l = l_max_res * l_step_r;
 1469|       |
 1470|       |    /* set values for first packet iterator */
 1471|  8.79k|    l_current_pi = l_pi;
 1472|       |
 1473|       |    /* memory allocation for include */
 1474|       |    /* prevent an integer overflow issue */
 1475|       |    /* 0 < l_tcp->numlayers < 65536 c.f. opj_j2k_read_cod in j2k.c */
 1476|  8.79k|    l_current_pi->include = 00;
 1477|  8.79k|    if (l_step_l <= (UINT_MAX / (l_tcp->numlayers + 1U))) {
  ------------------
  |  Branch (1477:9): [True: 8.79k, False: 1]
  ------------------
 1478|  8.79k|        l_current_pi->include_size = (l_tcp->numlayers + 1U) * l_step_l;
 1479|  8.79k|        l_current_pi->include = (OPJ_INT16*) opj_calloc(
 1480|  8.79k|                                    l_current_pi->include_size, sizeof(OPJ_INT16));
 1481|  8.79k|    }
 1482|       |
 1483|  8.79k|    if (!l_current_pi->include) {
  ------------------
  |  Branch (1483:9): [True: 15, False: 8.77k]
  ------------------
 1484|     15|        opj_free(l_tmp_data);
 1485|     15|        opj_free(l_tmp_ptr);
 1486|     15|        opj_pi_destroy(l_pi, l_bound);
 1487|     15|        return 00;
 1488|     15|    }
 1489|       |
 1490|       |    /* special treatment for the first packet iterator */
 1491|  8.77k|    l_current_comp = l_current_pi->comps;
 1492|  8.77k|    l_img_comp = p_image->comps;
 1493|  8.77k|    l_tccp = l_tcp->tccps;
 1494|       |
 1495|  8.77k|    l_current_pi->tx0 = l_tx0;
 1496|  8.77k|    l_current_pi->ty0 = l_ty0;
 1497|  8.77k|    l_current_pi->tx1 = l_tx1;
 1498|  8.77k|    l_current_pi->ty1 = l_ty1;
 1499|       |
 1500|       |    /*l_current_pi->dx = l_img_comp->dx;*/
 1501|       |    /*l_current_pi->dy = l_img_comp->dy;*/
 1502|       |
 1503|  8.77k|    l_current_pi->step_p = l_step_p;
 1504|  8.77k|    l_current_pi->step_c = l_step_c;
 1505|  8.77k|    l_current_pi->step_r = l_step_r;
 1506|  8.77k|    l_current_pi->step_l = l_step_l;
 1507|       |
 1508|       |    /* allocation for components and number of components has already been calculated by opj_pi_create */
 1509|  8.77k|    for
 1510|  37.1k|    (compno = 0; compno < numcomps; ++compno) {
  ------------------
  |  Branch (1510:18): [True: 28.3k, False: 8.77k]
  ------------------
 1511|  28.3k|        opj_pi_resolution_t *l_res = l_current_comp->resolutions;
 1512|  28.3k|        l_encoding_value_ptr = l_tmp_ptr[compno];
 1513|       |
 1514|  28.3k|        l_current_comp->dx = l_img_comp->dx;
 1515|  28.3k|        l_current_comp->dy = l_img_comp->dy;
 1516|       |        /* resolutions have already been initialized */
 1517|  28.3k|        for
 1518|   265k|        (resno = 0; resno < l_current_comp->numresolutions; resno++) {
  ------------------
  |  Branch (1518:21): [True: 236k, False: 28.3k]
  ------------------
 1519|   236k|            l_res->pdx = *(l_encoding_value_ptr++);
 1520|   236k|            l_res->pdy = *(l_encoding_value_ptr++);
 1521|   236k|            l_res->pw =  *(l_encoding_value_ptr++);
 1522|   236k|            l_res->ph =  *(l_encoding_value_ptr++);
 1523|   236k|            ++l_res;
 1524|   236k|        }
 1525|  28.3k|        ++l_current_comp;
 1526|  28.3k|        ++l_img_comp;
 1527|  28.3k|        ++l_tccp;
 1528|  28.3k|    }
 1529|  8.77k|    ++l_current_pi;
 1530|       |
 1531|  22.4k|    for (pino = 1 ; pino < l_bound ; ++pino) {
  ------------------
  |  Branch (1531:21): [True: 13.7k, False: 8.77k]
  ------------------
 1532|  13.7k|        l_current_comp = l_current_pi->comps;
 1533|  13.7k|        l_img_comp = p_image->comps;
 1534|  13.7k|        l_tccp = l_tcp->tccps;
 1535|       |
 1536|  13.7k|        l_current_pi->tx0 = l_tx0;
 1537|  13.7k|        l_current_pi->ty0 = l_ty0;
 1538|  13.7k|        l_current_pi->tx1 = l_tx1;
 1539|  13.7k|        l_current_pi->ty1 = l_ty1;
 1540|       |        /*l_current_pi->dx = l_dx_min;*/
 1541|       |        /*l_current_pi->dy = l_dy_min;*/
 1542|  13.7k|        l_current_pi->step_p = l_step_p;
 1543|  13.7k|        l_current_pi->step_c = l_step_c;
 1544|  13.7k|        l_current_pi->step_r = l_step_r;
 1545|  13.7k|        l_current_pi->step_l = l_step_l;
 1546|       |
 1547|       |        /* allocation for components and number of components has already been calculated by opj_pi_create */
 1548|  13.7k|        for
 1549|  65.1k|        (compno = 0; compno < numcomps; ++compno) {
  ------------------
  |  Branch (1549:22): [True: 51.4k, False: 13.7k]
  ------------------
 1550|  51.4k|            opj_pi_resolution_t *l_res = l_current_comp->resolutions;
 1551|  51.4k|            l_encoding_value_ptr = l_tmp_ptr[compno];
 1552|       |
 1553|  51.4k|            l_current_comp->dx = l_img_comp->dx;
 1554|  51.4k|            l_current_comp->dy = l_img_comp->dy;
 1555|       |            /* resolutions have already been initialized */
 1556|  51.4k|            for
 1557|   392k|            (resno = 0; resno < l_current_comp->numresolutions; resno++) {
  ------------------
  |  Branch (1557:25): [True: 340k, False: 51.4k]
  ------------------
 1558|   340k|                l_res->pdx = *(l_encoding_value_ptr++);
 1559|   340k|                l_res->pdy = *(l_encoding_value_ptr++);
 1560|   340k|                l_res->pw =  *(l_encoding_value_ptr++);
 1561|   340k|                l_res->ph =  *(l_encoding_value_ptr++);
 1562|   340k|                ++l_res;
 1563|   340k|            }
 1564|  51.4k|            ++l_current_comp;
 1565|  51.4k|            ++l_img_comp;
 1566|  51.4k|            ++l_tccp;
 1567|  51.4k|        }
 1568|       |        /* special treatment*/
 1569|  13.7k|        l_current_pi->include = (l_current_pi - 1)->include;
 1570|  13.7k|        l_current_pi->include_size = (l_current_pi - 1)->include_size;
 1571|  13.7k|        ++l_current_pi;
 1572|  13.7k|    }
 1573|  8.77k|    opj_free(l_tmp_data);
 1574|  8.77k|    l_tmp_data = 00;
 1575|  8.77k|    opj_free(l_tmp_ptr);
 1576|  8.77k|    l_tmp_ptr = 00;
 1577|  8.77k|    if
 1578|  8.77k|    (l_tcp->POC) {
  ------------------
  |  Branch (1578:6): [True: 1.01k, False: 7.76k]
  ------------------
 1579|  1.01k|        opj_pi_update_decode_poc(l_pi, l_tcp, l_max_prec, l_max_res);
 1580|  7.76k|    } else {
 1581|  7.76k|        opj_pi_update_decode_not_poc(l_pi, l_tcp, l_max_prec, l_max_res);
 1582|  7.76k|    }
 1583|  8.77k|    return l_pi;
 1584|  8.79k|}
opj_pi_destroy:
 2068|  8.79k|{
 2069|  8.79k|    OPJ_UINT32 compno, pino;
 2070|  8.79k|    opj_pi_iterator_t *l_current_pi = p_pi;
 2071|  8.79k|    if (p_pi) {
  ------------------
  |  Branch (2071:9): [True: 8.79k, False: 0]
  ------------------
 2072|  8.79k|        if (p_pi->include) {
  ------------------
  |  Branch (2072:13): [True: 8.77k, False: 15]
  ------------------
 2073|  8.77k|            opj_free(p_pi->include);
 2074|  8.77k|            p_pi->include = 00;
 2075|  8.77k|        }
 2076|  31.3k|        for (pino = 0; pino < p_nb_elements; ++pino) {
  ------------------
  |  Branch (2076:24): [True: 22.5k, False: 8.79k]
  ------------------
 2077|  22.5k|            if (l_current_pi->comps) {
  ------------------
  |  Branch (2077:17): [True: 22.5k, False: 0]
  ------------------
 2078|  22.5k|                opj_pi_comp_t *l_current_component = l_current_pi->comps;
 2079|   102k|                for (compno = 0; compno < l_current_pi->numcomps; compno++) {
  ------------------
  |  Branch (2079:34): [True: 79.9k, False: 22.5k]
  ------------------
 2080|  79.9k|                    if (l_current_component->resolutions) {
  ------------------
  |  Branch (2080:25): [True: 79.9k, False: 0]
  ------------------
 2081|  79.9k|                        opj_free(l_current_component->resolutions);
 2082|  79.9k|                        l_current_component->resolutions = 00;
 2083|  79.9k|                    }
 2084|       |
 2085|  79.9k|                    ++l_current_component;
 2086|  79.9k|                }
 2087|  22.5k|                opj_free(l_current_pi->comps);
 2088|  22.5k|                l_current_pi->comps = 0;
 2089|  22.5k|            }
 2090|  22.5k|            ++l_current_pi;
 2091|  22.5k|        }
 2092|  8.79k|        opj_free(p_pi);
 2093|  8.79k|    }
 2094|  8.79k|}
opj_pi_next:
 2132|   695M|{
 2133|   695M|    switch (pi->poc.prg) {
  ------------------
  |  Branch (2133:13): [True: 5.06k, False: 695M]
  ------------------
 2134|   543M|    case OPJ_LRCP:
  ------------------
  |  Branch (2134:5): [True: 543M, False: 152M]
  ------------------
 2135|   543M|        return opj_pi_next_lrcp(pi);
 2136|  58.8M|    case OPJ_RLCP:
  ------------------
  |  Branch (2136:5): [True: 58.8M, False: 636M]
  ------------------
 2137|  58.8M|        return opj_pi_next_rlcp(pi);
 2138|  62.6M|    case OPJ_RPCL:
  ------------------
  |  Branch (2138:5): [True: 62.6M, False: 633M]
  ------------------
 2139|  62.6M|        return opj_pi_next_rpcl(pi);
 2140|  18.5M|    case OPJ_PCRL:
  ------------------
  |  Branch (2140:5): [True: 18.5M, False: 677M]
  ------------------
 2141|  18.5M|        return opj_pi_next_pcrl(pi);
 2142|  12.0M|    case OPJ_CPRL:
  ------------------
  |  Branch (2142:5): [True: 12.0M, False: 683M]
  ------------------
 2143|  12.0M|        return opj_pi_next_cprl(pi);
 2144|      0|    case OPJ_PROG_UNKNOWN:
  ------------------
  |  Branch (2144:5): [True: 0, False: 695M]
  ------------------
 2145|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2146|   695M|    }
 2147|       |
 2148|  5.06k|    return OPJ_FALSE;
  ------------------
  |  |  118|  5.06k|#define OPJ_FALSE 0
  ------------------
 2149|   695M|}
pi.c:opj_pi_create:
 1018|  8.79k|{
 1019|       |    /* loop*/
 1020|  8.79k|    OPJ_UINT32 pino, compno;
 1021|       |    /* number of poc in the p_pi*/
 1022|  8.79k|    OPJ_UINT32 l_poc_bound;
 1023|       |
 1024|       |    /* pointers to tile coding parameters and components.*/
 1025|  8.79k|    opj_pi_iterator_t *l_pi = 00;
 1026|  8.79k|    opj_tcp_t *tcp = 00;
 1027|  8.79k|    const opj_tccp_t *tccp = 00;
 1028|       |
 1029|       |    /* current packet iterator being allocated*/
 1030|  8.79k|    opj_pi_iterator_t *l_current_pi = 00;
 1031|       |
 1032|       |    /* preconditions in debug*/
 1033|  8.79k|    assert(cp != 00);
 1034|  8.79k|    assert(image != 00);
 1035|  8.79k|    assert(tileno < cp->tw * cp->th);
 1036|       |
 1037|       |    /* initializations*/
 1038|  8.79k|    tcp = &cp->tcps[tileno];
 1039|  8.79k|    l_poc_bound = tcp->numpocs + 1;
 1040|       |
 1041|       |    /* memory allocations*/
 1042|  8.79k|    l_pi = (opj_pi_iterator_t*) opj_calloc((l_poc_bound),
 1043|  8.79k|                                           sizeof(opj_pi_iterator_t));
 1044|  8.79k|    if (!l_pi) {
  ------------------
  |  Branch (1044:9): [True: 0, False: 8.79k]
  ------------------
 1045|      0|        return NULL;
 1046|      0|    }
 1047|       |
 1048|  8.79k|    l_current_pi = l_pi;
 1049|  31.3k|    for (pino = 0; pino < l_poc_bound ; ++pino) {
  ------------------
  |  Branch (1049:20): [True: 22.5k, False: 8.79k]
  ------------------
 1050|       |
 1051|  22.5k|        l_current_pi->manager = manager;
 1052|       |
 1053|  22.5k|        l_current_pi->comps = (opj_pi_comp_t*) opj_calloc(image->numcomps,
 1054|  22.5k|                              sizeof(opj_pi_comp_t));
 1055|  22.5k|        if (! l_current_pi->comps) {
  ------------------
  |  Branch (1055:13): [True: 0, False: 22.5k]
  ------------------
 1056|      0|            opj_pi_destroy(l_pi, l_poc_bound);
 1057|      0|            return NULL;
 1058|      0|        }
 1059|       |
 1060|  22.5k|        l_current_pi->numcomps = image->numcomps;
 1061|       |
 1062|   102k|        for (compno = 0; compno < image->numcomps; ++compno) {
  ------------------
  |  Branch (1062:26): [True: 79.9k, False: 22.5k]
  ------------------
 1063|  79.9k|            opj_pi_comp_t *comp = &l_current_pi->comps[compno];
 1064|       |
 1065|  79.9k|            tccp = &tcp->tccps[compno];
 1066|       |
 1067|  79.9k|            comp->resolutions = (opj_pi_resolution_t*) opj_calloc(tccp->numresolutions,
 1068|  79.9k|                                sizeof(opj_pi_resolution_t));
 1069|  79.9k|            if (!comp->resolutions) {
  ------------------
  |  Branch (1069:17): [True: 0, False: 79.9k]
  ------------------
 1070|      0|                opj_pi_destroy(l_pi, l_poc_bound);
 1071|      0|                return 00;
 1072|      0|            }
 1073|       |
 1074|  79.9k|            comp->numresolutions = tccp->numresolutions;
 1075|  79.9k|        }
 1076|  22.5k|        ++l_current_pi;
 1077|  22.5k|    }
 1078|  8.79k|    return l_pi;
 1079|  8.79k|}
pi.c:opj_get_all_encoding_parameters:
  890|  8.79k|{
  891|       |    /* loop*/
  892|  8.79k|    OPJ_UINT32 compno, resno;
  893|       |
  894|       |    /* pointers*/
  895|  8.79k|    const opj_tcp_t *tcp = 00;
  896|  8.79k|    const opj_tccp_t * l_tccp = 00;
  897|  8.79k|    const opj_image_comp_t * l_img_comp = 00;
  898|       |
  899|       |    /* to store l_dx, l_dy, w and h for each resolution and component.*/
  900|  8.79k|    OPJ_UINT32 * lResolutionPtr;
  901|       |
  902|       |    /* position in x and y of tile*/
  903|  8.79k|    OPJ_UINT32 p, q;
  904|       |
  905|       |    /* non-corrected (in regard to image offset) tile offset */
  906|  8.79k|    OPJ_UINT32 l_tx0, l_ty0;
  907|       |
  908|       |    /* preconditions in debug*/
  909|  8.79k|    assert(p_cp != 00);
  910|  8.79k|    assert(p_image != 00);
  911|  8.79k|    assert(tileno < p_cp->tw * p_cp->th);
  912|       |
  913|       |    /* initializations*/
  914|  8.79k|    tcp = &p_cp->tcps [tileno];
  915|  8.79k|    l_tccp = tcp->tccps;
  916|  8.79k|    l_img_comp = p_image->comps;
  917|       |
  918|       |    /* position in x and y of tile*/
  919|  8.79k|    p = tileno % p_cp->tw;
  920|  8.79k|    q = tileno / p_cp->tw;
  921|       |
  922|       |    /* here calculation of tx0, tx1, ty0, ty1, maxprec, l_dx and l_dy */
  923|  8.79k|    l_tx0 = p_cp->tx0 + p *
  924|  8.79k|            p_cp->tdx; /* can't be greater than p_image->x1 so won't overflow */
  925|  8.79k|    *p_tx0 = opj_uint_max(l_tx0, p_image->x0);
  926|  8.79k|    *p_tx1 = opj_uint_min(opj_uint_adds(l_tx0, p_cp->tdx), p_image->x1);
  927|  8.79k|    l_ty0 = p_cp->ty0 + q *
  928|  8.79k|            p_cp->tdy; /* can't be greater than p_image->y1 so won't overflow */
  929|  8.79k|    *p_ty0 = opj_uint_max(l_ty0, p_image->y0);
  930|  8.79k|    *p_ty1 = opj_uint_min(opj_uint_adds(l_ty0, p_cp->tdy), p_image->y1);
  931|       |
  932|       |    /* max precision and resolution is 0 (can only grow)*/
  933|  8.79k|    *p_max_prec = 0;
  934|  8.79k|    *p_max_res = 0;
  935|       |
  936|       |    /* take the largest value for dx_min and dy_min*/
  937|  8.79k|    *p_dx_min = 0x7fffffff;
  938|  8.79k|    *p_dy_min = 0x7fffffff;
  939|       |
  940|  37.1k|    for (compno = 0; compno < p_image->numcomps; ++compno) {
  ------------------
  |  Branch (940:22): [True: 28.4k, False: 8.79k]
  ------------------
  941|       |        /* arithmetic variables to calculate*/
  942|  28.4k|        OPJ_UINT32 l_level_no;
  943|  28.4k|        OPJ_UINT32 l_rx0, l_ry0, l_rx1, l_ry1;
  944|  28.4k|        OPJ_UINT32 l_px0, l_py0, l_px1, py1;
  945|  28.4k|        OPJ_UINT32 l_product;
  946|  28.4k|        OPJ_UINT32 l_tcx0, l_tcy0, l_tcx1, l_tcy1;
  947|  28.4k|        OPJ_UINT32 l_pdx, l_pdy, l_pw, l_ph;
  948|       |
  949|  28.4k|        lResolutionPtr = p_resolutions ? p_resolutions[compno] : NULL;
  ------------------
  |  Branch (949:26): [True: 28.4k, False: 0]
  ------------------
  950|       |
  951|  28.4k|        l_tcx0 = opj_uint_ceildiv(*p_tx0, l_img_comp->dx);
  952|  28.4k|        l_tcy0 = opj_uint_ceildiv(*p_ty0, l_img_comp->dy);
  953|  28.4k|        l_tcx1 = opj_uint_ceildiv(*p_tx1, l_img_comp->dx);
  954|  28.4k|        l_tcy1 = opj_uint_ceildiv(*p_ty1, l_img_comp->dy);
  955|       |
  956|  28.4k|        if (l_tccp->numresolutions > *p_max_res) {
  ------------------
  |  Branch (956:13): [True: 8.81k, False: 19.5k]
  ------------------
  957|  8.81k|            *p_max_res = l_tccp->numresolutions;
  958|  8.81k|        }
  959|       |
  960|       |        /* use custom size for precincts*/
  961|  28.4k|        l_level_no = l_tccp->numresolutions;
  962|   265k|        for (resno = 0; resno < l_tccp->numresolutions; ++resno) {
  ------------------
  |  Branch (962:25): [True: 236k, False: 28.4k]
  ------------------
  963|   236k|            OPJ_UINT32 l_dx, l_dy;
  964|       |
  965|   236k|            --l_level_no;
  966|       |
  967|       |            /* precinct width and height*/
  968|   236k|            l_pdx = l_tccp->prcw[resno];
  969|   236k|            l_pdy = l_tccp->prch[resno];
  970|   236k|            if (lResolutionPtr) {
  ------------------
  |  Branch (970:17): [True: 236k, False: 0]
  ------------------
  971|   236k|                *lResolutionPtr++ = l_pdx;
  972|   236k|                *lResolutionPtr++ = l_pdy;
  973|   236k|            }
  974|   236k|            if (l_pdx + l_level_no < 32 &&
  ------------------
  |  Branch (974:17): [True: 180k, False: 56.1k]
  ------------------
  975|   236k|                    l_img_comp->dx <= UINT_MAX / (1u << (l_pdx + l_level_no))) {
  ------------------
  |  Branch (975:21): [True: 165k, False: 15.3k]
  ------------------
  976|   165k|                l_dx = l_img_comp->dx * (1u << (l_pdx + l_level_no));
  977|       |                /* take the minimum size for l_dx for each comp and resolution*/
  978|   165k|                *p_dx_min = opj_uint_min(*p_dx_min, l_dx);
  979|   165k|            }
  980|   236k|            if (l_pdy + l_level_no < 32 &&
  ------------------
  |  Branch (980:17): [True: 180k, False: 56.1k]
  ------------------
  981|   236k|                    l_img_comp->dy <= UINT_MAX / (1u << (l_pdy + l_level_no))) {
  ------------------
  |  Branch (981:21): [True: 164k, False: 16.0k]
  ------------------
  982|   164k|                l_dy = l_img_comp->dy * (1u << (l_pdy + l_level_no));
  983|   164k|                *p_dy_min = opj_uint_min(*p_dy_min, l_dy);
  984|   164k|            }
  985|       |
  986|       |            /* various calculations of extents*/
  987|   236k|            l_rx0 = opj_uint_ceildivpow2(l_tcx0, l_level_no);
  988|   236k|            l_ry0 = opj_uint_ceildivpow2(l_tcy0, l_level_no);
  989|   236k|            l_rx1 = opj_uint_ceildivpow2(l_tcx1, l_level_no);
  990|   236k|            l_ry1 = opj_uint_ceildivpow2(l_tcy1, l_level_no);
  991|   236k|            l_px0 = opj_uint_floordivpow2(l_rx0, l_pdx) << l_pdx;
  992|   236k|            l_py0 = opj_uint_floordivpow2(l_ry0, l_pdy) << l_pdy;
  993|   236k|            l_px1 = opj_uint_ceildivpow2(l_rx1, l_pdx) << l_pdx;
  994|   236k|            py1 = opj_uint_ceildivpow2(l_ry1, l_pdy) << l_pdy;
  995|   236k|            l_pw = (l_rx0 == l_rx1) ? 0 : ((l_px1 - l_px0) >> l_pdx);
  ------------------
  |  Branch (995:20): [True: 126k, False: 110k]
  ------------------
  996|   236k|            l_ph = (l_ry0 == l_ry1) ? 0 : ((py1 - l_py0) >> l_pdy);
  ------------------
  |  Branch (996:20): [True: 123k, False: 113k]
  ------------------
  997|   236k|            if (lResolutionPtr) {
  ------------------
  |  Branch (997:17): [True: 236k, False: 0]
  ------------------
  998|   236k|                *lResolutionPtr++ = l_pw;
  999|   236k|                *lResolutionPtr++ = l_ph;
 1000|   236k|            }
 1001|   236k|            l_product = l_pw * l_ph;
 1002|       |
 1003|       |            /* update precision*/
 1004|   236k|            if (l_product > *p_max_prec) {
  ------------------
  |  Branch (1004:17): [True: 10.7k, False: 226k]
  ------------------
 1005|  10.7k|                *p_max_prec = l_product;
 1006|  10.7k|            }
 1007|       |
 1008|   236k|        }
 1009|  28.4k|        ++l_tccp;
 1010|  28.4k|        ++l_img_comp;
 1011|  28.4k|    }
 1012|  8.79k|}
pi.c:opj_pi_update_decode_poc:
 1219|  1.01k|{
 1220|       |    /* loop*/
 1221|  1.01k|    OPJ_UINT32 pino;
 1222|       |
 1223|       |    /* encoding parameters to set*/
 1224|  1.01k|    OPJ_UINT32 l_bound;
 1225|       |
 1226|  1.01k|    opj_pi_iterator_t * l_current_pi = 00;
 1227|  1.01k|    opj_poc_t* l_current_poc = 0;
 1228|       |
 1229|  1.01k|    OPJ_ARG_NOT_USED(p_max_res);
  ------------------
  |  |  142|  1.01k|#define OPJ_ARG_NOT_USED(x) (void)(x)
  ------------------
 1230|       |
 1231|       |    /* preconditions in debug*/
 1232|  1.01k|    assert(p_pi != 00);
 1233|  1.01k|    assert(p_tcp != 00);
 1234|       |
 1235|       |    /* initializations*/
 1236|  1.01k|    l_bound = p_tcp->numpocs + 1;
 1237|  1.01k|    l_current_pi = p_pi;
 1238|  1.01k|    l_current_poc = p_tcp->pocs;
 1239|       |
 1240|  15.7k|    for (pino = 0; pino < l_bound; ++pino) {
  ------------------
  |  Branch (1240:20): [True: 14.7k, False: 1.01k]
  ------------------
 1241|  14.7k|        l_current_pi->poc.prg = l_current_poc->prg; /* Progression Order #0 */
 1242|  14.7k|        l_current_pi->first = 1;
 1243|       |
 1244|  14.7k|        l_current_pi->poc.resno0 =
 1245|  14.7k|            l_current_poc->resno0; /* Resolution Level Index #0 (Start) */
 1246|  14.7k|        l_current_pi->poc.compno0 =
 1247|  14.7k|            l_current_poc->compno0; /* Component Index #0 (Start) */
 1248|  14.7k|        l_current_pi->poc.layno0 = 0;
 1249|  14.7k|        l_current_pi->poc.precno0 = 0;
 1250|  14.7k|        l_current_pi->poc.resno1 =
 1251|  14.7k|            l_current_poc->resno1; /* Resolution Level Index #0 (End) */
 1252|  14.7k|        l_current_pi->poc.compno1 =
 1253|  14.7k|            l_current_poc->compno1; /* Component Index #0 (End) */
 1254|  14.7k|        l_current_pi->poc.layno1 = opj_uint_min(l_current_poc->layno1,
 1255|  14.7k|                                                p_tcp->numlayers); /* Layer Index #0 (End) */
 1256|  14.7k|        l_current_pi->poc.precno1 = p_max_precision;
 1257|  14.7k|        ++l_current_pi;
 1258|  14.7k|        ++l_current_poc;
 1259|  14.7k|    }
 1260|  1.01k|}
pi.c:opj_pi_update_decode_not_poc:
 1266|  7.76k|{
 1267|       |    /* loop*/
 1268|  7.76k|    OPJ_UINT32 pino;
 1269|       |
 1270|       |    /* encoding parameters to set*/
 1271|  7.76k|    OPJ_UINT32 l_bound;
 1272|       |
 1273|  7.76k|    opj_pi_iterator_t * l_current_pi = 00;
 1274|       |    /* preconditions in debug*/
 1275|  7.76k|    assert(p_tcp != 00);
 1276|  7.76k|    assert(p_pi != 00);
 1277|       |
 1278|       |    /* initializations*/
 1279|  7.76k|    l_bound = p_tcp->numpocs + 1;
 1280|  7.76k|    l_current_pi = p_pi;
 1281|       |
 1282|  15.5k|    for (pino = 0; pino < l_bound; ++pino) {
  ------------------
  |  Branch (1282:20): [True: 7.76k, False: 7.76k]
  ------------------
 1283|  7.76k|        l_current_pi->poc.prg = p_tcp->prg;
 1284|  7.76k|        l_current_pi->first = 1;
 1285|  7.76k|        l_current_pi->poc.resno0 = 0;
 1286|  7.76k|        l_current_pi->poc.compno0 = 0;
 1287|  7.76k|        l_current_pi->poc.layno0 = 0;
 1288|  7.76k|        l_current_pi->poc.precno0 = 0;
 1289|  7.76k|        l_current_pi->poc.resno1 = p_max_res;
 1290|  7.76k|        l_current_pi->poc.compno1 = l_current_pi->numcomps;
 1291|  7.76k|        l_current_pi->poc.layno1 = p_tcp->numlayers;
 1292|  7.76k|        l_current_pi->poc.precno1 = p_max_precision;
 1293|  7.76k|        ++l_current_pi;
 1294|  7.76k|    }
 1295|  7.76k|}
pi.c:opj_pi_next_lrcp:
  238|   543M|{
  239|   543M|    opj_pi_comp_t *comp = NULL;
  240|   543M|    opj_pi_resolution_t *res = NULL;
  241|   543M|    OPJ_UINT32 index = 0;
  242|       |
  243|   543M|    if (pi->poc.compno0 >= pi->numcomps ||
  ------------------
  |  Branch (243:9): [True: 1.41k, False: 543M]
  ------------------
  244|   543M|            pi->poc.compno1 >= pi->numcomps + 1) {
  ------------------
  |  Branch (244:13): [True: 0, False: 543M]
  ------------------
  245|  1.41k|        opj_event_msg(pi->manager, EVT_ERROR,
  ------------------
  |  |   66|  1.41k|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  246|  1.41k|                      "opj_pi_next_lrcp(): invalid compno0/compno1\n");
  247|  1.41k|        return OPJ_FALSE;
  ------------------
  |  |  118|  1.41k|#define OPJ_FALSE 0
  ------------------
  248|  1.41k|    }
  249|       |
  250|   543M|    if (!pi->first) {
  ------------------
  |  Branch (250:9): [True: 543M, False: 4.45k]
  ------------------
  251|   543M|        comp = &pi->comps[pi->compno];
  252|   543M|        res = &comp->resolutions[pi->resno];
  253|   543M|        goto LABEL_SKIP;
  254|   543M|    } else {
  255|  4.45k|        pi->first = 0;
  256|  4.45k|    }
  257|       |
  258|  6.03M|    for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
  ------------------
  |  Branch (258:38): [True: 6.03M, False: 4.32k]
  ------------------
  259|  19.2M|        for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1;
  ------------------
  |  Branch (259:42): [True: 13.2M, False: 6.03M]
  ------------------
  260|  13.2M|                pi->resno++) {
  261|  32.6M|            for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
  ------------------
  |  Branch (261:48): [True: 19.4M, False: 13.2M]
  ------------------
  262|  19.4M|                comp = &pi->comps[pi->compno];
  263|  19.4M|                if (pi->resno >= comp->numresolutions) {
  ------------------
  |  Branch (263:21): [True: 3.87M, False: 15.6M]
  ------------------
  264|  3.87M|                    continue;
  265|  3.87M|                }
  266|  15.6M|                res = &comp->resolutions[pi->resno];
  267|  15.6M|                if (!pi->tp_on) {
  ------------------
  |  Branch (267:21): [True: 15.6M, False: 0]
  ------------------
  268|  15.6M|                    pi->poc.precno1 = res->pw * res->ph;
  269|  15.6M|                }
  270|   559M|                for (pi->precno = pi->poc.precno0; pi->precno < pi->poc.precno1; pi->precno++) {
  ------------------
  |  Branch (270:52): [True: 543M, False: 15.6M]
  ------------------
  271|   543M|                    index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno *
  272|   543M|                            pi->step_c + pi->precno * pi->step_p;
  273|       |                    /* Avoids index out of bounds access with */
  274|       |                    /* id_000098,sig_11,src_005411,op_havoc,rep_2 of */
  275|       |                    /* https://github.com/uclouvain/openjpeg/issues/938 */
  276|       |                    /* Not sure if this is the most clever fix. Perhaps */
  277|       |                    /* include should be resized when a POC arises, or */
  278|       |                    /* the POC should be rejected */
  279|   543M|                    if (index >= pi->include_size) {
  ------------------
  |  Branch (279:25): [True: 0, False: 543M]
  ------------------
  280|      0|                        opj_event_msg(pi->manager, EVT_ERROR, "Invalid access to pi->include");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  281|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  282|      0|                    }
  283|   543M|                    if (!pi->include[index]) {
  ------------------
  |  Branch (283:25): [True: 543M, False: 15.9k]
  ------------------
  284|   543M|                        pi->include[index] = 1;
  285|   543M|                        return OPJ_TRUE;
  ------------------
  |  |  117|   543M|#define OPJ_TRUE 1
  ------------------
  286|   543M|                    }
  287|   543M|LABEL_SKIP:
  288|   543M|                    ;
  289|   543M|                }
  290|  15.6M|            }
  291|  13.2M|        }
  292|  6.03M|    }
  293|       |
  294|  4.32k|    return OPJ_FALSE;
  ------------------
  |  |  118|  4.32k|#define OPJ_FALSE 0
  ------------------
  295|  4.45k|}
pi.c:opj_pi_next_rlcp:
  298|  58.8M|{
  299|  58.8M|    opj_pi_comp_t *comp = NULL;
  300|  58.8M|    opj_pi_resolution_t *res = NULL;
  301|  58.8M|    OPJ_UINT32 index = 0;
  302|       |
  303|  58.8M|    if (pi->poc.compno0 >= pi->numcomps ||
  ------------------
  |  Branch (303:9): [True: 271, False: 58.8M]
  ------------------
  304|  58.8M|            pi->poc.compno1 >= pi->numcomps + 1) {
  ------------------
  |  Branch (304:13): [True: 0, False: 58.8M]
  ------------------
  305|    271|        opj_event_msg(pi->manager, EVT_ERROR,
  ------------------
  |  |   66|    271|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  306|    271|                      "opj_pi_next_rlcp(): invalid compno0/compno1\n");
  307|    271|        return OPJ_FALSE;
  ------------------
  |  |  118|    271|#define OPJ_FALSE 0
  ------------------
  308|    271|    }
  309|       |
  310|  58.8M|    if (!pi->first) {
  ------------------
  |  Branch (310:9): [True: 58.8M, False: 2.54k]
  ------------------
  311|  58.8M|        comp = &pi->comps[pi->compno];
  312|  58.8M|        res = &comp->resolutions[pi->resno];
  313|  58.8M|        goto LABEL_SKIP;
  314|  58.8M|    } else {
  315|  2.54k|        pi->first = 0;
  316|  2.54k|    }
  317|       |
  318|  23.9k|    for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1; pi->resno++) {
  ------------------
  |  Branch (318:38): [True: 21.4k, False: 2.44k]
  ------------------
  319|  2.01M|        for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
  ------------------
  |  Branch (319:42): [True: 1.99M, False: 21.3k]
  ------------------
  320|  13.6M|            for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
  ------------------
  |  Branch (320:48): [True: 11.6M, False: 1.99M]
  ------------------
  321|  11.6M|                comp = &pi->comps[pi->compno];
  322|  11.6M|                if (pi->resno >= comp->numresolutions) {
  ------------------
  |  Branch (322:21): [True: 224k, False: 11.4M]
  ------------------
  323|   224k|                    continue;
  324|   224k|                }
  325|  11.4M|                res = &comp->resolutions[pi->resno];
  326|  11.4M|                if (!pi->tp_on) {
  ------------------
  |  Branch (326:21): [True: 11.4M, False: 0]
  ------------------
  327|  11.4M|                    pi->poc.precno1 = res->pw * res->ph;
  328|  11.4M|                }
  329|  70.2M|                for (pi->precno = pi->poc.precno0; pi->precno < pi->poc.precno1; pi->precno++) {
  ------------------
  |  Branch (329:52): [True: 58.8M, False: 11.4M]
  ------------------
  330|  58.8M|                    index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno *
  331|  58.8M|                            pi->step_c + pi->precno * pi->step_p;
  332|  58.8M|                    if (index >= pi->include_size) {
  ------------------
  |  Branch (332:25): [True: 0, False: 58.8M]
  ------------------
  333|      0|                        opj_event_msg(pi->manager, EVT_ERROR, "Invalid access to pi->include");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  334|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  335|      0|                    }
  336|  58.8M|                    if (!pi->include[index]) {
  ------------------
  |  Branch (336:25): [True: 58.8M, False: 2.85k]
  ------------------
  337|  58.8M|                        pi->include[index] = 1;
  338|  58.8M|                        return OPJ_TRUE;
  ------------------
  |  |  117|  58.8M|#define OPJ_TRUE 1
  ------------------
  339|  58.8M|                    }
  340|  58.8M|LABEL_SKIP:
  341|  58.8M|                    ;
  342|  58.8M|                }
  343|  11.4M|            }
  344|  1.99M|        }
  345|  21.4k|    }
  346|       |
  347|  2.44k|    return OPJ_FALSE;
  ------------------
  |  |  118|  2.44k|#define OPJ_FALSE 0
  ------------------
  348|  2.54k|}
pi.c:opj_pi_next_rpcl:
  351|  62.6M|{
  352|  62.6M|    opj_pi_comp_t *comp = NULL;
  353|  62.6M|    opj_pi_resolution_t *res = NULL;
  354|  62.6M|    OPJ_UINT32 index = 0;
  355|       |
  356|  62.6M|    if (pi->poc.compno0 >= pi->numcomps ||
  ------------------
  |  Branch (356:9): [True: 1.09k, False: 62.6M]
  ------------------
  357|  62.6M|            pi->poc.compno1 >= pi->numcomps + 1) {
  ------------------
  |  Branch (357:13): [True: 0, False: 62.6M]
  ------------------
  358|  1.09k|        opj_event_msg(pi->manager, EVT_ERROR,
  ------------------
  |  |   66|  1.09k|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  359|  1.09k|                      "opj_pi_next_rpcl(): invalid compno0/compno1\n");
  360|  1.09k|        return OPJ_FALSE;
  ------------------
  |  |  118|  1.09k|#define OPJ_FALSE 0
  ------------------
  361|  1.09k|    }
  362|       |
  363|  62.6M|    if (!pi->first) {
  ------------------
  |  Branch (363:9): [True: 62.6M, False: 1.33k]
  ------------------
  364|  62.6M|        goto LABEL_SKIP;
  365|  62.6M|    } else {
  366|  1.33k|        OPJ_UINT32 compno, resno;
  367|  1.33k|        pi->first = 0;
  368|  1.33k|        pi->dx = 0;
  369|  1.33k|        pi->dy = 0;
  370|  6.09k|        for (compno = 0; compno < pi->numcomps; compno++) {
  ------------------
  |  Branch (370:26): [True: 4.76k, False: 1.33k]
  ------------------
  371|  4.76k|            comp = &pi->comps[compno];
  372|  22.3k|            for (resno = 0; resno < comp->numresolutions; resno++) {
  ------------------
  |  Branch (372:29): [True: 17.6k, False: 4.76k]
  ------------------
  373|  17.6k|                OPJ_UINT32 dx, dy;
  374|  17.6k|                res = &comp->resolutions[resno];
  375|  17.6k|                if (res->pdx + comp->numresolutions - 1 - resno < 32 &&
  ------------------
  |  Branch (375:21): [True: 15.6k, False: 1.94k]
  ------------------
  376|  17.6k|                        comp->dx <= UINT_MAX / (1u << (res->pdx + comp->numresolutions - 1 - resno))) {
  ------------------
  |  Branch (376:25): [True: 15.1k, False: 537]
  ------------------
  377|  15.1k|                    dx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));
  378|  15.1k|                    pi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);
  ------------------
  |  Branch (378:30): [True: 1.33k, False: 13.8k]
  ------------------
  379|  15.1k|                }
  380|  17.6k|                if (res->pdy + comp->numresolutions - 1 - resno < 32 &&
  ------------------
  |  Branch (380:21): [True: 15.7k, False: 1.93k]
  ------------------
  381|  17.6k|                        comp->dy <= UINT_MAX / (1u << (res->pdy + comp->numresolutions - 1 - resno))) {
  ------------------
  |  Branch (381:25): [True: 14.8k, False: 805]
  ------------------
  382|  14.8k|                    dy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));
  383|  14.8k|                    pi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);
  ------------------
  |  Branch (383:30): [True: 1.33k, False: 13.5k]
  ------------------
  384|  14.8k|                }
  385|  17.6k|            }
  386|  4.76k|        }
  387|  1.33k|        if (pi->dx == 0 || pi->dy == 0) {
  ------------------
  |  Branch (387:13): [True: 0, False: 1.33k]
  |  Branch (387:28): [True: 0, False: 1.33k]
  ------------------
  388|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  389|      0|        }
  390|  1.33k|    }
  391|  1.33k|    if (!pi->tp_on) {
  ------------------
  |  Branch (391:9): [True: 1.33k, False: 0]
  ------------------
  392|  1.33k|        pi->poc.ty0 = pi->ty0;
  393|  1.33k|        pi->poc.tx0 = pi->tx0;
  394|  1.33k|        pi->poc.ty1 = pi->ty1;
  395|  1.33k|        pi->poc.tx1 = pi->tx1;
  396|  1.33k|    }
  397|  45.0k|    for (pi->resno = pi->poc.resno0; pi->resno < pi->poc.resno1; pi->resno++) {
  ------------------
  |  Branch (397:38): [True: 43.7k, False: 1.29k]
  ------------------
  398|  20.2M|        for (pi->y = (OPJ_UINT32)pi->poc.ty0; pi->y < (OPJ_UINT32)pi->poc.ty1;
  ------------------
  |  Branch (398:47): [True: 20.1M, False: 43.7k]
  ------------------
  399|  20.1M|                pi->y += (pi->dy - (pi->y % pi->dy))) {
  400|  73.1M|            for (pi->x = (OPJ_UINT32)pi->poc.tx0; pi->x < (OPJ_UINT32)pi->poc.tx1;
  ------------------
  |  Branch (400:51): [True: 52.9M, False: 20.1M]
  ------------------
  401|  52.9M|                    pi->x += (pi->dx - (pi->x % pi->dx))) {
  402|  96.2M|                for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
  ------------------
  |  Branch (402:52): [True: 43.3M, False: 52.9M]
  ------------------
  403|  43.3M|                    OPJ_UINT32 levelno;
  404|  43.3M|                    OPJ_UINT32 trx0, try0;
  405|  43.3M|                    OPJ_UINT32  trx1, try1;
  406|  43.3M|                    OPJ_UINT32  rpx, rpy;
  407|  43.3M|                    OPJ_UINT32  prci, prcj;
  408|  43.3M|                    comp = &pi->comps[pi->compno];
  409|  43.3M|                    if (pi->resno >= comp->numresolutions) {
  ------------------
  |  Branch (409:25): [True: 40.0M, False: 3.34M]
  ------------------
  410|  40.0M|                        continue;
  411|  40.0M|                    }
  412|  3.34M|                    res = &comp->resolutions[pi->resno];
  413|  3.34M|                    levelno = comp->numresolutions - 1 - pi->resno;
  414|       |
  415|  3.34M|                    if ((OPJ_UINT32)(((OPJ_UINT64)comp->dx << levelno) >> levelno) != comp->dx ||
  ------------------
  |  Branch (415:25): [True: 0, False: 3.34M]
  ------------------
  416|  3.34M|                            (OPJ_UINT32)(((OPJ_UINT64)comp->dy << levelno) >> levelno) != comp->dy) {
  ------------------
  |  Branch (416:29): [True: 0, False: 3.34M]
  ------------------
  417|      0|                        continue;
  418|      0|                    }
  419|       |
  420|  3.34M|                    trx0 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->tx0,
  421|  3.34M|                                                         ((OPJ_UINT64)comp->dx << levelno));
  422|  3.34M|                    try0 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->ty0,
  423|  3.34M|                                                         ((OPJ_UINT64)comp->dy << levelno));
  424|  3.34M|                    trx1 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->tx1,
  425|  3.34M|                                                         ((OPJ_UINT64)comp->dx << levelno));
  426|  3.34M|                    try1 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->ty1,
  427|  3.34M|                                                         ((OPJ_UINT64)comp->dy << levelno));
  428|  3.34M|                    rpx = res->pdx + levelno;
  429|  3.34M|                    rpy = res->pdy + levelno;
  430|       |
  431|  3.34M|                    if ((OPJ_UINT32)(((OPJ_UINT64)comp->dx << rpx) >> rpx) != comp->dx ||
  ------------------
  |  Branch (431:25): [True: 0, False: 3.34M]
  ------------------
  432|  3.34M|                            (OPJ_UINT32)(((OPJ_UINT64)comp->dy << rpy) >> rpy) != comp->dy) {
  ------------------
  |  Branch (432:29): [True: 0, False: 3.34M]
  ------------------
  433|      0|                        continue;
  434|      0|                    }
  435|       |
  436|       |                    /* See ISO-15441. B.12.1.3 Resolution level-position-component-layer progression */
  437|  3.34M|                    if (!(((OPJ_UINT64)pi->y % ((OPJ_UINT64)comp->dy << rpy) == 0) ||
  ------------------
  |  Branch (437:27): [True: 1.47M, False: 1.87M]
  ------------------
  438|  3.34M|                            ((pi->y == pi->ty0) &&
  ------------------
  |  Branch (438:30): [True: 1.49M, False: 371k]
  ------------------
  439|  1.87M|                             (((OPJ_UINT64)try0 << levelno) % ((OPJ_UINT64)1U << rpy))))) {
  ------------------
  |  Branch (439:30): [True: 1.49M, False: 3.13k]
  ------------------
  440|   374k|                        continue;
  441|   374k|                    }
  442|  2.96M|                    if (!(((OPJ_UINT64)pi->x % ((OPJ_UINT64)comp->dx << rpx) == 0) ||
  ------------------
  |  Branch (442:27): [True: 2.76M, False: 199k]
  ------------------
  443|  2.96M|                            ((pi->x == pi->tx0) &&
  ------------------
  |  Branch (443:30): [True: 32.4k, False: 166k]
  ------------------
  444|   199k|                             (((OPJ_UINT64)trx0 << levelno) % ((OPJ_UINT64)1U << rpx))))) {
  ------------------
  |  Branch (444:30): [True: 29.6k, False: 2.79k]
  ------------------
  445|   169k|                        continue;
  446|   169k|                    }
  447|       |
  448|  2.79M|                    if ((res->pw == 0) || (res->ph == 0)) {
  ------------------
  |  Branch (448:25): [True: 4.50k, False: 2.79M]
  |  Branch (448:43): [True: 4.56k, False: 2.78M]
  ------------------
  449|  9.07k|                        continue;
  450|  9.07k|                    }
  451|       |
  452|  2.78M|                    if ((trx0 == trx1) || (try0 == try1)) {
  ------------------
  |  Branch (452:25): [True: 0, False: 2.78M]
  |  Branch (452:43): [True: 0, False: 2.78M]
  ------------------
  453|      0|                        continue;
  454|      0|                    }
  455|       |
  456|  2.78M|                    prci = opj_uint_floordivpow2(opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->x,
  457|  2.78M|                                                 ((OPJ_UINT64)comp->dx << levelno)), res->pdx)
  458|  2.78M|                           - opj_uint_floordivpow2(trx0, res->pdx);
  459|  2.78M|                    prcj = opj_uint_floordivpow2(opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->y,
  460|  2.78M|                                                 ((OPJ_UINT64)comp->dy << levelno)), res->pdy)
  461|  2.78M|                           - opj_uint_floordivpow2(try0, res->pdy);
  462|  2.78M|                    pi->precno = prci + prcj * res->pw;
  463|  65.5M|                    for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
  ------------------
  |  Branch (463:54): [True: 62.7M, False: 2.78M]
  ------------------
  464|  62.7M|                        index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno *
  465|  62.7M|                                pi->step_c + pi->precno * pi->step_p;
  466|  62.7M|                        if (index >= pi->include_size) {
  ------------------
  |  Branch (466:29): [True: 0, False: 62.7M]
  ------------------
  467|      0|                            opj_event_msg(pi->manager, EVT_ERROR, "Invalid access to pi->include");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  468|      0|                            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  469|      0|                        }
  470|  62.7M|                        if (!pi->include[index]) {
  ------------------
  |  Branch (470:29): [True: 62.6M, False: 89.1k]
  ------------------
  471|  62.6M|                            pi->include[index] = 1;
  472|  62.6M|                            return OPJ_TRUE;
  ------------------
  |  |  117|  62.6M|#define OPJ_TRUE 1
  ------------------
  473|  62.6M|                        }
  474|  62.7M|LABEL_SKIP:
  475|  62.7M|                        ;
  476|  62.7M|                    }
  477|  2.78M|                }
  478|  52.9M|            }
  479|  20.1M|        }
  480|  43.7k|    }
  481|       |
  482|  1.29k|    return OPJ_FALSE;
  ------------------
  |  |  118|  1.29k|#define OPJ_FALSE 0
  ------------------
  483|  1.33k|}
pi.c:opj_pi_next_pcrl:
  486|  18.5M|{
  487|  18.5M|    opj_pi_comp_t *comp = NULL;
  488|  18.5M|    opj_pi_resolution_t *res = NULL;
  489|  18.5M|    OPJ_UINT32 index = 0;
  490|       |
  491|  18.5M|    if (pi->poc.compno0 >= pi->numcomps ||
  ------------------
  |  Branch (491:9): [True: 1.82k, False: 18.5M]
  ------------------
  492|  18.5M|            pi->poc.compno1 >= pi->numcomps + 1) {
  ------------------
  |  Branch (492:13): [True: 0, False: 18.5M]
  ------------------
  493|  1.82k|        opj_event_msg(pi->manager, EVT_ERROR,
  ------------------
  |  |   66|  1.82k|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  494|  1.82k|                      "opj_pi_next_pcrl(): invalid compno0/compno1\n");
  495|  1.82k|        return OPJ_FALSE;
  ------------------
  |  |  118|  1.82k|#define OPJ_FALSE 0
  ------------------
  496|  1.82k|    }
  497|       |
  498|  18.5M|    if (!pi->first) {
  ------------------
  |  Branch (498:9): [True: 18.5M, False: 1.95k]
  ------------------
  499|  18.5M|        comp = &pi->comps[pi->compno];
  500|  18.5M|        goto LABEL_SKIP;
  501|  18.5M|    } else {
  502|  1.95k|        OPJ_UINT32 compno, resno;
  503|  1.95k|        pi->first = 0;
  504|  1.95k|        pi->dx = 0;
  505|  1.95k|        pi->dy = 0;
  506|  9.72k|        for (compno = 0; compno < pi->numcomps; compno++) {
  ------------------
  |  Branch (506:26): [True: 7.77k, False: 1.95k]
  ------------------
  507|  7.77k|            comp = &pi->comps[compno];
  508|  63.5k|            for (resno = 0; resno < comp->numresolutions; resno++) {
  ------------------
  |  Branch (508:29): [True: 55.7k, False: 7.77k]
  ------------------
  509|  55.7k|                OPJ_UINT32 dx, dy;
  510|  55.7k|                res = &comp->resolutions[resno];
  511|  55.7k|                if (res->pdx + comp->numresolutions - 1 - resno < 32 &&
  ------------------
  |  Branch (511:21): [True: 50.2k, False: 5.49k]
  ------------------
  512|  55.7k|                        comp->dx <= UINT_MAX / (1u << (res->pdx + comp->numresolutions - 1 - resno))) {
  ------------------
  |  Branch (512:25): [True: 48.0k, False: 2.23k]
  ------------------
  513|  48.0k|                    dx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));
  514|  48.0k|                    pi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);
  ------------------
  |  Branch (514:30): [True: 1.95k, False: 46.1k]
  ------------------
  515|  48.0k|                }
  516|  55.7k|                if (res->pdy + comp->numresolutions - 1 - resno < 32 &&
  ------------------
  |  Branch (516:21): [True: 50.2k, False: 5.49k]
  ------------------
  517|  55.7k|                        comp->dy <= UINT_MAX / (1u << (res->pdy + comp->numresolutions - 1 - resno))) {
  ------------------
  |  Branch (517:25): [True: 47.8k, False: 2.45k]
  ------------------
  518|  47.8k|                    dy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));
  519|  47.8k|                    pi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);
  ------------------
  |  Branch (519:30): [True: 1.95k, False: 45.8k]
  ------------------
  520|  47.8k|                }
  521|  55.7k|            }
  522|  7.77k|        }
  523|  1.95k|        if (pi->dx == 0 || pi->dy == 0) {
  ------------------
  |  Branch (523:13): [True: 0, False: 1.95k]
  |  Branch (523:28): [True: 0, False: 1.95k]
  ------------------
  524|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  525|      0|        }
  526|  1.95k|    }
  527|  1.95k|    if (!pi->tp_on) {
  ------------------
  |  Branch (527:9): [True: 1.95k, False: 0]
  ------------------
  528|  1.95k|        pi->poc.ty0 = pi->ty0;
  529|  1.95k|        pi->poc.tx0 = pi->tx0;
  530|  1.95k|        pi->poc.ty1 = pi->ty1;
  531|  1.95k|        pi->poc.tx1 = pi->tx1;
  532|  1.95k|    }
  533|  77.3k|    for (pi->y = (OPJ_UINT32)pi->poc.ty0; pi->y < (OPJ_UINT32)pi->poc.ty1;
  ------------------
  |  Branch (533:43): [True: 75.4k, False: 1.87k]
  ------------------
  534|  75.4k|            pi->y += (pi->dy - (pi->y % pi->dy))) {
  535|  1.59M|        for (pi->x = (OPJ_UINT32)pi->poc.tx0; pi->x < (OPJ_UINT32)pi->poc.tx1;
  ------------------
  |  Branch (535:47): [True: 1.52M, False: 75.3k]
  ------------------
  536|  1.52M|                pi->x += (pi->dx - (pi->x % pi->dx))) {
  537|  5.30M|            for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
  ------------------
  |  Branch (537:48): [True: 3.78M, False: 1.52M]
  ------------------
  538|  3.78M|                comp = &pi->comps[pi->compno];
  539|  3.78M|                for (pi->resno = pi->poc.resno0;
  540|  12.5M|                        pi->resno < opj_uint_min(pi->poc.resno1, comp->numresolutions); pi->resno++) {
  ------------------
  |  Branch (540:25): [True: 8.76M, False: 3.78M]
  ------------------
  541|  8.76M|                    OPJ_UINT32 levelno;
  542|  8.76M|                    OPJ_UINT32 trx0, try0;
  543|  8.76M|                    OPJ_UINT32 trx1, try1;
  544|  8.76M|                    OPJ_UINT32 rpx, rpy;
  545|  8.76M|                    OPJ_UINT32 prci, prcj;
  546|  8.76M|                    res = &comp->resolutions[pi->resno];
  547|  8.76M|                    levelno = comp->numresolutions - 1 - pi->resno;
  548|       |
  549|  8.76M|                    if ((OPJ_UINT32)(((OPJ_UINT64)comp->dx << levelno) >> levelno) != comp->dx ||
  ------------------
  |  Branch (549:25): [True: 0, False: 8.76M]
  ------------------
  550|  8.76M|                            (OPJ_UINT32)(((OPJ_UINT64)comp->dy << levelno) >> levelno) != comp->dy) {
  ------------------
  |  Branch (550:29): [True: 0, False: 8.76M]
  ------------------
  551|      0|                        continue;
  552|      0|                    }
  553|       |
  554|  8.76M|                    trx0 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->tx0,
  555|  8.76M|                                                         ((OPJ_UINT64)comp->dx << levelno));
  556|  8.76M|                    try0 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->ty0,
  557|  8.76M|                                                         ((OPJ_UINT64)comp->dy << levelno));
  558|  8.76M|                    trx1 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->tx1,
  559|  8.76M|                                                         ((OPJ_UINT64)comp->dx << levelno));
  560|  8.76M|                    try1 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->ty1,
  561|  8.76M|                                                         ((OPJ_UINT64)comp->dy << levelno));
  562|  8.76M|                    rpx = res->pdx + levelno;
  563|  8.76M|                    rpy = res->pdy + levelno;
  564|       |
  565|  8.76M|                    if ((OPJ_UINT32)(((OPJ_UINT64)comp->dx << rpx) >> rpx) != comp->dx ||
  ------------------
  |  Branch (565:25): [True: 0, False: 8.76M]
  ------------------
  566|  8.76M|                            (OPJ_UINT32)(((OPJ_UINT64)comp->dy << rpy) >> rpy) != comp->dy) {
  ------------------
  |  Branch (566:29): [True: 0, False: 8.76M]
  ------------------
  567|      0|                        continue;
  568|      0|                    }
  569|       |
  570|       |                    /* See ISO-15441. B.12.1.4 Position-component-resolution level-layer progression */
  571|  8.76M|                    if (!(((OPJ_UINT64)pi->y % ((OPJ_UINT64)comp->dy << rpy) == 0) ||
  ------------------
  |  Branch (571:27): [True: 1.83M, False: 6.92M]
  ------------------
  572|  8.76M|                            ((pi->y == pi->ty0) &&
  ------------------
  |  Branch (572:30): [True: 577k, False: 6.35M]
  ------------------
  573|  6.92M|                             (((OPJ_UINT64)try0 << levelno) % ((OPJ_UINT64)1U << rpy))))) {
  ------------------
  |  Branch (573:30): [True: 558k, False: 19.4k]
  ------------------
  574|  6.37M|                        continue;
  575|  6.37M|                    }
  576|  2.38M|                    if (!(((OPJ_UINT64)pi->x % ((OPJ_UINT64)comp->dx << rpx) == 0) ||
  ------------------
  |  Branch (576:27): [True: 735k, False: 1.65M]
  ------------------
  577|  2.38M|                            ((pi->x == pi->tx0) &&
  ------------------
  |  Branch (577:30): [True: 102k, False: 1.55M]
  ------------------
  578|  1.65M|                             (((OPJ_UINT64)trx0 << levelno) % ((OPJ_UINT64)1U << rpx))))) {
  ------------------
  |  Branch (578:30): [True: 97.9k, False: 4.78k]
  ------------------
  579|  1.55M|                        continue;
  580|  1.55M|                    }
  581|       |
  582|   833k|                    if ((res->pw == 0) || (res->ph == 0)) {
  ------------------
  |  Branch (582:25): [True: 22.9k, False: 810k]
  |  Branch (582:43): [True: 10.8k, False: 799k]
  ------------------
  583|  33.7k|                        continue;
  584|  33.7k|                    }
  585|       |
  586|   799k|                    if ((trx0 == trx1) || (try0 == try1)) {
  ------------------
  |  Branch (586:25): [True: 0, False: 799k]
  |  Branch (586:43): [True: 0, False: 799k]
  ------------------
  587|      0|                        continue;
  588|      0|                    }
  589|       |
  590|   799k|                    prci = opj_uint_floordivpow2(opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->x,
  591|   799k|                                                 ((OPJ_UINT64)comp->dx << levelno)), res->pdx)
  592|   799k|                           - opj_uint_floordivpow2(trx0, res->pdx);
  593|   799k|                    prcj = opj_uint_floordivpow2(opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->y,
  594|   799k|                                                 ((OPJ_UINT64)comp->dy << levelno)), res->pdy)
  595|   799k|                           - opj_uint_floordivpow2(try0, res->pdy);
  596|   799k|                    pi->precno = prci + prcj * res->pw;
  597|  19.3M|                    for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
  ------------------
  |  Branch (597:54): [True: 18.5M, False: 799k]
  ------------------
  598|  18.5M|                        index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno *
  599|  18.5M|                                pi->step_c + pi->precno * pi->step_p;
  600|  18.5M|                        if (index >= pi->include_size) {
  ------------------
  |  Branch (600:29): [True: 0, False: 18.5M]
  ------------------
  601|      0|                            opj_event_msg(pi->manager, EVT_ERROR, "Invalid access to pi->include");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  602|      0|                            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  603|      0|                        }
  604|  18.5M|                        if (!pi->include[index]) {
  ------------------
  |  Branch (604:29): [True: 18.5M, False: 26.8k]
  ------------------
  605|  18.5M|                            pi->include[index] = 1;
  606|  18.5M|                            return OPJ_TRUE;
  ------------------
  |  |  117|  18.5M|#define OPJ_TRUE 1
  ------------------
  607|  18.5M|                        }
  608|  18.5M|LABEL_SKIP:
  609|  18.5M|                        ;
  610|  18.5M|                    }
  611|   799k|                }
  612|  3.78M|            }
  613|  1.52M|        }
  614|  75.4k|    }
  615|       |
  616|  1.87k|    return OPJ_FALSE;
  ------------------
  |  |  118|  1.87k|#define OPJ_FALSE 0
  ------------------
  617|  1.95k|}
pi.c:opj_pi_next_cprl:
  620|  12.0M|{
  621|  12.0M|    opj_pi_comp_t *comp = NULL;
  622|  12.0M|    opj_pi_resolution_t *res = NULL;
  623|  12.0M|    OPJ_UINT32 index = 0;
  624|       |
  625|  12.0M|    if (pi->poc.compno0 >= pi->numcomps ||
  ------------------
  |  Branch (625:9): [True: 315, False: 12.0M]
  ------------------
  626|  12.0M|            pi->poc.compno1 >= pi->numcomps + 1) {
  ------------------
  |  Branch (626:13): [True: 0, False: 12.0M]
  ------------------
  627|    315|        opj_event_msg(pi->manager, EVT_ERROR,
  ------------------
  |  |   66|    315|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  628|    315|                      "opj_pi_next_cprl(): invalid compno0/compno1\n");
  629|    315|        return OPJ_FALSE;
  ------------------
  |  |  118|    315|#define OPJ_FALSE 0
  ------------------
  630|    315|    }
  631|       |
  632|  12.0M|    if (!pi->first) {
  ------------------
  |  Branch (632:9): [True: 12.0M, False: 2.16k]
  ------------------
  633|  12.0M|        comp = &pi->comps[pi->compno];
  634|  12.0M|        goto LABEL_SKIP;
  635|  12.0M|    } else {
  636|  2.16k|        pi->first = 0;
  637|  2.16k|    }
  638|       |
  639|  8.95k|    for (pi->compno = pi->poc.compno0; pi->compno < pi->poc.compno1; pi->compno++) {
  ------------------
  |  Branch (639:40): [True: 6.85k, False: 2.10k]
  ------------------
  640|  6.85k|        OPJ_UINT32 resno;
  641|  6.85k|        comp = &pi->comps[pi->compno];
  642|  6.85k|        pi->dx = 0;
  643|  6.85k|        pi->dy = 0;
  644|  51.5k|        for (resno = 0; resno < comp->numresolutions; resno++) {
  ------------------
  |  Branch (644:25): [True: 44.6k, False: 6.85k]
  ------------------
  645|  44.6k|            OPJ_UINT32 dx, dy;
  646|  44.6k|            res = &comp->resolutions[resno];
  647|  44.6k|            if (res->pdx + comp->numresolutions - 1 - resno < 32 &&
  ------------------
  |  Branch (647:17): [True: 35.4k, False: 9.22k]
  ------------------
  648|  44.6k|                    comp->dx <= UINT_MAX / (1u << (res->pdx + comp->numresolutions - 1 - resno))) {
  ------------------
  |  Branch (648:21): [True: 34.4k, False: 1.04k]
  ------------------
  649|  34.4k|                dx = comp->dx * (1u << (res->pdx + comp->numresolutions - 1 - resno));
  650|  34.4k|                pi->dx = !pi->dx ? dx : opj_uint_min(pi->dx, dx);
  ------------------
  |  Branch (650:26): [True: 6.85k, False: 27.5k]
  ------------------
  651|  34.4k|            }
  652|  44.6k|            if (res->pdy + comp->numresolutions - 1 - resno < 32 &&
  ------------------
  |  Branch (652:17): [True: 35.4k, False: 9.22k]
  ------------------
  653|  44.6k|                    comp->dy <= UINT_MAX / (1u << (res->pdy + comp->numresolutions - 1 - resno))) {
  ------------------
  |  Branch (653:21): [True: 34.2k, False: 1.27k]
  ------------------
  654|  34.2k|                dy = comp->dy * (1u << (res->pdy + comp->numresolutions - 1 - resno));
  655|  34.2k|                pi->dy = !pi->dy ? dy : opj_uint_min(pi->dy, dy);
  ------------------
  |  Branch (655:26): [True: 6.85k, False: 27.3k]
  ------------------
  656|  34.2k|            }
  657|  44.6k|        }
  658|  6.85k|        if (pi->dx == 0 || pi->dy == 0) {
  ------------------
  |  Branch (658:13): [True: 0, False: 6.85k]
  |  Branch (658:28): [True: 0, False: 6.85k]
  ------------------
  659|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  660|      0|        }
  661|  6.85k|        if (!pi->tp_on) {
  ------------------
  |  Branch (661:13): [True: 6.85k, False: 0]
  ------------------
  662|  6.85k|            pi->poc.ty0 = pi->ty0;
  663|  6.85k|            pi->poc.tx0 = pi->tx0;
  664|  6.85k|            pi->poc.ty1 = pi->ty1;
  665|  6.85k|            pi->poc.tx1 = pi->tx1;
  666|  6.85k|        }
  667|   169k|        for (pi->y = (OPJ_UINT32)pi->poc.ty0; pi->y < (OPJ_UINT32)pi->poc.ty1;
  ------------------
  |  Branch (667:47): [True: 162k, False: 6.79k]
  ------------------
  668|   162k|                pi->y += (pi->dy - (pi->y % pi->dy))) {
  669|  1.50M|            for (pi->x = (OPJ_UINT32)pi->poc.tx0; pi->x < (OPJ_UINT32)pi->poc.tx1;
  ------------------
  |  Branch (669:51): [True: 1.34M, False: 162k]
  ------------------
  670|  1.34M|                    pi->x += (pi->dx - (pi->x % pi->dx))) {
  671|  1.34M|                for (pi->resno = pi->poc.resno0;
  672|  9.15M|                        pi->resno < opj_uint_min(pi->poc.resno1, comp->numresolutions); pi->resno++) {
  ------------------
  |  Branch (672:25): [True: 7.80M, False: 1.34M]
  ------------------
  673|  7.80M|                    OPJ_UINT32 levelno;
  674|  7.80M|                    OPJ_UINT32 trx0, try0;
  675|  7.80M|                    OPJ_UINT32 trx1, try1;
  676|  7.80M|                    OPJ_UINT32 rpx, rpy;
  677|  7.80M|                    OPJ_UINT32 prci, prcj;
  678|  7.80M|                    res = &comp->resolutions[pi->resno];
  679|  7.80M|                    levelno = comp->numresolutions - 1 - pi->resno;
  680|       |
  681|  7.80M|                    if ((OPJ_UINT32)(((OPJ_UINT64)comp->dx << levelno) >> levelno) != comp->dx ||
  ------------------
  |  Branch (681:25): [True: 0, False: 7.80M]
  ------------------
  682|  7.80M|                            (OPJ_UINT32)(((OPJ_UINT64)comp->dy << levelno) >> levelno) != comp->dy) {
  ------------------
  |  Branch (682:29): [True: 0, False: 7.80M]
  ------------------
  683|      0|                        continue;
  684|      0|                    }
  685|       |
  686|  7.80M|                    trx0 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->tx0,
  687|  7.80M|                                                         ((OPJ_UINT64)comp->dx << levelno));
  688|  7.80M|                    try0 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->ty0,
  689|  7.80M|                                                         ((OPJ_UINT64)comp->dy << levelno));
  690|  7.80M|                    trx1 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->tx1,
  691|  7.80M|                                                         ((OPJ_UINT64)comp->dx << levelno));
  692|  7.80M|                    try1 = opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->ty1,
  693|  7.80M|                                                         ((OPJ_UINT64)comp->dy << levelno));
  694|  7.80M|                    rpx = res->pdx + levelno;
  695|  7.80M|                    rpy = res->pdy + levelno;
  696|       |
  697|  7.80M|                    if ((OPJ_UINT32)(((OPJ_UINT64)comp->dx << rpx) >> rpx) != comp->dx ||
  ------------------
  |  Branch (697:25): [True: 0, False: 7.80M]
  ------------------
  698|  7.80M|                            (OPJ_UINT32)(((OPJ_UINT64)comp->dy << rpy) >> rpy) != comp->dy) {
  ------------------
  |  Branch (698:29): [True: 0, False: 7.80M]
  ------------------
  699|      0|                        continue;
  700|      0|                    }
  701|       |
  702|       |                    /* See ISO-15441. B.12.1.5 Component-position-resolution level-layer progression */
  703|  7.80M|                    if (!(((OPJ_UINT64)pi->y % ((OPJ_UINT64)comp->dy << rpy) == 0) ||
  ------------------
  |  Branch (703:27): [True: 1.46M, False: 6.34M]
  ------------------
  704|  7.80M|                            ((pi->y == pi->ty0) &&
  ------------------
  |  Branch (704:30): [True: 581k, False: 5.76M]
  ------------------
  705|  6.34M|                             (((OPJ_UINT64)try0 << levelno) % ((OPJ_UINT64)1U << rpy))))) {
  ------------------
  |  Branch (705:30): [True: 576k, False: 5.37k]
  ------------------
  706|  5.76M|                        continue;
  707|  5.76M|                    }
  708|  2.03M|                    if (!(((OPJ_UINT64)pi->x % ((OPJ_UINT64)comp->dx << rpx) == 0) ||
  ------------------
  |  Branch (708:27): [True: 635k, False: 1.40M]
  ------------------
  709|  2.03M|                            ((pi->x == pi->tx0) &&
  ------------------
  |  Branch (709:30): [True: 212k, False: 1.19M]
  ------------------
  710|  1.40M|                             (((OPJ_UINT64)trx0 << levelno) % ((OPJ_UINT64)1U << rpx))))) {
  ------------------
  |  Branch (710:30): [True: 203k, False: 8.59k]
  ------------------
  711|  1.20M|                        continue;
  712|  1.20M|                    }
  713|       |
  714|   839k|                    if ((res->pw == 0) || (res->ph == 0)) {
  ------------------
  |  Branch (714:25): [True: 22.9k, False: 816k]
  |  Branch (714:43): [True: 19.0k, False: 797k]
  ------------------
  715|  42.0k|                        continue;
  716|  42.0k|                    }
  717|       |
  718|   797k|                    if ((trx0 == trx1) || (try0 == try1)) {
  ------------------
  |  Branch (718:25): [True: 0, False: 797k]
  |  Branch (718:43): [True: 0, False: 797k]
  ------------------
  719|      0|                        continue;
  720|      0|                    }
  721|       |
  722|   797k|                    prci = opj_uint_floordivpow2(opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->x,
  723|   797k|                                                 ((OPJ_UINT64)comp->dx << levelno)), res->pdx)
  724|   797k|                           - opj_uint_floordivpow2(trx0, res->pdx);
  725|   797k|                    prcj = opj_uint_floordivpow2(opj_uint64_ceildiv_res_uint32((OPJ_UINT64)pi->y,
  726|   797k|                                                 ((OPJ_UINT64)comp->dy << levelno)), res->pdy)
  727|   797k|                           - opj_uint_floordivpow2(try0, res->pdy);
  728|   797k|                    pi->precno = (OPJ_UINT32)(prci + prcj * res->pw);
  729|  12.8M|                    for (pi->layno = pi->poc.layno0; pi->layno < pi->poc.layno1; pi->layno++) {
  ------------------
  |  Branch (729:54): [True: 12.0M, False: 796k]
  ------------------
  730|  12.0M|                        index = pi->layno * pi->step_l + pi->resno * pi->step_r + pi->compno *
  731|  12.0M|                                pi->step_c + pi->precno * pi->step_p;
  732|  12.0M|                        if (index >= pi->include_size) {
  ------------------
  |  Branch (732:29): [True: 0, False: 12.0M]
  ------------------
  733|      0|                            opj_event_msg(pi->manager, EVT_ERROR, "Invalid access to pi->include");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  734|      0|                            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  735|      0|                        }
  736|  12.0M|                        if (!pi->include[index]) {
  ------------------
  |  Branch (736:29): [True: 12.0M, False: 59.7k]
  ------------------
  737|  12.0M|                            pi->include[index] = 1;
  738|  12.0M|                            return OPJ_TRUE;
  ------------------
  |  |  117|  12.0M|#define OPJ_TRUE 1
  ------------------
  739|  12.0M|                        }
  740|  12.0M|LABEL_SKIP:
  741|  12.0M|                        ;
  742|  12.0M|                    }
  743|   797k|                }
  744|  1.34M|            }
  745|   162k|        }
  746|  6.85k|    }
  747|       |
  748|  2.10k|    return OPJ_FALSE;
  ------------------
  |  |  118|  2.10k|#define OPJ_FALSE 0
  ------------------
  749|  2.16k|}

opj_sparse_array_int32_create:
   49|  7.27k|{
   50|  7.27k|    opj_sparse_array_int32_t* sa;
   51|       |
   52|  7.27k|    if (width == 0 || height == 0 || block_width == 0 || block_height == 0) {
  ------------------
  |  Branch (52:9): [True: 0, False: 7.27k]
  |  Branch (52:23): [True: 0, False: 7.27k]
  |  Branch (52:38): [True: 0, False: 7.27k]
  |  Branch (52:58): [True: 0, False: 7.27k]
  ------------------
   53|      0|        return NULL;
   54|      0|    }
   55|  7.27k|    if (block_width > ((OPJ_UINT32)~0U) / block_height / sizeof(OPJ_INT32)) {
  ------------------
  |  Branch (55:9): [True: 0, False: 7.27k]
  ------------------
   56|      0|        return NULL;
   57|      0|    }
   58|       |
   59|  7.27k|    sa = (opj_sparse_array_int32_t*) opj_calloc(1,
   60|  7.27k|            sizeof(opj_sparse_array_int32_t));
   61|  7.27k|    sa->width = width;
   62|  7.27k|    sa->height = height;
   63|  7.27k|    sa->block_width = block_width;
   64|  7.27k|    sa->block_height = block_height;
   65|  7.27k|    sa->block_count_hor = opj_uint_ceildiv(width, block_width);
   66|  7.27k|    sa->block_count_ver = opj_uint_ceildiv(height, block_height);
   67|  7.27k|    if (sa->block_count_hor > ((OPJ_UINT32)~0U) / sa->block_count_ver) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7.27k]
  ------------------
   68|      0|        opj_free(sa);
   69|      0|        return NULL;
   70|      0|    }
   71|  7.27k|    sa->data_blocks = (OPJ_INT32**) opj_calloc(sizeof(OPJ_INT32*),
   72|  7.27k|                      (size_t) sa->block_count_hor * sa->block_count_ver);
   73|  7.27k|    if (sa->data_blocks == NULL) {
  ------------------
  |  Branch (73:9): [True: 0, False: 7.27k]
  ------------------
   74|      0|        opj_free(sa);
   75|      0|        return NULL;
   76|      0|    }
   77|       |
   78|  7.27k|    return sa;
   79|  7.27k|}
opj_sparse_array_int32_free:
   82|  7.27k|{
   83|  7.27k|    if (sa) {
  ------------------
  |  Branch (83:9): [True: 7.27k, False: 0]
  ------------------
   84|  7.27k|        OPJ_UINT32 i;
   85|  96.7M|        for (i = 0; i < sa->block_count_hor * sa->block_count_ver; i++) {
  ------------------
  |  Branch (85:21): [True: 96.7M, False: 7.27k]
  ------------------
   86|  96.7M|            if (sa->data_blocks[i]) {
  ------------------
  |  Branch (86:17): [True: 243k, False: 96.4M]
  ------------------
   87|   243k|                opj_free(sa->data_blocks[i]);
   88|   243k|            }
   89|  96.7M|        }
   90|  7.27k|        opj_free(sa->data_blocks);
   91|  7.27k|        opj_free(sa);
   92|  7.27k|    }
   93|  7.27k|}
opj_sparse_array_is_region_valid:
  100|  8.74M|{
  101|  8.74M|    return !(x0 >= sa->width || x1 <= x0 || x1 > sa->width ||
  ------------------
  |  Branch (101:14): [True: 1.00M, False: 7.73M]
  |  Branch (101:33): [True: 750k, False: 6.98M]
  |  Branch (101:45): [True: 0, False: 6.98M]
  ------------------
  102|  8.74M|             y0 >= sa->height || y1 <= y0 || y1 > sa->height);
  ------------------
  |  Branch (102:14): [True: 7.52k, False: 6.98M]
  |  Branch (102:34): [True: 117k, False: 6.86M]
  |  Branch (102:46): [True: 0, False: 6.86M]
  ------------------
  103|  8.74M|}
opj_sparse_array_int32_read:
  320|  5.70M|{
  321|  5.70M|    return opj_sparse_array_int32_read_or_write(
  322|  5.70M|               (opj_sparse_array_int32_t*)sa, x0, y0, x1, y1,
  323|  5.70M|               dest,
  324|  5.70M|               dest_col_stride,
  325|  5.70M|               dest_line_stride,
  326|  5.70M|               forgiving,
  327|  5.70M|               OPJ_TRUE);
  ------------------
  |  |  117|  5.70M|#define OPJ_TRUE 1
  ------------------
  328|  5.70M|}
opj_sparse_array_int32_write:
  339|  3.04M|{
  340|  3.04M|    return opj_sparse_array_int32_read_or_write(sa, x0, y0, x1, y1,
  341|  3.04M|            (OPJ_INT32*)src,
  342|  3.04M|            src_col_stride,
  343|  3.04M|            src_line_stride,
  344|  3.04M|            forgiving,
  345|  3.04M|            OPJ_FALSE);
  ------------------
  |  |  118|  3.04M|#define OPJ_FALSE 0
  ------------------
  346|  3.04M|}
sparse_array.c:opj_sparse_array_int32_read_or_write:
  116|  8.74M|{
  117|  8.74M|    OPJ_UINT32 y, block_y;
  118|  8.74M|    OPJ_UINT32 y_incr = 0;
  119|  8.74M|    const OPJ_UINT32 block_width = sa->block_width;
  120|       |
  121|  8.74M|    if (!opj_sparse_array_is_region_valid(sa, x0, y0, x1, y1)) {
  ------------------
  |  Branch (121:9): [True: 1.88M, False: 6.86M]
  ------------------
  122|  1.88M|        return forgiving;
  123|  1.88M|    }
  124|       |
  125|  6.86M|    block_y = y0 / sa->block_height;
  126|  15.2M|    for (y = y0; y < y1; block_y ++, y += y_incr) {
  ------------------
  |  Branch (126:18): [True: 8.35M, False: 6.86M]
  ------------------
  127|  8.35M|        OPJ_UINT32 x, block_x;
  128|  8.35M|        OPJ_UINT32 x_incr = 0;
  129|  8.35M|        OPJ_UINT32 block_y_offset;
  130|  8.35M|        y_incr = (y == y0) ? sa->block_height - (y0 % sa->block_height) :
  ------------------
  |  Branch (130:18): [True: 6.86M, False: 1.49M]
  ------------------
  131|  8.35M|                 sa->block_height;
  132|  8.35M|        block_y_offset = sa->block_height - y_incr;
  133|  8.35M|        y_incr = opj_uint_min(y_incr, y1 - y);
  134|  8.35M|        block_x = x0 / block_width;
  135|  22.0M|        for (x = x0; x < x1; block_x ++, x += x_incr) {
  ------------------
  |  Branch (135:22): [True: 13.6M, False: 8.35M]
  ------------------
  136|  13.6M|            OPJ_UINT32 j;
  137|  13.6M|            OPJ_UINT32 block_x_offset;
  138|  13.6M|            OPJ_INT32* src_block;
  139|  13.6M|            x_incr = (x == x0) ? block_width - (x0 % block_width) : block_width;
  ------------------
  |  Branch (139:22): [True: 8.35M, False: 5.31M]
  ------------------
  140|  13.6M|            block_x_offset = block_width - x_incr;
  141|  13.6M|            x_incr = opj_uint_min(x_incr, x1 - x);
  142|  13.6M|            src_block = sa->data_blocks[block_y * sa->block_count_hor + block_x];
  143|  13.6M|            if (is_read_op) {
  ------------------
  |  Branch (143:17): [True: 7.32M, False: 6.35M]
  ------------------
  144|  7.32M|                if (src_block == NULL) {
  ------------------
  |  Branch (144:21): [True: 488, False: 7.32M]
  ------------------
  145|    488|                    if (buf_col_stride == 1) {
  ------------------
  |  Branch (145:25): [True: 0, False: 488]
  ------------------
  146|      0|                        OPJ_INT32* dest_ptr = buf + (y - y0) * (OPJ_SIZE_T)buf_line_stride +
  147|      0|                                              (x - x0) * buf_col_stride;
  148|      0|                        for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (148:37): [True: 0, False: 0]
  ------------------
  149|      0|                            memset(dest_ptr, 0, sizeof(OPJ_INT32) * x_incr);
  150|      0|                            dest_ptr += buf_line_stride;
  151|      0|                        }
  152|    488|                    } else {
  153|    488|                        OPJ_INT32* dest_ptr = buf + (y - y0) * (OPJ_SIZE_T)buf_line_stride +
  154|    488|                                              (x - x0) * buf_col_stride;
  155|    976|                        for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (155:37): [True: 488, False: 488]
  ------------------
  156|    488|                            OPJ_UINT32 k;
  157|  5.52k|                            for (k = 0; k < x_incr; k++) {
  ------------------
  |  Branch (157:41): [True: 5.03k, False: 488]
  ------------------
  158|  5.03k|                                dest_ptr[k * buf_col_stride] = 0;
  159|  5.03k|                            }
  160|    488|                            dest_ptr += buf_line_stride;
  161|    488|                        }
  162|    488|                    }
  163|  7.32M|                } else {
  164|  7.32M|                    const OPJ_INT32* OPJ_RESTRICT src_ptr = src_block + block_y_offset *
  165|  7.32M|                                                            (OPJ_SIZE_T)block_width + block_x_offset;
  166|  7.32M|                    if (buf_col_stride == 1) {
  ------------------
  |  Branch (166:25): [True: 1.40M, False: 5.91M]
  ------------------
  167|  1.40M|                        OPJ_INT32* OPJ_RESTRICT dest_ptr = buf + (y - y0) * (OPJ_SIZE_T)buf_line_stride
  168|  1.40M|                                                           +
  169|  1.40M|                                                           (x - x0) * buf_col_stride;
  170|  1.40M|                        if (x_incr == 4) {
  ------------------
  |  Branch (170:29): [True: 985k, False: 422k]
  ------------------
  171|       |                            /* Same code as general branch, but the compiler */
  172|       |                            /* can have an efficient memcpy() */
  173|   985k|                            (void)(x_incr); /* trick to silent cppcheck duplicateBranch warning */
  174|  41.0M|                            for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (174:41): [True: 40.0M, False: 985k]
  ------------------
  175|  40.0M|                                memcpy(dest_ptr, src_ptr, sizeof(OPJ_INT32) * x_incr);
  176|  40.0M|                                dest_ptr += buf_line_stride;
  177|  40.0M|                                src_ptr += block_width;
  178|  40.0M|                            }
  179|   985k|                        } else {
  180|  14.2M|                            for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (180:41): [True: 13.8M, False: 422k]
  ------------------
  181|  13.8M|                                memcpy(dest_ptr, src_ptr, sizeof(OPJ_INT32) * x_incr);
  182|  13.8M|                                dest_ptr += buf_line_stride;
  183|  13.8M|                                src_ptr += block_width;
  184|  13.8M|                            }
  185|   422k|                        }
  186|  5.91M|                    } else {
  187|  5.91M|                        OPJ_INT32* OPJ_RESTRICT dest_ptr = buf + (y - y0) * (OPJ_SIZE_T)buf_line_stride
  188|  5.91M|                                                           +
  189|  5.91M|                                                           (x - x0) * buf_col_stride;
  190|  5.91M|                        if (x_incr == 1) {
  ------------------
  |  Branch (190:29): [True: 1.94M, False: 3.96M]
  ------------------
  191|  3.89M|                            for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (191:41): [True: 1.94M, False: 1.94M]
  ------------------
  192|  1.94M|                                *dest_ptr = *src_ptr;
  193|  1.94M|                                dest_ptr += buf_line_stride;
  194|  1.94M|                                src_ptr += block_width;
  195|  1.94M|                            }
  196|  3.96M|                        } else if (y_incr == 1 && buf_col_stride == 2) {
  ------------------
  |  Branch (196:36): [True: 3.96M, False: 0]
  |  Branch (196:51): [True: 3.34M, False: 620k]
  ------------------
  197|  3.34M|                            OPJ_UINT32 k;
  198|  42.8M|                            for (k = 0; k < (x_incr & ~3U); k += 4) {
  ------------------
  |  Branch (198:41): [True: 39.4M, False: 3.34M]
  ------------------
  199|  39.4M|                                dest_ptr[k * buf_col_stride] = src_ptr[k];
  200|  39.4M|                                dest_ptr[(k + 1) * buf_col_stride] = src_ptr[k + 1];
  201|  39.4M|                                dest_ptr[(k + 2) * buf_col_stride] = src_ptr[k + 2];
  202|  39.4M|                                dest_ptr[(k + 3) * buf_col_stride] = src_ptr[k + 3];
  203|  39.4M|                            }
  204|  5.75M|                            for (; k < x_incr; k++) {
  ------------------
  |  Branch (204:36): [True: 2.41M, False: 3.34M]
  ------------------
  205|  2.41M|                                dest_ptr[k * buf_col_stride] = src_ptr[k];
  206|  2.41M|                            }
  207|  3.34M|                        } else if (x_incr >= 8 && buf_col_stride == 8) {
  ------------------
  |  Branch (207:36): [True: 441k, False: 179k]
  |  Branch (207:51): [True: 0, False: 441k]
  ------------------
  208|      0|                            for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (208:41): [True: 0, False: 0]
  ------------------
  209|      0|                                OPJ_UINT32 k;
  210|      0|                                for (k = 0; k < (x_incr & ~3U); k += 4) {
  ------------------
  |  Branch (210:45): [True: 0, False: 0]
  ------------------
  211|      0|                                    dest_ptr[k * buf_col_stride] = src_ptr[k];
  212|      0|                                    dest_ptr[(k + 1) * buf_col_stride] = src_ptr[k + 1];
  213|      0|                                    dest_ptr[(k + 2) * buf_col_stride] = src_ptr[k + 2];
  214|      0|                                    dest_ptr[(k + 3) * buf_col_stride] = src_ptr[k + 3];
  215|      0|                                }
  216|      0|                                for (; k < x_incr; k++) {
  ------------------
  |  Branch (216:40): [True: 0, False: 0]
  ------------------
  217|      0|                                    dest_ptr[k * buf_col_stride] = src_ptr[k];
  218|      0|                                }
  219|      0|                                dest_ptr += buf_line_stride;
  220|      0|                                src_ptr += block_width;
  221|      0|                            }
  222|   620k|                        } else {
  223|       |                            /* General case */
  224|  1.24M|                            for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (224:41): [True: 620k, False: 620k]
  ------------------
  225|   620k|                                OPJ_UINT32 k;
  226|  18.5M|                                for (k = 0; k < x_incr; k++) {
  ------------------
  |  Branch (226:45): [True: 17.9M, False: 620k]
  ------------------
  227|  17.9M|                                    dest_ptr[k * buf_col_stride] = src_ptr[k];
  228|  17.9M|                                }
  229|   620k|                                dest_ptr += buf_line_stride;
  230|   620k|                                src_ptr += block_width;
  231|   620k|                            }
  232|   620k|                        }
  233|  5.91M|                    }
  234|  7.32M|                }
  235|  7.32M|            } else {
  236|  6.35M|                if (src_block == NULL) {
  ------------------
  |  Branch (236:21): [True: 243k, False: 6.10M]
  ------------------
  237|   243k|                    src_block = (OPJ_INT32*) opj_calloc(1,
  238|   243k|                                                        (size_t) sa->block_width * sa->block_height * sizeof(OPJ_INT32));
  239|   243k|                    if (src_block == NULL) {
  ------------------
  |  Branch (239:25): [True: 0, False: 243k]
  ------------------
  240|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  241|      0|                    }
  242|   243k|                    sa->data_blocks[block_y * sa->block_count_hor + block_x] = src_block;
  243|   243k|                }
  244|       |
  245|  6.35M|                if (buf_col_stride == 1) {
  ------------------
  |  Branch (245:21): [True: 6.19M, False: 158k]
  ------------------
  246|  6.19M|                    OPJ_INT32* OPJ_RESTRICT dest_ptr = src_block + block_y_offset *
  247|  6.19M|                                                       (OPJ_SIZE_T)block_width + block_x_offset;
  248|  6.19M|                    const OPJ_INT32* OPJ_RESTRICT src_ptr = buf + (y - y0) *
  249|  6.19M|                                                            (OPJ_SIZE_T)buf_line_stride + (x - x0) * buf_col_stride;
  250|  6.19M|                    if (x_incr == 4) {
  ------------------
  |  Branch (250:25): [True: 970k, False: 5.22M]
  ------------------
  251|       |                        /* Same code as general branch, but the compiler */
  252|       |                        /* can have an efficient memcpy() */
  253|   970k|                        (void)(x_incr); /* trick to silent cppcheck duplicateBranch warning */
  254|  44.2M|                        for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (254:37): [True: 43.3M, False: 970k]
  ------------------
  255|  43.3M|                            memcpy(dest_ptr, src_ptr, sizeof(OPJ_INT32) * x_incr);
  256|  43.3M|                            dest_ptr += block_width;
  257|  43.3M|                            src_ptr += buf_line_stride;
  258|  43.3M|                        }
  259|  5.22M|                    } else {
  260|  46.1M|                        for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (260:37): [True: 40.9M, False: 5.22M]
  ------------------
  261|  40.9M|                            memcpy(dest_ptr, src_ptr, sizeof(OPJ_INT32) * x_incr);
  262|  40.9M|                            dest_ptr += block_width;
  263|  40.9M|                            src_ptr += buf_line_stride;
  264|  40.9M|                        }
  265|  5.22M|                    }
  266|  6.19M|                } else {
  267|   158k|                    OPJ_INT32* OPJ_RESTRICT dest_ptr = src_block + block_y_offset *
  268|   158k|                                                       (OPJ_SIZE_T)block_width + block_x_offset;
  269|   158k|                    const OPJ_INT32* OPJ_RESTRICT src_ptr = buf + (y - y0) *
  270|   158k|                                                            (OPJ_SIZE_T)buf_line_stride + (x - x0) * buf_col_stride;
  271|   158k|                    if (x_incr == 1) {
  ------------------
  |  Branch (271:25): [True: 72.3k, False: 86.0k]
  ------------------
  272|   647k|                        for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (272:37): [True: 575k, False: 72.3k]
  ------------------
  273|   575k|                            *dest_ptr = *src_ptr;
  274|   575k|                            src_ptr += buf_line_stride;
  275|   575k|                            dest_ptr += block_width;
  276|   575k|                        }
  277|  86.0k|                    } else if (x_incr >= 8 && buf_col_stride == 8) {
  ------------------
  |  Branch (277:32): [True: 55.4k, False: 30.5k]
  |  Branch (277:47): [True: 55.4k, False: 0]
  ------------------
  278|   431k|                        for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (278:37): [True: 375k, False: 55.4k]
  ------------------
  279|   375k|                            OPJ_UINT32 k;
  280|  4.76M|                            for (k = 0; k < (x_incr & ~3U); k += 4) {
  ------------------
  |  Branch (280:41): [True: 4.38M, False: 375k]
  ------------------
  281|  4.38M|                                dest_ptr[k] = src_ptr[k * buf_col_stride];
  282|  4.38M|                                dest_ptr[k + 1] = src_ptr[(k + 1) * buf_col_stride];
  283|  4.38M|                                dest_ptr[k + 2] = src_ptr[(k + 2) * buf_col_stride];
  284|  4.38M|                                dest_ptr[k + 3] = src_ptr[(k + 3) * buf_col_stride];
  285|  4.38M|                            }
  286|   629k|                            for (; k < x_incr; k++) {
  ------------------
  |  Branch (286:36): [True: 253k, False: 375k]
  ------------------
  287|   253k|                                dest_ptr[k] = src_ptr[k * buf_col_stride];
  288|   253k|                            }
  289|   375k|                            src_ptr += buf_line_stride;
  290|   375k|                            dest_ptr += block_width;
  291|   375k|                        }
  292|  55.4k|                    } else {
  293|       |                        /* General case */
  294|   273k|                        for (j = 0; j < y_incr; j++) {
  ------------------
  |  Branch (294:37): [True: 243k, False: 30.5k]
  ------------------
  295|   243k|                            OPJ_UINT32 k;
  296|   850k|                            for (k = 0; k < x_incr; k++) {
  ------------------
  |  Branch (296:41): [True: 606k, False: 243k]
  ------------------
  297|   606k|                                dest_ptr[k] = src_ptr[k * buf_col_stride];
  298|   606k|                            }
  299|   243k|                            src_ptr += buf_line_stride;
  300|   243k|                            dest_ptr += block_width;
  301|   243k|                        }
  302|  30.5k|                    }
  303|   158k|                }
  304|  6.35M|            }
  305|  13.6M|        }
  306|  8.35M|    }
  307|       |
  308|  6.86M|    return OPJ_TRUE;
  ------------------
  |  |  117|  6.86M|#define OPJ_TRUE 1
  ------------------
  309|  6.86M|}

opj_t1_create:
 1548|  6.83k|{
 1549|  6.83k|    opj_t1_t *l_t1 = 00;
 1550|       |
 1551|  6.83k|    l_t1 = (opj_t1_t*) opj_calloc(1, sizeof(opj_t1_t));
 1552|  6.83k|    if (!l_t1) {
  ------------------
  |  Branch (1552:9): [True: 0, False: 6.83k]
  ------------------
 1553|      0|        return 00;
 1554|      0|    }
 1555|       |
 1556|  6.83k|    l_t1->encoder = isEncoder;
 1557|       |
 1558|  6.83k|    return l_t1;
 1559|  6.83k|}
opj_t1_destroy:
 1568|  6.83k|{
 1569|  6.83k|    if (! p_t1) {
  ------------------
  |  Branch (1569:9): [True: 0, False: 6.83k]
  ------------------
 1570|      0|        return;
 1571|      0|    }
 1572|       |
 1573|  6.83k|    if (p_t1->data) {
  ------------------
  |  Branch (1573:9): [True: 6.82k, False: 3]
  ------------------
 1574|  6.82k|        opj_aligned_free(p_t1->data);
 1575|  6.82k|        p_t1->data = 00;
 1576|  6.82k|    }
 1577|       |
 1578|  6.83k|    if (p_t1->flags) {
  ------------------
  |  Branch (1578:9): [True: 6.82k, False: 1]
  ------------------
 1579|  6.82k|        opj_aligned_free(p_t1->flags);
 1580|  6.82k|        p_t1->flags = 00;
 1581|  6.82k|    }
 1582|       |
 1583|  6.83k|    opj_free(p_t1->cblkdatabuffer);
 1584|       |
 1585|  6.83k|    opj_free(p_t1);
 1586|  6.83k|}
opj_t1_decode_cblks:
 1843|  26.6k|{
 1844|  26.6k|    opj_thread_pool_t* tp = tcd->thread_pool;
 1845|  26.6k|    OPJ_UINT32 resno, bandno, precno, cblkno;
 1846|       |
 1847|       |#ifdef DEBUG_VERBOSE
 1848|       |    OPJ_UINT32 codeblocks_decoded = 0;
 1849|       |    printf("Enter opj_t1_decode_cblks()\n");
 1850|       |#endif
 1851|       |
 1852|   254k|    for (resno = 0; resno < tilec->minimum_num_resolutions; ++resno) {
  ------------------
  |  Branch (1852:21): [True: 228k, False: 26.1k]
  ------------------
 1853|   228k|        opj_tcd_resolution_t* res = &tilec->resolutions[resno];
 1854|       |
 1855|   859k|        for (bandno = 0; bandno < res->numbands; ++bandno) {
  ------------------
  |  Branch (1855:26): [True: 631k, False: 227k]
  ------------------
 1856|   631k|            opj_tcd_band_t* OPJ_RESTRICT band = &res->bands[bandno];
 1857|       |
 1858|  22.7M|            for (precno = 0; precno < res->pw * res->ph; ++precno) {
  ------------------
  |  Branch (1858:30): [True: 22.1M, False: 631k]
  ------------------
 1859|  22.1M|                opj_tcd_precinct_t* precinct = &band->precincts[precno];
 1860|       |
 1861|  22.1M|                if (!opj_tcd_is_subband_area_of_interest(tcd,
  ------------------
  |  Branch (1861:21): [True: 20.7M, False: 1.38M]
  ------------------
 1862|  22.1M|                        tilec->compno,
 1863|  22.1M|                        resno,
 1864|  22.1M|                        band->bandno,
 1865|  22.1M|                        (OPJ_UINT32)precinct->x0,
 1866|  22.1M|                        (OPJ_UINT32)precinct->y0,
 1867|  22.1M|                        (OPJ_UINT32)precinct->x1,
 1868|  22.1M|                        (OPJ_UINT32)precinct->y1)) {
 1869|   214M|                    for (cblkno = 0; cblkno < precinct->cw * precinct->ch; ++cblkno) {
  ------------------
  |  Branch (1869:38): [True: 193M, False: 20.7M]
  ------------------
 1870|   193M|                        opj_tcd_cblk_dec_t* cblk = &precinct->cblks.dec[cblkno];
 1871|   193M|                        if (cblk->decoded_data) {
  ------------------
  |  Branch (1871:29): [True: 0, False: 193M]
  ------------------
 1872|       |#ifdef DEBUG_VERBOSE
 1873|       |                            printf("Discarding codeblock %d,%d at resno=%d, bandno=%d\n",
 1874|       |                                   cblk->x0, cblk->y0, resno, bandno);
 1875|       |#endif
 1876|      0|                            opj_aligned_free(cblk->decoded_data);
 1877|      0|                            cblk->decoded_data = NULL;
 1878|      0|                        }
 1879|   193M|                    }
 1880|  20.7M|                    continue;
 1881|  20.7M|                }
 1882|       |
 1883|  20.6M|                for (cblkno = 0; cblkno < precinct->cw * precinct->ch; ++cblkno) {
  ------------------
  |  Branch (1883:34): [True: 19.2M, False: 1.38M]
  ------------------
 1884|  19.2M|                    opj_tcd_cblk_dec_t* cblk = &precinct->cblks.dec[cblkno];
 1885|  19.2M|                    opj_t1_cblk_decode_processing_job_t* job;
 1886|       |
 1887|  19.2M|                    if (!opj_tcd_is_subband_area_of_interest(tcd,
  ------------------
  |  Branch (1887:25): [True: 15.6M, False: 3.63M]
  ------------------
 1888|  19.2M|                            tilec->compno,
 1889|  19.2M|                            resno,
 1890|  19.2M|                            band->bandno,
 1891|  19.2M|                            (OPJ_UINT32)cblk->x0,
 1892|  19.2M|                            (OPJ_UINT32)cblk->y0,
 1893|  19.2M|                            (OPJ_UINT32)cblk->x1,
 1894|  19.2M|                            (OPJ_UINT32)cblk->y1)) {
 1895|  15.6M|                        if (cblk->decoded_data) {
  ------------------
  |  Branch (1895:29): [True: 0, False: 15.6M]
  ------------------
 1896|       |#ifdef DEBUG_VERBOSE
 1897|       |                            printf("Discarding codeblock %d,%d at resno=%d, bandno=%d\n",
 1898|       |                                   cblk->x0, cblk->y0, resno, bandno);
 1899|       |#endif
 1900|      0|                            opj_aligned_free(cblk->decoded_data);
 1901|      0|                            cblk->decoded_data = NULL;
 1902|      0|                        }
 1903|  15.6M|                        continue;
 1904|  15.6M|                    }
 1905|       |
 1906|  3.63M|                    if (!tcd->whole_tile_decoding) {
  ------------------
  |  Branch (1906:25): [True: 1.26M, False: 2.37M]
  ------------------
 1907|  1.26M|                        OPJ_UINT32 cblk_w = (OPJ_UINT32)(cblk->x1 - cblk->x0);
 1908|  1.26M|                        OPJ_UINT32 cblk_h = (OPJ_UINT32)(cblk->y1 - cblk->y0);
 1909|  1.26M|                        if (cblk->decoded_data != NULL) {
  ------------------
  |  Branch (1909:29): [True: 0, False: 1.26M]
  ------------------
 1910|       |#ifdef DEBUG_VERBOSE
 1911|       |                            printf("Reusing codeblock %d,%d at resno=%d, bandno=%d\n",
 1912|       |                                   cblk->x0, cblk->y0, resno, bandno);
 1913|       |#endif
 1914|      0|                            continue;
 1915|      0|                        }
 1916|  1.26M|                        if (cblk_w == 0 || cblk_h == 0) {
  ------------------
  |  Branch (1916:29): [True: 23.2k, False: 1.24M]
  |  Branch (1916:44): [True: 8.83k, False: 1.23M]
  ------------------
 1917|  32.0k|                            continue;
 1918|  32.0k|                        }
 1919|       |#ifdef DEBUG_VERBOSE
 1920|       |                        printf("Decoding codeblock %d,%d at resno=%d, bandno=%d\n",
 1921|       |                               cblk->x0, cblk->y0, resno, bandno);
 1922|       |#endif
 1923|  1.26M|                    }
 1924|       |
 1925|  3.60M|                    job = (opj_t1_cblk_decode_processing_job_t*) opj_calloc(1,
 1926|  3.60M|                            sizeof(opj_t1_cblk_decode_processing_job_t));
 1927|  3.60M|                    if (!job) {
  ------------------
  |  Branch (1927:25): [True: 0, False: 3.60M]
  ------------------
 1928|      0|                        *pret = OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1929|      0|                        return;
 1930|      0|                    }
 1931|  3.60M|                    job->whole_tile_decoding = tcd->whole_tile_decoding;
 1932|  3.60M|                    job->resno = resno;
 1933|  3.60M|                    job->cblk = cblk;
 1934|  3.60M|                    job->band = band;
 1935|  3.60M|                    job->tilec = tilec;
 1936|  3.60M|                    job->tccp = tccp;
 1937|  3.60M|                    job->pret = pret;
 1938|  3.60M|                    job->p_manager_mutex = p_manager_mutex;
 1939|  3.60M|                    job->p_manager = p_manager;
 1940|  3.60M|                    job->check_pterm = check_pterm;
 1941|  3.60M|                    job->mustuse_cblkdatabuffer = opj_thread_pool_get_thread_count(tp) > 1;
 1942|  3.60M|                    opj_thread_pool_submit_job(tp, opj_t1_clbl_decode_processor, job);
 1943|       |#ifdef DEBUG_VERBOSE
 1944|       |                    codeblocks_decoded ++;
 1945|       |#endif
 1946|  3.60M|                    if (!(*pret)) {
  ------------------
  |  Branch (1946:25): [True: 529, False: 3.60M]
  ------------------
 1947|    529|                        return;
 1948|    529|                    }
 1949|  3.60M|                } /* cblkno */
 1950|  1.38M|            } /* precno */
 1951|   631k|        } /* bandno */
 1952|   228k|    } /* resno */
 1953|       |
 1954|       |#ifdef DEBUG_VERBOSE
 1955|       |    printf("Leave opj_t1_decode_cblks(). Number decoded: %d\n", codeblocks_decoded);
 1956|       |#endif
 1957|  26.1k|    return;
 1958|  26.6k|}
t1.c:opj_t1_clbl_decode_processor:
 1608|  3.60M|{
 1609|  3.60M|    opj_tcd_cblk_dec_t* cblk;
 1610|  3.60M|    opj_tcd_band_t* band;
 1611|  3.60M|    opj_tcd_tilecomp_t* tilec;
 1612|  3.60M|    opj_tccp_t* tccp;
 1613|  3.60M|    OPJ_INT32* OPJ_RESTRICT datap;
 1614|  3.60M|    OPJ_UINT32 cblk_w, cblk_h;
 1615|  3.60M|    OPJ_INT32 x, y;
 1616|  3.60M|    OPJ_UINT32 i, j;
 1617|  3.60M|    opj_t1_cblk_decode_processing_job_t* job;
 1618|  3.60M|    opj_t1_t* t1;
 1619|  3.60M|    OPJ_UINT32 resno;
 1620|  3.60M|    OPJ_UINT32 tile_w;
 1621|       |
 1622|  3.60M|    job = (opj_t1_cblk_decode_processing_job_t*) user_data;
 1623|       |
 1624|  3.60M|    cblk = job->cblk;
 1625|       |
 1626|  3.60M|    if (!job->whole_tile_decoding) {
  ------------------
  |  Branch (1626:9): [True: 1.23M, False: 2.37M]
  ------------------
 1627|  1.23M|        cblk_w = (OPJ_UINT32)(cblk->x1 - cblk->x0);
 1628|  1.23M|        cblk_h = (OPJ_UINT32)(cblk->y1 - cblk->y0);
 1629|       |
 1630|  1.23M|        cblk->decoded_data = (OPJ_INT32*)opj_aligned_malloc(sizeof(OPJ_INT32) *
 1631|  1.23M|                             cblk_w * cblk_h);
 1632|  1.23M|        if (cblk->decoded_data == NULL) {
  ------------------
  |  Branch (1632:13): [True: 0, False: 1.23M]
  ------------------
 1633|      0|            if (job->p_manager_mutex) {
  ------------------
  |  Branch (1633:17): [True: 0, False: 0]
  ------------------
 1634|      0|                opj_mutex_lock(job->p_manager_mutex);
 1635|      0|            }
 1636|      0|            opj_event_msg(job->p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1637|      0|                          "Cannot allocate cblk->decoded_data\n");
 1638|      0|            if (job->p_manager_mutex) {
  ------------------
  |  Branch (1638:17): [True: 0, False: 0]
  ------------------
 1639|      0|                opj_mutex_unlock(job->p_manager_mutex);
 1640|      0|            }
 1641|      0|            *(job->pret) = OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1642|      0|            opj_free(job);
 1643|      0|            return;
 1644|      0|        }
 1645|       |        /* Zero-init required */
 1646|  1.23M|        memset(cblk->decoded_data, 0, sizeof(OPJ_INT32) * cblk_w * cblk_h);
 1647|  2.37M|    } else if (cblk->decoded_data) {
  ------------------
  |  Branch (1647:16): [True: 0, False: 2.37M]
  ------------------
 1648|       |        /* Not sure if that code path can happen, but better be */
 1649|       |        /* safe than sorry */
 1650|      0|        opj_aligned_free(cblk->decoded_data);
 1651|      0|        cblk->decoded_data = NULL;
 1652|      0|    }
 1653|       |
 1654|  3.60M|    resno = job->resno;
 1655|  3.60M|    band = job->band;
 1656|  3.60M|    tilec = job->tilec;
 1657|  3.60M|    tccp = job->tccp;
 1658|  3.60M|    tile_w = (OPJ_UINT32)(tilec->resolutions[tilec->minimum_num_resolutions - 1].x1
 1659|  3.60M|                          -
 1660|  3.60M|                          tilec->resolutions[tilec->minimum_num_resolutions - 1].x0);
 1661|       |
 1662|  3.60M|    if (!*(job->pret)) {
  ------------------
  |  Branch (1662:9): [True: 0, False: 3.60M]
  ------------------
 1663|      0|        opj_free(job);
 1664|      0|        return;
 1665|      0|    }
 1666|       |
 1667|  3.60M|    t1 = (opj_t1_t*) opj_tls_get(tls, OPJ_TLS_KEY_T1);
  ------------------
  |  |   35|  3.60M|#define OPJ_TLS_KEY_T1  0
  ------------------
 1668|  3.60M|    if (t1 == NULL) {
  ------------------
  |  Branch (1668:9): [True: 6.83k, False: 3.60M]
  ------------------
 1669|  6.83k|        t1 = opj_t1_create(OPJ_FALSE);
  ------------------
  |  |  118|  6.83k|#define OPJ_FALSE 0
  ------------------
 1670|  6.83k|        if (t1 == NULL) {
  ------------------
  |  Branch (1670:13): [True: 0, False: 6.83k]
  ------------------
 1671|      0|            opj_event_msg(job->p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1672|      0|                          "Cannot allocate Tier 1 handle\n");
 1673|      0|            *(job->pret) = OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1674|      0|            opj_free(job);
 1675|      0|            return;
 1676|      0|        }
 1677|  6.83k|        if (!opj_tls_set(tls, OPJ_TLS_KEY_T1, t1, opj_t1_destroy_wrapper)) {
  ------------------
  |  |   35|  6.83k|#define OPJ_TLS_KEY_T1  0
  ------------------
  |  Branch (1677:13): [True: 0, False: 6.83k]
  ------------------
 1678|      0|            opj_event_msg(job->p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1679|      0|                          "Unable to set t1 handle as TLS\n");
 1680|      0|            opj_t1_destroy(t1);
 1681|      0|            *(job->pret) = OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1682|      0|            opj_free(job);
 1683|      0|            return;
 1684|      0|        }
 1685|  6.83k|    }
 1686|  3.60M|    t1->mustuse_cblkdatabuffer = job->mustuse_cblkdatabuffer;
 1687|       |
 1688|  3.60M|    if ((tccp->cblksty & J2K_CCP_CBLKSTY_HT) != 0) {
  ------------------
  |  |   64|  3.60M|#define J2K_CCP_CBLKSTY_HT 0x40       /**< (high throughput) HT codeblocks */
  ------------------
  |  Branch (1688:9): [True: 95.8k, False: 3.51M]
  ------------------
 1689|  95.8k|        if (OPJ_FALSE == opj_t1_ht_decode_cblk(
  ------------------
  |  |  118|  95.8k|#define OPJ_FALSE 0
  ------------------
  |  Branch (1689:13): [True: 438, False: 95.4k]
  ------------------
 1690|  95.8k|                    t1,
 1691|  95.8k|                    cblk,
 1692|  95.8k|                    band->bandno,
 1693|  95.8k|                    (OPJ_UINT32)tccp->roishift,
 1694|  95.8k|                    tccp->cblksty,
 1695|  95.8k|                    job->p_manager,
 1696|  95.8k|                    job->p_manager_mutex,
 1697|  95.8k|                    job->check_pterm)) {
 1698|    438|            *(job->pret) = OPJ_FALSE;
  ------------------
  |  |  118|    438|#define OPJ_FALSE 0
  ------------------
 1699|    438|            opj_free(job);
 1700|    438|            return;
 1701|    438|        }
 1702|  3.51M|    } else {
 1703|  3.51M|        if (OPJ_FALSE == opj_t1_decode_cblk(
  ------------------
  |  |  118|  3.51M|#define OPJ_FALSE 0
  ------------------
  |  Branch (1703:13): [True: 91, False: 3.51M]
  ------------------
 1704|  3.51M|                    t1,
 1705|  3.51M|                    cblk,
 1706|  3.51M|                    band->bandno,
 1707|  3.51M|                    (OPJ_UINT32)tccp->roishift,
 1708|  3.51M|                    tccp->cblksty,
 1709|  3.51M|                    job->p_manager,
 1710|  3.51M|                    job->p_manager_mutex,
 1711|  3.51M|                    job->check_pterm)) {
 1712|     91|            *(job->pret) = OPJ_FALSE;
  ------------------
  |  |  118|     91|#define OPJ_FALSE 0
  ------------------
 1713|     91|            opj_free(job);
 1714|     91|            return;
 1715|     91|        }
 1716|  3.51M|    }
 1717|       |
 1718|  3.60M|    x = cblk->x0 - band->x0;
 1719|  3.60M|    y = cblk->y0 - band->y0;
 1720|  3.60M|    if (band->bandno & 1) {
  ------------------
  |  Branch (1720:9): [True: 1.44M, False: 2.16M]
  ------------------
 1721|  1.44M|        opj_tcd_resolution_t* pres = &tilec->resolutions[resno - 1];
 1722|  1.44M|        x += pres->x1 - pres->x0;
 1723|  1.44M|    }
 1724|  3.60M|    if (band->bandno & 2) {
  ------------------
  |  Branch (1724:9): [True: 1.47M, False: 2.12M]
  ------------------
 1725|  1.47M|        opj_tcd_resolution_t* pres = &tilec->resolutions[resno - 1];
 1726|  1.47M|        y += pres->y1 - pres->y0;
 1727|  1.47M|    }
 1728|       |
 1729|  3.60M|    datap = cblk->decoded_data ? cblk->decoded_data : t1->data;
  ------------------
  |  Branch (1729:13): [True: 1.23M, False: 2.37M]
  ------------------
 1730|  3.60M|    cblk_w = t1->w;
 1731|  3.60M|    cblk_h = t1->h;
 1732|       |
 1733|  3.60M|    if (tccp->roishift) {
  ------------------
  |  Branch (1733:9): [True: 9.74k, False: 3.59M]
  ------------------
 1734|  9.74k|        if (tccp->roishift >= 31) {
  ------------------
  |  Branch (1734:13): [True: 1.25k, False: 8.49k]
  ------------------
 1735|  6.75k|            for (j = 0; j < cblk_h; ++j) {
  ------------------
  |  Branch (1735:25): [True: 5.50k, False: 1.25k]
  ------------------
 1736|   403k|                for (i = 0; i < cblk_w; ++i) {
  ------------------
  |  Branch (1736:29): [True: 398k, False: 5.50k]
  ------------------
 1737|   398k|                    datap[(j * cblk_w) + i] = 0;
 1738|   398k|                }
 1739|  5.50k|            }
 1740|  8.49k|        } else {
 1741|  8.49k|            OPJ_INT32 thresh = 1 << tccp->roishift;
 1742|   130k|            for (j = 0; j < cblk_h; ++j) {
  ------------------
  |  Branch (1742:25): [True: 121k, False: 8.49k]
  ------------------
 1743|  1.89M|                for (i = 0; i < cblk_w; ++i) {
  ------------------
  |  Branch (1743:29): [True: 1.76M, False: 121k]
  ------------------
 1744|  1.76M|                    OPJ_INT32 val = datap[(j * cblk_w) + i];
 1745|  1.76M|                    OPJ_INT32 mag = abs(val);
 1746|  1.76M|                    if (mag >= thresh) {
  ------------------
  |  Branch (1746:25): [True: 935, False: 1.76M]
  ------------------
 1747|    935|                        mag >>= tccp->roishift;
 1748|    935|                        datap[(j * cblk_w) + i] = val < 0 ? -mag : mag;
  ------------------
  |  Branch (1748:51): [True: 473, False: 462]
  ------------------
 1749|    935|                    }
 1750|  1.76M|                }
 1751|   121k|            }
 1752|  8.49k|        }
 1753|  9.74k|    }
 1754|       |
 1755|       |    /* Both can be non NULL if for example decoding a full tile and then */
 1756|       |    /* partially a tile. In which case partial decoding should be the */
 1757|       |    /* priority */
 1758|  3.60M|    assert((cblk->decoded_data != NULL) || (tilec->data != NULL));
 1759|       |
 1760|  3.60M|    if (cblk->decoded_data) {
  ------------------
  |  Branch (1760:9): [True: 1.23M, False: 2.37M]
  ------------------
 1761|  1.23M|        OPJ_UINT32 cblk_size = cblk_w * cblk_h;
 1762|  1.23M|        if (tccp->qmfbid == 1) {
  ------------------
  |  Branch (1762:13): [True: 946k, False: 286k]
  ------------------
 1763|   659M|            for (i = 0; i < cblk_size; ++i) {
  ------------------
  |  Branch (1763:25): [True: 658M, False: 946k]
  ------------------
 1764|   658M|                datap[i] /= 2;
 1765|   658M|            }
 1766|   946k|        } else {        /* if (tccp->qmfbid == 0) */
 1767|   286k|            const float stepsize = 0.5f * band->stepsize;
 1768|   286k|            i = 0;
 1769|   286k|#ifdef __SSE2__
 1770|   286k|            {
 1771|   286k|                const __m128 xmm_stepsize = _mm_set1_ps(stepsize);
 1772|  4.02M|                for (; i < (cblk_size & ~15U); i += 16) {
  ------------------
  |  Branch (1772:24): [True: 3.74M, False: 286k]
  ------------------
 1773|  3.74M|                    __m128 xmm0_data = _mm_cvtepi32_ps(_mm_load_si128((__m128i * const)(
 1774|  3.74M|                                                           datap + 0)));
 1775|  3.74M|                    __m128 xmm1_data = _mm_cvtepi32_ps(_mm_load_si128((__m128i * const)(
 1776|  3.74M|                                                           datap + 4)));
 1777|  3.74M|                    __m128 xmm2_data = _mm_cvtepi32_ps(_mm_load_si128((__m128i * const)(
 1778|  3.74M|                                                           datap + 8)));
 1779|  3.74M|                    __m128 xmm3_data = _mm_cvtepi32_ps(_mm_load_si128((__m128i * const)(
 1780|  3.74M|                                                           datap + 12)));
 1781|  3.74M|                    _mm_store_ps((float*)(datap +  0), _mm_mul_ps(xmm0_data, xmm_stepsize));
 1782|  3.74M|                    _mm_store_ps((float*)(datap +  4), _mm_mul_ps(xmm1_data, xmm_stepsize));
 1783|  3.74M|                    _mm_store_ps((float*)(datap +  8), _mm_mul_ps(xmm2_data, xmm_stepsize));
 1784|  3.74M|                    _mm_store_ps((float*)(datap + 12), _mm_mul_ps(xmm3_data, xmm_stepsize));
 1785|  3.74M|                    datap += 16;
 1786|  3.74M|                }
 1787|   286k|            }
 1788|   286k|#endif
 1789|   669k|            for (; i < cblk_size; ++i) {
  ------------------
  |  Branch (1789:20): [True: 382k, False: 286k]
  ------------------
 1790|   382k|                OPJ_FLOAT32 tmp = ((OPJ_FLOAT32)(*datap)) * stepsize;
 1791|   382k|                memcpy(datap, &tmp, sizeof(tmp));
 1792|   382k|                datap++;
 1793|   382k|            }
 1794|   286k|        }
 1795|  2.37M|    } else if (tccp->qmfbid == 1) {
  ------------------
  |  Branch (1795:16): [True: 668k, False: 1.70M]
  ------------------
 1796|   668k|        OPJ_INT32* OPJ_RESTRICT tiledp = &tilec->data[(OPJ_SIZE_T)y * tile_w +
 1797|   668k|                                                       (OPJ_SIZE_T)x];
 1798|  23.5M|        for (j = 0; j < cblk_h; ++j) {
  ------------------
  |  Branch (1798:21): [True: 22.8M, False: 668k]
  ------------------
 1799|  22.8M|            i = 0;
 1800|   159M|            for (; i < (cblk_w & ~(OPJ_UINT32)3U); i += 4U) {
  ------------------
  |  Branch (1800:20): [True: 136M, False: 22.8M]
  ------------------
 1801|   136M|                OPJ_INT32 tmp0 = datap[(j * cblk_w) + i + 0U];
 1802|   136M|                OPJ_INT32 tmp1 = datap[(j * cblk_w) + i + 1U];
 1803|   136M|                OPJ_INT32 tmp2 = datap[(j * cblk_w) + i + 2U];
 1804|   136M|                OPJ_INT32 tmp3 = datap[(j * cblk_w) + i + 3U];
 1805|   136M|                ((OPJ_INT32*)tiledp)[(j * (OPJ_SIZE_T)tile_w) + i + 0U] = tmp0 / 2;
 1806|   136M|                ((OPJ_INT32*)tiledp)[(j * (OPJ_SIZE_T)tile_w) + i + 1U] = tmp1 / 2;
 1807|   136M|                ((OPJ_INT32*)tiledp)[(j * (OPJ_SIZE_T)tile_w) + i + 2U] = tmp2 / 2;
 1808|   136M|                ((OPJ_INT32*)tiledp)[(j * (OPJ_SIZE_T)tile_w) + i + 3U] = tmp3 / 2;
 1809|   136M|            }
 1810|  28.9M|            for (; i < cblk_w; ++i) {
  ------------------
  |  Branch (1810:20): [True: 6.08M, False: 22.8M]
  ------------------
 1811|  6.08M|                OPJ_INT32 tmp = datap[(j * cblk_w) + i];
 1812|  6.08M|                ((OPJ_INT32*)tiledp)[(j * (OPJ_SIZE_T)tile_w) + i] = tmp / 2;
 1813|  6.08M|            }
 1814|  22.8M|        }
 1815|  1.70M|    } else {        /* if (tccp->qmfbid == 0) */
 1816|  1.70M|        const float stepsize = 0.5f * band->stepsize;
 1817|  1.70M|        OPJ_FLOAT32* OPJ_RESTRICT tiledp = (OPJ_FLOAT32*) &tilec->data[(OPJ_SIZE_T)y *
 1818|  1.70M|                                                         tile_w + (OPJ_SIZE_T)x];
 1819|  8.45M|        for (j = 0; j < cblk_h; ++j) {
  ------------------
  |  Branch (1819:21): [True: 6.74M, False: 1.70M]
  ------------------
 1820|  6.74M|            OPJ_FLOAT32* OPJ_RESTRICT tiledp2 = tiledp;
 1821|  45.7M|            for (i = 0; i < cblk_w; ++i) {
  ------------------
  |  Branch (1821:25): [True: 38.9M, False: 6.74M]
  ------------------
 1822|  38.9M|                OPJ_FLOAT32 tmp = (OPJ_FLOAT32) * datap * stepsize;
 1823|  38.9M|                *tiledp2 = tmp;
 1824|  38.9M|                datap++;
 1825|  38.9M|                tiledp2++;
 1826|  38.9M|            }
 1827|  6.74M|            tiledp += tile_w;
 1828|  6.74M|        }
 1829|  1.70M|    }
 1830|       |
 1831|  3.60M|    opj_free(job);
 1832|  3.60M|}
t1.c:opj_t1_destroy_wrapper:
 1603|  6.83k|{
 1604|  6.83k|    opj_t1_destroy((opj_t1_t*) t1);
 1605|  6.83k|}
t1.c:opj_t1_decode_cblk:
 1969|  3.51M|{
 1970|  3.51M|    opj_mqc_t *mqc = &(t1->mqc);   /* MQC component */
 1971|       |
 1972|  3.51M|    OPJ_INT32 bpno_plus_one;
 1973|  3.51M|    OPJ_UINT32 passtype;
 1974|  3.51M|    OPJ_UINT32 segno, passno;
 1975|  3.51M|    OPJ_BYTE* cblkdata = NULL;
 1976|  3.51M|    OPJ_UINT32 cblkdataindex = 0;
 1977|  3.51M|    OPJ_BYTE type = T1_TYPE_MQ; /* BYPASS mode */
  ------------------
  |  |   70|  3.51M|#define T1_TYPE_MQ 0    /**< Normal coding using entropy coder */
  ------------------
 1978|  3.51M|    OPJ_INT32* original_t1_data = NULL;
 1979|       |
 1980|  3.51M|    mqc->lut_ctxno_zc_orient = lut_ctxno_zc + (orient << 9);
 1981|       |
 1982|  3.51M|    if (!opj_t1_allocate_buffers(
  ------------------
  |  Branch (1982:9): [True: 0, False: 3.51M]
  ------------------
 1983|  3.51M|                t1,
 1984|  3.51M|                (OPJ_UINT32)(cblk->x1 - cblk->x0),
 1985|  3.51M|                (OPJ_UINT32)(cblk->y1 - cblk->y0))) {
 1986|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1987|      0|    }
 1988|       |
 1989|  3.51M|    bpno_plus_one = (OPJ_INT32)(roishift + cblk->numbps);
 1990|  3.51M|    if (bpno_plus_one >= 31) {
  ------------------
  |  Branch (1990:9): [True: 91, False: 3.51M]
  ------------------
 1991|     91|        if (p_manager_mutex) {
  ------------------
  |  Branch (1991:13): [True: 91, False: 0]
  ------------------
 1992|     91|            opj_mutex_lock(p_manager_mutex);
 1993|     91|        }
 1994|     91|        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|     91|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1995|     91|                      "opj_t1_decode_cblk(): unsupported bpno_plus_one = %d >= 31\n",
 1996|     91|                      bpno_plus_one);
 1997|     91|        if (p_manager_mutex) {
  ------------------
  |  Branch (1997:13): [True: 91, False: 0]
  ------------------
 1998|     91|            opj_mutex_unlock(p_manager_mutex);
 1999|     91|        }
 2000|     91|        return OPJ_FALSE;
  ------------------
  |  |  118|     91|#define OPJ_FALSE 0
  ------------------
 2001|     91|    }
 2002|  3.51M|    passtype = 2;
 2003|       |
 2004|  3.51M|    opj_mqc_resetstates(mqc);
 2005|  3.51M|    opj_mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);
  ------------------
  |  |   65|  3.51M|#define T1_CTXNO_UNI (T1_CTXNO_AGG+T1_NUMCTXS_AGG)
  |  |  ------------------
  |  |  |  |   64|  3.51M|#define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  3.51M|#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  3.51M|#define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|  3.51M|#define T1_CTXNO_ZC  0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   55|  3.51M|#define T1_NUMCTXS_ZC  9
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  3.51M|#define T1_NUMCTXS_SC  5
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  3.51M|#define T1_NUMCTXS_MAG 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_CTXNO_UNI (T1_CTXNO_AGG+T1_NUMCTXS_AGG)
  |  |  ------------------
  |  |  |  |   58|  3.51M|#define T1_NUMCTXS_AGG 1
  |  |  ------------------
  ------------------
 2006|  3.51M|    opj_mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);
  ------------------
  |  |   64|  3.51M|#define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
  |  |  ------------------
  |  |  |  |   63|  3.51M|#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.51M|#define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|  3.51M|#define T1_CTXNO_ZC  0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  3.51M|#define T1_NUMCTXS_ZC  9
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   56|  3.51M|#define T1_NUMCTXS_SC  5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
  |  |  ------------------
  |  |  |  |   57|  3.51M|#define T1_NUMCTXS_MAG 3
  |  |  ------------------
  ------------------
 2007|  3.51M|    opj_mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);
  ------------------
  |  |   61|  3.51M|#define T1_CTXNO_ZC  0
  ------------------
 2008|       |
 2009|       |    /* Even if we have a single chunk, in multi-threaded decoding */
 2010|       |    /* the insertion of our synthetic marker might potentially override */
 2011|       |    /* valid codestream of other codeblocks decoded in parallel. */
 2012|  3.51M|    if (cblk->numchunks > 1 || t1->mustuse_cblkdatabuffer) {
  ------------------
  |  Branch (2012:9): [True: 24.7k, False: 3.48M]
  |  Branch (2012:32): [True: 0, False: 3.48M]
  ------------------
 2013|  24.7k|        OPJ_UINT32 i;
 2014|  24.7k|        OPJ_UINT32 cblk_len;
 2015|       |
 2016|       |        /* Compute whole codeblock length from chunk lengths */
 2017|  24.7k|        cblk_len = 0;
 2018|   211k|        for (i = 0; i < cblk->numchunks; i++) {
  ------------------
  |  Branch (2018:21): [True: 187k, False: 24.7k]
  ------------------
 2019|   187k|            cblk_len += cblk->chunks[i].len;
 2020|   187k|        }
 2021|       |
 2022|       |        /* Allocate temporary memory if needed */
 2023|  24.7k|        if (cblk_len + OPJ_COMMON_CBLK_DATA_EXTRA > t1->cblkdatabuffersize) {
  ------------------
  |  |   39|  24.7k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
  |  Branch (2023:13): [True: 2.76k, False: 22.0k]
  ------------------
 2024|  2.76k|            cblkdata = (OPJ_BYTE*)opj_realloc(t1->cblkdatabuffer,
 2025|  2.76k|                                              cblk_len + OPJ_COMMON_CBLK_DATA_EXTRA);
  ------------------
  |  |   39|  2.76k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
 2026|  2.76k|            if (cblkdata == NULL) {
  ------------------
  |  Branch (2026:17): [True: 0, False: 2.76k]
  ------------------
 2027|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2028|      0|            }
 2029|  2.76k|            t1->cblkdatabuffer = cblkdata;
 2030|  2.76k|            memset(t1->cblkdatabuffer + cblk_len, 0, OPJ_COMMON_CBLK_DATA_EXTRA);
  ------------------
  |  |   39|  2.76k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
 2031|  2.76k|            t1->cblkdatabuffersize = cblk_len + OPJ_COMMON_CBLK_DATA_EXTRA;
  ------------------
  |  |   39|  2.76k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
 2032|  2.76k|        }
 2033|       |
 2034|       |        /* Concatenate all chunks */
 2035|  24.7k|        cblkdata = t1->cblkdatabuffer;
 2036|  24.7k|        cblk_len = 0;
 2037|   211k|        for (i = 0; i < cblk->numchunks; i++) {
  ------------------
  |  Branch (2037:21): [True: 187k, False: 24.7k]
  ------------------
 2038|   187k|            memcpy(cblkdata + cblk_len, cblk->chunks[i].data, cblk->chunks[i].len);
 2039|   187k|            cblk_len += cblk->chunks[i].len;
 2040|   187k|        }
 2041|  3.48M|    } else if (cblk->numchunks == 1) {
  ------------------
  |  Branch (2041:16): [True: 87.7k, False: 3.39M]
  ------------------
 2042|  87.7k|        cblkdata = cblk->chunks[0].data;
 2043|  3.39M|    } else {
 2044|       |        /* Not sure if that can happen in practice, but avoid Coverity to */
 2045|       |        /* think we will dereference a null cblkdta pointer */
 2046|  3.39M|        return OPJ_TRUE;
  ------------------
  |  |  117|  3.39M|#define OPJ_TRUE 1
  ------------------
 2047|  3.39M|    }
 2048|       |
 2049|       |    /* For subtile decoding, directly decode in the decoded_data buffer of */
 2050|       |    /* the code-block. Hack t1->data to point to it, and restore it later */
 2051|   112k|    if (cblk->decoded_data) {
  ------------------
  |  Branch (2051:9): [True: 46.8k, False: 65.7k]
  ------------------
 2052|  46.8k|        original_t1_data = t1->data;
 2053|  46.8k|        t1->data = cblk->decoded_data;
 2054|  46.8k|    }
 2055|       |
 2056|   330k|    for (segno = 0; segno < cblk->real_num_segs; ++segno) {
  ------------------
  |  Branch (2056:21): [True: 217k, False: 112k]
  ------------------
 2057|   217k|        opj_tcd_seg_t *seg = &cblk->segs[segno];
 2058|       |
 2059|       |        /* BYPASS mode */
 2060|   217k|        type = ((bpno_plus_one <= ((OPJ_INT32)(cblk->numbps)) - 4) && (passtype < 2) &&
  ------------------
  |  Branch (2060:17): [True: 54.6k, False: 163k]
  |  Branch (2060:71): [True: 42.5k, False: 12.0k]
  ------------------
 2061|   217k|                (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
  ------------------
  |  |   58|  42.5k|#define J2K_CCP_CBLKSTY_LAZY 0x01     /**< Selective arithmetic coding bypass */
  ------------------
                              (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
  ------------------
  |  |   71|  39.5k|#define T1_TYPE_RAW 1   /**< No encoding the information is store under raw format in codestream (mode switch RAW)*/
  ------------------
                              (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ;
  ------------------
  |  |   70|   396k|#define T1_TYPE_MQ 0    /**< Normal coding using entropy coder */
  ------------------
  |  Branch (2061:17): [True: 39.5k, False: 2.99k]
  ------------------
 2062|       |
 2063|   217k|        if (type == T1_TYPE_RAW) {
  ------------------
  |  |   71|   217k|#define T1_TYPE_RAW 1   /**< No encoding the information is store under raw format in codestream (mode switch RAW)*/
  ------------------
  |  Branch (2063:13): [True: 39.5k, False: 178k]
  ------------------
 2064|  39.5k|            opj_mqc_raw_init_dec(mqc, cblkdata + cblkdataindex, seg->len,
 2065|  39.5k|                                 OPJ_COMMON_CBLK_DATA_EXTRA);
  ------------------
  |  |   39|  39.5k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
 2066|   178k|        } else {
 2067|   178k|            opj_mqc_init_dec(mqc, cblkdata + cblkdataindex, seg->len,
 2068|   178k|                             OPJ_COMMON_CBLK_DATA_EXTRA);
  ------------------
  |  |   39|   178k|#define OPJ_COMMON_CBLK_DATA_EXTRA        2    /**< Margin for a fake FFFF marker */
  ------------------
 2069|   178k|        }
 2070|   217k|        cblkdataindex += seg->len;
 2071|       |
 2072|  1.71M|        for (passno = 0; (passno < seg->real_num_passes) &&
  ------------------
  |  Branch (2072:26): [True: 1.57M, False: 138k]
  ------------------
 2073|  1.71M|                (bpno_plus_one >= 1); ++passno) {
  ------------------
  |  Branch (2073:17): [True: 1.49M, False: 78.8k]
  ------------------
 2074|  1.49M|            switch (passtype) {
  ------------------
  |  Branch (2074:21): [True: 0, False: 1.49M]
  ------------------
 2075|   479k|            case 0:
  ------------------
  |  Branch (2075:13): [True: 479k, False: 1.01M]
  ------------------
 2076|   479k|                if (type == T1_TYPE_RAW) {
  ------------------
  |  |   71|   479k|#define T1_TYPE_RAW 1   /**< No encoding the information is store under raw format in codestream (mode switch RAW)*/
  ------------------
  |  Branch (2076:21): [True: 12.2k, False: 466k]
  ------------------
 2077|  12.2k|                    opj_t1_dec_sigpass_raw(t1, bpno_plus_one, (OPJ_INT32)cblksty);
 2078|   466k|                } else {
 2079|   466k|                    opj_t1_dec_sigpass_mqc(t1, bpno_plus_one, (OPJ_INT32)cblksty);
 2080|   466k|                }
 2081|   479k|                break;
 2082|   457k|            case 1:
  ------------------
  |  Branch (2082:13): [True: 457k, False: 1.03M]
  ------------------
 2083|   457k|                if (type == T1_TYPE_RAW) {
  ------------------
  |  |   71|   457k|#define T1_TYPE_RAW 1   /**< No encoding the information is store under raw format in codestream (mode switch RAW)*/
  ------------------
  |  Branch (2083:21): [True: 12.0k, False: 445k]
  ------------------
 2084|  12.0k|                    opj_t1_dec_refpass_raw(t1, bpno_plus_one);
 2085|   445k|                } else {
 2086|   445k|                    opj_t1_dec_refpass_mqc(t1, bpno_plus_one);
 2087|   445k|                }
 2088|   457k|                break;
 2089|   557k|            case 2:
  ------------------
  |  Branch (2089:13): [True: 557k, False: 936k]
  ------------------
 2090|   557k|                opj_t1_dec_clnpass(t1, bpno_plus_one, (OPJ_INT32)cblksty);
 2091|   557k|                break;
 2092|  1.49M|            }
 2093|       |
 2094|  1.49M|            if ((cblksty & J2K_CCP_CBLKSTY_RESET) && type == T1_TYPE_MQ) {
  ------------------
  |  |   59|  1.49M|#define J2K_CCP_CBLKSTY_RESET 0x02    /**< Reset context probabilities on coding pass boundaries */
  ------------------
                          if ((cblksty & J2K_CCP_CBLKSTY_RESET) && type == T1_TYPE_MQ) {
  ------------------
  |  |   70|  1.18M|#define T1_TYPE_MQ 0    /**< Normal coding using entropy coder */
  ------------------
  |  Branch (2094:17): [True: 1.18M, False: 313k]
  |  Branch (2094:54): [True: 1.16M, False: 13.1k]
  ------------------
 2095|  1.16M|                opj_mqc_resetstates(mqc);
 2096|  1.16M|                opj_mqc_setstate(mqc, T1_CTXNO_UNI, 0, 46);
  ------------------
  |  |   65|  1.16M|#define T1_CTXNO_UNI (T1_CTXNO_AGG+T1_NUMCTXS_AGG)
  |  |  ------------------
  |  |  |  |   64|  1.16M|#define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   63|  1.16M|#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   62|  1.16M|#define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   61|  1.16M|#define T1_CTXNO_ZC  0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   55|  1.16M|#define T1_NUMCTXS_ZC  9
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   56|  1.16M|#define T1_NUMCTXS_SC  5
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
  |  |  |  |  ------------------
  |  |  |  |  |  |   57|  1.16M|#define T1_NUMCTXS_MAG 3
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_CTXNO_UNI (T1_CTXNO_AGG+T1_NUMCTXS_AGG)
  |  |  ------------------
  |  |  |  |   58|  1.16M|#define T1_NUMCTXS_AGG 1
  |  |  ------------------
  ------------------
 2097|  1.16M|                opj_mqc_setstate(mqc, T1_CTXNO_AGG, 0, 3);
  ------------------
  |  |   64|  1.16M|#define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
  |  |  ------------------
  |  |  |  |   63|  1.16M|#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.16M|#define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   61|  1.16M|#define T1_CTXNO_ZC  0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.16M|#define T1_NUMCTXS_ZC  9
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   56|  1.16M|#define T1_NUMCTXS_SC  5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_CTXNO_AGG (T1_CTXNO_MAG+T1_NUMCTXS_MAG)
  |  |  ------------------
  |  |  |  |   57|  1.16M|#define T1_NUMCTXS_MAG 3
  |  |  ------------------
  ------------------
 2098|  1.16M|                opj_mqc_setstate(mqc, T1_CTXNO_ZC, 0, 4);
  ------------------
  |  |   61|  1.16M|#define T1_CTXNO_ZC  0
  ------------------
 2099|  1.16M|            }
 2100|  1.49M|            if (++passtype == 3) {
  ------------------
  |  Branch (2100:17): [True: 557k, False: 936k]
  ------------------
 2101|   557k|                passtype = 0;
 2102|   557k|                bpno_plus_one--;
 2103|   557k|            }
 2104|  1.49M|        }
 2105|       |
 2106|   217k|        opq_mqc_finish_dec(mqc);
 2107|   217k|    }
 2108|       |
 2109|   112k|    if (check_pterm) {
  ------------------
  |  Branch (2109:9): [True: 60.4k, False: 52.1k]
  ------------------
 2110|  60.4k|        if (mqc->bp + 2 < mqc->end) {
  ------------------
  |  Branch (2110:13): [True: 7.65k, False: 52.7k]
  ------------------
 2111|  7.65k|            if (p_manager_mutex) {
  ------------------
  |  Branch (2111:17): [True: 7.65k, False: 0]
  ------------------
 2112|  7.65k|                opj_mutex_lock(p_manager_mutex);
 2113|  7.65k|            }
 2114|  7.65k|            opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  7.65k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 2115|  7.65k|                          "PTERM check failure: %d remaining bytes in code block (%d used / %d)\n",
 2116|  7.65k|                          (int)(mqc->end - mqc->bp) - 2,
 2117|  7.65k|                          (int)(mqc->bp - mqc->start),
 2118|  7.65k|                          (int)(mqc->end - mqc->start));
 2119|  7.65k|            if (p_manager_mutex) {
  ------------------
  |  Branch (2119:17): [True: 7.65k, False: 0]
  ------------------
 2120|  7.65k|                opj_mutex_unlock(p_manager_mutex);
 2121|  7.65k|            }
 2122|  52.7k|        } else if (mqc->end_of_byte_stream_counter > 2) {
  ------------------
  |  Branch (2122:20): [True: 45.5k, False: 7.25k]
  ------------------
 2123|  45.5k|            if (p_manager_mutex) {
  ------------------
  |  Branch (2123:17): [True: 45.5k, False: 0]
  ------------------
 2124|  45.5k|                opj_mutex_lock(p_manager_mutex);
 2125|  45.5k|            }
 2126|  45.5k|            opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  45.5k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 2127|  45.5k|                          "PTERM check failure: %d synthetized 0xFF markers read\n",
 2128|  45.5k|                          mqc->end_of_byte_stream_counter);
 2129|  45.5k|            if (p_manager_mutex) {
  ------------------
  |  Branch (2129:17): [True: 45.5k, False: 0]
  ------------------
 2130|  45.5k|                opj_mutex_unlock(p_manager_mutex);
 2131|  45.5k|            }
 2132|  45.5k|        }
 2133|  60.4k|    }
 2134|       |
 2135|       |    /* Restore original t1->data is needed */
 2136|   112k|    if (cblk->decoded_data) {
  ------------------
  |  Branch (2136:9): [True: 46.8k, False: 65.7k]
  ------------------
 2137|  46.8k|        t1->data = original_t1_data;
 2138|  46.8k|    }
 2139|       |
 2140|   112k|    return OPJ_TRUE;
  ------------------
  |  |  117|   112k|#define OPJ_TRUE 1
  ------------------
 2141|   112k|}
t1.c:opj_t1_allocate_buffers:
 1452|  3.51M|{
 1453|  3.51M|    OPJ_UINT32 flagssize;
 1454|  3.51M|    OPJ_UINT32 flags_stride;
 1455|       |
 1456|       |    /* No risk of overflow. Prior checks ensure those assert are met */
 1457|       |    /* They are per the specification */
 1458|  3.51M|    assert(w <= 1024);
 1459|  3.51M|    assert(h <= 1024);
 1460|  3.51M|    assert(w * h <= 4096);
 1461|       |
 1462|       |    /* encoder uses tile buffer, so no need to allocate */
 1463|  3.51M|    {
 1464|  3.51M|        OPJ_UINT32 datasize = w * h;
 1465|       |
 1466|  3.51M|        if (datasize > t1->datasize) {
  ------------------
  |  Branch (1466:13): [True: 13.9k, False: 3.49M]
  ------------------
 1467|  13.9k|            opj_aligned_free(t1->data);
 1468|  13.9k|            t1->data = (OPJ_INT32*) opj_aligned_malloc(datasize * sizeof(OPJ_INT32));
 1469|  13.9k|            if (!t1->data) {
  ------------------
  |  Branch (1469:17): [True: 0, False: 13.9k]
  ------------------
 1470|       |                /* FIXME event manager error callback */
 1471|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1472|      0|            }
 1473|  13.9k|            t1->datasize = datasize;
 1474|  13.9k|        }
 1475|       |        /* memset first arg is declared to never be null by gcc */
 1476|  3.51M|        if (t1->data != NULL) {
  ------------------
  |  Branch (1476:13): [True: 3.51M, False: 465]
  ------------------
 1477|  3.51M|            memset(t1->data, 0, datasize * sizeof(OPJ_INT32));
 1478|  3.51M|        }
 1479|  3.51M|    }
 1480|       |
 1481|      0|    flags_stride = w + 2U; /* can't be 0U */
 1482|       |
 1483|  3.51M|    flagssize = (h + 3U) / 4U + 2U;
 1484|       |
 1485|  3.51M|    flagssize *= flags_stride;
 1486|  3.51M|    {
 1487|  3.51M|        opj_flag_t* p;
 1488|  3.51M|        OPJ_UINT32 x;
 1489|  3.51M|        OPJ_UINT32 flags_height = (h + 3U) / 4U;
 1490|       |
 1491|  3.51M|        if (flagssize > t1->flagssize) {
  ------------------
  |  Branch (1491:13): [True: 215k, False: 3.29M]
  ------------------
 1492|       |
 1493|   215k|            opj_aligned_free(t1->flags);
 1494|   215k|            t1->flags = (opj_flag_t*) opj_aligned_malloc(flagssize * sizeof(
 1495|   215k|                            opj_flag_t));
 1496|   215k|            if (!t1->flags) {
  ------------------
  |  Branch (1496:17): [True: 0, False: 215k]
  ------------------
 1497|       |                /* FIXME event manager error callback */
 1498|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1499|      0|            }
 1500|   215k|        }
 1501|  3.51M|        t1->flagssize = flagssize;
 1502|       |
 1503|  3.51M|        memset(t1->flags, 0, flagssize * sizeof(opj_flag_t));
 1504|       |
 1505|  3.51M|        p = &t1->flags[0];
 1506|  70.3M|        for (x = 0; x < flags_stride; ++x) {
  ------------------
  |  Branch (1506:21): [True: 66.8M, False: 3.51M]
  ------------------
 1507|       |            /* magic value to hopefully stop any passes being interested in this entry */
 1508|  66.8M|            *p++ = (T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3);
  ------------------
  |  |  115|  66.8M|#define T1_PI_0     (1U << 21)
  ------------------
                          *p++ = (T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3);
  ------------------
  |  |  119|  66.8M|#define T1_PI_1     (1U << 24)
  ------------------
                          *p++ = (T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3);
  ------------------
  |  |  122|  66.8M|#define T1_PI_2     (1U << 27)
  ------------------
                          *p++ = (T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3);
  ------------------
  |  |  125|  66.8M|#define T1_PI_3     (1U << 30)
  ------------------
 1509|  66.8M|        }
 1510|       |
 1511|  3.51M|        p = &t1->flags[((flags_height + 1) * flags_stride)];
 1512|  70.3M|        for (x = 0; x < flags_stride; ++x) {
  ------------------
  |  Branch (1512:21): [True: 66.8M, False: 3.51M]
  ------------------
 1513|       |            /* magic value to hopefully stop any passes being interested in this entry */
 1514|  66.8M|            *p++ = (T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3);
  ------------------
  |  |  115|  66.8M|#define T1_PI_0     (1U << 21)
  ------------------
                          *p++ = (T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3);
  ------------------
  |  |  119|  66.8M|#define T1_PI_1     (1U << 24)
  ------------------
                          *p++ = (T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3);
  ------------------
  |  |  122|  66.8M|#define T1_PI_2     (1U << 27)
  ------------------
                          *p++ = (T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3);
  ------------------
  |  |  125|  66.8M|#define T1_PI_3     (1U << 30)
  ------------------
 1515|  66.8M|        }
 1516|       |
 1517|  3.51M|        if (h % 4) {
  ------------------
  |  Branch (1517:13): [True: 930k, False: 2.58M]
  ------------------
 1518|   930k|            OPJ_UINT32 v = 0;
 1519|   930k|            p = &t1->flags[((flags_height) * flags_stride)];
 1520|   930k|            if (h % 4 == 1) {
  ------------------
  |  Branch (1520:17): [True: 387k, False: 542k]
  ------------------
 1521|   387k|                v |= T1_PI_1 | T1_PI_2 | T1_PI_3;
  ------------------
  |  |  119|   387k|#define T1_PI_1     (1U << 24)
  ------------------
                              v |= T1_PI_1 | T1_PI_2 | T1_PI_3;
  ------------------
  |  |  122|   387k|#define T1_PI_2     (1U << 27)
  ------------------
                              v |= T1_PI_1 | T1_PI_2 | T1_PI_3;
  ------------------
  |  |  125|   387k|#define T1_PI_3     (1U << 30)
  ------------------
 1522|   542k|            } else if (h % 4 == 2) {
  ------------------
  |  Branch (1522:24): [True: 364k, False: 178k]
  ------------------
 1523|   364k|                v |= T1_PI_2 | T1_PI_3;
  ------------------
  |  |  122|   364k|#define T1_PI_2     (1U << 27)
  ------------------
                              v |= T1_PI_2 | T1_PI_3;
  ------------------
  |  |  125|   364k|#define T1_PI_3     (1U << 30)
  ------------------
 1524|   364k|            } else if (h % 4 == 3) {
  ------------------
  |  Branch (1524:24): [True: 178k, False: 0]
  ------------------
 1525|   178k|                v |= T1_PI_3;
  ------------------
  |  |  125|   178k|#define T1_PI_3     (1U << 30)
  ------------------
 1526|   178k|            }
 1527|  23.2M|            for (x = 0; x < flags_stride; ++x) {
  ------------------
  |  Branch (1527:25): [True: 22.3M, False: 930k]
  ------------------
 1528|  22.3M|                *p++ = v;
 1529|  22.3M|            }
 1530|   930k|        }
 1531|  3.51M|    }
 1532|       |
 1533|      0|    t1->w = w;
 1534|  3.51M|    t1->h = h;
 1535|       |
 1536|  3.51M|    return OPJ_TRUE;
  ------------------
  |  |  117|  3.51M|#define OPJ_TRUE 1
  ------------------
 1537|  3.51M|}
t1.c:opj_t1_dec_sigpass_raw:
  583|  12.2k|{
  584|  12.2k|    OPJ_INT32 one, half, oneplushalf;
  585|  12.2k|    OPJ_UINT32 i, j, k;
  586|  12.2k|    OPJ_INT32 *data = t1->data;
  587|  12.2k|    opj_flag_t *flagsp = &T1_FLAGS(0, 0);
  ------------------
  |  |   60|  12.2k|#define T1_FLAGS(x, y) (t1->flags[x + 1 + ((y / 4) + 1) * (t1->w+2)])
  ------------------
  588|  12.2k|    const OPJ_UINT32 l_w = t1->w;
  589|  12.2k|    one = 1 << bpno;
  590|  12.2k|    half = one >> 1;
  591|  12.2k|    oneplushalf = one | half;
  592|       |
  593|   137k|    for (k = 0; k < (t1->h & ~3U); k += 4, flagsp += 2, data += 3 * l_w) {
  ------------------
  |  Branch (593:17): [True: 125k, False: 12.2k]
  ------------------
  594|  5.00M|        for (i = 0; i < l_w; ++i, ++flagsp, ++data) {
  ------------------
  |  Branch (594:21): [True: 4.87M, False: 125k]
  ------------------
  595|  4.87M|            opj_flag_t flags = *flagsp;
  596|  4.87M|            if (flags != 0) {
  ------------------
  |  Branch (596:17): [True: 3.38M, False: 1.49M]
  ------------------
  597|  3.38M|                opj_t1_dec_sigpass_step_raw(
  598|  3.38M|                    t1,
  599|  3.38M|                    flagsp,
  600|  3.38M|                    data,
  601|  3.38M|                    oneplushalf,
  602|  3.38M|                    cblksty & J2K_CCP_CBLKSTY_VSC, /* vsc */
  ------------------
  |  |   61|  3.38M|#define J2K_CCP_CBLKSTY_VSC 0x08      /**< Vertically stripe causal context */
  ------------------
  603|  3.38M|                    0U);
  604|  3.38M|                opj_t1_dec_sigpass_step_raw(
  605|  3.38M|                    t1,
  606|  3.38M|                    flagsp,
  607|  3.38M|                    data + l_w,
  608|  3.38M|                    oneplushalf,
  609|  3.38M|                    OPJ_FALSE, /* vsc */
  ------------------
  |  |  118|  3.38M|#define OPJ_FALSE 0
  ------------------
  610|  3.38M|                    1U);
  611|  3.38M|                opj_t1_dec_sigpass_step_raw(
  612|  3.38M|                    t1,
  613|  3.38M|                    flagsp,
  614|  3.38M|                    data + 2 * l_w,
  615|  3.38M|                    oneplushalf,
  616|  3.38M|                    OPJ_FALSE, /* vsc */
  ------------------
  |  |  118|  3.38M|#define OPJ_FALSE 0
  ------------------
  617|  3.38M|                    2U);
  618|  3.38M|                opj_t1_dec_sigpass_step_raw(
  619|  3.38M|                    t1,
  620|  3.38M|                    flagsp,
  621|  3.38M|                    data + 3 * l_w,
  622|  3.38M|                    oneplushalf,
  623|  3.38M|                    OPJ_FALSE, /* vsc */
  ------------------
  |  |  118|  3.38M|#define OPJ_FALSE 0
  ------------------
  624|  3.38M|                    3U);
  625|  3.38M|            }
  626|  4.87M|        }
  627|   125k|    }
  628|  12.2k|    if (k < t1->h) {
  ------------------
  |  Branch (628:9): [True: 4.78k, False: 7.42k]
  ------------------
  629|   361k|        for (i = 0; i < l_w; ++i, ++flagsp, ++data) {
  ------------------
  |  Branch (629:21): [True: 356k, False: 4.78k]
  ------------------
  630|  1.16M|            for (j = 0; j < t1->h - k; ++j) {
  ------------------
  |  Branch (630:25): [True: 805k, False: 356k]
  ------------------
  631|   805k|                opj_t1_dec_sigpass_step_raw(
  632|   805k|                    t1,
  633|   805k|                    flagsp,
  634|   805k|                    data + j * l_w,
  635|   805k|                    oneplushalf,
  636|   805k|                    cblksty & J2K_CCP_CBLKSTY_VSC, /* vsc */
  ------------------
  |  |   61|   805k|#define J2K_CCP_CBLKSTY_VSC 0x08      /**< Vertically stripe causal context */
  ------------------
  637|   805k|                    j);
  638|   805k|            }
  639|   356k|        }
  640|  4.78k|    }
  641|  12.2k|}
t1.c:opj_t1_dec_sigpass_step_raw:
  416|  14.3M|{
  417|  14.3M|    OPJ_UINT32 v;
  418|  14.3M|    opj_mqc_t *mqc = &(t1->mqc);       /* RAW component */
  419|       |
  420|  14.3M|    OPJ_UINT32 const flags = *flagsp;
  421|       |
  422|  14.3M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U &&
  ------------------
  |  |  153|  14.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  ------------------
  |  |  |  |   95|  14.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  ------------------
  ------------------
                  if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U &&
  ------------------
  |  |  163|  14.3M|#define T1_PI_THIS    T1_PI_0
  |  |  ------------------
  |  |  |  |  115|  14.3M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  ------------------
  |  Branch (422:9): [True: 2.14M, False: 12.1M]
  ------------------
  423|  14.3M|            (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) {
  ------------------
  |  |  158|  2.14M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  149|  2.14M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|  2.14M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  150|  2.14M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|  2.14M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  151|  2.14M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  2.14M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  152|  2.14M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|  2.14M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  154|  2.14M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.14M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  155|  2.14M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  2.14M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  156|  2.14M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  2.14M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  157|  2.14M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  2.14M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (423:13): [True: 1.91M, False: 226k]
  ------------------
  424|  1.91M|        if (opj_mqc_raw_decode(mqc)) {
  ------------------
  |  Branch (424:13): [True: 1.79M, False: 126k]
  ------------------
  425|  1.79M|            v = opj_mqc_raw_decode(mqc);
  426|  1.79M|            *datap = v ? -oneplushalf : oneplushalf;
  ------------------
  |  Branch (426:22): [True: 1.77M, False: 16.8k]
  ------------------
  427|  1.79M|            opj_t1_update_flags(flagsp, ci, v, t1->w + 2, vsc);
  428|  1.79M|        }
  429|  1.91M|        *flagsp |= T1_PI_THIS << (ci * 3U);
  ------------------
  |  |  163|  1.91M|#define T1_PI_THIS    T1_PI_0
  |  |  ------------------
  |  |  |  |  115|  1.91M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  ------------------
  430|  1.91M|    }
  431|  14.3M|}
t1.c:opj_t1_update_flags:
  353|  1.79M|{
  354|  1.79M|    opj_t1_update_flags_macro(*flagsp, flagsp, ci, s, stride, vsc);
  ------------------
  |  |  321|  1.79M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  322|  1.79M|{ \
  |  |  323|  1.79M|    /* east */ \
  |  |  324|  1.79M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  ------------------
  |  |  |  |   96|  1.79M|#define T1_SIGMA_5  (1U << 5)
  |  |  ------------------
  |  |  325|  1.79M| \
  |  |  326|  1.79M|    /* mark target as significant */ \
  |  |  327|  1.79M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  ------------------
  |  |  |  |  113|  1.79M|#define T1_CHI_1_I  19
  |  |  ------------------
  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  ------------------
  |  |  |  |   95|  1.79M|#define T1_SIGMA_4  (1U << 4)
  |  |  ------------------
  |  |  328|  1.79M| \
  |  |  329|  1.79M|    /* west */ \
  |  |  330|  1.79M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  ------------------
  |  |  |  |   94|  1.79M|#define T1_SIGMA_3  (1U << 3)
  |  |  ------------------
  |  |  331|  1.79M| \
  |  |  332|  1.79M|    /* north-west, north, north-east */ \
  |  |  333|  1.79M|    if (ci == 0U && !(vsc)) { \
  |  |  ------------------
  |  |  |  Branch (333:9): [True: 447k, False: 1.34M]
  |  |  |  Branch (333:21): [True: 343k, False: 104k]
  |  |  ------------------
  |  |  334|   343k|        opj_flag_t* north = flagsp - (stride); \
  |  |  335|   343k|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  ------------------
  |  |  |  |  127|   343k|#define T1_CHI_5_I  31
  |  |  ------------------
  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  ------------------
  |  |  |  |  107|   343k|#define T1_SIGMA_16 (1U << 16)
  |  |  ------------------
  |  |  336|   343k|        north[-1] |= T1_SIGMA_17; \
  |  |  ------------------
  |  |  |  |  108|   343k|#define T1_SIGMA_17 (1U << 17)
  |  |  ------------------
  |  |  337|   343k|        north[1] |= T1_SIGMA_15; \
  |  |  ------------------
  |  |  |  |  106|   343k|#define T1_SIGMA_15 (1U << 15)
  |  |  ------------------
  |  |  338|   343k|    } \
  |  |  339|  1.79M| \
  |  |  340|  1.79M|    /* south-west, south, south-east */ \
  |  |  341|  1.79M|    if (ci == 3U) { \
  |  |  ------------------
  |  |  |  Branch (341:9): [True: 447k, False: 1.34M]
  |  |  ------------------
  |  |  342|   447k|        opj_flag_t* south = flagsp + (stride); \
  |  |  343|   447k|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  ------------------
  |  |  |  |  111|   447k|#define T1_CHI_0_I  18
  |  |  ------------------
  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  ------------------
  |  |  |  |   92|   447k|#define T1_SIGMA_1  (1U << 1)
  |  |  ------------------
  |  |  344|   447k|        south[-1] |= T1_SIGMA_2; \
  |  |  ------------------
  |  |  |  |   93|   447k|#define T1_SIGMA_2  (1U << 2)
  |  |  ------------------
  |  |  345|   447k|        south[1] |= T1_SIGMA_0; \
  |  |  ------------------
  |  |  |  |   91|   447k|#define T1_SIGMA_0  (1U << 0)
  |  |  ------------------
  |  |  346|   447k|    } \
  |  |  347|  1.79M|}
  ------------------
  355|  1.79M|}
t1.c:opj_t1_dec_sigpass_mqc:
  721|   466k|{
  722|   466k|    if (t1->w == 64 && t1->h == 64) {
  ------------------
  |  Branch (722:9): [True: 204k, False: 262k]
  |  Branch (722:24): [True: 164k, False: 39.7k]
  ------------------
  723|   164k|        if (cblksty & J2K_CCP_CBLKSTY_VSC) {
  ------------------
  |  |   61|   164k|#define J2K_CCP_CBLKSTY_VSC 0x08      /**< Vertically stripe causal context */
  ------------------
  |  Branch (723:13): [True: 85.0k, False: 79.7k]
  ------------------
  724|  85.0k|            opj_t1_dec_sigpass_mqc_64x64_vsc(t1, bpno);
  725|  85.0k|        } else {
  726|  79.7k|            opj_t1_dec_sigpass_mqc_64x64_novsc(t1, bpno);
  727|  79.7k|        }
  728|   302k|    } else {
  729|   302k|        if (cblksty & J2K_CCP_CBLKSTY_VSC) {
  ------------------
  |  |   61|   302k|#define J2K_CCP_CBLKSTY_VSC 0x08      /**< Vertically stripe causal context */
  ------------------
  |  Branch (729:13): [True: 150k, False: 151k]
  ------------------
  730|   150k|            opj_t1_dec_sigpass_mqc_generic_vsc(t1, bpno);
  731|   151k|        } else {
  732|   151k|            opj_t1_dec_sigpass_mqc_generic_novsc(t1, bpno);
  733|   151k|        }
  734|   302k|    }
  735|   466k|}
t1.c:opj_t1_dec_sigpass_mqc_64x64_vsc:
  697|  85.0k|{
  698|  85.0k|    opj_t1_dec_sigpass_mqc_internal(t1, bpno, OPJ_TRUE, 64, 64, 66);
  ------------------
  |  |  643|  85.0k|#define opj_t1_dec_sigpass_mqc_internal(t1, bpno, vsc, w, h, flags_stride) \
  |  |  644|  85.0k|{ \
  |  |  645|  85.0k|        OPJ_INT32 one, half, oneplushalf; \
  |  |  646|  85.0k|        OPJ_UINT32 i, j, k; \
  |  |  647|  85.0k|        register OPJ_INT32 *data = t1->data; \
  |  |  648|  85.0k|        register opj_flag_t *flagsp = &t1->flags[(flags_stride) + 1]; \
  |  |  649|  85.0k|        const OPJ_UINT32 l_w = w; \
  |  |  650|  85.0k|        opj_mqc_t* mqc = &(t1->mqc); \
  |  |  651|  85.0k|        DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|  85.0k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|  85.0k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|  85.0k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|  85.0k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  |  652|  85.0k|        register OPJ_UINT32 v; \
  |  |  653|  85.0k|        one = 1 << bpno; \
  |  |  654|  85.0k|        half = one >> 1; \
  |  |  655|  85.0k|        oneplushalf = one | half; \
  |  |  656|  1.44M|        for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (656:21): [True: 1.36M, False: 85.0k]
  |  |  ------------------
  |  |  657|  88.4M|                for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (657:29): [True: 87.0M, False: 1.36M]
  |  |  ------------------
  |  |  658|  87.0M|                        opj_flag_t flags = *flagsp; \
  |  |  659|  87.0M|                        if( flags != 0 ) { \
  |  |  ------------------
  |  |  |  Branch (659:29): [True: 59.3M, False: 27.7M]
  |  |  ------------------
  |  |  660|  59.3M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  59.3M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  59.3M|{ \
  |  |  |  |  437|  59.3M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  59.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  59.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  59.3M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  59.3M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 12.0M, False: 47.2M]
  |  |  |  |  ------------------
  |  |  |  |  438|  59.3M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  12.0M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  12.0M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  12.0M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  12.0M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  12.0M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  12.0M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  12.0M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  12.0M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  12.0M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  12.0M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  12.0M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  12.0M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  12.0M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  12.0M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  12.0M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  12.0M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  12.0M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 11.7M, False: 318k]
  |  |  |  |  ------------------
  |  |  |  |  439|  11.7M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  11.7M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  11.7M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  11.7M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  11.7M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  11.7M|{ \
  |  |  |  |  |  |  140|  11.7M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  11.7M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  11.7M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  11.7M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  11.7M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  11.7M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.70M, False: 9.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.70M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.70M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.70M|{ \
  |  |  |  |  |  |  |  |   57|  2.70M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 594k, False: 2.10M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   594k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   594k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   594k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  2.10M|    } else { \
  |  |  |  |  |  |  |  |   62|  2.10M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  2.10M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  2.10M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  2.10M|    } \
  |  |  |  |  |  |  |  |   66|  2.70M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.70M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.70M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.70M|{ \
  |  |  |  |  |  |  |  |  128|  4.37M|    do { \
  |  |  |  |  |  |  |  |  129|  4.37M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 544k, False: 3.83M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   544k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   544k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   544k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   544k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   544k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   544k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   544k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   544k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 530k, False: 14.2k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   530k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 527k, False: 2.31k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   527k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   527k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   527k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   527k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.31k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.31k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.31k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.31k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   530k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  14.2k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  14.2k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  14.2k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  14.2k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   544k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   544k|        } \
  |  |  |  |  |  |  |  |  132|  4.37M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.37M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.37M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.37M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.67M, False: 2.70M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.70M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  9.05M|    } else {  \
  |  |  |  |  |  |  149|  9.05M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  9.05M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.82M, False: 6.23M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.82M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.82M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.82M|{ \
  |  |  |  |  |  |  |  |   45|  2.82M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 456k, False: 2.36M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   456k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   456k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.36M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.36M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.36M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.36M|    } \
  |  |  |  |  |  |  |  |   52|  2.82M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.82M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.82M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.82M|{ \
  |  |  |  |  |  |  |  |  128|  3.03M|    do { \
  |  |  |  |  |  |  |  |  129|  3.03M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 385k, False: 2.64M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   385k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   385k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   385k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   385k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   385k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   385k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   385k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   385k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 380k, False: 5.45k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   380k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 377k, False: 2.69k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   377k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   377k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   377k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   377k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.69k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.69k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.69k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.69k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   380k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.45k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.45k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.45k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.45k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   385k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   385k|        } \
  |  |  |  |  |  |  |  |  132|  3.03M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.03M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.03M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.03M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 205k, False: 2.82M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.82M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  6.23M|        } else { \
  |  |  |  |  |  |  154|  6.23M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  6.23M|        } \
  |  |  |  |  |  |  156|  9.05M|    } \
  |  |  |  |  |  |  157|  11.7M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  11.7M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 5.75M, False: 6.00M]
  |  |  |  |  ------------------
  |  |  |  |  443|  5.75M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  5.75M|                                flags, \
  |  |  |  |  445|  5.75M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  5.75M|                                ci); \
  |  |  |  |  447|  5.75M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  5.75M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  5.75M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  5.75M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  5.75M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  5.75M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  5.75M|{ \
  |  |  |  |  |  |  140|  5.75M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  5.75M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  5.75M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  5.75M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  5.75M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  5.75M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.34M, False: 4.40M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.34M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.34M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.34M|{ \
  |  |  |  |  |  |  |  |   57|  1.34M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 301k, False: 1.04M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   301k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   301k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   301k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.04M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.04M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.04M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.04M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.04M|    } \
  |  |  |  |  |  |  |  |   66|  1.34M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.34M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.34M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.34M|{ \
  |  |  |  |  |  |  |  |  128|  2.15M|    do { \
  |  |  |  |  |  |  |  |  129|  2.15M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 264k, False: 1.89M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   264k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   264k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   264k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   264k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   264k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   264k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   264k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   264k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 259k, False: 4.77k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   259k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 258k, False: 1.70k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   258k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   258k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   258k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   258k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.70k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.70k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.70k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.70k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   259k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.77k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.77k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.77k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.77k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   264k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   264k|        } \
  |  |  |  |  |  |  |  |  132|  2.15M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.15M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.15M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.15M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 805k, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.34M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  4.40M|    } else {  \
  |  |  |  |  |  |  149|  4.40M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  4.40M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.46M, False: 2.93M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.46M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.46M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.46M|{ \
  |  |  |  |  |  |  |  |   45|  1.46M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 246k, False: 1.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   246k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   246k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.21M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.21M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.21M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.21M|    } \
  |  |  |  |  |  |  |  |   52|  1.46M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.46M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.46M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.46M|{ \
  |  |  |  |  |  |  |  |  128|  1.56M|    do { \
  |  |  |  |  |  |  |  |  129|  1.56M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 198k, False: 1.36M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   198k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   198k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   198k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   198k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   198k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   198k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   198k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   198k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 194k, False: 3.61k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   194k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 193k, False: 993]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   193k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   193k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   193k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   193k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    993|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    993|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    993|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    993|            } \
  |  |  |  |  |  |  |  |  |  |  118|   194k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.61k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.61k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.61k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.61k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   198k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   198k|        } \
  |  |  |  |  |  |  |  |  132|  1.56M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.56M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.56M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.56M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 106k, False: 1.46M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.46M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.93M|        } else { \
  |  |  |  |  |  |  154|  2.93M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.93M|        } \
  |  |  |  |  |  |  156|  4.40M|    } \
  |  |  |  |  |  |  157|  5.75M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  5.75M|            v = v ^ spb; \
  |  |  |  |  452|  5.75M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 2.84M, False: 2.90M]
  |  |  |  |  ------------------
  |  |  |  |  453|  5.75M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  5.75M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  5.75M|{ \
  |  |  |  |  |  |  323|  5.75M|    /* east */ \
  |  |  |  |  |  |  324|  5.75M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.75M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  5.75M| \
  |  |  |  |  |  |  326|  5.75M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  5.75M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  5.75M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  5.75M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  5.75M| \
  |  |  |  |  |  |  329|  5.75M|    /* west */ \
  |  |  |  |  |  |  330|  5.75M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  5.75M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  5.75M| \
  |  |  |  |  |  |  332|  5.75M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  5.75M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  5.75M| \
  |  |  |  |  |  |  340|  5.75M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  5.75M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  5.75M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  5.75M|        } \
  |  |  |  |  455|  11.7M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.7M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.7M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  11.7M|    } \
  |  |  |  |  457|  59.3M|}
  |  |  ------------------
  |  |  661|  59.3M|                                flags, flagsp, flags_stride, data, \
  |  |  662|  59.3M|                                l_w, 0, mqc, curctx, v, a, c, ct, oneplushalf, vsc); \
  |  |  663|  59.3M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  59.3M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  59.3M|{ \
  |  |  |  |  437|  59.3M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  59.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  59.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  59.3M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  59.3M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 12.1M, False: 47.1M]
  |  |  |  |  ------------------
  |  |  |  |  438|  59.3M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  12.1M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  12.1M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  12.1M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  12.1M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  12.1M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  12.1M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  12.1M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  12.1M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  12.1M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  12.1M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  12.1M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  12.1M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  12.1M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  12.1M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  12.1M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  12.1M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  12.1M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 11.8M, False: 307k]
  |  |  |  |  ------------------
  |  |  |  |  439|  11.8M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  11.8M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  11.8M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  11.8M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  11.8M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  11.8M|{ \
  |  |  |  |  |  |  140|  11.8M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  11.8M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  11.8M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  11.8M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  11.8M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  11.8M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.72M, False: 9.16M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.72M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.72M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.72M|{ \
  |  |  |  |  |  |  |  |   57|  2.72M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 587k, False: 2.13M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   587k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   587k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   587k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  2.13M|    } else { \
  |  |  |  |  |  |  |  |   62|  2.13M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  2.13M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  2.13M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  2.13M|    } \
  |  |  |  |  |  |  |  |   66|  2.72M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.72M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.72M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.72M|{ \
  |  |  |  |  |  |  |  |  128|  4.39M|    do { \
  |  |  |  |  |  |  |  |  129|  4.39M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 542k, False: 3.85M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   542k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   542k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   542k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   542k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   542k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   542k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   542k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   542k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 532k, False: 9.99k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   532k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 527k, False: 4.44k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   527k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   527k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   527k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   527k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.44k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.44k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.44k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.44k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   532k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  9.99k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  9.99k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  9.99k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  9.99k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   542k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   542k|        } \
  |  |  |  |  |  |  |  |  132|  4.39M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.39M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.39M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.39M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.66M, False: 2.72M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.72M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  9.16M|    } else {  \
  |  |  |  |  |  |  149|  9.16M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  9.16M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.84M, False: 6.31M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.84M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.84M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.84M|{ \
  |  |  |  |  |  |  |  |   45|  2.84M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 468k, False: 2.37M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   468k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   468k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.37M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.37M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.37M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.37M|    } \
  |  |  |  |  |  |  |  |   52|  2.84M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.84M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.84M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.84M|{ \
  |  |  |  |  |  |  |  |  128|  3.05M|    do { \
  |  |  |  |  |  |  |  |  129|  3.05M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 383k, False: 2.67M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   383k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   383k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   383k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   383k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   383k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   383k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   383k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   383k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 377k, False: 5.43k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   377k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 375k, False: 2.55k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   375k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   375k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   375k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   375k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.55k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.55k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.55k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.55k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   377k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.43k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.43k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.43k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.43k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   383k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   383k|        } \
  |  |  |  |  |  |  |  |  132|  3.05M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.05M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.05M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.05M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 208k, False: 2.84M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.84M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  6.31M|        } else { \
  |  |  |  |  |  |  154|  6.31M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  6.31M|        } \
  |  |  |  |  |  |  156|  9.16M|    } \
  |  |  |  |  |  |  157|  11.8M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  11.8M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 5.79M, False: 6.08M]
  |  |  |  |  ------------------
  |  |  |  |  443|  5.79M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  5.79M|                                flags, \
  |  |  |  |  445|  5.79M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  5.79M|                                ci); \
  |  |  |  |  447|  5.79M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  5.79M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  5.79M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  5.79M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  5.79M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  5.79M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  5.79M|{ \
  |  |  |  |  |  |  140|  5.79M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  5.79M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  5.79M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  5.79M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  5.79M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  5.79M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.35M, False: 4.44M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.35M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.35M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.35M|{ \
  |  |  |  |  |  |  |  |   57|  1.35M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 298k, False: 1.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   298k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   298k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   298k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.05M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.05M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.05M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.05M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.05M|    } \
  |  |  |  |  |  |  |  |   66|  1.35M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.35M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.35M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.35M|{ \
  |  |  |  |  |  |  |  |  128|  2.17M|    do { \
  |  |  |  |  |  |  |  |  129|  2.17M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 273k, False: 1.90M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   273k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   273k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   273k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   273k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   273k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   273k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   273k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   273k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 267k, False: 5.93k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   267k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 265k, False: 1.92k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   265k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   265k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   265k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   265k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.92k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.92k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.92k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.92k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   267k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.93k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.93k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.93k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.93k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   273k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   273k|        } \
  |  |  |  |  |  |  |  |  132|  2.17M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.17M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.17M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.17M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 826k, False: 1.35M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.35M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  4.44M|    } else {  \
  |  |  |  |  |  |  149|  4.44M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  4.44M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.44M, False: 3.00M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.44M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.44M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.44M|{ \
  |  |  |  |  |  |  |  |   45|  1.44M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 235k, False: 1.20M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   235k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   235k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.20M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.20M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.20M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.20M|    } \
  |  |  |  |  |  |  |  |   52|  1.44M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.44M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.44M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.44M|{ \
  |  |  |  |  |  |  |  |  128|  1.54M|    do { \
  |  |  |  |  |  |  |  |  129|  1.54M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 186k, False: 1.35M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   186k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   186k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   186k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   186k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   186k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   186k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   186k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   186k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 184k, False: 2.35k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   184k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 182k, False: 1.17k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   182k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   182k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   182k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   182k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.17k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.17k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.17k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.17k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   184k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.35k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.35k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.35k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.35k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   186k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   186k|        } \
  |  |  |  |  |  |  |  |  132|  1.54M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.54M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.54M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.54M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 98.2k, False: 1.44M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.44M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  3.00M|        } else { \
  |  |  |  |  |  |  154|  3.00M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  3.00M|        } \
  |  |  |  |  |  |  156|  4.44M|    } \
  |  |  |  |  |  |  157|  5.79M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  5.79M|            v = v ^ spb; \
  |  |  |  |  452|  5.79M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 2.84M, False: 2.95M]
  |  |  |  |  ------------------
  |  |  |  |  453|  5.79M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  5.79M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  5.79M|{ \
  |  |  |  |  |  |  323|  5.79M|    /* east */ \
  |  |  |  |  |  |  324|  5.79M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.79M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  5.79M| \
  |  |  |  |  |  |  326|  5.79M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  5.79M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  5.79M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  5.79M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  5.79M| \
  |  |  |  |  |  |  329|  5.79M|    /* west */ \
  |  |  |  |  |  |  330|  5.79M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  5.79M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  5.79M| \
  |  |  |  |  |  |  332|  5.79M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  5.79M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  5.79M| \
  |  |  |  |  |  |  340|  5.79M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  5.79M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  5.79M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  5.79M|        } \
  |  |  |  |  455|  11.8M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.8M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.8M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  11.8M|    } \
  |  |  |  |  457|  59.3M|}
  |  |  ------------------
  |  |  664|  59.3M|                                flags, flagsp, flags_stride, data, \
  |  |  665|  59.3M|                                l_w, 1, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  666|  59.3M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  59.3M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  59.3M|{ \
  |  |  |  |  437|  59.3M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  59.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  59.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  59.3M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  59.3M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 12.2M, False: 47.0M]
  |  |  |  |  ------------------
  |  |  |  |  438|  59.3M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  12.2M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  12.2M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  12.2M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  12.2M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  12.2M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  12.2M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  12.2M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  12.2M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  12.2M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  12.2M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  12.2M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  12.2M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  12.2M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  12.2M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  12.2M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  12.2M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  12.2M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 11.7M, False: 459k]
  |  |  |  |  ------------------
  |  |  |  |  439|  11.7M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  11.7M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  11.7M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  11.7M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  11.7M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  11.7M|{ \
  |  |  |  |  |  |  140|  11.7M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  11.7M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  11.7M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  11.7M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  11.7M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  11.7M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.68M, False: 9.11M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.68M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.68M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.68M|{ \
  |  |  |  |  |  |  |  |   57|  2.68M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 575k, False: 2.10M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   575k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   575k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   575k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  2.10M|    } else { \
  |  |  |  |  |  |  |  |   62|  2.10M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  2.10M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  2.10M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  2.10M|    } \
  |  |  |  |  |  |  |  |   66|  2.68M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.68M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.68M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.68M|{ \
  |  |  |  |  |  |  |  |  128|  4.33M|    do { \
  |  |  |  |  |  |  |  |  129|  4.33M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 546k, False: 3.78M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   546k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   546k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   546k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   546k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   546k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   546k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   546k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   546k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 534k, False: 11.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   534k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 531k, False: 3.21k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   531k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   531k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   531k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   531k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.21k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.21k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.21k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.21k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   534k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  11.7k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  11.7k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  11.7k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  11.7k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   546k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   546k|        } \
  |  |  |  |  |  |  |  |  132|  4.33M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.33M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.33M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.33M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.65M, False: 2.68M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.68M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  9.11M|    } else {  \
  |  |  |  |  |  |  149|  9.11M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  9.11M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.80M, False: 6.30M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.80M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.80M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.80M|{ \
  |  |  |  |  |  |  |  |   45|  2.80M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 470k, False: 2.33M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   470k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   470k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.33M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.33M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.33M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.33M|    } \
  |  |  |  |  |  |  |  |   52|  2.80M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.80M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.80M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.80M|{ \
  |  |  |  |  |  |  |  |  128|  3.01M|    do { \
  |  |  |  |  |  |  |  |  129|  3.01M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 380k, False: 2.63M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   380k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   380k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   380k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   380k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   380k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   380k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   380k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   380k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 375k, False: 4.63k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   375k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 374k, False: 1.25k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   374k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   374k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   374k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   374k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.25k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.25k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.25k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.25k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   375k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.63k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.63k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.63k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.63k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   380k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   380k|        } \
  |  |  |  |  |  |  |  |  132|  3.01M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.01M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.01M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.01M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 207k, False: 2.80M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.80M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  6.30M|        } else { \
  |  |  |  |  |  |  154|  6.30M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  6.30M|        } \
  |  |  |  |  |  |  156|  9.11M|    } \
  |  |  |  |  |  |  157|  11.7M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  11.7M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 5.81M, False: 5.97M]
  |  |  |  |  ------------------
  |  |  |  |  443|  5.81M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  5.81M|                                flags, \
  |  |  |  |  445|  5.81M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  5.81M|                                ci); \
  |  |  |  |  447|  5.81M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  5.81M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  5.81M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  5.81M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  5.81M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  5.81M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  5.81M|{ \
  |  |  |  |  |  |  140|  5.81M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  5.81M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  5.81M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  5.81M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  5.81M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  5.81M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.36M, False: 4.45M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.36M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.36M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.36M|{ \
  |  |  |  |  |  |  |  |   57|  1.36M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 307k, False: 1.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   307k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   307k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   307k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.05M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.05M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.05M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.05M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.05M|    } \
  |  |  |  |  |  |  |  |   66|  1.36M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.36M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.36M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.36M|{ \
  |  |  |  |  |  |  |  |  128|  2.21M|    do { \
  |  |  |  |  |  |  |  |  129|  2.21M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 276k, False: 1.93M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   276k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   276k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   276k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   276k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   276k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   276k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   276k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   276k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 273k, False: 3.44k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   273k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 272k, False: 1.14k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   272k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   272k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   272k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   272k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.14k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.14k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.14k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.14k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   273k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.44k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.44k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.44k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.44k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   276k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   276k|        } \
  |  |  |  |  |  |  |  |  132|  2.21M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.21M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.21M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.21M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 851k, False: 1.36M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.36M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  4.45M|    } else {  \
  |  |  |  |  |  |  149|  4.45M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  4.45M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.45M, False: 3.00M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.45M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.45M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.45M|{ \
  |  |  |  |  |  |  |  |   45|  1.45M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 235k, False: 1.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   235k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   235k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.21M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.21M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.21M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.21M|    } \
  |  |  |  |  |  |  |  |   52|  1.45M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.45M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.45M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.45M|{ \
  |  |  |  |  |  |  |  |  128|  1.55M|    do { \
  |  |  |  |  |  |  |  |  129|  1.55M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 192k, False: 1.36M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   192k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   192k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   192k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   192k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   192k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   192k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   192k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   192k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 188k, False: 3.99k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   188k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 187k, False: 1.73k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   187k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   187k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   187k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   187k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.73k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.73k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.73k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.73k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   188k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.99k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.99k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.99k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.99k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   192k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   192k|        } \
  |  |  |  |  |  |  |  |  132|  1.55M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.55M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.55M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.55M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 102k, False: 1.45M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.45M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  3.00M|        } else { \
  |  |  |  |  |  |  154|  3.00M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  3.00M|        } \
  |  |  |  |  |  |  156|  4.45M|    } \
  |  |  |  |  |  |  157|  5.81M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  5.81M|            v = v ^ spb; \
  |  |  |  |  452|  5.81M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 2.90M, False: 2.91M]
  |  |  |  |  ------------------
  |  |  |  |  453|  5.81M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  5.81M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  5.81M|{ \
  |  |  |  |  |  |  323|  5.81M|    /* east */ \
  |  |  |  |  |  |  324|  5.81M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.81M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  5.81M| \
  |  |  |  |  |  |  326|  5.81M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  5.81M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  5.81M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  5.81M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  5.81M| \
  |  |  |  |  |  |  329|  5.81M|    /* west */ \
  |  |  |  |  |  |  330|  5.81M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  5.81M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  5.81M| \
  |  |  |  |  |  |  332|  5.81M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  5.81M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  5.81M| \
  |  |  |  |  |  |  340|  5.81M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  5.81M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  5.81M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  5.81M|        } \
  |  |  |  |  455|  11.7M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.7M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.7M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  11.7M|    } \
  |  |  |  |  457|  59.3M|}
  |  |  ------------------
  |  |  667|  59.3M|                                flags, flagsp, flags_stride, data, \
  |  |  668|  59.3M|                                l_w, 2, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  669|  59.3M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  59.3M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  59.3M|{ \
  |  |  |  |  437|  59.3M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  59.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  59.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  59.3M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  59.3M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 12.6M, False: 46.6M]
  |  |  |  |  ------------------
  |  |  |  |  438|  59.3M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  12.6M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  12.6M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  12.6M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  12.6M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  12.6M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  12.6M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  12.6M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  12.6M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  12.6M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  12.6M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  12.6M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  12.6M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  12.6M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  12.6M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  12.6M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  12.6M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  12.6M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 11.7M, False: 920k]
  |  |  |  |  ------------------
  |  |  |  |  439|  11.7M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  11.7M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  11.7M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  11.7M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  11.7M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  11.7M|{ \
  |  |  |  |  |  |  140|  11.7M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  11.7M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  11.7M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  11.7M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  11.7M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  11.7M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.65M, False: 9.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.65M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.65M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.65M|{ \
  |  |  |  |  |  |  |  |   57|  2.65M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 570k, False: 2.08M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   570k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   570k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   570k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  2.08M|    } else { \
  |  |  |  |  |  |  |  |   62|  2.08M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  2.08M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  2.08M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  2.08M|    } \
  |  |  |  |  |  |  |  |   66|  2.65M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.65M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.65M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.65M|{ \
  |  |  |  |  |  |  |  |  128|  4.29M|    do { \
  |  |  |  |  |  |  |  |  129|  4.29M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 541k, False: 3.75M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   541k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   541k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   541k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   541k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   541k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   541k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   541k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   541k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 535k, False: 6.63k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   535k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 531k, False: 3.43k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   531k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   531k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   531k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   531k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.43k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.43k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.43k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.43k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   535k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  6.63k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  6.63k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  6.63k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  6.63k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   541k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   541k|        } \
  |  |  |  |  |  |  |  |  132|  4.29M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.29M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.29M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.29M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.64M, False: 2.65M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.65M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  9.09M|    } else {  \
  |  |  |  |  |  |  149|  9.09M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  9.09M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.79M, False: 6.30M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.79M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.79M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.79M|{ \
  |  |  |  |  |  |  |  |   45|  2.79M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 453k, False: 2.33M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   453k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   453k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.33M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.33M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.33M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.33M|    } \
  |  |  |  |  |  |  |  |   52|  2.79M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.79M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.79M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.79M|{ \
  |  |  |  |  |  |  |  |  128|  2.99M|    do { \
  |  |  |  |  |  |  |  |  129|  2.99M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 370k, False: 2.62M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   370k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   370k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   370k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   370k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   370k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   370k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   370k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   370k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 364k, False: 5.62k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   364k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 362k, False: 2.33k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   362k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   362k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   362k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   362k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.33k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.33k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.33k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.33k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   364k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.62k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.62k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.62k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.62k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   370k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   370k|        } \
  |  |  |  |  |  |  |  |  132|  2.99M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.99M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.99M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.99M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 203k, False: 2.79M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.79M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  6.30M|        } else { \
  |  |  |  |  |  |  154|  6.30M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  6.30M|        } \
  |  |  |  |  |  |  156|  9.09M|    } \
  |  |  |  |  |  |  157|  11.7M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  11.7M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 5.84M, False: 5.90M]
  |  |  |  |  ------------------
  |  |  |  |  443|  5.84M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  5.84M|                                flags, \
  |  |  |  |  445|  5.84M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  5.84M|                                ci); \
  |  |  |  |  447|  5.84M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  5.84M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  5.84M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  5.84M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  5.84M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  5.84M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  5.84M|{ \
  |  |  |  |  |  |  140|  5.84M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  5.84M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  5.84M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  5.84M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  5.84M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  5.84M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.34M, False: 4.50M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.34M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.34M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.34M|{ \
  |  |  |  |  |  |  |  |   57|  1.34M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 302k, False: 1.03M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   302k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   302k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   302k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.03M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.03M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.03M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.03M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.03M|    } \
  |  |  |  |  |  |  |  |   66|  1.34M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.34M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.34M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.34M|{ \
  |  |  |  |  |  |  |  |  128|  2.17M|    do { \
  |  |  |  |  |  |  |  |  129|  2.17M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 275k, False: 1.90M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   275k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   275k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   275k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   275k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   275k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   275k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   275k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   275k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 270k, False: 5.04k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   270k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 268k, False: 1.52k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   268k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   268k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   268k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   268k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.52k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.52k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.52k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.52k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   270k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.04k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.04k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.04k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.04k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   275k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   275k|        } \
  |  |  |  |  |  |  |  |  132|  2.17M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.17M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.17M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.17M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 835k, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.34M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  4.50M|    } else {  \
  |  |  |  |  |  |  149|  4.50M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  4.50M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.45M, False: 3.05M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.45M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.45M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.45M|{ \
  |  |  |  |  |  |  |  |   45|  1.45M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 242k, False: 1.20M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   242k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   242k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.20M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.20M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.20M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.20M|    } \
  |  |  |  |  |  |  |  |   52|  1.45M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.45M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.45M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.45M|{ \
  |  |  |  |  |  |  |  |  128|  1.55M|    do { \
  |  |  |  |  |  |  |  |  129|  1.55M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 199k, False: 1.35M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   199k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   199k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   199k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   199k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   199k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   199k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   199k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   199k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 196k, False: 3.02k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   196k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 195k, False: 1.15k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   195k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   195k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   195k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   195k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.15k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.15k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.15k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.15k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   196k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.02k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.02k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.02k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.02k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   199k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   199k|        } \
  |  |  |  |  |  |  |  |  132|  1.55M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.55M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.55M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.55M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 104k, False: 1.45M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.45M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  3.05M|        } else { \
  |  |  |  |  |  |  154|  3.05M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  3.05M|        } \
  |  |  |  |  |  |  156|  4.50M|    } \
  |  |  |  |  |  |  157|  5.84M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  5.84M|            v = v ^ spb; \
  |  |  |  |  452|  5.84M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 2.89M, False: 2.94M]
  |  |  |  |  ------------------
  |  |  |  |  453|  5.84M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  5.84M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  5.84M|{ \
  |  |  |  |  |  |  323|  5.84M|    /* east */ \
  |  |  |  |  |  |  324|  5.84M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.84M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  5.84M| \
  |  |  |  |  |  |  326|  5.84M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  5.84M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  5.84M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  5.84M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  5.84M| \
  |  |  |  |  |  |  329|  5.84M|    /* west */ \
  |  |  |  |  |  |  330|  5.84M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  5.84M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  5.84M| \
  |  |  |  |  |  |  332|  5.84M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  5.84M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  5.84M| \
  |  |  |  |  |  |  340|  5.84M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  5.84M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  5.84M|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|  5.84M|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  5.84M|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  5.84M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  5.84M|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  5.84M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  5.84M|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  5.84M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|  5.84M|    } \
  |  |  |  |  |  |  347|  5.84M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  5.84M|        } \
  |  |  |  |  455|  11.7M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.7M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.7M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  11.7M|    } \
  |  |  |  |  457|  59.3M|}
  |  |  ------------------
  |  |  670|  59.3M|                                flags, flagsp, flags_stride, data, \
  |  |  671|  59.3M|                                l_w, 3, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  672|  59.3M|                            *flagsp = flags; \
  |  |  673|  59.3M|                        } \
  |  |  674|  87.0M|                } \
  |  |  675|  1.36M|        } \
  |  |  676|  85.0k|        UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|  85.0k|        mqc->curctx = curctx; \
  |  |  |  |  167|  85.0k|        mqc->c = c; \
  |  |  |  |  168|  85.0k|        mqc->a = a; \
  |  |  |  |  169|  85.0k|        mqc->ct = ct;
  |  |  ------------------
  |  |  677|  85.0k|        if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (677:13): [True: 0, False: 85.0k]
  |  |  ------------------
  |  |  678|      0|            for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (678:25): [True: 0, False: 0]
  |  |  ------------------
  |  |  679|      0|                for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (679:29): [True: 0, False: 0]
  |  |  ------------------
  |  |  680|      0|                        opj_t1_dec_sigpass_step_mqc(t1, flagsp, \
  |  |  681|      0|                            data + j * l_w, oneplushalf, j, flags_stride, vsc); \
  |  |  682|      0|                } \
  |  |  683|      0|            } \
  |  |  684|      0|        } \
  |  |  685|  85.0k|}
  ------------------
  699|  85.0k|}
t1.c:opj_t1_getctxno_zc:
  252|   232M|{
  253|   232M|    return mqc->lut_ctxno_zc_orient[(f & T1_SIGMA_NEIGHBOURS)];
  ------------------
  |  |  158|   232M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  149|   232M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|   232M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  150|   232M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|   232M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  151|   232M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   232M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  152|   232M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|   232M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  154|   232M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   232M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  155|   232M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|   232M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  156|   232M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   232M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  157|   232M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   232M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|   232M|}
t1.c:opj_t1_getctxtno_sc_or_spb_index:
  260|   108M|{
  261|       |    /*
  262|       |      0 pfX T1_CHI_THIS           T1_LUT_SGN_W
  263|       |      1 tfX T1_SIGMA_1            T1_LUT_SIG_N
  264|       |      2 nfX T1_CHI_THIS           T1_LUT_SGN_E
  265|       |      3 tfX T1_SIGMA_3            T1_LUT_SIG_W
  266|       |      4  fX T1_CHI_(THIS - 1)     T1_LUT_SGN_N
  267|       |      5 tfX T1_SIGMA_5            T1_LUT_SIG_E
  268|       |      6  fX T1_CHI_(THIS + 1)     T1_LUT_SGN_S
  269|       |      7 tfX T1_SIGMA_7            T1_LUT_SIG_S
  270|       |    */
  271|       |
  272|   108M|    OPJ_UINT32 lu = (fX >> (ci * 3U)) & (T1_SIGMA_1 | T1_SIGMA_3 | T1_SIGMA_5 |
  ------------------
  |  |   92|   108M|#define T1_SIGMA_1  (1U << 1)
  ------------------
                  OPJ_UINT32 lu = (fX >> (ci * 3U)) & (T1_SIGMA_1 | T1_SIGMA_3 | T1_SIGMA_5 |
  ------------------
  |  |   94|   108M|#define T1_SIGMA_3  (1U << 3)
  ------------------
                  OPJ_UINT32 lu = (fX >> (ci * 3U)) & (T1_SIGMA_1 | T1_SIGMA_3 | T1_SIGMA_5 |
  ------------------
  |  |   96|   108M|#define T1_SIGMA_5  (1U << 5)
  ------------------
  273|   108M|                                         T1_SIGMA_7);
  ------------------
  |  |   98|   108M|#define T1_SIGMA_7  (1U << 7)
  ------------------
  274|       |
  275|   108M|    lu |= (pfX >> (T1_CHI_THIS_I      + (ci * 3U))) & (1U << 0);
  ------------------
  |  |  161|   108M|#define T1_CHI_THIS_I T1_CHI_1_I
  |  |  ------------------
  |  |  |  |  113|   108M|#define T1_CHI_1_I  19
  |  |  ------------------
  ------------------
  276|   108M|    lu |= (nfX >> (T1_CHI_THIS_I - 2U + (ci * 3U))) & (1U << 2);
  ------------------
  |  |  161|   108M|#define T1_CHI_THIS_I T1_CHI_1_I
  |  |  ------------------
  |  |  |  |  113|   108M|#define T1_CHI_1_I  19
  |  |  ------------------
  ------------------
  277|   108M|    if (ci == 0U) {
  ------------------
  |  Branch (277:9): [True: 27.2M, False: 80.8M]
  ------------------
  278|  27.2M|        lu |= (fX >> (T1_CHI_0_I - 4U)) & (1U << 4);
  ------------------
  |  |  111|  27.2M|#define T1_CHI_0_I  18
  ------------------
  279|  80.8M|    } else {
  280|  80.8M|        lu |= (fX >> (T1_CHI_1_I - 4U + ((ci - 1U) * 3U))) & (1U << 4);
  ------------------
  |  |  113|  80.8M|#define T1_CHI_1_I  19
  ------------------
  281|  80.8M|    }
  282|   108M|    lu |= (fX >> (T1_CHI_2_I - 6U + (ci * 3U))) & (1U << 6);
  ------------------
  |  |  117|   108M|#define T1_CHI_2_I  22
  ------------------
  283|   108M|    return lu;
  284|   108M|}
t1.c:opj_t1_getctxno_sc:
  287|   108M|{
  288|   108M|    return lut_ctxno_sc[lu];
  289|   108M|}
t1.c:opj_t1_getspb:
  299|   108M|{
  300|   108M|    return lut_spb[lu];
  301|   108M|}
t1.c:opj_t1_dec_sigpass_step_mqc:
  467|  4.22M|{
  468|  4.22M|    OPJ_UINT32 v;
  469|       |
  470|  4.22M|    opj_mqc_t *mqc = &(t1->mqc);       /* MQC component */
  471|  4.22M|    opj_t1_dec_sigpass_step_mqc_macro(*flagsp, flagsp, flags_stride, datap,
  ------------------
  |  |  435|  4.22M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  436|  4.22M|{ \
  |  |  437|  4.22M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  ------------------
  |  |  |  |  153|  4.22M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  4.22M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  ------------------
  |  |  |  |  163|  4.22M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|  4.22M|#define T1_PI_0     (1U << 21)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (437:9): [True: 2.43M, False: 1.78M]
  |  |  ------------------
  |  |  438|  4.22M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  ------------------
  |  |  |  |  158|  2.43M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|  2.43M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  2.43M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  150|  2.43M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  2.43M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.43M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  2.43M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.43M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  2.43M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  2.43M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  2.43M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  155|  2.43M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|  2.43M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|  2.43M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|  2.43M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  157|  2.43M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|  2.43M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (438:9): [True: 614k, False: 1.82M]
  |  |  ------------------
  |  |  439|   614k|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  440|   614k|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  ------------------
  |  |  |  |   62|   614k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  |  441|   614k|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   614k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   614k|{ \
  |  |  |  |  140|   614k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   614k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   614k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   614k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   614k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   614k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 154k, False: 460k]
  |  |  |  |  ------------------
  |  |  |  |  146|   154k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   154k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   154k|{ \
  |  |  |  |  |  |   57|   154k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 34.0k, False: 120k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  34.0k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  34.0k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  34.0k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   120k|    } else { \
  |  |  |  |  |  |   62|   120k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   120k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   120k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   120k|    } \
  |  |  |  |  |  |   66|   154k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   154k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   154k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   154k|{ \
  |  |  |  |  |  |  128|   236k|    do { \
  |  |  |  |  |  |  129|   236k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 29.8k, False: 206k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  29.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  29.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  29.8k|{ \
  |  |  |  |  |  |  |  |  104|  29.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  29.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  29.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  29.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  29.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 23.7k, False: 6.15k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  23.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 21.7k, False: 1.95k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  21.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  21.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  21.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  21.7k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.95k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.95k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.95k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.95k|            } \
  |  |  |  |  |  |  |  |  118|  23.7k|        } else { \
  |  |  |  |  |  |  |  |  119|  6.15k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  6.15k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  6.15k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  6.15k|        } \
  |  |  |  |  |  |  |  |  123|  29.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  29.8k|        } \
  |  |  |  |  |  |  132|   236k|        a <<= 1; \
  |  |  |  |  |  |  133|   236k|        c <<= 1; \
  |  |  |  |  |  |  134|   236k|        ct--; \
  |  |  |  |  |  |  135|   236k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 81.6k, False: 154k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   154k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   460k|    } else {  \
  |  |  |  |  149|   460k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   460k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 164k, False: 295k]
  |  |  |  |  ------------------
  |  |  |  |  151|   164k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   164k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   164k|{ \
  |  |  |  |  |  |   45|   164k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 29.9k, False: 134k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  29.9k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  29.9k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   134k|    } else { \
  |  |  |  |  |  |   49|   134k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   134k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   134k|    } \
  |  |  |  |  |  |   52|   164k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   164k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   164k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   164k|{ \
  |  |  |  |  |  |  128|   177k|    do { \
  |  |  |  |  |  |  129|   177k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 22.4k, False: 154k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  22.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  22.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  22.4k|{ \
  |  |  |  |  |  |  |  |  104|  22.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  22.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  22.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  22.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  22.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 18.9k, False: 3.50k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  18.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 17.2k, False: 1.69k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  17.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  17.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  17.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  17.2k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.69k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.69k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.69k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.69k|            } \
  |  |  |  |  |  |  |  |  118|  18.9k|        } else { \
  |  |  |  |  |  |  |  |  119|  3.50k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  3.50k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  3.50k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  3.50k|        } \
  |  |  |  |  |  |  |  |  123|  22.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  22.4k|        } \
  |  |  |  |  |  |  132|   177k|        a <<= 1; \
  |  |  |  |  |  |  133|   177k|        c <<= 1; \
  |  |  |  |  |  |  134|   177k|        ct--; \
  |  |  |  |  |  |  135|   177k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 12.1k, False: 164k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   164k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   295k|        } else { \
  |  |  |  |  154|   295k|            d = (*curctx)->mps; \
  |  |  |  |  155|   295k|        } \
  |  |  |  |  156|   460k|    } \
  |  |  |  |  157|   614k|}
  |  |  ------------------
  |  |  442|   614k|        if (v) { \
  |  |  ------------------
  |  |  |  Branch (442:13): [True: 274k, False: 340k]
  |  |  ------------------
  |  |  443|   274k|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  444|   274k|                                flags, \
  |  |  445|   274k|                                flagsp[-1], flagsp[1], \
  |  |  446|   274k|                                ci); \
  |  |  447|   274k|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  448|   274k|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  449|   274k|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  ------------------
  |  |  |  |   62|   274k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  |  450|   274k|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   274k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   274k|{ \
  |  |  |  |  140|   274k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   274k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   274k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   274k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   274k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   274k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 78.4k, False: 195k]
  |  |  |  |  ------------------
  |  |  |  |  146|  78.4k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  78.4k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|  78.4k|{ \
  |  |  |  |  |  |   57|  78.4k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 18.7k, False: 59.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  18.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  18.7k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  18.7k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|  59.7k|    } else { \
  |  |  |  |  |  |   62|  59.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|  59.7k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|  59.7k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|  59.7k|    } \
  |  |  |  |  |  |   66|  78.4k|}
  |  |  |  |  ------------------
  |  |  |  |  147|  78.4k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|  78.4k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|  78.4k|{ \
  |  |  |  |  |  |  128|   115k|    do { \
  |  |  |  |  |  |  129|   115k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 13.7k, False: 101k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  13.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  13.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  13.7k|{ \
  |  |  |  |  |  |  |  |  104|  13.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  13.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  13.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  13.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  13.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 11.5k, False: 2.29k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  11.5k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 10.6k, False: 898]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  10.6k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  10.6k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  10.6k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  10.6k|            } else { \
  |  |  |  |  |  |  |  |  114|    898|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|    898|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|    898|                ct = 7; \
  |  |  |  |  |  |  |  |  117|    898|            } \
  |  |  |  |  |  |  |  |  118|  11.5k|        } else { \
  |  |  |  |  |  |  |  |  119|  2.29k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  2.29k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  2.29k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  2.29k|        } \
  |  |  |  |  |  |  |  |  123|  13.7k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  13.7k|        } \
  |  |  |  |  |  |  132|   115k|        a <<= 1; \
  |  |  |  |  |  |  133|   115k|        c <<= 1; \
  |  |  |  |  |  |  134|   115k|        ct--; \
  |  |  |  |  |  |  135|   115k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 37.1k, False: 78.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  78.4k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   195k|    } else {  \
  |  |  |  |  149|   195k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   195k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 80.1k, False: 115k]
  |  |  |  |  ------------------
  |  |  |  |  151|  80.1k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  80.1k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|  80.1k|{ \
  |  |  |  |  |  |   45|  80.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 13.9k, False: 66.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  13.9k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  13.9k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|  66.2k|    } else { \
  |  |  |  |  |  |   49|  66.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|  66.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|  66.2k|    } \
  |  |  |  |  |  |   52|  80.1k|}
  |  |  |  |  ------------------
  |  |  |  |  152|  80.1k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|  80.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|  80.1k|{ \
  |  |  |  |  |  |  128|  86.5k|    do { \
  |  |  |  |  |  |  129|  86.5k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 11.5k, False: 74.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  11.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  11.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  11.5k|{ \
  |  |  |  |  |  |  |  |  104|  11.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  11.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  11.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  11.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  11.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 9.38k, False: 2.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  9.38k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 8.18k, False: 1.20k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  8.18k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  8.18k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  8.18k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  8.18k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.20k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.20k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.20k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.20k|            } \
  |  |  |  |  |  |  |  |  118|  9.38k|        } else { \
  |  |  |  |  |  |  |  |  119|  2.19k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  2.19k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  2.19k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  2.19k|        } \
  |  |  |  |  |  |  |  |  123|  11.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  11.5k|        } \
  |  |  |  |  |  |  132|  86.5k|        a <<= 1; \
  |  |  |  |  |  |  133|  86.5k|        c <<= 1; \
  |  |  |  |  |  |  134|  86.5k|        ct--; \
  |  |  |  |  |  |  135|  86.5k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 6.41k, False: 80.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  80.1k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   115k|        } else { \
  |  |  |  |  154|   115k|            d = (*curctx)->mps; \
  |  |  |  |  155|   115k|        } \
  |  |  |  |  156|   195k|    } \
  |  |  |  |  157|   274k|}
  |  |  ------------------
  |  |  451|   274k|            v = v ^ spb; \
  |  |  452|   274k|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  ------------------
  |  |  |  Branch (452:36): [True: 135k, False: 138k]
  |  |  ------------------
  |  |  453|   274k|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  ------------------
  |  |  |  |  321|   274k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  322|   274k|{ \
  |  |  |  |  323|   274k|    /* east */ \
  |  |  |  |  324|   274k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   274k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  ------------------
  |  |  |  |  325|   274k| \
  |  |  |  |  326|   274k|    /* mark target as significant */ \
  |  |  |  |  327|   274k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|   274k|#define T1_CHI_1_I  19
  |  |  |  |  ------------------
  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|   274k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  ------------------
  |  |  |  |  328|   274k| \
  |  |  |  |  329|   274k|    /* west */ \
  |  |  |  |  330|   274k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|   274k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  ------------------
  |  |  |  |  331|   274k| \
  |  |  |  |  332|   274k|    /* north-west, north, north-east */ \
  |  |  |  |  333|   274k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (333:9): [True: 132k, False: 141k]
  |  |  |  |  |  Branch (333:21): [True: 77.6k, False: 55.3k]
  |  |  |  |  ------------------
  |  |  |  |  334|  77.6k|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  335|  77.6k|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  77.6k|#define T1_CHI_5_I  31
  |  |  |  |  ------------------
  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|  77.6k|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  ------------------
  |  |  |  |  336|  77.6k|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  77.6k|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  ------------------
  |  |  |  |  337|  77.6k|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|  77.6k|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  ------------------
  |  |  |  |  338|  77.6k|    } \
  |  |  |  |  339|   274k| \
  |  |  |  |  340|   274k|    /* south-west, south, south-east */ \
  |  |  |  |  341|   274k|    if (ci == 3U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (341:9): [True: 0, False: 274k]
  |  |  |  |  ------------------
  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  ------------------
  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  ------------------
  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  ------------------
  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |  346|      0|    } \
  |  |  |  |  347|   274k|}
  |  |  ------------------
  |  |  454|   274k|        } \
  |  |  455|   614k|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  ------------------
  |  |  |  |  163|   614k|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|   614k|#define T1_PI_0     (1U << 21)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  456|   614k|    } \
  |  |  457|  4.22M|}
  ------------------
  472|  4.22M|                                      0, ci, mqc, mqc->curctx,
  473|  4.22M|                                      v, mqc->a, mqc->c, mqc->ct, oneplushalf, vsc);
  474|  4.22M|}
t1.c:opj_t1_dec_sigpass_mqc_64x64_novsc:
  690|  79.7k|{
  691|  79.7k|    opj_t1_dec_sigpass_mqc_internal(t1, bpno, OPJ_FALSE, 64, 64, 66);
  ------------------
  |  |  643|  79.7k|#define opj_t1_dec_sigpass_mqc_internal(t1, bpno, vsc, w, h, flags_stride) \
  |  |  644|  79.7k|{ \
  |  |  645|  79.7k|        OPJ_INT32 one, half, oneplushalf; \
  |  |  646|  79.7k|        OPJ_UINT32 i, j, k; \
  |  |  647|  79.7k|        register OPJ_INT32 *data = t1->data; \
  |  |  648|  79.7k|        register opj_flag_t *flagsp = &t1->flags[(flags_stride) + 1]; \
  |  |  649|  79.7k|        const OPJ_UINT32 l_w = w; \
  |  |  650|  79.7k|        opj_mqc_t* mqc = &(t1->mqc); \
  |  |  651|  79.7k|        DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|  79.7k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|  79.7k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|  79.7k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|  79.7k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  |  652|  79.7k|        register OPJ_UINT32 v; \
  |  |  653|  79.7k|        one = 1 << bpno; \
  |  |  654|  79.7k|        half = one >> 1; \
  |  |  655|  79.7k|        oneplushalf = one | half; \
  |  |  656|  1.35M|        for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (656:21): [True: 1.27M, False: 79.7k]
  |  |  ------------------
  |  |  657|  82.8M|                for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (657:29): [True: 81.6M, False: 1.27M]
  |  |  ------------------
  |  |  658|  81.6M|                        opj_flag_t flags = *flagsp; \
  |  |  659|  81.6M|                        if( flags != 0 ) { \
  |  |  ------------------
  |  |  |  Branch (659:29): [True: 60.9M, False: 20.6M]
  |  |  ------------------
  |  |  660|  60.9M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  60.9M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  60.9M|{ \
  |  |  |  |  437|  60.9M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  60.9M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  60.9M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  60.9M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  60.9M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 12.6M, False: 48.3M]
  |  |  |  |  ------------------
  |  |  |  |  438|  60.9M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  12.6M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  12.6M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  12.6M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  12.6M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  12.6M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  12.6M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  12.6M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  12.6M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  12.6M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  12.6M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  12.6M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  12.6M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  12.6M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  12.6M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  12.6M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  12.6M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  12.6M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 11.8M, False: 856k]
  |  |  |  |  ------------------
  |  |  |  |  439|  11.8M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  11.8M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  11.8M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  11.8M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  11.8M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  11.8M|{ \
  |  |  |  |  |  |  140|  11.8M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  11.8M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  11.8M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  11.8M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  11.8M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  11.8M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.86M, False: 8.95M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.86M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.86M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.86M|{ \
  |  |  |  |  |  |  |  |   57|  2.86M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 617k, False: 2.24M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   617k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   617k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   617k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  2.24M|    } else { \
  |  |  |  |  |  |  |  |   62|  2.24M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  2.24M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  2.24M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  2.24M|    } \
  |  |  |  |  |  |  |  |   66|  2.86M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.86M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.86M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.86M|{ \
  |  |  |  |  |  |  |  |  128|  4.59M|    do { \
  |  |  |  |  |  |  |  |  129|  4.59M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 571k, False: 4.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   571k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   571k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   571k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   571k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   571k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   571k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   571k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   571k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 519k, False: 52.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   519k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 516k, False: 2.30k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   516k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   516k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   516k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   516k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.30k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.30k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.30k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.30k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   519k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  52.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  52.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  52.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  52.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   571k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   571k|        } \
  |  |  |  |  |  |  |  |  132|  4.59M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.59M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.59M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.59M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.73M, False: 2.86M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.86M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  8.95M|    } else {  \
  |  |  |  |  |  |  149|  8.95M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  8.95M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.97M, False: 5.98M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.97M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.97M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.97M|{ \
  |  |  |  |  |  |  |  |   45|  2.97M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 492k, False: 2.47M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   492k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   492k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.47M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.47M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.47M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.47M|    } \
  |  |  |  |  |  |  |  |   52|  2.97M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.97M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.97M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.97M|{ \
  |  |  |  |  |  |  |  |  128|  3.19M|    do { \
  |  |  |  |  |  |  |  |  129|  3.19M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 401k, False: 2.79M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   401k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   401k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   401k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   401k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   401k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   401k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   401k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   401k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 367k, False: 33.1k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   367k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 366k, False: 1.78k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   366k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   366k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   366k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   366k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.78k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.78k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.78k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.78k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   367k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  33.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  33.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  33.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  33.1k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   401k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   401k|        } \
  |  |  |  |  |  |  |  |  132|  3.19M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.19M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.19M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.19M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 223k, False: 2.97M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.97M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.98M|        } else { \
  |  |  |  |  |  |  154|  5.98M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  5.98M|        } \
  |  |  |  |  |  |  156|  8.95M|    } \
  |  |  |  |  |  |  157|  11.8M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  11.8M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 5.81M, False: 6.00M]
  |  |  |  |  ------------------
  |  |  |  |  443|  5.81M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  5.81M|                                flags, \
  |  |  |  |  445|  5.81M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  5.81M|                                ci); \
  |  |  |  |  447|  5.81M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  5.81M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  5.81M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  5.81M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  5.81M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  5.81M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  5.81M|{ \
  |  |  |  |  |  |  140|  5.81M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  5.81M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  5.81M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  5.81M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  5.81M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  5.81M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.44M, False: 4.36M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.44M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.44M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.44M|{ \
  |  |  |  |  |  |  |  |   57|  1.44M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 320k, False: 1.12M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   320k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   320k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   320k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.12M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.12M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.12M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.12M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.12M|    } \
  |  |  |  |  |  |  |  |   66|  1.44M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.44M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.44M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.44M|{ \
  |  |  |  |  |  |  |  |  128|  2.31M|    do { \
  |  |  |  |  |  |  |  |  129|  2.31M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 294k, False: 2.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   294k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   294k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   294k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   294k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   294k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   294k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   294k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   294k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 270k, False: 23.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   270k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 268k, False: 1.48k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   268k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   268k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   268k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   268k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.48k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.48k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.48k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.48k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   270k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  23.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  23.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  23.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  23.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   294k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   294k|        } \
  |  |  |  |  |  |  |  |  132|  2.31M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.31M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.31M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.31M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 865k, False: 1.44M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.44M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  4.36M|    } else {  \
  |  |  |  |  |  |  149|  4.36M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  4.36M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.55M, False: 2.81M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.55M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.55M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.55M|{ \
  |  |  |  |  |  |  |  |   45|  1.55M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 267k, False: 1.28M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   267k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   267k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.28M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.28M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.28M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.28M|    } \
  |  |  |  |  |  |  |  |   52|  1.55M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.55M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.55M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.55M|{ \
  |  |  |  |  |  |  |  |  128|  1.66M|    do { \
  |  |  |  |  |  |  |  |  129|  1.66M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 210k, False: 1.45M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   210k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   210k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   210k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   210k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   210k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   210k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   210k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   210k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 193k, False: 17.3k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   193k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 192k, False: 1.02k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   192k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   192k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   192k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   192k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.02k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.02k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.02k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.02k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   193k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  17.3k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  17.3k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  17.3k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  17.3k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   210k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   210k|        } \
  |  |  |  |  |  |  |  |  132|  1.66M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.66M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.66M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.66M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 116k, False: 1.55M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.55M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.81M|        } else { \
  |  |  |  |  |  |  154|  2.81M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.81M|        } \
  |  |  |  |  |  |  156|  4.36M|    } \
  |  |  |  |  |  |  157|  5.81M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  5.81M|            v = v ^ spb; \
  |  |  |  |  452|  5.81M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 2.87M, False: 2.94M]
  |  |  |  |  ------------------
  |  |  |  |  453|  5.81M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  5.81M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  5.81M|{ \
  |  |  |  |  |  |  323|  5.81M|    /* east */ \
  |  |  |  |  |  |  324|  5.81M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.81M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  5.81M| \
  |  |  |  |  |  |  326|  5.81M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  5.81M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  5.81M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  5.81M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  5.81M| \
  |  |  |  |  |  |  329|  5.81M|    /* west */ \
  |  |  |  |  |  |  330|  5.81M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  5.81M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  5.81M| \
  |  |  |  |  |  |  332|  5.81M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  5.81M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|  5.81M|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|  5.81M|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  5.81M|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|  5.81M|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|  5.81M|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|  5.81M|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|  5.81M|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|  5.81M|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|  5.81M|    } \
  |  |  |  |  |  |  339|  5.81M| \
  |  |  |  |  |  |  340|  5.81M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  5.81M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  5.81M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  5.81M|        } \
  |  |  |  |  455|  11.8M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.8M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.8M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  11.8M|    } \
  |  |  |  |  457|  60.9M|}
  |  |  ------------------
  |  |  661|  60.9M|                                flags, flagsp, flags_stride, data, \
  |  |  662|  60.9M|                                l_w, 0, mqc, curctx, v, a, c, ct, oneplushalf, vsc); \
  |  |  663|  60.9M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  60.9M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  60.9M|{ \
  |  |  |  |  437|  60.9M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  60.9M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  60.9M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  60.9M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  60.9M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 12.8M, False: 48.1M]
  |  |  |  |  ------------------
  |  |  |  |  438|  60.9M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  12.8M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  12.8M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  12.8M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  12.8M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  12.8M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  12.8M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  12.8M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  12.8M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  12.8M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  12.8M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  12.8M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  12.8M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  12.8M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  12.8M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  12.8M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  12.8M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  12.8M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 12.0M, False: 805k]
  |  |  |  |  ------------------
  |  |  |  |  439|  12.0M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  12.0M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  12.0M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  12.0M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  12.0M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  12.0M|{ \
  |  |  |  |  |  |  140|  12.0M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  12.0M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  12.0M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  12.0M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  12.0M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  12.0M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.90M, False: 9.11M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.90M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.90M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.90M|{ \
  |  |  |  |  |  |  |  |   57|  2.90M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 627k, False: 2.27M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   627k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   627k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   627k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  2.27M|    } else { \
  |  |  |  |  |  |  |  |   62|  2.27M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  2.27M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  2.27M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  2.27M|    } \
  |  |  |  |  |  |  |  |   66|  2.90M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.90M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.90M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.90M|{ \
  |  |  |  |  |  |  |  |  128|  4.65M|    do { \
  |  |  |  |  |  |  |  |  129|  4.65M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 579k, False: 4.07M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   579k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   579k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   579k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   579k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   579k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   579k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   579k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   579k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 527k, False: 52.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   527k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 525k, False: 2.34k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   525k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   525k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   525k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   525k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.34k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.34k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.34k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.34k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   527k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  52.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  52.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  52.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  52.0k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   579k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   579k|        } \
  |  |  |  |  |  |  |  |  132|  4.65M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.65M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.65M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.65M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.75M, False: 2.90M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.90M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  9.11M|    } else {  \
  |  |  |  |  |  |  149|  9.11M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  9.11M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 3.02M, False: 6.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  3.02M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  3.02M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  3.02M|{ \
  |  |  |  |  |  |  |  |   45|  3.02M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 497k, False: 2.52M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   497k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   497k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.52M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.52M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.52M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.52M|    } \
  |  |  |  |  |  |  |  |   52|  3.02M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.02M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  3.02M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  3.02M|{ \
  |  |  |  |  |  |  |  |  128|  3.25M|    do { \
  |  |  |  |  |  |  |  |  129|  3.25M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 412k, False: 2.84M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   412k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   412k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   412k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   412k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   412k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   412k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   412k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   412k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 377k, False: 34.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   377k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 376k, False: 1.86k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   376k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   376k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   376k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   376k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.86k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.86k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.86k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.86k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   377k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  34.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  34.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  34.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  34.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   412k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   412k|        } \
  |  |  |  |  |  |  |  |  132|  3.25M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.25M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.25M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.25M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 229k, False: 3.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  3.02M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  6.09M|        } else { \
  |  |  |  |  |  |  154|  6.09M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  6.09M|        } \
  |  |  |  |  |  |  156|  9.11M|    } \
  |  |  |  |  |  |  157|  12.0M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  12.0M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 5.86M, False: 6.15M]
  |  |  |  |  ------------------
  |  |  |  |  443|  5.86M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  5.86M|                                flags, \
  |  |  |  |  445|  5.86M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  5.86M|                                ci); \
  |  |  |  |  447|  5.86M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  5.86M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  5.86M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  5.86M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  5.86M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  5.86M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  5.86M|{ \
  |  |  |  |  |  |  140|  5.86M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  5.86M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  5.86M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  5.86M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  5.86M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  5.86M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.46M, False: 4.40M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.46M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.46M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.46M|{ \
  |  |  |  |  |  |  |  |   57|  1.46M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 325k, False: 1.13M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   325k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   325k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   325k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.13M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.13M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.13M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.13M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.13M|    } \
  |  |  |  |  |  |  |  |   66|  1.46M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.46M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.46M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.46M|{ \
  |  |  |  |  |  |  |  |  128|  2.32M|    do { \
  |  |  |  |  |  |  |  |  129|  2.32M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 292k, False: 2.03M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   292k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   292k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   292k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   292k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   292k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   292k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   292k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   292k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 273k, False: 19.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   273k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 272k, False: 1.24k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   272k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   272k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   272k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   272k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.24k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.24k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.24k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.24k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   273k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  19.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  19.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  19.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  19.6k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   292k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   292k|        } \
  |  |  |  |  |  |  |  |  132|  2.32M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.32M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.32M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.32M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 863k, False: 1.46M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.46M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  4.40M|    } else {  \
  |  |  |  |  |  |  149|  4.40M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  4.40M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.55M, False: 2.84M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.55M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.55M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.55M|{ \
  |  |  |  |  |  |  |  |   45|  1.55M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 258k, False: 1.29M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   258k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   258k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.29M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.29M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.29M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.29M|    } \
  |  |  |  |  |  |  |  |   52|  1.55M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.55M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.55M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.55M|{ \
  |  |  |  |  |  |  |  |  128|  1.66M|    do { \
  |  |  |  |  |  |  |  |  129|  1.66M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 203k, False: 1.46M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   203k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   203k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   203k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   203k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   203k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   203k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   203k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   203k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 188k, False: 14.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   188k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 187k, False: 1.05k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   187k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   187k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   187k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   187k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.05k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.05k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.05k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.05k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   188k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  14.7k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  14.7k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  14.7k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  14.7k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   203k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   203k|        } \
  |  |  |  |  |  |  |  |  132|  1.66M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.66M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.66M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.66M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 109k, False: 1.55M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.55M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.84M|        } else { \
  |  |  |  |  |  |  154|  2.84M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.84M|        } \
  |  |  |  |  |  |  156|  4.40M|    } \
  |  |  |  |  |  |  157|  5.86M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  5.86M|            v = v ^ spb; \
  |  |  |  |  452|  5.86M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 2.91M, False: 2.95M]
  |  |  |  |  ------------------
  |  |  |  |  453|  5.86M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  5.86M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  5.86M|{ \
  |  |  |  |  |  |  323|  5.86M|    /* east */ \
  |  |  |  |  |  |  324|  5.86M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.86M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  5.86M| \
  |  |  |  |  |  |  326|  5.86M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  5.86M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  5.86M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  5.86M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  5.86M| \
  |  |  |  |  |  |  329|  5.86M|    /* west */ \
  |  |  |  |  |  |  330|  5.86M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  5.86M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  5.86M| \
  |  |  |  |  |  |  332|  5.86M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  5.86M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  5.86M| \
  |  |  |  |  |  |  340|  5.86M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  5.86M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  5.86M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  5.86M|        } \
  |  |  |  |  455|  12.0M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  12.0M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  12.0M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  12.0M|    } \
  |  |  |  |  457|  60.9M|}
  |  |  ------------------
  |  |  664|  60.9M|                                flags, flagsp, flags_stride, data, \
  |  |  665|  60.9M|                                l_w, 1, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  666|  60.9M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  60.9M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  60.9M|{ \
  |  |  |  |  437|  60.9M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  60.9M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  60.9M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  60.9M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  60.9M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 12.8M, False: 48.1M]
  |  |  |  |  ------------------
  |  |  |  |  438|  60.9M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  12.8M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  12.8M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  12.8M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  12.8M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  12.8M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  12.8M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  12.8M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  12.8M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  12.8M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  12.8M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  12.8M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  12.8M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  12.8M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  12.8M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  12.8M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  12.8M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  12.8M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 12.0M, False: 800k]
  |  |  |  |  ------------------
  |  |  |  |  439|  12.0M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  12.0M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  12.0M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  12.0M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  12.0M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  12.0M|{ \
  |  |  |  |  |  |  140|  12.0M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  12.0M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  12.0M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  12.0M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  12.0M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  12.0M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.90M, False: 9.13M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.90M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.90M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.90M|{ \
  |  |  |  |  |  |  |  |   57|  2.90M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 616k, False: 2.28M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   616k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   616k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   616k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  2.28M|    } else { \
  |  |  |  |  |  |  |  |   62|  2.28M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  2.28M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  2.28M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  2.28M|    } \
  |  |  |  |  |  |  |  |   66|  2.90M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.90M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.90M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.90M|{ \
  |  |  |  |  |  |  |  |  128|  4.68M|    do { \
  |  |  |  |  |  |  |  |  129|  4.68M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 590k, False: 4.09M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   590k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   590k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   590k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   590k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   590k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   590k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   590k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   590k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 537k, False: 53.2k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   537k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 534k, False: 2.39k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   534k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   534k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   534k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   534k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.39k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.39k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.39k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.39k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   537k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  53.2k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  53.2k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  53.2k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  53.2k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   590k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   590k|        } \
  |  |  |  |  |  |  |  |  132|  4.68M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.68M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.68M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.68M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.78M, False: 2.90M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.90M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  9.13M|    } else {  \
  |  |  |  |  |  |  149|  9.13M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  9.13M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 3.03M, False: 6.10M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  3.03M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  3.03M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  3.03M|{ \
  |  |  |  |  |  |  |  |   45|  3.03M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 502k, False: 2.53M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   502k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   502k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.53M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.53M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.53M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.53M|    } \
  |  |  |  |  |  |  |  |   52|  3.03M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.03M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  3.03M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  3.03M|{ \
  |  |  |  |  |  |  |  |  128|  3.26M|    do { \
  |  |  |  |  |  |  |  |  129|  3.26M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 405k, False: 2.85M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   405k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   405k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   405k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   405k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   405k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   405k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   405k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   405k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 371k, False: 33.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   371k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 370k, False: 1.67k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   370k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   370k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   370k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   370k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.67k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.67k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.67k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.67k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   371k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  33.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  33.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  33.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  33.9k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   405k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   405k|        } \
  |  |  |  |  |  |  |  |  132|  3.26M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.26M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.26M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.26M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 226k, False: 3.03M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  3.03M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  6.10M|        } else { \
  |  |  |  |  |  |  154|  6.10M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  6.10M|        } \
  |  |  |  |  |  |  156|  9.13M|    } \
  |  |  |  |  |  |  157|  12.0M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  12.0M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 5.91M, False: 6.12M]
  |  |  |  |  ------------------
  |  |  |  |  443|  5.91M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  5.91M|                                flags, \
  |  |  |  |  445|  5.91M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  5.91M|                                ci); \
  |  |  |  |  447|  5.91M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  5.91M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  5.91M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  5.91M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  5.91M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  5.91M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  5.91M|{ \
  |  |  |  |  |  |  140|  5.91M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  5.91M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  5.91M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  5.91M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  5.91M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  5.91M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.46M, False: 4.44M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.46M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.46M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.46M|{ \
  |  |  |  |  |  |  |  |   57|  1.46M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 326k, False: 1.13M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   326k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   326k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   326k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.13M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.13M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.13M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.13M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.13M|    } \
  |  |  |  |  |  |  |  |   66|  1.46M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.46M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.46M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.46M|{ \
  |  |  |  |  |  |  |  |  128|  2.34M|    do { \
  |  |  |  |  |  |  |  |  129|  2.34M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 293k, False: 2.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   293k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   293k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   293k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   293k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   293k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   293k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   293k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   293k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 273k, False: 19.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   273k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 272k, False: 1.26k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   272k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   272k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   272k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   272k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.26k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.26k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.26k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.26k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   273k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  19.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  19.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  19.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  19.9k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   293k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   293k|        } \
  |  |  |  |  |  |  |  |  132|  2.34M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.34M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.34M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.34M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 879k, False: 1.46M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.46M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  4.44M|    } else {  \
  |  |  |  |  |  |  149|  4.44M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  4.44M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.57M, False: 2.87M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.57M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.57M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.57M|{ \
  |  |  |  |  |  |  |  |   45|  1.57M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 263k, False: 1.30M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   263k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   263k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.30M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.30M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.30M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.30M|    } \
  |  |  |  |  |  |  |  |   52|  1.57M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.57M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.57M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.57M|{ \
  |  |  |  |  |  |  |  |  128|  1.68M|    do { \
  |  |  |  |  |  |  |  |  129|  1.68M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 211k, False: 1.47M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   211k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   211k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   211k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   211k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   211k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   211k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   211k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   211k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 195k, False: 15.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   195k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 194k, False: 1.05k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   194k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   194k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   194k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   194k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.05k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.05k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.05k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.05k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   195k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  15.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  15.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  15.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  15.9k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   211k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   211k|        } \
  |  |  |  |  |  |  |  |  132|  1.68M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.68M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.68M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.68M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 114k, False: 1.57M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.57M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.87M|        } else { \
  |  |  |  |  |  |  154|  2.87M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.87M|        } \
  |  |  |  |  |  |  156|  4.44M|    } \
  |  |  |  |  |  |  157|  5.91M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  5.91M|            v = v ^ spb; \
  |  |  |  |  452|  5.91M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 2.92M, False: 2.98M]
  |  |  |  |  ------------------
  |  |  |  |  453|  5.91M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  5.91M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  5.91M|{ \
  |  |  |  |  |  |  323|  5.91M|    /* east */ \
  |  |  |  |  |  |  324|  5.91M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.91M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  5.91M| \
  |  |  |  |  |  |  326|  5.91M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  5.91M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  5.91M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  5.91M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  5.91M| \
  |  |  |  |  |  |  329|  5.91M|    /* west */ \
  |  |  |  |  |  |  330|  5.91M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  5.91M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  5.91M| \
  |  |  |  |  |  |  332|  5.91M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  5.91M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  5.91M| \
  |  |  |  |  |  |  340|  5.91M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  5.91M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  5.91M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  5.91M|        } \
  |  |  |  |  455|  12.0M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  12.0M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  12.0M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  12.0M|    } \
  |  |  |  |  457|  60.9M|}
  |  |  ------------------
  |  |  667|  60.9M|                                flags, flagsp, flags_stride, data, \
  |  |  668|  60.9M|                                l_w, 2, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  669|  60.9M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  60.9M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  60.9M|{ \
  |  |  |  |  437|  60.9M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  60.9M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  60.9M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  60.9M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  60.9M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 13.0M, False: 47.9M]
  |  |  |  |  ------------------
  |  |  |  |  438|  60.9M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  13.0M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  13.0M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  13.0M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  13.0M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  13.0M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  13.0M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  13.0M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  13.0M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  13.0M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  13.0M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  13.0M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  13.0M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  13.0M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  13.0M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  13.0M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  13.0M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  13.0M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 12.2M, False: 839k]
  |  |  |  |  ------------------
  |  |  |  |  439|  12.2M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  12.2M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  12.2M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  12.2M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  12.2M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  12.2M|{ \
  |  |  |  |  |  |  140|  12.2M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  12.2M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  12.2M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  12.2M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  12.2M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  12.2M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.94M, False: 9.28M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.94M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.94M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.94M|{ \
  |  |  |  |  |  |  |  |   57|  2.94M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 631k, False: 2.31M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   631k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   631k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   631k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  2.31M|    } else { \
  |  |  |  |  |  |  |  |   62|  2.31M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  2.31M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  2.31M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  2.31M|    } \
  |  |  |  |  |  |  |  |   66|  2.94M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.94M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.94M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.94M|{ \
  |  |  |  |  |  |  |  |  128|  4.70M|    do { \
  |  |  |  |  |  |  |  |  129|  4.70M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 587k, False: 4.12M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   587k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   587k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   587k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   587k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   587k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   587k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   587k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   587k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 536k, False: 51.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   536k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 533k, False: 2.32k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   533k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   533k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   533k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   533k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.32k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.32k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.32k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.32k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   536k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  51.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  51.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  51.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  51.0k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   587k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   587k|        } \
  |  |  |  |  |  |  |  |  132|  4.70M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.70M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.70M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.70M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.76M, False: 2.94M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.94M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  9.28M|    } else {  \
  |  |  |  |  |  |  149|  9.28M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  9.28M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 3.07M, False: 6.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  3.07M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  3.07M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  3.07M|{ \
  |  |  |  |  |  |  |  |   45|  3.07M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 507k, False: 2.56M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   507k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   507k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.56M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.56M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.56M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.56M|    } \
  |  |  |  |  |  |  |  |   52|  3.07M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  3.07M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  3.07M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  3.07M|{ \
  |  |  |  |  |  |  |  |  128|  3.30M|    do { \
  |  |  |  |  |  |  |  |  129|  3.30M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 408k, False: 2.89M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   408k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   408k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   408k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   408k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   408k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   408k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   408k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   408k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 373k, False: 35.1k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   373k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 372k, False: 1.63k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   372k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   372k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   372k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   372k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.63k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.63k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.63k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.63k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   373k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  35.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  35.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  35.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  35.1k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   408k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   408k|        } \
  |  |  |  |  |  |  |  |  132|  3.30M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.30M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.30M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.30M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 229k, False: 3.07M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  3.07M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  6.21M|        } else { \
  |  |  |  |  |  |  154|  6.21M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  6.21M|        } \
  |  |  |  |  |  |  156|  9.28M|    } \
  |  |  |  |  |  |  157|  12.2M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  12.2M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 6.02M, False: 6.20M]
  |  |  |  |  ------------------
  |  |  |  |  443|  6.02M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  6.02M|                                flags, \
  |  |  |  |  445|  6.02M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  6.02M|                                ci); \
  |  |  |  |  447|  6.02M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  6.02M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  6.02M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  6.02M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  6.02M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  6.02M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  6.02M|{ \
  |  |  |  |  |  |  140|  6.02M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  6.02M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  6.02M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  6.02M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  6.02M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  6.02M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.49M, False: 4.52M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.49M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.49M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.49M|{ \
  |  |  |  |  |  |  |  |   57|  1.49M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 337k, False: 1.15M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   337k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   337k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   337k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.15M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.15M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.15M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.15M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.15M|    } \
  |  |  |  |  |  |  |  |   66|  1.49M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.49M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.49M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.49M|{ \
  |  |  |  |  |  |  |  |  128|  2.37M|    do { \
  |  |  |  |  |  |  |  |  129|  2.37M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 296k, False: 2.07M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   296k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   296k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   296k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   296k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   296k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   296k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   296k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   296k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 276k, False: 19.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   276k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 275k, False: 1.32k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   275k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   275k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   275k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   275k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.32k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.32k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.32k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.32k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   276k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  19.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  19.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  19.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  19.6k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   296k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   296k|        } \
  |  |  |  |  |  |  |  |  132|  2.37M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.37M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.37M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.37M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 876k, False: 1.49M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.49M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  4.52M|    } else {  \
  |  |  |  |  |  |  149|  4.52M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  4.52M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.61M, False: 2.91M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.61M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.61M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.61M|{ \
  |  |  |  |  |  |  |  |   45|  1.61M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 268k, False: 1.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   268k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   268k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.34M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.34M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.34M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.34M|    } \
  |  |  |  |  |  |  |  |   52|  1.61M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.61M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.61M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.61M|{ \
  |  |  |  |  |  |  |  |  128|  1.72M|    do { \
  |  |  |  |  |  |  |  |  129|  1.72M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 216k, False: 1.51M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   216k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   216k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   216k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   216k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   216k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   216k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   216k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   216k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 203k, False: 13.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   203k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 202k, False: 990]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   202k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   202k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   202k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   202k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    990|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    990|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    990|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    990|            } \
  |  |  |  |  |  |  |  |  |  |  118|   203k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  13.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  13.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  13.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  13.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   216k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   216k|        } \
  |  |  |  |  |  |  |  |  132|  1.72M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.72M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.72M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.72M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 116k, False: 1.61M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.61M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.91M|        } else { \
  |  |  |  |  |  |  154|  2.91M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.91M|        } \
  |  |  |  |  |  |  156|  4.52M|    } \
  |  |  |  |  |  |  157|  6.02M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  6.02M|            v = v ^ spb; \
  |  |  |  |  452|  6.02M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 2.96M, False: 3.05M]
  |  |  |  |  ------------------
  |  |  |  |  453|  6.02M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  6.02M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  6.02M|{ \
  |  |  |  |  |  |  323|  6.02M|    /* east */ \
  |  |  |  |  |  |  324|  6.02M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  6.02M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  6.02M| \
  |  |  |  |  |  |  326|  6.02M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  6.02M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  6.02M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  6.02M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  6.02M| \
  |  |  |  |  |  |  329|  6.02M|    /* west */ \
  |  |  |  |  |  |  330|  6.02M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  6.02M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  6.02M| \
  |  |  |  |  |  |  332|  6.02M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  6.02M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  6.02M| \
  |  |  |  |  |  |  340|  6.02M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  6.02M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  6.02M|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|  6.02M|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  6.02M|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  6.02M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  6.02M|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  6.02M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  6.02M|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  6.02M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|  6.02M|    } \
  |  |  |  |  |  |  347|  6.02M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  6.02M|        } \
  |  |  |  |  455|  12.2M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  12.2M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  12.2M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  12.2M|    } \
  |  |  |  |  457|  60.9M|}
  |  |  ------------------
  |  |  670|  60.9M|                                flags, flagsp, flags_stride, data, \
  |  |  671|  60.9M|                                l_w, 3, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  672|  60.9M|                            *flagsp = flags; \
  |  |  673|  60.9M|                        } \
  |  |  674|  81.6M|                } \
  |  |  675|  1.27M|        } \
  |  |  676|  79.7k|        UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|  79.7k|        mqc->curctx = curctx; \
  |  |  |  |  167|  79.7k|        mqc->c = c; \
  |  |  |  |  168|  79.7k|        mqc->a = a; \
  |  |  |  |  169|  79.7k|        mqc->ct = ct;
  |  |  ------------------
  |  |  677|  79.7k|        if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (677:13): [True: 0, False: 79.7k]
  |  |  ------------------
  |  |  678|      0|            for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (678:25): [True: 0, False: 0]
  |  |  ------------------
  |  |  679|      0|                for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (679:29): [True: 0, False: 0]
  |  |  ------------------
  |  |  680|      0|                        opj_t1_dec_sigpass_step_mqc(t1, flagsp, \
  |  |  681|      0|                            data + j * l_w, oneplushalf, j, flags_stride, vsc); \
  |  |  682|      0|                } \
  |  |  683|      0|            } \
  |  |  684|      0|        } \
  |  |  685|  79.7k|}
  ------------------
  692|  79.7k|}
t1.c:opj_t1_dec_sigpass_mqc_generic_vsc:
  712|   150k|{
  713|   150k|    opj_t1_dec_sigpass_mqc_internal(t1, bpno, OPJ_TRUE, t1->w, t1->h,
  ------------------
  |  |  643|   150k|#define opj_t1_dec_sigpass_mqc_internal(t1, bpno, vsc, w, h, flags_stride) \
  |  |  644|   150k|{ \
  |  |  645|   150k|        OPJ_INT32 one, half, oneplushalf; \
  |  |  646|   150k|        OPJ_UINT32 i, j, k; \
  |  |  647|   150k|        register OPJ_INT32 *data = t1->data; \
  |  |  648|   150k|        register opj_flag_t *flagsp = &t1->flags[(flags_stride) + 1]; \
  |  |  649|   150k|        const OPJ_UINT32 l_w = w; \
  |  |  650|   150k|        opj_mqc_t* mqc = &(t1->mqc); \
  |  |  651|   150k|        DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|   150k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|   150k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|   150k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|   150k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  |  652|   150k|        register OPJ_UINT32 v; \
  |  |  653|   150k|        one = 1 << bpno; \
  |  |  654|   150k|        half = one >> 1; \
  |  |  655|   150k|        oneplushalf = one | half; \
  |  |  656|  1.65M|        for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (656:21): [True: 1.50M, False: 150k]
  |  |  ------------------
  |  |  657|  18.5M|                for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (657:29): [True: 17.0M, False: 1.50M]
  |  |  ------------------
  |  |  658|  17.0M|                        opj_flag_t flags = *flagsp; \
  |  |  659|  17.0M|                        if( flags != 0 ) { \
  |  |  ------------------
  |  |  |  Branch (659:29): [True: 11.5M, False: 5.46M]
  |  |  ------------------
  |  |  660|  11.5M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  11.5M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  11.5M|{ \
  |  |  |  |  437|  11.5M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  11.5M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  11.5M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.5M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.5M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 2.82M, False: 8.74M]
  |  |  |  |  ------------------
  |  |  |  |  438|  11.5M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  2.82M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  2.82M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  2.82M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  2.82M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  2.82M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  2.82M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  2.82M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  2.82M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  2.82M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  2.82M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  2.82M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  2.82M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  2.82M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  2.82M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  2.82M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  2.82M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  2.82M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 2.67M, False: 153k]
  |  |  |  |  ------------------
  |  |  |  |  439|  2.67M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  2.67M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  2.67M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  2.67M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  2.67M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  2.67M|{ \
  |  |  |  |  |  |  140|  2.67M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  2.67M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  2.67M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  2.67M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  2.67M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  2.67M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 710k, False: 1.96M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   710k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   710k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   710k|{ \
  |  |  |  |  |  |  |  |   57|   710k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 156k, False: 553k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   156k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   156k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   156k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   553k|    } else { \
  |  |  |  |  |  |  |  |   62|   553k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   553k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   553k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   553k|    } \
  |  |  |  |  |  |  |  |   66|   710k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   710k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   710k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   710k|{ \
  |  |  |  |  |  |  |  |  128|  1.10M|    do { \
  |  |  |  |  |  |  |  |  129|  1.10M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 139k, False: 968k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   139k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   139k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   139k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   139k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   139k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   139k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   139k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   139k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 133k, False: 5.71k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   133k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 131k, False: 2.14k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   131k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   131k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   131k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   131k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.14k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.14k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.14k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.14k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   133k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.71k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.71k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.71k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.71k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   139k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   139k|        } \
  |  |  |  |  |  |  |  |  132|  1.10M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.10M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.10M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.10M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 398k, False: 710k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   710k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  1.96M|    } else {  \
  |  |  |  |  |  |  149|  1.96M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  1.96M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 725k, False: 1.23M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   725k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   725k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   725k|{ \
  |  |  |  |  |  |  |  |   45|   725k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 124k, False: 601k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   124k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   124k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   601k|    } else { \
  |  |  |  |  |  |  |  |   49|   601k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   601k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   601k|    } \
  |  |  |  |  |  |  |  |   52|   725k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   725k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   725k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   725k|{ \
  |  |  |  |  |  |  |  |  128|   777k|    do { \
  |  |  |  |  |  |  |  |  129|   777k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 97.4k, False: 680k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  97.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  97.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  97.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  97.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  97.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  97.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  97.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  97.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 92.9k, False: 4.50k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  92.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 91.2k, False: 1.69k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  91.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  91.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  91.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  91.2k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.69k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.69k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.69k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.69k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  92.9k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.50k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.50k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.50k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.50k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  97.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  97.4k|        } \
  |  |  |  |  |  |  |  |  132|   777k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   777k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   777k|        ct--; \
  |  |  |  |  |  |  |  |  135|   777k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 52.2k, False: 725k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   725k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.23M|        } else { \
  |  |  |  |  |  |  154|  1.23M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.23M|        } \
  |  |  |  |  |  |  156|  1.96M|    } \
  |  |  |  |  |  |  157|  2.67M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  2.67M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 1.32M, False: 1.35M]
  |  |  |  |  ------------------
  |  |  |  |  443|  1.32M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  1.32M|                                flags, \
  |  |  |  |  445|  1.32M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  1.32M|                                ci); \
  |  |  |  |  447|  1.32M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  1.32M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  1.32M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.32M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  1.32M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.32M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.32M|{ \
  |  |  |  |  |  |  140|  1.32M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.32M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.32M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.32M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.32M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.32M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 374k, False: 945k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   374k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   374k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   374k|{ \
  |  |  |  |  |  |  |  |   57|   374k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 96.2k, False: 278k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  96.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  96.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  96.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   278k|    } else { \
  |  |  |  |  |  |  |  |   62|   278k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   278k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   278k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   278k|    } \
  |  |  |  |  |  |  |  |   66|   374k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   374k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   374k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   374k|{ \
  |  |  |  |  |  |  |  |  128|   570k|    do { \
  |  |  |  |  |  |  |  |  129|   570k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 71.2k, False: 498k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  71.2k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  71.2k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  71.2k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  71.2k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  71.2k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  71.2k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  71.2k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  71.2k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 66.6k, False: 4.58k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  66.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 65.5k, False: 1.13k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  65.5k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  65.5k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  65.5k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  65.5k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.13k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.13k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.13k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.13k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  66.6k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.58k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.58k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.58k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.58k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  71.2k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  71.2k|        } \
  |  |  |  |  |  |  |  |  132|   570k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   570k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   570k|        ct--; \
  |  |  |  |  |  |  |  |  135|   570k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 195k, False: 374k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   374k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   945k|    } else {  \
  |  |  |  |  |  |  149|   945k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   945k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 386k, False: 559k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   386k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   386k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   386k|{ \
  |  |  |  |  |  |  |  |   45|   386k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 72.9k, False: 313k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  72.9k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  72.9k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   313k|    } else { \
  |  |  |  |  |  |  |  |   49|   313k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   313k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   313k|    } \
  |  |  |  |  |  |  |  |   52|   386k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   386k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   386k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   386k|{ \
  |  |  |  |  |  |  |  |  128|   419k|    do { \
  |  |  |  |  |  |  |  |  129|   419k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 56.3k, False: 362k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  56.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  56.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  56.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  56.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  56.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  56.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  56.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  56.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 53.9k, False: 2.37k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  53.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 51.7k, False: 2.15k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  51.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  51.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  51.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  51.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.15k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.15k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.15k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.15k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  53.9k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.37k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.37k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.37k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.37k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  56.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  56.3k|        } \
  |  |  |  |  |  |  |  |  132|   419k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   419k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   419k|        ct--; \
  |  |  |  |  |  |  |  |  135|   419k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 32.6k, False: 386k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   386k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   559k|        } else { \
  |  |  |  |  |  |  154|   559k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   559k|        } \
  |  |  |  |  |  |  156|   945k|    } \
  |  |  |  |  |  |  157|  1.32M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  1.32M|            v = v ^ spb; \
  |  |  |  |  452|  1.32M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 657k, False: 663k]
  |  |  |  |  ------------------
  |  |  |  |  453|  1.32M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.32M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.32M|{ \
  |  |  |  |  |  |  323|  1.32M|    /* east */ \
  |  |  |  |  |  |  324|  1.32M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.32M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.32M| \
  |  |  |  |  |  |  326|  1.32M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.32M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.32M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.32M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.32M| \
  |  |  |  |  |  |  329|  1.32M|    /* west */ \
  |  |  |  |  |  |  330|  1.32M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.32M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.32M| \
  |  |  |  |  |  |  332|  1.32M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.32M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.32M| \
  |  |  |  |  |  |  340|  1.32M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.32M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.32M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  1.32M|        } \
  |  |  |  |  455|  2.67M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  2.67M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  2.67M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  2.67M|    } \
  |  |  |  |  457|  11.5M|}
  |  |  ------------------
  |  |  661|  11.5M|                                flags, flagsp, flags_stride, data, \
  |  |  662|  11.5M|                                l_w, 0, mqc, curctx, v, a, c, ct, oneplushalf, vsc); \
  |  |  663|  11.5M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  11.5M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  11.5M|{ \
  |  |  |  |  437|  11.5M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  11.5M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  11.5M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.5M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.5M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 2.87M, False: 8.70M]
  |  |  |  |  ------------------
  |  |  |  |  438|  11.5M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  2.87M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  2.87M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  2.87M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  2.87M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  2.87M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  2.87M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  2.87M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  2.87M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  2.87M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  2.87M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  2.87M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  2.87M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  2.87M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  2.87M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  2.87M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  2.87M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  2.87M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 2.75M, False: 113k]
  |  |  |  |  ------------------
  |  |  |  |  439|  2.75M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  2.75M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  2.75M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  2.75M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  2.75M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  2.75M|{ \
  |  |  |  |  |  |  140|  2.75M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  2.75M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  2.75M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  2.75M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  2.75M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  2.75M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 720k, False: 2.03M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   720k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   720k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   720k|{ \
  |  |  |  |  |  |  |  |   57|   720k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 157k, False: 563k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   157k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   157k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   157k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   563k|    } else { \
  |  |  |  |  |  |  |  |   62|   563k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   563k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   563k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   563k|    } \
  |  |  |  |  |  |  |  |   66|   720k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   720k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   720k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   720k|{ \
  |  |  |  |  |  |  |  |  128|  1.12M|    do { \
  |  |  |  |  |  |  |  |  129|  1.12M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 142k, False: 981k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   142k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   142k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   142k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   142k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   142k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   142k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   142k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   142k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 136k, False: 6.62k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   136k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 133k, False: 2.43k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   133k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   133k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   133k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   133k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.43k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.43k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.43k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.43k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   136k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  6.62k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  6.62k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  6.62k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  6.62k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   142k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   142k|        } \
  |  |  |  |  |  |  |  |  132|  1.12M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.12M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.12M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.12M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 403k, False: 720k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   720k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.03M|    } else {  \
  |  |  |  |  |  |  149|  2.03M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.03M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 755k, False: 1.28M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   755k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   755k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   755k|{ \
  |  |  |  |  |  |  |  |   45|   755k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 128k, False: 626k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   128k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   128k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   626k|    } else { \
  |  |  |  |  |  |  |  |   49|   626k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   626k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   626k|    } \
  |  |  |  |  |  |  |  |   52|   755k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   755k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   755k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   755k|{ \
  |  |  |  |  |  |  |  |  128|   812k|    do { \
  |  |  |  |  |  |  |  |  129|   812k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 99.3k, False: 713k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  99.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  99.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  99.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  99.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  99.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  99.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  99.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  99.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 95.0k, False: 4.30k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  95.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 93.5k, False: 1.49k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  93.5k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  93.5k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  93.5k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  93.5k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.49k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.49k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.49k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.49k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  95.0k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.30k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.30k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.30k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.30k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  99.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  99.3k|        } \
  |  |  |  |  |  |  |  |  132|   812k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   812k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   812k|        ct--; \
  |  |  |  |  |  |  |  |  135|   812k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 56.7k, False: 755k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   755k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.28M|        } else { \
  |  |  |  |  |  |  154|  1.28M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.28M|        } \
  |  |  |  |  |  |  156|  2.03M|    } \
  |  |  |  |  |  |  157|  2.75M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  2.75M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 1.34M, False: 1.41M]
  |  |  |  |  ------------------
  |  |  |  |  443|  1.34M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  1.34M|                                flags, \
  |  |  |  |  445|  1.34M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  1.34M|                                ci); \
  |  |  |  |  447|  1.34M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  1.34M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  1.34M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.34M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  1.34M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.34M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.34M|{ \
  |  |  |  |  |  |  140|  1.34M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.34M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.34M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.34M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.34M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.34M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 372k, False: 968k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   372k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   372k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   372k|{ \
  |  |  |  |  |  |  |  |   57|   372k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 93.7k, False: 278k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  93.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  93.7k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  93.7k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   278k|    } else { \
  |  |  |  |  |  |  |  |   62|   278k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   278k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   278k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   278k|    } \
  |  |  |  |  |  |  |  |   66|   372k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   372k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   372k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   372k|{ \
  |  |  |  |  |  |  |  |  128|   564k|    do { \
  |  |  |  |  |  |  |  |  129|   564k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 70.4k, False: 494k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  70.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  70.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  70.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  70.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  70.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  70.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  70.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  70.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 66.6k, False: 3.85k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  66.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 65.1k, False: 1.41k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  65.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  65.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  65.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  65.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.41k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.41k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.41k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.41k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  66.6k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.85k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.85k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.85k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.85k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  70.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  70.4k|        } \
  |  |  |  |  |  |  |  |  132|   564k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   564k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   564k|        ct--; \
  |  |  |  |  |  |  |  |  135|   564k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 192k, False: 372k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   372k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   968k|    } else {  \
  |  |  |  |  |  |  149|   968k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   968k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 391k, False: 577k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   391k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   391k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   391k|{ \
  |  |  |  |  |  |  |  |   45|   391k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 78.0k, False: 313k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  78.0k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  78.0k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   313k|    } else { \
  |  |  |  |  |  |  |  |   49|   313k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   313k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   313k|    } \
  |  |  |  |  |  |  |  |   52|   391k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   391k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   391k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   391k|{ \
  |  |  |  |  |  |  |  |  128|   426k|    do { \
  |  |  |  |  |  |  |  |  129|   426k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 52.4k, False: 373k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  52.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  52.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  52.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  52.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  52.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  52.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  52.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  52.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 49.1k, False: 3.22k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  49.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 48.2k, False: 989]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  48.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  48.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  48.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  48.2k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    989|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    989|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    989|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    989|            } \
  |  |  |  |  |  |  |  |  |  |  118|  49.1k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.22k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.22k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.22k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.22k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  52.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  52.4k|        } \
  |  |  |  |  |  |  |  |  132|   426k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   426k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   426k|        ct--; \
  |  |  |  |  |  |  |  |  135|   426k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 34.9k, False: 391k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   391k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   577k|        } else { \
  |  |  |  |  |  |  154|   577k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   577k|        } \
  |  |  |  |  |  |  156|   968k|    } \
  |  |  |  |  |  |  157|  1.34M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  1.34M|            v = v ^ spb; \
  |  |  |  |  452|  1.34M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 674k, False: 666k]
  |  |  |  |  ------------------
  |  |  |  |  453|  1.34M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.34M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.34M|{ \
  |  |  |  |  |  |  323|  1.34M|    /* east */ \
  |  |  |  |  |  |  324|  1.34M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.34M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.34M| \
  |  |  |  |  |  |  326|  1.34M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.34M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.34M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.34M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.34M| \
  |  |  |  |  |  |  329|  1.34M|    /* west */ \
  |  |  |  |  |  |  330|  1.34M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.34M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.34M| \
  |  |  |  |  |  |  332|  1.34M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.34M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.34M| \
  |  |  |  |  |  |  340|  1.34M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.34M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.34M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  1.34M|        } \
  |  |  |  |  455|  2.75M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  2.75M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  2.75M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  2.75M|    } \
  |  |  |  |  457|  11.5M|}
  |  |  ------------------
  |  |  664|  11.5M|                                flags, flagsp, flags_stride, data, \
  |  |  665|  11.5M|                                l_w, 1, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  666|  11.5M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  11.5M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  11.5M|{ \
  |  |  |  |  437|  11.5M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  11.5M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  11.5M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.5M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.5M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 2.87M, False: 8.70M]
  |  |  |  |  ------------------
  |  |  |  |  438|  11.5M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  2.87M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  2.87M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  2.87M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  2.87M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  2.87M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  2.87M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  2.87M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  2.87M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  2.87M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  2.87M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  2.87M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  2.87M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  2.87M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  2.87M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  2.87M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  2.87M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  2.87M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 2.72M, False: 142k]
  |  |  |  |  ------------------
  |  |  |  |  439|  2.72M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  2.72M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  2.72M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  2.72M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  2.72M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  2.72M|{ \
  |  |  |  |  |  |  140|  2.72M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  2.72M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  2.72M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  2.72M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  2.72M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  2.72M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 711k, False: 2.01M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   711k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   711k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   711k|{ \
  |  |  |  |  |  |  |  |   57|   711k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 157k, False: 553k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   157k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   157k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   157k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   553k|    } else { \
  |  |  |  |  |  |  |  |   62|   553k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   553k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   553k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   553k|    } \
  |  |  |  |  |  |  |  |   66|   711k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   711k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   711k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   711k|{ \
  |  |  |  |  |  |  |  |  128|  1.11M|    do { \
  |  |  |  |  |  |  |  |  129|  1.11M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 144k, False: 973k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   144k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   144k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   144k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   144k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   144k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   144k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   144k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   144k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 138k, False: 5.80k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   138k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 135k, False: 2.94k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   135k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   135k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   135k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   135k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.94k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.94k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.94k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.94k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   138k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.80k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.80k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.80k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.80k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   144k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   144k|        } \
  |  |  |  |  |  |  |  |  132|  1.11M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.11M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.11M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.11M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 406k, False: 711k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   711k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.01M|    } else {  \
  |  |  |  |  |  |  149|  2.01M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.01M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 744k, False: 1.27M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   744k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   744k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   744k|{ \
  |  |  |  |  |  |  |  |   45|   744k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 118k, False: 626k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   118k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   118k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   626k|    } else { \
  |  |  |  |  |  |  |  |   49|   626k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   626k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   626k|    } \
  |  |  |  |  |  |  |  |   52|   744k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   744k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   744k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   744k|{ \
  |  |  |  |  |  |  |  |  128|   796k|    do { \
  |  |  |  |  |  |  |  |  129|   796k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 99.4k, False: 696k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  99.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  99.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  99.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  99.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  99.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  99.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  99.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  99.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 95.1k, False: 4.32k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  95.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 93.3k, False: 1.76k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  93.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  93.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  93.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  93.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.76k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.76k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.76k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.76k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  95.1k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.32k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.32k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.32k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.32k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  99.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  99.4k|        } \
  |  |  |  |  |  |  |  |  132|   796k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   796k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   796k|        ct--; \
  |  |  |  |  |  |  |  |  135|   796k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 51.3k, False: 744k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   744k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.27M|        } else { \
  |  |  |  |  |  |  154|  1.27M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.27M|        } \
  |  |  |  |  |  |  156|  2.01M|    } \
  |  |  |  |  |  |  157|  2.72M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  2.72M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 1.32M, False: 1.40M]
  |  |  |  |  ------------------
  |  |  |  |  443|  1.32M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  1.32M|                                flags, \
  |  |  |  |  445|  1.32M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  1.32M|                                ci); \
  |  |  |  |  447|  1.32M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  1.32M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  1.32M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.32M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  1.32M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.32M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.32M|{ \
  |  |  |  |  |  |  140|  1.32M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.32M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.32M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.32M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.32M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.32M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 365k, False: 959k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   365k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   365k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   365k|{ \
  |  |  |  |  |  |  |  |   57|   365k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 91.3k, False: 274k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  91.3k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  91.3k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  91.3k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   274k|    } else { \
  |  |  |  |  |  |  |  |   62|   274k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   274k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   274k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   274k|    } \
  |  |  |  |  |  |  |  |   66|   365k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   365k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   365k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   365k|{ \
  |  |  |  |  |  |  |  |  128|   553k|    do { \
  |  |  |  |  |  |  |  |  129|   553k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 69.5k, False: 483k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  69.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  69.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  69.5k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  69.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  69.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  69.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  69.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  69.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 65.2k, False: 4.33k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  65.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 64.3k, False: 849]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  64.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  64.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  64.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  64.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    849|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    849|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    849|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    849|            } \
  |  |  |  |  |  |  |  |  |  |  118|  65.2k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.33k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.33k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.33k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.33k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  69.5k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  69.5k|        } \
  |  |  |  |  |  |  |  |  132|   553k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   553k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   553k|        ct--; \
  |  |  |  |  |  |  |  |  135|   553k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 187k, False: 365k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   365k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   959k|    } else {  \
  |  |  |  |  |  |  149|   959k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   959k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 374k, False: 584k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   374k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   374k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   374k|{ \
  |  |  |  |  |  |  |  |   45|   374k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 72.7k, False: 301k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  72.7k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  72.7k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   301k|    } else { \
  |  |  |  |  |  |  |  |   49|   301k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   301k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   301k|    } \
  |  |  |  |  |  |  |  |   52|   374k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   374k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   374k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   374k|{ \
  |  |  |  |  |  |  |  |  128|   408k|    do { \
  |  |  |  |  |  |  |  |  129|   408k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 50.8k, False: 357k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  50.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  50.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  50.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  50.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  50.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  50.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  50.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  50.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 47.9k, False: 2.84k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  47.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 46.6k, False: 1.34k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  46.6k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  46.6k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  46.6k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  46.6k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.34k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.34k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.34k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.34k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  47.9k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.84k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.84k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.84k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.84k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  50.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  50.8k|        } \
  |  |  |  |  |  |  |  |  132|   408k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   408k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   408k|        ct--; \
  |  |  |  |  |  |  |  |  135|   408k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 33.4k, False: 374k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   374k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   584k|        } else { \
  |  |  |  |  |  |  154|   584k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   584k|        } \
  |  |  |  |  |  |  156|   959k|    } \
  |  |  |  |  |  |  157|  1.32M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  1.32M|            v = v ^ spb; \
  |  |  |  |  452|  1.32M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 668k, False: 656k]
  |  |  |  |  ------------------
  |  |  |  |  453|  1.32M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.32M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.32M|{ \
  |  |  |  |  |  |  323|  1.32M|    /* east */ \
  |  |  |  |  |  |  324|  1.32M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.32M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.32M| \
  |  |  |  |  |  |  326|  1.32M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.32M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.32M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.32M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.32M| \
  |  |  |  |  |  |  329|  1.32M|    /* west */ \
  |  |  |  |  |  |  330|  1.32M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.32M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.32M| \
  |  |  |  |  |  |  332|  1.32M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.32M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.32M| \
  |  |  |  |  |  |  340|  1.32M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.32M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.32M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  1.32M|        } \
  |  |  |  |  455|  2.72M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  2.72M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  2.72M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  2.72M|    } \
  |  |  |  |  457|  11.5M|}
  |  |  ------------------
  |  |  667|  11.5M|                                flags, flagsp, flags_stride, data, \
  |  |  668|  11.5M|                                l_w, 2, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  669|  11.5M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  11.5M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  11.5M|{ \
  |  |  |  |  437|  11.5M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  11.5M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  11.5M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  11.5M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  11.5M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 2.96M, False: 8.60M]
  |  |  |  |  ------------------
  |  |  |  |  438|  11.5M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  2.96M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  2.96M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  2.96M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  2.96M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  2.96M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  2.96M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  2.96M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  2.96M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  2.96M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  2.96M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  2.96M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  2.96M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  2.96M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  2.96M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  2.96M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  2.96M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  2.96M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 2.68M, False: 280k]
  |  |  |  |  ------------------
  |  |  |  |  439|  2.68M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  2.68M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  2.68M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  2.68M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  2.68M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  2.68M|{ \
  |  |  |  |  |  |  140|  2.68M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  2.68M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  2.68M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  2.68M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  2.68M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  2.68M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 685k, False: 1.99M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   685k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   685k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   685k|{ \
  |  |  |  |  |  |  |  |   57|   685k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 147k, False: 538k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   147k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   147k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   147k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   538k|    } else { \
  |  |  |  |  |  |  |  |   62|   538k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   538k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   538k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   538k|    } \
  |  |  |  |  |  |  |  |   66|   685k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   685k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   685k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   685k|{ \
  |  |  |  |  |  |  |  |  128|  1.09M|    do { \
  |  |  |  |  |  |  |  |  129|  1.09M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 135k, False: 958k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   135k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   135k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   135k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   135k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   135k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   135k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   135k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   135k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 128k, False: 6.36k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   128k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 127k, False: 1.67k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   127k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   127k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   127k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   127k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.67k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.67k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.67k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.67k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   128k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  6.36k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  6.36k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  6.36k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  6.36k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   135k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   135k|        } \
  |  |  |  |  |  |  |  |  132|  1.09M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.09M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.09M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.09M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 407k, False: 685k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   685k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  1.99M|    } else {  \
  |  |  |  |  |  |  149|  1.99M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  1.99M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 724k, False: 1.27M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   724k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   724k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   724k|{ \
  |  |  |  |  |  |  |  |   45|   724k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 120k, False: 604k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   120k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   120k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   604k|    } else { \
  |  |  |  |  |  |  |  |   49|   604k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   604k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   604k|    } \
  |  |  |  |  |  |  |  |   52|   724k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   724k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   724k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   724k|{ \
  |  |  |  |  |  |  |  |  128|   773k|    do { \
  |  |  |  |  |  |  |  |  129|   773k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 93.4k, False: 679k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  93.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  93.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  93.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  93.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  93.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  93.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  93.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  93.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 89.1k, False: 4.35k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  89.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 87.9k, False: 1.18k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  87.9k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  87.9k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  87.9k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  87.9k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.18k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.18k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.18k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.18k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  89.1k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.35k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.35k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.35k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.35k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  93.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  93.4k|        } \
  |  |  |  |  |  |  |  |  132|   773k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   773k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   773k|        ct--; \
  |  |  |  |  |  |  |  |  135|   773k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 48.3k, False: 724k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   724k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.27M|        } else { \
  |  |  |  |  |  |  154|  1.27M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.27M|        } \
  |  |  |  |  |  |  156|  1.99M|    } \
  |  |  |  |  |  |  157|  2.68M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  2.68M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 1.33M, False: 1.35M]
  |  |  |  |  ------------------
  |  |  |  |  443|  1.33M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  1.33M|                                flags, \
  |  |  |  |  445|  1.33M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  1.33M|                                ci); \
  |  |  |  |  447|  1.33M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  1.33M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  1.33M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.33M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  1.33M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.33M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.33M|{ \
  |  |  |  |  |  |  140|  1.33M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.33M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.33M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.33M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.33M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.33M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 370k, False: 960k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   370k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   370k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   370k|{ \
  |  |  |  |  |  |  |  |   57|   370k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 92.5k, False: 278k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  92.5k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  92.5k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  92.5k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   278k|    } else { \
  |  |  |  |  |  |  |  |   62|   278k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   278k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   278k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   278k|    } \
  |  |  |  |  |  |  |  |   66|   370k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   370k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   370k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   370k|{ \
  |  |  |  |  |  |  |  |  128|   565k|    do { \
  |  |  |  |  |  |  |  |  129|   565k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 70.0k, False: 495k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  70.0k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  70.0k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  70.0k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  70.0k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  70.0k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  70.0k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  70.0k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  70.0k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 67.5k, False: 2.52k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  67.5k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 66.3k, False: 1.14k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  66.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  66.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  66.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  66.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.14k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.14k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.14k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.14k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  67.5k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.52k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.52k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.52k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.52k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  70.0k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  70.0k|        } \
  |  |  |  |  |  |  |  |  132|   565k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   565k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   565k|        ct--; \
  |  |  |  |  |  |  |  |  135|   565k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 194k, False: 370k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   370k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   960k|    } else {  \
  |  |  |  |  |  |  149|   960k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   960k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 380k, False: 579k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   380k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   380k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   380k|{ \
  |  |  |  |  |  |  |  |   45|   380k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 73.9k, False: 306k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  73.9k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  73.9k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   306k|    } else { \
  |  |  |  |  |  |  |  |   49|   306k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   306k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   306k|    } \
  |  |  |  |  |  |  |  |   52|   380k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   380k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   380k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   380k|{ \
  |  |  |  |  |  |  |  |  128|   411k|    do { \
  |  |  |  |  |  |  |  |  129|   411k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 51.3k, False: 359k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  51.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  51.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  51.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  51.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  51.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  51.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  51.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  51.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 49.1k, False: 2.22k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  49.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 48.3k, False: 860]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  48.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  48.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  48.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  48.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    860|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    860|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    860|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    860|            } \
  |  |  |  |  |  |  |  |  |  |  118|  49.1k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.22k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.22k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.22k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.22k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  51.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  51.3k|        } \
  |  |  |  |  |  |  |  |  132|   411k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   411k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   411k|        ct--; \
  |  |  |  |  |  |  |  |  135|   411k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 30.6k, False: 380k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   380k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   579k|        } else { \
  |  |  |  |  |  |  154|   579k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   579k|        } \
  |  |  |  |  |  |  156|   960k|    } \
  |  |  |  |  |  |  157|  1.33M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  1.33M|            v = v ^ spb; \
  |  |  |  |  452|  1.33M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 666k, False: 664k]
  |  |  |  |  ------------------
  |  |  |  |  453|  1.33M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.33M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.33M|{ \
  |  |  |  |  |  |  323|  1.33M|    /* east */ \
  |  |  |  |  |  |  324|  1.33M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.33M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.33M| \
  |  |  |  |  |  |  326|  1.33M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.33M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.33M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.33M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.33M| \
  |  |  |  |  |  |  329|  1.33M|    /* west */ \
  |  |  |  |  |  |  330|  1.33M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.33M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.33M| \
  |  |  |  |  |  |  332|  1.33M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.33M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.33M| \
  |  |  |  |  |  |  340|  1.33M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.33M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  1.33M|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|  1.33M|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  1.33M|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  1.33M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  1.33M|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  1.33M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  1.33M|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  1.33M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|  1.33M|    } \
  |  |  |  |  |  |  347|  1.33M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  1.33M|        } \
  |  |  |  |  455|  2.68M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  2.68M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  2.68M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  2.68M|    } \
  |  |  |  |  457|  11.5M|}
  |  |  ------------------
  |  |  670|  11.5M|                                flags, flagsp, flags_stride, data, \
  |  |  671|  11.5M|                                l_w, 3, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  672|  11.5M|                            *flagsp = flags; \
  |  |  673|  11.5M|                        } \
  |  |  674|  17.0M|                } \
  |  |  675|  1.50M|        } \
  |  |  676|   150k|        UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|   150k|        mqc->curctx = curctx; \
  |  |  |  |  167|   150k|        mqc->c = c; \
  |  |  |  |  168|   150k|        mqc->a = a; \
  |  |  |  |  169|   150k|        mqc->ct = ct;
  |  |  ------------------
  |  |  677|   150k|        if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (677:13): [True: 67.3k, False: 83.5k]
  |  |  ------------------
  |  |  678|   880k|            for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (678:25): [True: 813k, False: 67.3k]
  |  |  ------------------
  |  |  679|  2.35M|                for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (679:29): [True: 1.54M, False: 813k]
  |  |  ------------------
  |  |  680|  1.54M|                        opj_t1_dec_sigpass_step_mqc(t1, flagsp, \
  |  |  681|  1.54M|                            data + j * l_w, oneplushalf, j, flags_stride, vsc); \
  |  |  682|  1.54M|                } \
  |  |  683|   813k|            } \
  |  |  684|  67.3k|        } \
  |  |  685|   150k|}
  ------------------
  714|   150k|                                    t1->w + 2U);
  715|   150k|}
t1.c:opj_t1_dec_sigpass_mqc_generic_novsc:
  704|   151k|{
  705|   151k|    opj_t1_dec_sigpass_mqc_internal(t1, bpno, OPJ_FALSE, t1->w, t1->h,
  ------------------
  |  |  643|   151k|#define opj_t1_dec_sigpass_mqc_internal(t1, bpno, vsc, w, h, flags_stride) \
  |  |  644|   151k|{ \
  |  |  645|   151k|        OPJ_INT32 one, half, oneplushalf; \
  |  |  646|   151k|        OPJ_UINT32 i, j, k; \
  |  |  647|   151k|        register OPJ_INT32 *data = t1->data; \
  |  |  648|   151k|        register opj_flag_t *flagsp = &t1->flags[(flags_stride) + 1]; \
  |  |  649|   151k|        const OPJ_UINT32 l_w = w; \
  |  |  650|   151k|        opj_mqc_t* mqc = &(t1->mqc); \
  |  |  651|   151k|        DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|   151k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|   151k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|   151k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|   151k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  |  652|   151k|        register OPJ_UINT32 v; \
  |  |  653|   151k|        one = 1 << bpno; \
  |  |  654|   151k|        half = one >> 1; \
  |  |  655|   151k|        oneplushalf = one | half; \
  |  |  656|  1.71M|        for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (656:21): [True: 1.56M, False: 151k]
  |  |  ------------------
  |  |  657|  21.2M|                for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (657:29): [True: 19.6M, False: 1.56M]
  |  |  ------------------
  |  |  658|  19.6M|                        opj_flag_t flags = *flagsp; \
  |  |  659|  19.6M|                        if( flags != 0 ) { \
  |  |  ------------------
  |  |  |  Branch (659:29): [True: 12.4M, False: 7.19M]
  |  |  ------------------
  |  |  660|  12.4M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  12.4M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  12.4M|{ \
  |  |  |  |  437|  12.4M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  12.4M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  12.4M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  12.4M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  12.4M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 3.52M, False: 8.93M]
  |  |  |  |  ------------------
  |  |  |  |  438|  12.4M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  3.52M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  3.52M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  3.52M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  3.52M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  3.52M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  3.52M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  3.52M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  3.52M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  3.52M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  3.52M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  3.52M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  3.52M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  3.52M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  3.52M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  3.52M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  3.52M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  3.52M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 3.14M, False: 372k]
  |  |  |  |  ------------------
  |  |  |  |  439|  3.14M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  3.14M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.14M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  3.14M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.14M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.14M|{ \
  |  |  |  |  |  |  140|  3.14M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.14M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.14M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.14M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.14M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.14M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 843k, False: 2.30M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   843k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   843k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   843k|{ \
  |  |  |  |  |  |  |  |   57|   843k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 189k, False: 654k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   189k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   189k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   189k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   654k|    } else { \
  |  |  |  |  |  |  |  |   62|   654k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   654k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   654k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   654k|    } \
  |  |  |  |  |  |  |  |   66|   843k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   843k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   843k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   843k|{ \
  |  |  |  |  |  |  |  |  128|  1.32M|    do { \
  |  |  |  |  |  |  |  |  129|  1.32M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 170k, False: 1.15M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   170k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   170k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   170k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   170k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   170k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   170k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   170k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   170k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 142k, False: 27.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   142k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 140k, False: 2.09k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   140k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   140k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   140k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   140k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.09k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.09k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.09k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.09k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   142k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  27.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  27.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  27.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  27.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   170k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   170k|        } \
  |  |  |  |  |  |  |  |  132|  1.32M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.32M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.32M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.32M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 477k, False: 843k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   843k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.30M|    } else {  \
  |  |  |  |  |  |  149|  2.30M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.30M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 840k, False: 1.46M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   840k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   840k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   840k|{ \
  |  |  |  |  |  |  |  |   45|   840k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 153k, False: 686k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   153k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   153k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   686k|    } else { \
  |  |  |  |  |  |  |  |   49|   686k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   686k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   686k|    } \
  |  |  |  |  |  |  |  |   52|   840k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   840k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   840k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   840k|{ \
  |  |  |  |  |  |  |  |  128|   907k|    do { \
  |  |  |  |  |  |  |  |  129|   907k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 116k, False: 790k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   116k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   116k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   116k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   116k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   116k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   116k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   116k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   116k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 98.4k, False: 17.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  98.4k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 97.0k, False: 1.46k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  97.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  97.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  97.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  97.0k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.46k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.46k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.46k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.46k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  98.4k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  17.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  17.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  17.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  17.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   116k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   116k|        } \
  |  |  |  |  |  |  |  |  132|   907k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   907k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   907k|        ct--; \
  |  |  |  |  |  |  |  |  135|   907k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 67.1k, False: 840k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   840k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.46M|        } else { \
  |  |  |  |  |  |  154|  1.46M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.46M|        } \
  |  |  |  |  |  |  156|  2.30M|    } \
  |  |  |  |  |  |  157|  3.14M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  3.14M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 1.51M, False: 1.62M]
  |  |  |  |  ------------------
  |  |  |  |  443|  1.51M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  1.51M|                                flags, \
  |  |  |  |  445|  1.51M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  1.51M|                                ci); \
  |  |  |  |  447|  1.51M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  1.51M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  1.51M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.51M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  1.51M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.51M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.51M|{ \
  |  |  |  |  |  |  140|  1.51M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.51M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.51M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.51M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.51M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.51M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 441k, False: 1.07M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   441k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   441k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   441k|{ \
  |  |  |  |  |  |  |  |   57|   441k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 109k, False: 332k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   109k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   109k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   109k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   332k|    } else { \
  |  |  |  |  |  |  |  |   62|   332k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   332k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   332k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   332k|    } \
  |  |  |  |  |  |  |  |   66|   441k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   441k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   441k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   441k|{ \
  |  |  |  |  |  |  |  |  128|   671k|    do { \
  |  |  |  |  |  |  |  |  129|   671k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 85.1k, False: 586k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  85.1k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  85.1k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  85.1k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  85.1k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  85.1k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  85.1k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  85.1k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  85.1k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 73.9k, False: 11.1k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  73.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 71.7k, False: 2.27k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  71.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  71.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  71.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  71.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.27k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.27k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.27k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.27k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  73.9k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  11.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  11.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  11.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  11.1k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  85.1k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  85.1k|        } \
  |  |  |  |  |  |  |  |  132|   671k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   671k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   671k|        ct--; \
  |  |  |  |  |  |  |  |  135|   671k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 229k, False: 441k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   441k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  1.07M|    } else {  \
  |  |  |  |  |  |  149|  1.07M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  1.07M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 436k, False: 639k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   436k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   436k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   436k|{ \
  |  |  |  |  |  |  |  |   45|   436k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 83.7k, False: 352k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  83.7k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  83.7k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   352k|    } else { \
  |  |  |  |  |  |  |  |   49|   352k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   352k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   352k|    } \
  |  |  |  |  |  |  |  |   52|   436k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   436k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   436k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   436k|{ \
  |  |  |  |  |  |  |  |  128|   472k|    do { \
  |  |  |  |  |  |  |  |  129|   472k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 61.6k, False: 411k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  61.6k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  61.6k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  61.6k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  61.6k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  61.6k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  61.6k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  61.6k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  61.6k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 52.0k, False: 9.55k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  52.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 51.0k, False: 1.00k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  51.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  51.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  51.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  51.0k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.00k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.00k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.00k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.00k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  52.0k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  9.55k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  9.55k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  9.55k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  9.55k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  61.6k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  61.6k|        } \
  |  |  |  |  |  |  |  |  132|   472k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   472k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   472k|        ct--; \
  |  |  |  |  |  |  |  |  135|   472k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 36.0k, False: 436k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   436k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   639k|        } else { \
  |  |  |  |  |  |  154|   639k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   639k|        } \
  |  |  |  |  |  |  156|  1.07M|    } \
  |  |  |  |  |  |  157|  1.51M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  1.51M|            v = v ^ spb; \
  |  |  |  |  452|  1.51M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 763k, False: 754k]
  |  |  |  |  ------------------
  |  |  |  |  453|  1.51M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.51M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.51M|{ \
  |  |  |  |  |  |  323|  1.51M|    /* east */ \
  |  |  |  |  |  |  324|  1.51M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.51M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.51M| \
  |  |  |  |  |  |  326|  1.51M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.51M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.51M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.51M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.51M| \
  |  |  |  |  |  |  329|  1.51M|    /* west */ \
  |  |  |  |  |  |  330|  1.51M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.51M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.51M| \
  |  |  |  |  |  |  332|  1.51M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.51M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|  1.51M|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|  1.51M|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  1.51M|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|  1.51M|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|  1.51M|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|  1.51M|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|  1.51M|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|  1.51M|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|  1.51M|    } \
  |  |  |  |  |  |  339|  1.51M| \
  |  |  |  |  |  |  340|  1.51M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.51M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.51M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  1.51M|        } \
  |  |  |  |  455|  3.14M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  3.14M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  3.14M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  3.14M|    } \
  |  |  |  |  457|  12.4M|}
  |  |  ------------------
  |  |  661|  12.4M|                                flags, flagsp, flags_stride, data, \
  |  |  662|  12.4M|                                l_w, 0, mqc, curctx, v, a, c, ct, oneplushalf, vsc); \
  |  |  663|  12.4M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  12.4M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  12.4M|{ \
  |  |  |  |  437|  12.4M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  12.4M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  12.4M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  12.4M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  12.4M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 3.54M, False: 8.90M]
  |  |  |  |  ------------------
  |  |  |  |  438|  12.4M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  3.54M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  3.54M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  3.54M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  3.54M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  3.54M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  3.54M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  3.54M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  3.54M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  3.54M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  3.54M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  3.54M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  3.54M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  3.54M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  3.54M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  3.54M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  3.54M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  3.54M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 3.20M, False: 340k]
  |  |  |  |  ------------------
  |  |  |  |  439|  3.20M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  3.20M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.20M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  3.20M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.20M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.20M|{ \
  |  |  |  |  |  |  140|  3.20M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.20M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.20M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.20M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.20M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.20M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 856k, False: 2.35M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   856k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   856k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   856k|{ \
  |  |  |  |  |  |  |  |   57|   856k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 190k, False: 665k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   190k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   190k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   190k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   665k|    } else { \
  |  |  |  |  |  |  |  |   62|   665k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   665k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   665k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   665k|    } \
  |  |  |  |  |  |  |  |   66|   856k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   856k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   856k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   856k|{ \
  |  |  |  |  |  |  |  |  128|  1.33M|    do { \
  |  |  |  |  |  |  |  |  129|  1.33M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 165k, False: 1.16M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   165k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   165k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   165k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   165k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   165k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   165k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   165k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   165k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 138k, False: 27.1k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   138k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 136k, False: 1.79k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   136k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   136k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   136k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   136k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.79k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.79k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.79k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.79k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   138k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  27.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  27.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  27.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  27.1k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   165k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   165k|        } \
  |  |  |  |  |  |  |  |  132|  1.33M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.33M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.33M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.33M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 475k, False: 856k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   856k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.35M|    } else {  \
  |  |  |  |  |  |  149|  2.35M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.35M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 849k, False: 1.50M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   849k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   849k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   849k|{ \
  |  |  |  |  |  |  |  |   45|   849k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 143k, False: 706k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   143k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   143k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   706k|    } else { \
  |  |  |  |  |  |  |  |   49|   706k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   706k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   706k|    } \
  |  |  |  |  |  |  |  |   52|   849k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   849k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   849k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   849k|{ \
  |  |  |  |  |  |  |  |  128|   911k|    do { \
  |  |  |  |  |  |  |  |  129|   911k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 114k, False: 796k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   114k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   114k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   114k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   114k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   114k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   114k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   114k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   114k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 97.2k, False: 17.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  97.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 95.4k, False: 1.78k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  95.4k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  95.4k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  95.4k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  95.4k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.78k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.78k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.78k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.78k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  97.2k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  17.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  17.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  17.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  17.6k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   114k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   114k|        } \
  |  |  |  |  |  |  |  |  132|   911k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   911k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   911k|        ct--; \
  |  |  |  |  |  |  |  |  135|   911k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 61.3k, False: 849k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   849k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.50M|        } else { \
  |  |  |  |  |  |  154|  1.50M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.50M|        } \
  |  |  |  |  |  |  156|  2.35M|    } \
  |  |  |  |  |  |  157|  3.20M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  3.20M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 1.53M, False: 1.67M]
  |  |  |  |  ------------------
  |  |  |  |  443|  1.53M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  1.53M|                                flags, \
  |  |  |  |  445|  1.53M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  1.53M|                                ci); \
  |  |  |  |  447|  1.53M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  1.53M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  1.53M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.53M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  1.53M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.53M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.53M|{ \
  |  |  |  |  |  |  140|  1.53M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.53M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.53M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.53M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.53M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.53M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 437k, False: 1.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   437k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   437k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   437k|{ \
  |  |  |  |  |  |  |  |   57|   437k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 105k, False: 332k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   105k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   105k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   105k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   332k|    } else { \
  |  |  |  |  |  |  |  |   62|   332k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   332k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   332k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   332k|    } \
  |  |  |  |  |  |  |  |   66|   437k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   437k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   437k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   437k|{ \
  |  |  |  |  |  |  |  |  128|   672k|    do { \
  |  |  |  |  |  |  |  |  129|   672k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 79.3k, False: 593k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  79.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  79.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  79.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  79.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  79.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  79.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  79.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  79.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 68.2k, False: 11.1k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  68.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 66.5k, False: 1.74k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  66.5k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  66.5k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  66.5k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  66.5k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.74k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.74k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.74k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.74k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  68.2k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  11.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  11.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  11.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  11.1k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  79.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  79.3k|        } \
  |  |  |  |  |  |  |  |  132|   672k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   672k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   672k|        ct--; \
  |  |  |  |  |  |  |  |  135|   672k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 235k, False: 437k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   437k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  1.09M|    } else {  \
  |  |  |  |  |  |  149|  1.09M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  1.09M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 445k, False: 647k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   445k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   445k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   445k|{ \
  |  |  |  |  |  |  |  |   45|   445k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 83.5k, False: 361k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  83.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  83.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   361k|    } else { \
  |  |  |  |  |  |  |  |   49|   361k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   361k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   361k|    } \
  |  |  |  |  |  |  |  |   52|   445k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   445k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   445k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   445k|{ \
  |  |  |  |  |  |  |  |  128|   483k|    do { \
  |  |  |  |  |  |  |  |  129|   483k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 59.0k, False: 424k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  59.0k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  59.0k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  59.0k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  59.0k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  59.0k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  59.0k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  59.0k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  59.0k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 50.3k, False: 8.64k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  50.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 49.1k, False: 1.22k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  49.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  49.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  49.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  49.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.22k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.22k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.22k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.22k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  50.3k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.64k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.64k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.64k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.64k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  59.0k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  59.0k|        } \
  |  |  |  |  |  |  |  |  132|   483k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   483k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   483k|        ct--; \
  |  |  |  |  |  |  |  |  135|   483k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 37.9k, False: 445k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   445k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   647k|        } else { \
  |  |  |  |  |  |  154|   647k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   647k|        } \
  |  |  |  |  |  |  156|  1.09M|    } \
  |  |  |  |  |  |  157|  1.53M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  1.53M|            v = v ^ spb; \
  |  |  |  |  452|  1.53M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 764k, False: 766k]
  |  |  |  |  ------------------
  |  |  |  |  453|  1.53M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.53M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.53M|{ \
  |  |  |  |  |  |  323|  1.53M|    /* east */ \
  |  |  |  |  |  |  324|  1.53M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.53M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.53M| \
  |  |  |  |  |  |  326|  1.53M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.53M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.53M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.53M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.53M| \
  |  |  |  |  |  |  329|  1.53M|    /* west */ \
  |  |  |  |  |  |  330|  1.53M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.53M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.53M| \
  |  |  |  |  |  |  332|  1.53M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.53M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.53M| \
  |  |  |  |  |  |  340|  1.53M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.53M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.53M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  1.53M|        } \
  |  |  |  |  455|  3.20M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  3.20M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  3.20M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  3.20M|    } \
  |  |  |  |  457|  12.4M|}
  |  |  ------------------
  |  |  664|  12.4M|                                flags, flagsp, flags_stride, data, \
  |  |  665|  12.4M|                                l_w, 1, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  666|  12.4M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  12.4M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  12.4M|{ \
  |  |  |  |  437|  12.4M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  12.4M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  12.4M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  12.4M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  12.4M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 3.57M, False: 8.88M]
  |  |  |  |  ------------------
  |  |  |  |  438|  12.4M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  3.57M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  3.57M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  3.57M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  3.57M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  3.57M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  3.57M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  3.57M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  3.57M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  3.57M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  3.57M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  3.57M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  3.57M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  3.57M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  3.57M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  3.57M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  3.57M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  3.57M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 3.23M, False: 341k]
  |  |  |  |  ------------------
  |  |  |  |  439|  3.23M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  3.23M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.23M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  3.23M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.23M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.23M|{ \
  |  |  |  |  |  |  140|  3.23M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.23M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.23M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.23M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.23M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.23M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 851k, False: 2.38M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   851k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   851k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   851k|{ \
  |  |  |  |  |  |  |  |   57|   851k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 185k, False: 665k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   185k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   185k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   185k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   665k|    } else { \
  |  |  |  |  |  |  |  |   62|   665k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   665k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   665k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   665k|    } \
  |  |  |  |  |  |  |  |   66|   851k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   851k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   851k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   851k|{ \
  |  |  |  |  |  |  |  |  128|  1.33M|    do { \
  |  |  |  |  |  |  |  |  129|  1.33M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 167k, False: 1.17M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   167k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   167k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   167k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   167k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   167k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   167k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   167k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   167k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 139k, False: 28.3k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   139k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 135k, False: 3.63k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   135k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   135k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   135k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   135k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.63k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.63k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.63k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.63k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   139k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  28.3k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  28.3k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  28.3k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  28.3k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   167k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   167k|        } \
  |  |  |  |  |  |  |  |  132|  1.33M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.33M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.33M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.33M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 487k, False: 851k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   851k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.38M|    } else {  \
  |  |  |  |  |  |  149|  2.38M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.38M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 867k, False: 1.51M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   867k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   867k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   867k|{ \
  |  |  |  |  |  |  |  |   45|   867k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 147k, False: 720k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   147k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   147k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   720k|    } else { \
  |  |  |  |  |  |  |  |   49|   720k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   720k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   720k|    } \
  |  |  |  |  |  |  |  |   52|   867k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   867k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   867k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   867k|{ \
  |  |  |  |  |  |  |  |  128|   931k|    do { \
  |  |  |  |  |  |  |  |  129|   931k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 117k, False: 814k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   117k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   117k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   117k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   117k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   117k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   117k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   117k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   117k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 98.8k, False: 18.3k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  98.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 96.2k, False: 2.61k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  96.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  96.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  96.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  96.2k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.61k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.61k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.61k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.61k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  98.8k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  18.3k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  18.3k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  18.3k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  18.3k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   117k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   117k|        } \
  |  |  |  |  |  |  |  |  132|   931k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   931k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   931k|        ct--; \
  |  |  |  |  |  |  |  |  135|   931k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 63.5k, False: 867k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   867k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.51M|        } else { \
  |  |  |  |  |  |  154|  1.51M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.51M|        } \
  |  |  |  |  |  |  156|  2.38M|    } \
  |  |  |  |  |  |  157|  3.23M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  3.23M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 1.56M, False: 1.67M]
  |  |  |  |  ------------------
  |  |  |  |  443|  1.56M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  1.56M|                                flags, \
  |  |  |  |  445|  1.56M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  1.56M|                                ci); \
  |  |  |  |  447|  1.56M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  1.56M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  1.56M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.56M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  1.56M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.56M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.56M|{ \
  |  |  |  |  |  |  140|  1.56M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.56M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.56M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.56M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.56M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.56M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 444k, False: 1.11M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   444k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   444k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   444k|{ \
  |  |  |  |  |  |  |  |   57|   444k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 109k, False: 335k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   109k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   109k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   109k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   335k|    } else { \
  |  |  |  |  |  |  |  |   62|   335k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   335k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   335k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   335k|    } \
  |  |  |  |  |  |  |  |   66|   444k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   444k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   444k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   444k|{ \
  |  |  |  |  |  |  |  |  128|   675k|    do { \
  |  |  |  |  |  |  |  |  129|   675k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 83.3k, False: 592k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  83.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  83.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  83.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  83.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  83.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  83.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  83.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  83.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 70.7k, False: 12.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  70.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 67.7k, False: 2.94k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  67.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  67.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  67.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  67.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.94k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.94k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.94k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.94k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  70.7k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  12.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  12.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  12.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  12.6k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  83.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  83.3k|        } \
  |  |  |  |  |  |  |  |  132|   675k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   675k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   675k|        ct--; \
  |  |  |  |  |  |  |  |  135|   675k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 231k, False: 444k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   444k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  1.11M|    } else {  \
  |  |  |  |  |  |  149|  1.11M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  1.11M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 449k, False: 667k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   449k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   449k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   449k|{ \
  |  |  |  |  |  |  |  |   45|   449k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 86.3k, False: 363k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  86.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  86.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   363k|    } else { \
  |  |  |  |  |  |  |  |   49|   363k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   363k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   363k|    } \
  |  |  |  |  |  |  |  |   52|   449k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   449k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   449k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   449k|{ \
  |  |  |  |  |  |  |  |  128|   487k|    do { \
  |  |  |  |  |  |  |  |  129|   487k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 61.3k, False: 426k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  61.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  61.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  61.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  61.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  61.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  61.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  61.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  61.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 52.9k, False: 8.43k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  52.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 52.1k, False: 823]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  52.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  52.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  52.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  52.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    823|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    823|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    823|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    823|            } \
  |  |  |  |  |  |  |  |  |  |  118|  52.9k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.43k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.43k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.43k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.43k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  61.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  61.3k|        } \
  |  |  |  |  |  |  |  |  132|   487k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   487k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   487k|        ct--; \
  |  |  |  |  |  |  |  |  135|   487k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 38.0k, False: 449k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   449k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   667k|        } else { \
  |  |  |  |  |  |  154|   667k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   667k|        } \
  |  |  |  |  |  |  156|  1.11M|    } \
  |  |  |  |  |  |  157|  1.56M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  1.56M|            v = v ^ spb; \
  |  |  |  |  452|  1.56M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 770k, False: 790k]
  |  |  |  |  ------------------
  |  |  |  |  453|  1.56M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.56M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.56M|{ \
  |  |  |  |  |  |  323|  1.56M|    /* east */ \
  |  |  |  |  |  |  324|  1.56M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.56M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.56M| \
  |  |  |  |  |  |  326|  1.56M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.56M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.56M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.56M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.56M| \
  |  |  |  |  |  |  329|  1.56M|    /* west */ \
  |  |  |  |  |  |  330|  1.56M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.56M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.56M| \
  |  |  |  |  |  |  332|  1.56M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.56M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.56M| \
  |  |  |  |  |  |  340|  1.56M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.56M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.56M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  1.56M|        } \
  |  |  |  |  455|  3.23M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  3.23M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  3.23M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  3.23M|    } \
  |  |  |  |  457|  12.4M|}
  |  |  ------------------
  |  |  667|  12.4M|                                flags, flagsp, flags_stride, data, \
  |  |  668|  12.4M|                                l_w, 2, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  669|  12.4M|                            opj_t1_dec_sigpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  435|  12.4M|                                          v, a, c, ct, oneplushalf, vsc) \
  |  |  |  |  436|  12.4M|{ \
  |  |  |  |  437|  12.4M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  12.4M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  12.4M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == 0U && \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  12.4M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  12.4M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (437:9): [True: 3.58M, False: 8.87M]
  |  |  |  |  ------------------
  |  |  |  |  438|  12.4M|        (flags & (T1_SIGMA_NEIGHBOURS << (ci * 3U))) != 0U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  158|  3.58M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  149|  3.58M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|  3.58M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  150|  3.58M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|  3.58M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  151|  3.58M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|  3.58M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  152|  3.58M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|  3.58M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  154|  3.58M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|  3.58M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  155|  3.58M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|  3.58M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  156|  3.58M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|  3.58M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  157|  3.58M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|  3.58M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (438:9): [True: 3.22M, False: 364k]
  |  |  |  |  ------------------
  |  |  |  |  439|  3.22M|        OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  |  440|  3.22M|        opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.22M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  441|  3.22M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.22M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.22M|{ \
  |  |  |  |  |  |  140|  3.22M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.22M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.22M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.22M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.22M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.22M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 845k, False: 2.37M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   845k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   845k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   845k|{ \
  |  |  |  |  |  |  |  |   57|   845k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 186k, False: 658k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   186k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   186k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   186k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   658k|    } else { \
  |  |  |  |  |  |  |  |   62|   658k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   658k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   658k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   658k|    } \
  |  |  |  |  |  |  |  |   66|   845k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   845k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   845k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   845k|{ \
  |  |  |  |  |  |  |  |  128|  1.33M|    do { \
  |  |  |  |  |  |  |  |  129|  1.33M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 160k, False: 1.17M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   160k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   160k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   160k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   160k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   160k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   160k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   160k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   160k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 134k, False: 26.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   134k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 132k, False: 1.77k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   132k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   132k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   132k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   132k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.77k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.77k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.77k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.77k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   134k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  26.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  26.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  26.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  26.6k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   160k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   160k|        } \
  |  |  |  |  |  |  |  |  132|  1.33M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.33M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.33M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.33M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 489k, False: 845k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   845k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.37M|    } else {  \
  |  |  |  |  |  |  149|  2.37M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.37M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 879k, False: 1.49M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   879k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   879k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   879k|{ \
  |  |  |  |  |  |  |  |   45|   879k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 153k, False: 726k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   153k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   153k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   726k|    } else { \
  |  |  |  |  |  |  |  |   49|   726k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   726k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   726k|    } \
  |  |  |  |  |  |  |  |   52|   879k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   879k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   879k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   879k|{ \
  |  |  |  |  |  |  |  |  128|   945k|    do { \
  |  |  |  |  |  |  |  |  129|   945k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 122k, False: 822k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   122k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   122k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   122k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   122k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   122k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   122k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   122k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   122k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 104k, False: 18.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   104k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 102k, False: 2.23k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   102k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   102k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   102k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   102k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.23k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.23k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.23k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.23k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   104k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  18.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  18.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  18.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  18.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   122k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   122k|        } \
  |  |  |  |  |  |  |  |  132|   945k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   945k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   945k|        ct--; \
  |  |  |  |  |  |  |  |  135|   945k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 66.1k, False: 879k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   879k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.49M|        } else { \
  |  |  |  |  |  |  154|  1.49M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.49M|        } \
  |  |  |  |  |  |  156|  2.37M|    } \
  |  |  |  |  |  |  157|  3.22M|}
  |  |  |  |  ------------------
  |  |  |  |  442|  3.22M|        if (v) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (442:13): [True: 1.55M, False: 1.66M]
  |  |  |  |  ------------------
  |  |  |  |  443|  1.55M|            OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  |  444|  1.55M|                                flags, \
  |  |  |  |  445|  1.55M|                                flagsp[-1], flagsp[1], \
  |  |  |  |  446|  1.55M|                                ci); \
  |  |  |  |  447|  1.55M|            OPJ_UINT32 ctxt2 = opj_t1_getctxno_sc(lu); \
  |  |  |  |  448|  1.55M|            OPJ_UINT32 spb = opj_t1_getspb(lu); \
  |  |  |  |  449|  1.55M|            opj_t1_setcurctx(curctx, ctxt2); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.55M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  450|  1.55M|            opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.55M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.55M|{ \
  |  |  |  |  |  |  140|  1.55M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.55M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.55M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.55M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.55M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.55M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 441k, False: 1.11M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   441k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   441k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   441k|{ \
  |  |  |  |  |  |  |  |   57|   441k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 109k, False: 332k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   109k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   109k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   109k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   332k|    } else { \
  |  |  |  |  |  |  |  |   62|   332k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   332k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   332k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   332k|    } \
  |  |  |  |  |  |  |  |   66|   441k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   441k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   441k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   441k|{ \
  |  |  |  |  |  |  |  |  128|   674k|    do { \
  |  |  |  |  |  |  |  |  129|   674k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 84.2k, False: 590k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  84.2k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  84.2k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  84.2k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  84.2k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  84.2k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  84.2k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  84.2k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  84.2k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 72.3k, False: 11.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  72.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 69.7k, False: 2.60k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  69.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  69.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  69.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  69.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.60k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.60k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.60k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.60k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  72.3k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  11.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  11.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  11.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  11.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  84.2k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  84.2k|        } \
  |  |  |  |  |  |  |  |  132|   674k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   674k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   674k|        ct--; \
  |  |  |  |  |  |  |  |  135|   674k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 232k, False: 441k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   441k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  1.11M|    } else {  \
  |  |  |  |  |  |  149|  1.11M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  1.11M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 461k, False: 653k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   461k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   461k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   461k|{ \
  |  |  |  |  |  |  |  |   45|   461k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 82.9k, False: 378k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  82.9k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  82.9k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   378k|    } else { \
  |  |  |  |  |  |  |  |   49|   378k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   378k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   378k|    } \
  |  |  |  |  |  |  |  |   52|   461k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   461k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   461k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   461k|{ \
  |  |  |  |  |  |  |  |  128|   497k|    do { \
  |  |  |  |  |  |  |  |  129|   497k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 61.5k, False: 435k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  61.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  61.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  61.5k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  61.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  61.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  61.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  61.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  61.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 53.2k, False: 8.34k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  53.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 52.1k, False: 1.13k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  52.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  52.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  52.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  52.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.13k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.13k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.13k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.13k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  53.2k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.34k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.34k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.34k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.34k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  61.5k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  61.5k|        } \
  |  |  |  |  |  |  |  |  132|   497k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   497k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   497k|        ct--; \
  |  |  |  |  |  |  |  |  135|   497k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 36.1k, False: 461k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   461k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   653k|        } else { \
  |  |  |  |  |  |  154|   653k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   653k|        } \
  |  |  |  |  |  |  156|  1.11M|    } \
  |  |  |  |  |  |  157|  1.55M|}
  |  |  |  |  ------------------
  |  |  |  |  451|  1.55M|            v = v ^ spb; \
  |  |  |  |  452|  1.55M|            data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (452:36): [True: 773k, False: 782k]
  |  |  |  |  ------------------
  |  |  |  |  453|  1.55M|            opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.55M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.55M|{ \
  |  |  |  |  |  |  323|  1.55M|    /* east */ \
  |  |  |  |  |  |  324|  1.55M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.55M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.55M| \
  |  |  |  |  |  |  326|  1.55M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.55M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.55M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.55M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.55M| \
  |  |  |  |  |  |  329|  1.55M|    /* west */ \
  |  |  |  |  |  |  330|  1.55M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.55M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.55M| \
  |  |  |  |  |  |  332|  1.55M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.55M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.55M| \
  |  |  |  |  |  |  340|  1.55M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.55M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  1.55M|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|  1.55M|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  1.55M|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  1.55M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  1.55M|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  1.55M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  1.55M|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  1.55M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|  1.55M|    } \
  |  |  |  |  |  |  347|  1.55M|}
  |  |  |  |  ------------------
  |  |  |  |  454|  1.55M|        } \
  |  |  |  |  455|  3.22M|        flags |= T1_PI_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  3.22M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  3.22M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  456|  3.22M|    } \
  |  |  |  |  457|  12.4M|}
  |  |  ------------------
  |  |  670|  12.4M|                                flags, flagsp, flags_stride, data, \
  |  |  671|  12.4M|                                l_w, 3, mqc, curctx, v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  |  672|  12.4M|                            *flagsp = flags; \
  |  |  673|  12.4M|                        } \
  |  |  674|  19.6M|                } \
  |  |  675|  1.56M|        } \
  |  |  676|   151k|        UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|   151k|        mqc->curctx = curctx; \
  |  |  |  |  167|   151k|        mqc->c = c; \
  |  |  |  |  168|   151k|        mqc->a = a; \
  |  |  |  |  169|   151k|        mqc->ct = ct;
  |  |  ------------------
  |  |  677|   151k|        if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (677:13): [True: 47.8k, False: 103k]
  |  |  ------------------
  |  |  678|  1.47M|            for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (678:25): [True: 1.42M, False: 47.8k]
  |  |  ------------------
  |  |  679|  4.10M|                for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (679:29): [True: 2.67M, False: 1.42M]
  |  |  ------------------
  |  |  680|  2.67M|                        opj_t1_dec_sigpass_step_mqc(t1, flagsp, \
  |  |  681|  2.67M|                            data + j * l_w, oneplushalf, j, flags_stride, vsc); \
  |  |  682|  2.67M|                } \
  |  |  683|  1.42M|            } \
  |  |  684|  47.8k|        } \
  |  |  685|   151k|}
  ------------------
  706|   151k|                                    t1->w + 2U);
  707|   151k|}
t1.c:opj_t1_dec_refpass_raw:
  925|  12.0k|{
  926|  12.0k|    OPJ_INT32 one, poshalf;
  927|  12.0k|    OPJ_UINT32 i, j, k;
  928|  12.0k|    OPJ_INT32 *data = t1->data;
  929|  12.0k|    opj_flag_t *flagsp = &T1_FLAGS(0, 0);
  ------------------
  |  |   60|  12.0k|#define T1_FLAGS(x, y) (t1->flags[x + 1 + ((y / 4) + 1) * (t1->w+2)])
  ------------------
  930|  12.0k|    const OPJ_UINT32 l_w = t1->w;
  931|  12.0k|    one = 1 << bpno;
  932|  12.0k|    poshalf = one >> 1;
  933|   136k|    for (k = 0; k < (t1->h & ~3U); k += 4, flagsp += 2, data += 3 * l_w) {
  ------------------
  |  Branch (933:17): [True: 123k, False: 12.0k]
  ------------------
  934|  4.92M|        for (i = 0; i < l_w; ++i, ++flagsp, ++data) {
  ------------------
  |  Branch (934:21): [True: 4.80M, False: 123k]
  ------------------
  935|  4.80M|            opj_flag_t flags = *flagsp;
  936|  4.80M|            if (flags != 0) {
  ------------------
  |  Branch (936:17): [True: 3.34M, False: 1.45M]
  ------------------
  937|  3.34M|                opj_t1_dec_refpass_step_raw(
  938|  3.34M|                    t1,
  939|  3.34M|                    flagsp,
  940|  3.34M|                    data,
  941|  3.34M|                    poshalf,
  942|  3.34M|                    0U);
  943|  3.34M|                opj_t1_dec_refpass_step_raw(
  944|  3.34M|                    t1,
  945|  3.34M|                    flagsp,
  946|  3.34M|                    data + l_w,
  947|  3.34M|                    poshalf,
  948|  3.34M|                    1U);
  949|  3.34M|                opj_t1_dec_refpass_step_raw(
  950|  3.34M|                    t1,
  951|  3.34M|                    flagsp,
  952|  3.34M|                    data + 2 * l_w,
  953|  3.34M|                    poshalf,
  954|  3.34M|                    2U);
  955|  3.34M|                opj_t1_dec_refpass_step_raw(
  956|  3.34M|                    t1,
  957|  3.34M|                    flagsp,
  958|  3.34M|                    data + 3 * l_w,
  959|  3.34M|                    poshalf,
  960|  3.34M|                    3U);
  961|  3.34M|            }
  962|  4.80M|        }
  963|   123k|    }
  964|  12.0k|    if (k < t1->h) {
  ------------------
  |  Branch (964:9): [True: 4.74k, False: 7.35k]
  ------------------
  965|   354k|        for (i = 0; i < l_w; ++i, ++flagsp, ++data) {
  ------------------
  |  Branch (965:21): [True: 349k, False: 4.74k]
  ------------------
  966|  1.13M|            for (j = 0; j < t1->h - k; ++j) {
  ------------------
  |  Branch (966:25): [True: 789k, False: 349k]
  ------------------
  967|   789k|                opj_t1_dec_refpass_step_raw(
  968|   789k|                    t1,
  969|   789k|                    flagsp,
  970|   789k|                    data + j * l_w,
  971|   789k|                    poshalf,
  972|   789k|                    j);
  973|   789k|            }
  974|   349k|        }
  975|  4.74k|    }
  976|  12.0k|}
t1.c:opj_t1_dec_refpass_step_raw:
  770|  14.1M|{
  771|  14.1M|    OPJ_UINT32 v;
  772|       |
  773|  14.1M|    opj_mqc_t *mqc = &(t1->mqc);       /* RAW component */
  774|       |
  775|  14.1M|    if ((*flagsp & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) ==
  ------------------
  |  |  153|  14.1M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  ------------------
  |  |  |  |   95|  14.1M|#define T1_SIGMA_4  (1U << 4)
  |  |  ------------------
  ------------------
                  if ((*flagsp & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) ==
  ------------------
  |  |  163|  14.1M|#define T1_PI_THIS    T1_PI_0
  |  |  ------------------
  |  |  |  |  115|  14.1M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  ------------------
  |  Branch (775:9): [True: 11.9M, False: 2.21M]
  ------------------
  776|  14.1M|            (T1_SIGMA_THIS << (ci * 3U))) {
  ------------------
  |  |  153|  14.1M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  ------------------
  |  |  |  |   95|  14.1M|#define T1_SIGMA_4  (1U << 4)
  |  |  ------------------
  ------------------
  777|  11.9M|        v = opj_mqc_raw_decode(mqc);
  778|  11.9M|        *datap += (v ^ (*datap < 0)) ? poshalf : -poshalf;
  ------------------
  |  Branch (778:19): [True: 3.97M, False: 7.98M]
  ------------------
  779|  11.9M|        *flagsp |= T1_MU_THIS << (ci * 3U);
  ------------------
  |  |  162|  11.9M|#define T1_MU_THIS    T1_MU_0
  |  |  ------------------
  |  |  |  |  114|  11.9M|#define T1_MU_0     (1U << 20)
  |  |  ------------------
  ------------------
  780|  11.9M|    }
  781|  14.1M|}
t1.c:opj_t1_dec_refpass_mqc:
 1037|   445k|{
 1038|   445k|    if (t1->w == 64 && t1->h == 64) {
  ------------------
  |  Branch (1038:9): [True: 193k, False: 251k]
  |  Branch (1038:24): [True: 156k, False: 36.2k]
  ------------------
 1039|   156k|        opj_t1_dec_refpass_mqc_64x64(t1, bpno);
 1040|   288k|    } else {
 1041|   288k|        opj_t1_dec_refpass_mqc_generic(t1, bpno);
 1042|   288k|    }
 1043|   445k|}
t1.c:opj_t1_dec_refpass_mqc_64x64:
 1023|   156k|{
 1024|   156k|    opj_t1_dec_refpass_mqc_internal(t1, bpno, 64, 64, 66);
  ------------------
  |  |  978|   156k|#define opj_t1_dec_refpass_mqc_internal(t1, bpno, w, h, flags_stride) \
  |  |  979|   156k|{ \
  |  |  980|   156k|        OPJ_INT32 one, poshalf; \
  |  |  981|   156k|        OPJ_UINT32 i, j, k; \
  |  |  982|   156k|        register OPJ_INT32 *data = t1->data; \
  |  |  983|   156k|        register opj_flag_t *flagsp = &t1->flags[flags_stride + 1]; \
  |  |  984|   156k|        const OPJ_UINT32 l_w = w; \
  |  |  985|   156k|        opj_mqc_t* mqc = &(t1->mqc); \
  |  |  986|   156k|        DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|   156k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|   156k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|   156k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|   156k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  |  987|   156k|        register OPJ_UINT32 v; \
  |  |  988|   156k|        one = 1 << bpno; \
  |  |  989|   156k|        poshalf = one >> 1; \
  |  |  990|  2.66M|        for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (990:21): [True: 2.51M, False: 156k]
  |  |  ------------------
  |  |  991|   163M|                for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (991:29): [True: 160M, False: 2.51M]
  |  |  ------------------
  |  |  992|   160M|                        opj_flag_t flags = *flagsp; \
  |  |  993|   160M|                        if( flags != 0 ) { \
  |  |  ------------------
  |  |  |  Branch (993:29): [True: 116M, False: 44.4M]
  |  |  ------------------
  |  |  994|   116M|                            opj_t1_dec_refpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  784|   116M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  |  |  785|   116M|{ \
  |  |  |  |  786|   116M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   116M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   116M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|   116M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|   116M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (786:9): [True: 93.0M, False: 23.1M]
  |  |  |  |  ------------------
  |  |  |  |  787|   116M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   116M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   116M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  788|  93.0M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  |  |  789|  93.0M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  93.0M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  790|  93.0M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  93.0M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  93.0M|{ \
  |  |  |  |  |  |  140|  93.0M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  93.0M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  93.0M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  93.0M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  93.0M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  93.0M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 18.2M, False: 74.7M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  18.2M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  18.2M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  18.2M|{ \
  |  |  |  |  |  |  |  |   57|  18.2M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 3.56M, False: 14.6M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  3.56M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  3.56M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  3.56M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  14.6M|    } else { \
  |  |  |  |  |  |  |  |   62|  14.6M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  14.6M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  14.6M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  14.6M|    } \
  |  |  |  |  |  |  |  |   66|  18.2M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  18.2M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  18.2M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  18.2M|{ \
  |  |  |  |  |  |  |  |  128|  30.3M|    do { \
  |  |  |  |  |  |  |  |  129|  30.3M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 3.78M, False: 26.5M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  3.78M|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  3.78M|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  3.78M|{ \
  |  |  |  |  |  |  |  |  |  |  104|  3.78M|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  3.78M|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  3.78M|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  3.78M|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  3.78M|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 3.74M, False: 44.1k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  3.74M|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.74M, False: 2.12k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.74M|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.74M|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.74M|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.74M|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.12k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.12k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.12k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.12k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  3.74M|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  44.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  44.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  44.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  44.1k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  3.78M|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  3.78M|        } \
  |  |  |  |  |  |  |  |  132|  30.3M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  30.3M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  30.3M|        ct--; \
  |  |  |  |  |  |  |  |  135|  30.3M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 12.0M, False: 18.2M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  18.2M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  74.7M|    } else {  \
  |  |  |  |  |  |  149|  74.7M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  74.7M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 19.6M, False: 55.1M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  19.6M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  19.6M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  19.6M|{ \
  |  |  |  |  |  |  |  |   45|  19.6M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 3.02M, False: 16.6M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.02M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  3.02M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  16.6M|    } else { \
  |  |  |  |  |  |  |  |   49|  16.6M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  16.6M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  16.6M|    } \
  |  |  |  |  |  |  |  |   52|  19.6M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  19.6M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  19.6M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  19.6M|{ \
  |  |  |  |  |  |  |  |  128|  20.8M|    do { \
  |  |  |  |  |  |  |  |  129|  20.8M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 2.61M, False: 18.2M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  2.61M|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  2.61M|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  2.61M|{ \
  |  |  |  |  |  |  |  |  |  |  104|  2.61M|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  2.61M|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  2.61M|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  2.61M|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  2.61M|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 2.58M, False: 30.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  2.58M|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 2.58M, False: 1.19k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  2.58M|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  2.58M|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  2.58M|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  2.58M|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.19k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.19k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.19k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.19k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  2.58M|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  30.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  30.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  30.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  30.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  2.61M|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  2.61M|        } \
  |  |  |  |  |  |  |  |  132|  20.8M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  20.8M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  20.8M|        ct--; \
  |  |  |  |  |  |  |  |  135|  20.8M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.17M, False: 19.6M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  19.6M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  55.1M|        } else { \
  |  |  |  |  |  |  154|  55.1M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  55.1M|        } \
  |  |  |  |  |  |  156|  74.7M|    } \
  |  |  |  |  |  |  157|  93.0M|}
  |  |  |  |  ------------------
  |  |  |  |  791|  93.0M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (791:33): [True: 46.4M, False: 46.5M]
  |  |  |  |  ------------------
  |  |  |  |  792|  93.0M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  162|  93.0M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|  93.0M|#define T1_MU_0     (1U << 20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  793|  93.0M|    } \
  |  |  |  |  794|   116M|}
  |  |  ------------------
  |  |  995|   116M|                                flags, data, l_w, 0, \
  |  |  996|   116M|                                mqc, curctx, v, a, c, ct, poshalf); \
  |  |  997|   116M|                            opj_t1_dec_refpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  784|   116M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  |  |  785|   116M|{ \
  |  |  |  |  786|   116M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   116M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   116M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|   116M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|   116M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (786:9): [True: 92.7M, False: 23.4M]
  |  |  |  |  ------------------
  |  |  |  |  787|   116M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   116M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   116M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  788|  92.7M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  |  |  789|  92.7M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  92.7M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  790|  92.7M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  92.7M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  92.7M|{ \
  |  |  |  |  |  |  140|  92.7M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  92.7M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  92.7M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  92.7M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  92.7M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  92.7M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 18.2M, False: 74.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  18.2M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  18.2M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  18.2M|{ \
  |  |  |  |  |  |  |  |   57|  18.2M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 3.58M, False: 14.6M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  3.58M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  3.58M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  3.58M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  14.6M|    } else { \
  |  |  |  |  |  |  |  |   62|  14.6M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  14.6M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  14.6M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  14.6M|    } \
  |  |  |  |  |  |  |  |   66|  18.2M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  18.2M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  18.2M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  18.2M|{ \
  |  |  |  |  |  |  |  |  128|  30.3M|    do { \
  |  |  |  |  |  |  |  |  129|  30.3M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 3.77M, False: 26.5M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  3.77M|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  3.77M|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  3.77M|{ \
  |  |  |  |  |  |  |  |  |  |  104|  3.77M|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  3.77M|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  3.77M|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  3.77M|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  3.77M|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 3.73M, False: 41.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  3.73M|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.73M, False: 1.76k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.73M|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.73M|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.73M|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.73M|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.76k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.76k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.76k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.76k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  3.73M|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  41.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  41.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  41.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  41.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  3.77M|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  3.77M|        } \
  |  |  |  |  |  |  |  |  132|  30.3M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  30.3M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  30.3M|        ct--; \
  |  |  |  |  |  |  |  |  135|  30.3M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 12.0M, False: 18.2M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  18.2M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  74.5M|    } else {  \
  |  |  |  |  |  |  149|  74.5M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  74.5M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 19.5M, False: 54.9M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  19.5M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  19.5M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  19.5M|{ \
  |  |  |  |  |  |  |  |   45|  19.5M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 3.00M, False: 16.5M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.00M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  3.00M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  16.5M|    } else { \
  |  |  |  |  |  |  |  |   49|  16.5M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  16.5M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  16.5M|    } \
  |  |  |  |  |  |  |  |   52|  19.5M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  19.5M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  19.5M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  19.5M|{ \
  |  |  |  |  |  |  |  |  128|  20.7M|    do { \
  |  |  |  |  |  |  |  |  129|  20.7M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 2.59M, False: 18.1M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  2.59M|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  2.59M|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  2.59M|{ \
  |  |  |  |  |  |  |  |  |  |  104|  2.59M|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  2.59M|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  2.59M|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  2.59M|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  2.59M|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 2.56M, False: 29.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  2.56M|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 2.56M, False: 1.10k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  2.56M|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  2.56M|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  2.56M|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  2.56M|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.10k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.10k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.10k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.10k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  2.56M|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  29.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  29.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  29.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  29.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  2.59M|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  2.59M|        } \
  |  |  |  |  |  |  |  |  132|  20.7M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  20.7M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  20.7M|        ct--; \
  |  |  |  |  |  |  |  |  135|  20.7M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.16M, False: 19.5M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  19.5M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  54.9M|        } else { \
  |  |  |  |  |  |  154|  54.9M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  54.9M|        } \
  |  |  |  |  |  |  156|  74.5M|    } \
  |  |  |  |  |  |  157|  92.7M|}
  |  |  |  |  ------------------
  |  |  |  |  791|  92.7M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (791:33): [True: 46.4M, False: 46.3M]
  |  |  |  |  ------------------
  |  |  |  |  792|  92.7M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  162|  92.7M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|  92.7M|#define T1_MU_0     (1U << 20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  793|  92.7M|    } \
  |  |  |  |  794|   116M|}
  |  |  ------------------
  |  |  998|   116M|                                flags, data, l_w, 1, \
  |  |  999|   116M|                                mqc, curctx, v, a, c, ct, poshalf); \
  |  | 1000|   116M|                            opj_t1_dec_refpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  784|   116M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  |  |  785|   116M|{ \
  |  |  |  |  786|   116M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   116M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   116M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|   116M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|   116M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (786:9): [True: 92.7M, False: 23.4M]
  |  |  |  |  ------------------
  |  |  |  |  787|   116M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   116M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   116M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  788|  92.7M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  |  |  789|  92.7M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  92.7M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  790|  92.7M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  92.7M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  92.7M|{ \
  |  |  |  |  |  |  140|  92.7M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  92.7M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  92.7M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  92.7M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  92.7M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  92.7M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 18.1M, False: 74.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  18.1M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  18.1M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  18.1M|{ \
  |  |  |  |  |  |  |  |   57|  18.1M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 3.57M, False: 14.5M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  3.57M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  3.57M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  3.57M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  14.5M|    } else { \
  |  |  |  |  |  |  |  |   62|  14.5M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  14.5M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  14.5M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  14.5M|    } \
  |  |  |  |  |  |  |  |   66|  18.1M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  18.1M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  18.1M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  18.1M|{ \
  |  |  |  |  |  |  |  |  128|  30.1M|    do { \
  |  |  |  |  |  |  |  |  129|  30.1M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 3.76M, False: 26.4M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  3.76M|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  3.76M|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  3.76M|{ \
  |  |  |  |  |  |  |  |  |  |  104|  3.76M|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  3.76M|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  3.76M|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  3.76M|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  3.76M|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 3.72M, False: 42.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  3.72M|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.72M, False: 1.54k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.72M|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.72M|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.72M|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.72M|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.54k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.54k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.54k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.54k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  3.72M|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  42.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  42.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  42.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  42.0k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  3.76M|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  3.76M|        } \
  |  |  |  |  |  |  |  |  132|  30.1M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  30.1M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  30.1M|        ct--; \
  |  |  |  |  |  |  |  |  135|  30.1M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 12.0M, False: 18.1M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  18.1M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  74.5M|    } else {  \
  |  |  |  |  |  |  149|  74.5M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  74.5M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 19.7M, False: 54.8M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  19.7M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  19.7M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  19.7M|{ \
  |  |  |  |  |  |  |  |   45|  19.7M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 3.00M, False: 16.7M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.00M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  3.00M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  16.7M|    } else { \
  |  |  |  |  |  |  |  |   49|  16.7M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  16.7M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  16.7M|    } \
  |  |  |  |  |  |  |  |   52|  19.7M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  19.7M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  19.7M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  19.7M|{ \
  |  |  |  |  |  |  |  |  128|  20.8M|    do { \
  |  |  |  |  |  |  |  |  129|  20.8M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 2.60M, False: 18.2M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  2.60M|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  2.60M|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  2.60M|{ \
  |  |  |  |  |  |  |  |  |  |  104|  2.60M|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  2.60M|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  2.60M|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  2.60M|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  2.60M|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 2.57M, False: 28.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  2.57M|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 2.57M, False: 1.66k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  2.57M|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  2.57M|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  2.57M|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  2.57M|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.66k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.66k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.66k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.66k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  2.57M|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  28.7k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  28.7k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  28.7k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  28.7k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  2.60M|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  2.60M|        } \
  |  |  |  |  |  |  |  |  132|  20.8M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  20.8M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  20.8M|        ct--; \
  |  |  |  |  |  |  |  |  135|  20.8M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.17M, False: 19.7M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  19.7M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  54.8M|        } else { \
  |  |  |  |  |  |  154|  54.8M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  54.8M|        } \
  |  |  |  |  |  |  156|  74.5M|    } \
  |  |  |  |  |  |  157|  92.7M|}
  |  |  |  |  ------------------
  |  |  |  |  791|  92.7M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (791:33): [True: 46.3M, False: 46.4M]
  |  |  |  |  ------------------
  |  |  |  |  792|  92.7M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  162|  92.7M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|  92.7M|#define T1_MU_0     (1U << 20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  793|  92.7M|    } \
  |  |  |  |  794|   116M|}
  |  |  ------------------
  |  | 1001|   116M|                                flags, data, l_w, 2, \
  |  | 1002|   116M|                                mqc, curctx, v, a, c, ct, poshalf); \
  |  | 1003|   116M|                            opj_t1_dec_refpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  784|   116M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  |  |  785|   116M|{ \
  |  |  |  |  786|   116M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   116M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   116M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|   116M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|   116M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (786:9): [True: 92.1M, False: 24.0M]
  |  |  |  |  ------------------
  |  |  |  |  787|   116M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   116M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   116M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  788|  92.1M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  |  |  789|  92.1M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  92.1M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  790|  92.1M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  92.1M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  92.1M|{ \
  |  |  |  |  |  |  140|  92.1M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  92.1M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  92.1M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  92.1M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  92.1M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  92.1M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 18.0M, False: 74.0M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  18.0M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  18.0M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  18.0M|{ \
  |  |  |  |  |  |  |  |   57|  18.0M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 3.51M, False: 14.5M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  3.51M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  3.51M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  3.51M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  14.5M|    } else { \
  |  |  |  |  |  |  |  |   62|  14.5M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  14.5M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  14.5M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  14.5M|    } \
  |  |  |  |  |  |  |  |   66|  18.0M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  18.0M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  18.0M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  18.0M|{ \
  |  |  |  |  |  |  |  |  128|  30.0M|    do { \
  |  |  |  |  |  |  |  |  129|  30.0M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 3.77M, False: 26.2M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  3.77M|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  3.77M|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  3.77M|{ \
  |  |  |  |  |  |  |  |  |  |  104|  3.77M|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  3.77M|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  3.77M|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  3.77M|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  3.77M|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 3.73M, False: 44.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  3.73M|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.72M, False: 1.93k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.72M|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.72M|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.72M|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.72M|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.93k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.93k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.93k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.93k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  3.73M|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  44.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  44.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  44.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  44.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  3.77M|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  3.77M|        } \
  |  |  |  |  |  |  |  |  132|  30.0M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  30.0M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  30.0M|        ct--; \
  |  |  |  |  |  |  |  |  135|  30.0M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 11.9M, False: 18.0M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  18.0M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  74.0M|    } else {  \
  |  |  |  |  |  |  149|  74.0M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  74.0M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 19.5M, False: 54.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  19.5M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  19.5M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  19.5M|{ \
  |  |  |  |  |  |  |  |   45|  19.5M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 2.99M, False: 16.5M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  2.99M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  2.99M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  16.5M|    } else { \
  |  |  |  |  |  |  |  |   49|  16.5M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  16.5M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  16.5M|    } \
  |  |  |  |  |  |  |  |   52|  19.5M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  19.5M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  19.5M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  19.5M|{ \
  |  |  |  |  |  |  |  |  128|  20.6M|    do { \
  |  |  |  |  |  |  |  |  129|  20.6M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 2.59M, False: 18.0M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  2.59M|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  2.59M|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  2.59M|{ \
  |  |  |  |  |  |  |  |  |  |  104|  2.59M|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  2.59M|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  2.59M|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  2.59M|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  2.59M|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 2.56M, False: 30.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  2.56M|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 2.56M, False: 1.16k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  2.56M|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  2.56M|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  2.56M|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  2.56M|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.16k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.16k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.16k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.16k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  2.56M|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  30.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  30.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  30.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  30.9k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  2.59M|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  2.59M|        } \
  |  |  |  |  |  |  |  |  132|  20.6M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  20.6M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  20.6M|        ct--; \
  |  |  |  |  |  |  |  |  135|  20.6M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.16M, False: 19.5M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  19.5M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  54.5M|        } else { \
  |  |  |  |  |  |  154|  54.5M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  54.5M|        } \
  |  |  |  |  |  |  156|  74.0M|    } \
  |  |  |  |  |  |  157|  92.1M|}
  |  |  |  |  ------------------
  |  |  |  |  791|  92.1M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (791:33): [True: 46.0M, False: 46.1M]
  |  |  |  |  ------------------
  |  |  |  |  792|  92.1M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  162|  92.1M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|  92.1M|#define T1_MU_0     (1U << 20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  793|  92.1M|    } \
  |  |  |  |  794|   116M|}
  |  |  ------------------
  |  | 1004|   116M|                                flags, data, l_w, 3, \
  |  | 1005|   116M|                                mqc, curctx, v, a, c, ct, poshalf); \
  |  | 1006|   116M|                            *flagsp = flags; \
  |  | 1007|   116M|                        } \
  |  | 1008|   160M|                } \
  |  | 1009|  2.51M|        } \
  |  | 1010|   156k|        UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|   156k|        mqc->curctx = curctx; \
  |  |  |  |  167|   156k|        mqc->c = c; \
  |  |  |  |  168|   156k|        mqc->a = a; \
  |  |  |  |  169|   156k|        mqc->ct = ct;
  |  |  ------------------
  |  | 1011|   156k|        if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (1011:13): [True: 0, False: 156k]
  |  |  ------------------
  |  | 1012|      0|            for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (1012:25): [True: 0, False: 0]
  |  |  ------------------
  |  | 1013|      0|                for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (1013:29): [True: 0, False: 0]
  |  |  ------------------
  |  | 1014|      0|                        opj_t1_dec_refpass_step_mqc(t1, flagsp, data + j * l_w, poshalf, j); \
  |  | 1015|      0|                } \
  |  | 1016|      0|            } \
  |  | 1017|      0|        } \
  |  | 1018|   156k|}
  ------------------
 1025|   156k|}
t1.c:opj_t1_getctxno_mag:
  292|   439M|{
  293|   439M|    OPJ_UINT32 tmp = (f & T1_SIGMA_NEIGHBOURS) ? T1_CTXNO_MAG + 1 : T1_CTXNO_MAG;
  ------------------
  |  |  158|   439M|#define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  149|   439M|#define T1_SIGMA_NW   T1_SIGMA_0
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|   439M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  150|   439M|#define T1_SIGMA_N    T1_SIGMA_1
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|   439M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  151|   439M|#define T1_SIGMA_NE   T1_SIGMA_2
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   439M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  152|   439M|#define T1_SIGMA_W    T1_SIGMA_3
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|   439M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  154|   439M|#define T1_SIGMA_E    T1_SIGMA_5
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   439M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  155|   439M|#define T1_SIGMA_SW   T1_SIGMA_6
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|   439M|#define T1_SIGMA_6  (1U << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  156|   439M|#define T1_SIGMA_S    T1_SIGMA_7
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   439M|#define T1_SIGMA_7  (1U << 7)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_SIGMA_NEIGHBOURS (T1_SIGMA_NW | T1_SIGMA_N | T1_SIGMA_NE | T1_SIGMA_W | T1_SIGMA_E | T1_SIGMA_SW | T1_SIGMA_S | T1_SIGMA_SE)
  |  |  ------------------
  |  |  |  |  157|   439M|#define T1_SIGMA_SE   T1_SIGMA_8
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   439M|#define T1_SIGMA_8  (1U << 8)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  OPJ_UINT32 tmp = (f & T1_SIGMA_NEIGHBOURS) ? T1_CTXNO_MAG + 1 : T1_CTXNO_MAG;
  ------------------
  |  |   63|   439M|#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  ------------------
  |  |  |  |   62|   439M|#define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   61|   439M|#define T1_CTXNO_ZC  0
  |  |  |  |  ------------------
  |  |  |  |               #define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   439M|#define T1_NUMCTXS_ZC  9
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  ------------------
  |  |  |  |   56|   439M|#define T1_NUMCTXS_SC  5
  |  |  ------------------
  ------------------
                  OPJ_UINT32 tmp = (f & T1_SIGMA_NEIGHBOURS) ? T1_CTXNO_MAG + 1 : T1_CTXNO_MAG;
  ------------------
  |  |   63|   440M|#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  ------------------
  |  |  |  |   62|  93.5k|#define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   61|  93.5k|#define T1_CTXNO_ZC  0
  |  |  |  |  ------------------
  |  |  |  |               #define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  93.5k|#define T1_NUMCTXS_ZC  9
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  ------------------
  |  |  |  |   56|  93.5k|#define T1_NUMCTXS_SC  5
  |  |  ------------------
  ------------------
  |  Branch (293:22): [True: 439M, False: 93.5k]
  ------------------
  294|   439M|    OPJ_UINT32 tmp2 = (f & T1_MU_0) ? T1_CTXNO_MAG + 2 : tmp;
  ------------------
  |  |  114|   439M|#define T1_MU_0     (1U << 20)
  ------------------
                  OPJ_UINT32 tmp2 = (f & T1_MU_0) ? T1_CTXNO_MAG + 2 : tmp;
  ------------------
  |  |   63|   359M|#define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  ------------------
  |  |  |  |   62|   359M|#define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   61|   359M|#define T1_CTXNO_ZC  0
  |  |  |  |  ------------------
  |  |  |  |               #define T1_CTXNO_SC  (T1_CTXNO_ZC+T1_NUMCTXS_ZC)
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   359M|#define T1_NUMCTXS_ZC  9
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define T1_CTXNO_MAG (T1_CTXNO_SC+T1_NUMCTXS_SC)
  |  |  ------------------
  |  |  |  |   56|   359M|#define T1_NUMCTXS_SC  5
  |  |  ------------------
  ------------------
  |  Branch (294:23): [True: 359M, False: 80.7M]
  ------------------
  295|   439M|    return tmp2;
  296|   439M|}
t1.c:opj_t1_dec_refpass_step_mqc:
  802|  3.93M|{
  803|  3.93M|    OPJ_UINT32 v;
  804|       |
  805|  3.93M|    opj_mqc_t *mqc = &(t1->mqc);       /* MQC component */
  806|  3.93M|    opj_t1_dec_refpass_step_mqc_macro(*flagsp, datap, 0, ci,
  ------------------
  |  |  784|  3.93M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  785|  3.93M|{ \
  |  |  786|  3.93M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  ------------------
  |  |  |  |  153|  3.93M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  3.93M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  ------------------
  |  |  |  |  163|  3.93M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|  3.93M|#define T1_PI_0     (1U << 21)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (786:9): [True: 1.70M, False: 2.22M]
  |  |  ------------------
  |  |  787|  3.93M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  ------------------
  |  |  |  |  153|  3.93M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  3.93M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  788|  1.70M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  789|  1.70M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  ------------------
  |  |  |  |   62|  1.70M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  |  790|  1.70M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|  1.70M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|  1.70M|{ \
  |  |  |  |  140|  1.70M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|  1.70M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|  1.70M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|  1.70M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|  1.70M|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|  1.70M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 370k, False: 1.33M]
  |  |  |  |  ------------------
  |  |  |  |  146|   370k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   370k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   370k|{ \
  |  |  |  |  |  |   57|   370k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 82.2k, False: 288k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  82.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  82.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  82.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   288k|    } else { \
  |  |  |  |  |  |   62|   288k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   288k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   288k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   288k|    } \
  |  |  |  |  |  |   66|   370k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   370k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   370k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   370k|{ \
  |  |  |  |  |  |  128|   588k|    do { \
  |  |  |  |  |  |  129|   588k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 73.7k, False: 515k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  73.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  73.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  73.7k|{ \
  |  |  |  |  |  |  |  |  104|  73.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  73.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  73.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  73.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  73.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 67.6k, False: 6.06k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  67.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 65.0k, False: 2.61k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  65.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  65.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  65.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  65.0k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.61k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.61k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.61k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.61k|            } \
  |  |  |  |  |  |  |  |  118|  67.6k|        } else { \
  |  |  |  |  |  |  |  |  119|  6.06k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  6.06k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  6.06k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  6.06k|        } \
  |  |  |  |  |  |  |  |  123|  73.7k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  73.7k|        } \
  |  |  |  |  |  |  132|   588k|        a <<= 1; \
  |  |  |  |  |  |  133|   588k|        c <<= 1; \
  |  |  |  |  |  |  134|   588k|        ct--; \
  |  |  |  |  |  |  135|   588k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 218k, False: 370k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   370k|}
  |  |  |  |  ------------------
  |  |  |  |  148|  1.33M|    } else {  \
  |  |  |  |  149|  1.33M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|  1.33M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 388k, False: 949k]
  |  |  |  |  ------------------
  |  |  |  |  151|   388k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   388k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   388k|{ \
  |  |  |  |  |  |   45|   388k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 69.5k, False: 318k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  69.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  69.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   318k|    } else { \
  |  |  |  |  |  |   49|   318k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   318k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   318k|    } \
  |  |  |  |  |  |   52|   388k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   388k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   388k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   388k|{ \
  |  |  |  |  |  |  128|   413k|    do { \
  |  |  |  |  |  |  129|   413k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 52.4k, False: 360k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  52.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  52.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  52.4k|{ \
  |  |  |  |  |  |  |  |  104|  52.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  52.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  52.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  52.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  52.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 47.2k, False: 5.27k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  47.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 45.1k, False: 2.03k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  45.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  45.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  45.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  45.1k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.03k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.03k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.03k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.03k|            } \
  |  |  |  |  |  |  |  |  118|  47.2k|        } else { \
  |  |  |  |  |  |  |  |  119|  5.27k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  5.27k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  5.27k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  5.27k|        } \
  |  |  |  |  |  |  |  |  123|  52.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  52.4k|        } \
  |  |  |  |  |  |  132|   413k|        a <<= 1; \
  |  |  |  |  |  |  133|   413k|        c <<= 1; \
  |  |  |  |  |  |  134|   413k|        ct--; \
  |  |  |  |  |  |  135|   413k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 24.6k, False: 388k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   388k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   949k|        } else { \
  |  |  |  |  154|   949k|            d = (*curctx)->mps; \
  |  |  |  |  155|   949k|        } \
  |  |  |  |  156|  1.33M|    } \
  |  |  |  |  157|  1.70M|}
  |  |  ------------------
  |  |  791|  1.70M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  ------------------
  |  |  |  Branch (791:33): [True: 842k, False: 865k]
  |  |  ------------------
  |  |  792|  1.70M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  ------------------
  |  |  |  |  162|  1.70M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  ------------------
  |  |  |  |  |  |  114|  1.70M|#define T1_MU_0     (1U << 20)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  793|  1.70M|    } \
  |  |  794|  3.93M|}
  ------------------
  807|  3.93M|                                      mqc, mqc->curctx, v, mqc->a, mqc->c,
  808|  3.93M|                                      mqc->ct, poshalf);
  809|  3.93M|}
t1.c:opj_t1_dec_refpass_mqc_generic:
 1030|   288k|{
 1031|   288k|    opj_t1_dec_refpass_mqc_internal(t1, bpno, t1->w, t1->h, t1->w + 2U);
  ------------------
  |  |  978|   288k|#define opj_t1_dec_refpass_mqc_internal(t1, bpno, w, h, flags_stride) \
  |  |  979|   288k|{ \
  |  |  980|   288k|        OPJ_INT32 one, poshalf; \
  |  |  981|   288k|        OPJ_UINT32 i, j, k; \
  |  |  982|   288k|        register OPJ_INT32 *data = t1->data; \
  |  |  983|   288k|        register opj_flag_t *flagsp = &t1->flags[flags_stride + 1]; \
  |  |  984|   288k|        const OPJ_UINT32 l_w = w; \
  |  |  985|   288k|        opj_mqc_t* mqc = &(t1->mqc); \
  |  |  986|   288k|        DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|   288k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|   288k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|   288k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|   288k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  |  987|   288k|        register OPJ_UINT32 v; \
  |  |  988|   288k|        one = 1 << bpno; \
  |  |  989|   288k|        poshalf = one >> 1; \
  |  |  990|  3.23M|        for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (990:21): [True: 2.94M, False: 288k]
  |  |  ------------------
  |  |  991|  37.0M|                for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (991:29): [True: 34.0M, False: 2.94M]
  |  |  ------------------
  |  |  992|  34.0M|                        opj_flag_t flags = *flagsp; \
  |  |  993|  34.0M|                        if( flags != 0 ) { \
  |  |  ------------------
  |  |  |  Branch (993:29): [True: 22.6M, False: 11.4M]
  |  |  ------------------
  |  |  994|  22.6M|                            opj_t1_dec_refpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  784|  22.6M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  |  |  785|  22.6M|{ \
  |  |  |  |  786|  22.6M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  22.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  22.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  22.6M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  22.6M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (786:9): [True: 16.9M, False: 5.68M]
  |  |  |  |  ------------------
  |  |  |  |  787|  22.6M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  22.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  22.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  788|  16.9M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  |  |  789|  16.9M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  16.9M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  790|  16.9M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  16.9M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  16.9M|{ \
  |  |  |  |  |  |  140|  16.9M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  16.9M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  16.9M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  16.9M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  16.9M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  16.9M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 4.03M, False: 12.9M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  4.03M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  4.03M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  4.03M|{ \
  |  |  |  |  |  |  |  |   57|  4.03M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 838k, False: 3.20M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   838k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   838k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   838k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  3.20M|    } else { \
  |  |  |  |  |  |  |  |   62|  3.20M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  3.20M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  3.20M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  3.20M|    } \
  |  |  |  |  |  |  |  |   66|  4.03M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  4.03M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  4.03M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  4.03M|{ \
  |  |  |  |  |  |  |  |  128|  6.54M|    do { \
  |  |  |  |  |  |  |  |  129|  6.54M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 805k, False: 5.74M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   805k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   805k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   805k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   805k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   805k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   805k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   805k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   805k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 762k, False: 42.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   762k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 757k, False: 4.79k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   757k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   757k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   757k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   757k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.79k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.79k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.79k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.79k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   762k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  42.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  42.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  42.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  42.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   805k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   805k|        } \
  |  |  |  |  |  |  |  |  132|  6.54M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  6.54M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  6.54M|        ct--; \
  |  |  |  |  |  |  |  |  135|  6.54M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.50M, False: 4.03M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  4.03M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  12.9M|    } else {  \
  |  |  |  |  |  |  149|  12.9M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  12.9M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 4.26M, False: 8.66M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  4.26M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  4.26M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  4.26M|{ \
  |  |  |  |  |  |  |  |   45|  4.26M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 715k, False: 3.55M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   715k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   715k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  3.55M|    } else { \
  |  |  |  |  |  |  |  |   49|  3.55M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  3.55M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  3.55M|    } \
  |  |  |  |  |  |  |  |   52|  4.26M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  4.26M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  4.26M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  4.26M|{ \
  |  |  |  |  |  |  |  |  128|  4.54M|    do { \
  |  |  |  |  |  |  |  |  129|  4.54M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 570k, False: 3.97M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   570k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   570k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   570k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   570k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   570k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   570k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   570k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   570k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 538k, False: 31.2k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   538k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 535k, False: 3.23k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   535k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   535k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   535k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   535k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.23k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.23k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.23k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.23k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   538k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  31.2k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  31.2k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  31.2k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  31.2k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   570k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   570k|        } \
  |  |  |  |  |  |  |  |  132|  4.54M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.54M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.54M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.54M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 275k, False: 4.26M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  4.26M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  8.66M|        } else { \
  |  |  |  |  |  |  154|  8.66M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  8.66M|        } \
  |  |  |  |  |  |  156|  12.9M|    } \
  |  |  |  |  |  |  157|  16.9M|}
  |  |  |  |  ------------------
  |  |  |  |  791|  16.9M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (791:33): [True: 8.50M, False: 8.47M]
  |  |  |  |  ------------------
  |  |  |  |  792|  16.9M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  162|  16.9M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|  16.9M|#define T1_MU_0     (1U << 20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  793|  16.9M|    } \
  |  |  |  |  794|  22.6M|}
  |  |  ------------------
  |  |  995|  22.6M|                                flags, data, l_w, 0, \
  |  |  996|  22.6M|                                mqc, curctx, v, a, c, ct, poshalf); \
  |  |  997|  22.6M|                            opj_t1_dec_refpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  784|  22.6M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  |  |  785|  22.6M|{ \
  |  |  |  |  786|  22.6M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  22.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  22.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  22.6M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  22.6M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (786:9): [True: 16.9M, False: 5.75M]
  |  |  |  |  ------------------
  |  |  |  |  787|  22.6M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  22.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  22.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  788|  16.9M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  |  |  789|  16.9M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  16.9M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  790|  16.9M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  16.9M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  16.9M|{ \
  |  |  |  |  |  |  140|  16.9M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  16.9M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  16.9M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  16.9M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  16.9M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  16.9M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 4.03M, False: 12.8M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  4.03M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  4.03M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  4.03M|{ \
  |  |  |  |  |  |  |  |   57|  4.03M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 844k, False: 3.18M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   844k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   844k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   844k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  3.18M|    } else { \
  |  |  |  |  |  |  |  |   62|  3.18M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  3.18M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  3.18M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  3.18M|    } \
  |  |  |  |  |  |  |  |   66|  4.03M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  4.03M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  4.03M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  4.03M|{ \
  |  |  |  |  |  |  |  |  128|  6.52M|    do { \
  |  |  |  |  |  |  |  |  129|  6.52M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 821k, False: 5.70M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   821k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   821k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   821k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   821k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   821k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   821k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   821k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   821k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 777k, False: 43.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   777k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 772k, False: 5.31k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   772k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   772k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   772k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   772k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  5.31k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  5.31k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  5.31k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  5.31k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   777k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  43.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  43.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  43.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  43.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   821k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   821k|        } \
  |  |  |  |  |  |  |  |  132|  6.52M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  6.52M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  6.52M|        ct--; \
  |  |  |  |  |  |  |  |  135|  6.52M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.49M, False: 4.03M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  4.03M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  12.8M|    } else {  \
  |  |  |  |  |  |  149|  12.8M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  12.8M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 4.25M, False: 8.62M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  4.25M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  4.25M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  4.25M|{ \
  |  |  |  |  |  |  |  |   45|  4.25M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 712k, False: 3.53M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   712k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   712k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  3.53M|    } else { \
  |  |  |  |  |  |  |  |   49|  3.53M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  3.53M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  3.53M|    } \
  |  |  |  |  |  |  |  |   52|  4.25M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  4.25M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  4.25M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  4.25M|{ \
  |  |  |  |  |  |  |  |  128|  4.52M|    do { \
  |  |  |  |  |  |  |  |  129|  4.52M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 574k, False: 3.94M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   574k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   574k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   574k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   574k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   574k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   574k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   574k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   574k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 542k, False: 31.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   542k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 539k, False: 3.01k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   539k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   539k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   539k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   539k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.01k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.01k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.01k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.01k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   542k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  31.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  31.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  31.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  31.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   574k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   574k|        } \
  |  |  |  |  |  |  |  |  132|  4.52M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.52M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.52M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.52M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 269k, False: 4.25M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  4.25M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  8.62M|        } else { \
  |  |  |  |  |  |  154|  8.62M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  8.62M|        } \
  |  |  |  |  |  |  156|  12.8M|    } \
  |  |  |  |  |  |  157|  16.9M|}
  |  |  |  |  ------------------
  |  |  |  |  791|  16.9M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (791:33): [True: 8.43M, False: 8.47M]
  |  |  |  |  ------------------
  |  |  |  |  792|  16.9M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  162|  16.9M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|  16.9M|#define T1_MU_0     (1U << 20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  793|  16.9M|    } \
  |  |  |  |  794|  22.6M|}
  |  |  ------------------
  |  |  998|  22.6M|                                flags, data, l_w, 1, \
  |  |  999|  22.6M|                                mqc, curctx, v, a, c, ct, poshalf); \
  |  | 1000|  22.6M|                            opj_t1_dec_refpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  784|  22.6M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  |  |  785|  22.6M|{ \
  |  |  |  |  786|  22.6M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  22.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  22.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  22.6M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  22.6M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (786:9): [True: 16.8M, False: 5.79M]
  |  |  |  |  ------------------
  |  |  |  |  787|  22.6M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  22.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  22.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  788|  16.8M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  |  |  789|  16.8M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  16.8M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  790|  16.8M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  16.8M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  16.8M|{ \
  |  |  |  |  |  |  140|  16.8M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  16.8M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  16.8M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  16.8M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  16.8M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  16.8M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 4.02M, False: 12.8M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  4.02M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  4.02M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  4.02M|{ \
  |  |  |  |  |  |  |  |   57|  4.02M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 843k, False: 3.18M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   843k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   843k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   843k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  3.18M|    } else { \
  |  |  |  |  |  |  |  |   62|  3.18M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  3.18M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  3.18M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  3.18M|    } \
  |  |  |  |  |  |  |  |   66|  4.02M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  4.02M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  4.02M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  4.02M|{ \
  |  |  |  |  |  |  |  |  128|  6.52M|    do { \
  |  |  |  |  |  |  |  |  129|  6.52M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 824k, False: 5.70M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   824k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   824k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   824k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   824k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   824k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   824k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   824k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   824k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 782k, False: 42.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   782k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 776k, False: 5.79k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   776k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   776k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   776k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   776k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  5.79k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  5.79k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  5.79k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  5.79k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   782k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  42.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  42.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  42.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  42.6k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   824k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   824k|        } \
  |  |  |  |  |  |  |  |  132|  6.52M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  6.52M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  6.52M|        ct--; \
  |  |  |  |  |  |  |  |  135|  6.52M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.50M, False: 4.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  4.02M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  12.8M|    } else {  \
  |  |  |  |  |  |  149|  12.8M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  12.8M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 4.25M, False: 8.57M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  4.25M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  4.25M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  4.25M|{ \
  |  |  |  |  |  |  |  |   45|  4.25M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 717k, False: 3.54M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   717k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   717k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  3.54M|    } else { \
  |  |  |  |  |  |  |  |   49|  3.54M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  3.54M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  3.54M|    } \
  |  |  |  |  |  |  |  |   52|  4.25M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  4.25M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  4.25M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  4.25M|{ \
  |  |  |  |  |  |  |  |  128|  4.53M|    do { \
  |  |  |  |  |  |  |  |  129|  4.53M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 558k, False: 3.97M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   558k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   558k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   558k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   558k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   558k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   558k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   558k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   558k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 527k, False: 30.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   527k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 523k, False: 3.71k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   523k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   523k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   523k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   523k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.71k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.71k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.71k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.71k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   527k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  30.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  30.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  30.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  30.9k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   558k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   558k|        } \
  |  |  |  |  |  |  |  |  132|  4.53M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.53M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.53M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.53M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 276k, False: 4.25M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  4.25M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  8.57M|        } else { \
  |  |  |  |  |  |  154|  8.57M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  8.57M|        } \
  |  |  |  |  |  |  156|  12.8M|    } \
  |  |  |  |  |  |  157|  16.8M|}
  |  |  |  |  ------------------
  |  |  |  |  791|  16.8M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (791:33): [True: 8.43M, False: 8.42M]
  |  |  |  |  ------------------
  |  |  |  |  792|  16.8M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  162|  16.8M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|  16.8M|#define T1_MU_0     (1U << 20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  793|  16.8M|    } \
  |  |  |  |  794|  22.6M|}
  |  |  ------------------
  |  | 1001|  22.6M|                                flags, data, l_w, 2, \
  |  | 1002|  22.6M|                                mqc, curctx, v, a, c, ct, poshalf); \
  |  | 1003|  22.6M|                            opj_t1_dec_refpass_step_mqc_macro( \
  |  |  ------------------
  |  |  |  |  784|  22.6M|                                          mqc, curctx, v, a, c, ct, poshalf) \
  |  |  |  |  785|  22.6M|{ \
  |  |  |  |  786|  22.6M|    if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  22.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  22.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ((flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U))) == \
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  22.6M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  22.6M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (786:9): [True: 16.7M, False: 5.89M]
  |  |  |  |  ------------------
  |  |  |  |  787|  22.6M|            (T1_SIGMA_THIS << (ci * 3U))) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  22.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  22.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  788|  16.7M|        OPJ_UINT32 ctxt = opj_t1_getctxno_mag(flags >> (ci * 3U)); \
  |  |  |  |  789|  16.7M|        opj_t1_setcurctx(curctx, ctxt); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  16.7M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  |  790|  16.7M|        opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  16.7M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  16.7M|{ \
  |  |  |  |  |  |  140|  16.7M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  16.7M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  16.7M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  16.7M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  16.7M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  16.7M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 3.97M, False: 12.7M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  3.97M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  3.97M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  3.97M|{ \
  |  |  |  |  |  |  |  |   57|  3.97M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 832k, False: 3.14M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   832k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   832k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   832k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  3.14M|    } else { \
  |  |  |  |  |  |  |  |   62|  3.14M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  3.14M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  3.14M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  3.14M|    } \
  |  |  |  |  |  |  |  |   66|  3.97M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  3.97M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  3.97M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  3.97M|{ \
  |  |  |  |  |  |  |  |  128|  6.44M|    do { \
  |  |  |  |  |  |  |  |  129|  6.44M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 804k, False: 5.63M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   804k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   804k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   804k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   804k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   804k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   804k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   804k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   804k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 758k, False: 46.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   758k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 754k, False: 4.03k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   754k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   754k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   754k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   754k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.03k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.03k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.03k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.03k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   758k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  46.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  46.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  46.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  46.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   804k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   804k|        } \
  |  |  |  |  |  |  |  |  132|  6.44M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  6.44M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  6.44M|        ct--; \
  |  |  |  |  |  |  |  |  135|  6.44M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.46M, False: 3.97M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  3.97M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  12.7M|    } else {  \
  |  |  |  |  |  |  149|  12.7M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  12.7M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 4.22M, False: 8.56M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  4.22M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  4.22M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  4.22M|{ \
  |  |  |  |  |  |  |  |   45|  4.22M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 717k, False: 3.51M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   717k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   717k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  3.51M|    } else { \
  |  |  |  |  |  |  |  |   49|  3.51M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  3.51M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  3.51M|    } \
  |  |  |  |  |  |  |  |   52|  4.22M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  4.22M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  4.22M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  4.22M|{ \
  |  |  |  |  |  |  |  |  128|  4.50M|    do { \
  |  |  |  |  |  |  |  |  129|  4.50M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 563k, False: 3.93M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   563k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   563k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   563k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   563k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   563k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   563k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   563k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   563k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 532k, False: 31.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   532k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 529k, False: 3.30k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   529k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   529k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   529k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   529k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.30k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.30k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.30k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.30k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   532k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  31.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  31.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  31.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  31.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   563k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   563k|        } \
  |  |  |  |  |  |  |  |  132|  4.50M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  4.50M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  4.50M|        ct--; \
  |  |  |  |  |  |  |  |  135|  4.50M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 275k, False: 4.22M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  4.22M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  8.56M|        } else { \
  |  |  |  |  |  |  154|  8.56M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  8.56M|        } \
  |  |  |  |  |  |  156|  12.7M|    } \
  |  |  |  |  |  |  157|  16.7M|}
  |  |  |  |  ------------------
  |  |  |  |  791|  16.7M|        data[ci*data_stride] += (v ^ (data[ci*data_stride] < 0)) ? poshalf : -poshalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (791:33): [True: 8.34M, False: 8.42M]
  |  |  |  |  ------------------
  |  |  |  |  792|  16.7M|        flags |= T1_MU_THIS << (ci * 3U); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  162|  16.7M|#define T1_MU_THIS    T1_MU_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|  16.7M|#define T1_MU_0     (1U << 20)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  793|  16.7M|    } \
  |  |  |  |  794|  22.6M|}
  |  |  ------------------
  |  | 1004|  22.6M|                                flags, data, l_w, 3, \
  |  | 1005|  22.6M|                                mqc, curctx, v, a, c, ct, poshalf); \
  |  | 1006|  22.6M|                            *flagsp = flags; \
  |  | 1007|  22.6M|                        } \
  |  | 1008|  34.0M|                } \
  |  | 1009|  2.94M|        } \
  |  | 1010|   288k|        UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|   288k|        mqc->curctx = curctx; \
  |  |  |  |  167|   288k|        mqc->c = c; \
  |  |  |  |  168|   288k|        mqc->a = a; \
  |  |  |  |  169|   288k|        mqc->ct = ct;
  |  |  ------------------
  |  | 1011|   288k|        if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (1011:13): [True: 109k, False: 178k]
  |  |  ------------------
  |  | 1012|  2.19M|            for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (1012:25): [True: 2.08M, False: 109k]
  |  |  ------------------
  |  | 1013|  6.02M|                for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (1013:29): [True: 3.93M, False: 2.08M]
  |  |  ------------------
  |  | 1014|  3.93M|                        opj_t1_dec_refpass_step_mqc(t1, flagsp, data + j * l_w, poshalf, j); \
  |  | 1015|  3.93M|                } \
  |  | 1016|  2.08M|            } \
  |  | 1017|   109k|        } \
  |  | 1018|   288k|}
  ------------------
 1032|   288k|}
t1.c:opj_t1_dec_clnpass:
 1395|   557k|{
 1396|   557k|    if (t1->w == 64 && t1->h == 64) {
  ------------------
  |  Branch (1396:9): [True: 244k, False: 313k]
  |  Branch (1396:24): [True: 194k, False: 49.8k]
  ------------------
 1397|   194k|        if (cblksty & J2K_CCP_CBLKSTY_VSC) {
  ------------------
  |  |   61|   194k|#define J2K_CCP_CBLKSTY_VSC 0x08      /**< Vertically stripe causal context */
  ------------------
  |  Branch (1397:13): [True: 100k, False: 93.9k]
  ------------------
 1398|   100k|            opj_t1_dec_clnpass_64x64_vsc(t1, bpno);
 1399|   100k|        } else {
 1400|  93.9k|            opj_t1_dec_clnpass_64x64_novsc(t1, bpno);
 1401|  93.9k|        }
 1402|   362k|    } else {
 1403|   362k|        if (cblksty & J2K_CCP_CBLKSTY_VSC) {
  ------------------
  |  |   61|   362k|#define J2K_CCP_CBLKSTY_VSC 0x08      /**< Vertically stripe causal context */
  ------------------
  |  Branch (1403:13): [True: 180k, False: 182k]
  ------------------
 1404|   180k|            opj_t1_dec_clnpass_generic_vsc(t1, bpno);
 1405|   182k|        } else {
 1406|   182k|            opj_t1_dec_clnpass_generic_novsc(t1, bpno);
 1407|   182k|        }
 1408|   362k|    }
 1409|   557k|    opj_t1_dec_clnpass_check_segsym(t1, cblksty);
 1410|   557k|}
t1.c:opj_t1_dec_clnpass_64x64_vsc:
 1371|   100k|{
 1372|   100k|    opj_t1_dec_clnpass_internal(t1, bpno, OPJ_TRUE, 64, 64, 66);
  ------------------
  |  | 1251|   100k|#define opj_t1_dec_clnpass_internal(t1, bpno, vsc, w, h, flags_stride) \
  |  | 1252|   100k|{ \
  |  | 1253|   100k|    OPJ_INT32 one, half, oneplushalf; \
  |  | 1254|   100k|    OPJ_UINT32 runlen; \
  |  | 1255|   100k|    OPJ_UINT32 i, j, k; \
  |  | 1256|   100k|    const OPJ_UINT32 l_w = w; \
  |  | 1257|   100k|    opj_mqc_t* mqc = &(t1->mqc); \
  |  | 1258|   100k|    register OPJ_INT32 *data = t1->data; \
  |  | 1259|   100k|    register opj_flag_t *flagsp = &t1->flags[flags_stride + 1]; \
  |  | 1260|   100k|    DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|   100k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|   100k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|   100k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|   100k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  | 1261|   100k|    register OPJ_UINT32 v; \
  |  | 1262|   100k|    one = 1 << bpno; \
  |  | 1263|   100k|    half = one >> 1; \
  |  | 1264|   100k|    oneplushalf = one | half; \
  |  | 1265|  1.70M|    for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (1265:17): [True: 1.60M, False: 100k]
  |  |  ------------------
  |  | 1266|   104M|        for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (1266:21): [True: 102M, False: 1.60M]
  |  |  ------------------
  |  | 1267|   102M|            opj_flag_t flags = *flagsp; \
  |  | 1268|   102M|            if (flags == 0) { \
  |  |  ------------------
  |  |  |  Branch (1268:17): [True: 36.3M, False: 66.3M]
  |  |  ------------------
  |  | 1269|  36.3M|                OPJ_UINT32 partial = OPJ_TRUE; \
  |  |  ------------------
  |  |  |  |  117|  36.3M|#define OPJ_TRUE 1
  |  |  ------------------
  |  | 1270|  36.3M|                opj_t1_setcurctx(curctx, T1_CTXNO_AGG); \
  |  |  ------------------
  |  |  |  |   62|  36.3M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1271|  36.3M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|  36.3M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|  36.3M|{ \
  |  |  |  |  140|  36.3M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|  36.3M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|  36.3M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|  36.3M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|  36.3M|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|  36.3M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 534k, False: 35.7M]
  |  |  |  |  ------------------
  |  |  |  |  146|   534k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   534k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   534k|{ \
  |  |  |  |  |  |   57|   534k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 55.7k, False: 478k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  55.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  55.7k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  55.7k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   478k|    } else { \
  |  |  |  |  |  |   62|   478k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   478k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   478k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   478k|    } \
  |  |  |  |  |  |   66|   534k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   534k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   534k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   534k|{ \
  |  |  |  |  |  |  128|  1.31M|    do { \
  |  |  |  |  |  |  129|  1.31M|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 168k, False: 1.14M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|   168k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|   168k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|   168k|{ \
  |  |  |  |  |  |  |  |  104|   168k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|   168k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|   168k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|   168k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|   168k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 130k, False: 37.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|   130k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 124k, False: 5.91k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|   124k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|   124k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|   124k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|   124k|            } else { \
  |  |  |  |  |  |  |  |  114|  5.91k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  5.91k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  5.91k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  5.91k|            } \
  |  |  |  |  |  |  |  |  118|   130k|        } else { \
  |  |  |  |  |  |  |  |  119|  37.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  37.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  37.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  37.4k|        } \
  |  |  |  |  |  |  |  |  123|   168k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   168k|        } \
  |  |  |  |  |  |  132|  1.31M|        a <<= 1; \
  |  |  |  |  |  |  133|  1.31M|        c <<= 1; \
  |  |  |  |  |  |  134|  1.31M|        ct--; \
  |  |  |  |  |  |  135|  1.31M|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 782k, False: 534k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   534k|}
  |  |  |  |  ------------------
  |  |  |  |  148|  35.7M|    } else {  \
  |  |  |  |  149|  35.7M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|  35.7M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 720k, False: 35.0M]
  |  |  |  |  ------------------
  |  |  |  |  151|   720k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   720k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   720k|{ \
  |  |  |  |  |  |   45|   720k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 45.1k, False: 675k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  45.1k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  45.1k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   675k|    } else { \
  |  |  |  |  |  |   49|   675k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   675k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   675k|    } \
  |  |  |  |  |  |   52|   720k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   720k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   720k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   720k|{ \
  |  |  |  |  |  |  128|   740k|    do { \
  |  |  |  |  |  |  129|   740k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 101k, False: 638k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|   101k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|   101k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|   101k|{ \
  |  |  |  |  |  |  |  |  104|   101k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|   101k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|   101k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|   101k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|   101k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 79.8k, False: 22.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  79.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 77.1k, False: 2.69k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  77.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  77.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  77.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  77.1k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.69k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.69k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.69k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.69k|            } \
  |  |  |  |  |  |  |  |  118|  79.8k|        } else { \
  |  |  |  |  |  |  |  |  119|  22.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  22.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  22.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  22.0k|        } \
  |  |  |  |  |  |  |  |  123|   101k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   101k|        } \
  |  |  |  |  |  |  132|   740k|        a <<= 1; \
  |  |  |  |  |  |  133|   740k|        c <<= 1; \
  |  |  |  |  |  |  134|   740k|        ct--; \
  |  |  |  |  |  |  135|   740k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 20.6k, False: 720k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   720k|}
  |  |  |  |  ------------------
  |  |  |  |  153|  35.0M|        } else { \
  |  |  |  |  154|  35.0M|            d = (*curctx)->mps; \
  |  |  |  |  155|  35.0M|        } \
  |  |  |  |  156|  35.7M|    } \
  |  |  |  |  157|  36.3M|}
  |  |  ------------------
  |  | 1272|  36.3M|                if (!v) { \
  |  |  ------------------
  |  |  |  Branch (1272:21): [True: 35.7M, False: 563k]
  |  |  ------------------
  |  | 1273|  35.7M|                    continue; \
  |  | 1274|  35.7M|                } \
  |  | 1275|  36.3M|                opj_t1_setcurctx(curctx, T1_CTXNO_UNI); \
  |  |  ------------------
  |  |  |  |   62|   563k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1276|   563k|                opj_mqc_decode_macro(runlen, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   563k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   563k|{ \
  |  |  |  |  140|   563k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   563k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   563k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   563k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   563k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   563k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 282k, False: 281k]
  |  |  |  |  ------------------
  |  |  |  |  146|   282k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   282k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   282k|{ \
  |  |  |  |  |  |   57|   282k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 174k, False: 108k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|   174k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|   174k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|   174k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   174k|    } else { \
  |  |  |  |  |  |   62|   108k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   108k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   108k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   108k|    } \
  |  |  |  |  |  |   66|   282k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   282k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   282k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   282k|{ \
  |  |  |  |  |  |  128|   282k|    do { \
  |  |  |  |  |  |  129|   282k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 33.5k, False: 249k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  33.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  33.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  33.5k|{ \
  |  |  |  |  |  |  |  |  104|  33.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  33.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  33.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  33.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  33.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 26.7k, False: 6.81k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  26.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 25.8k, False: 958]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  25.8k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  25.8k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  25.8k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  25.8k|            } else { \
  |  |  |  |  |  |  |  |  114|    958|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|    958|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|    958|                ct = 7; \
  |  |  |  |  |  |  |  |  117|    958|            } \
  |  |  |  |  |  |  |  |  118|  26.7k|        } else { \
  |  |  |  |  |  |  |  |  119|  6.81k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  6.81k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  6.81k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  6.81k|        } \
  |  |  |  |  |  |  |  |  123|  33.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  33.5k|        } \
  |  |  |  |  |  |  132|   282k|        a <<= 1; \
  |  |  |  |  |  |  133|   282k|        c <<= 1; \
  |  |  |  |  |  |  134|   282k|        ct--; \
  |  |  |  |  |  |  135|   282k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 282k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   282k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   282k|    } else {  \
  |  |  |  |  149|   281k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   281k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 230k, False: 50.9k]
  |  |  |  |  ------------------
  |  |  |  |  151|   230k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   230k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   230k|{ \
  |  |  |  |  |  |   45|   230k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 131k, False: 99.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|   131k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|   131k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   131k|    } else { \
  |  |  |  |  |  |   49|  99.0k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|  99.0k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|  99.0k|    } \
  |  |  |  |  |  |   52|   230k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   230k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   230k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   230k|{ \
  |  |  |  |  |  |  128|   291k|    do { \
  |  |  |  |  |  |  129|   291k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 34.8k, False: 256k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  34.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  34.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  34.8k|{ \
  |  |  |  |  |  |  |  |  104|  34.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  34.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  34.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  34.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  34.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 29.0k, False: 5.79k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  29.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 28.2k, False: 808]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  28.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  28.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  28.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  28.2k|            } else { \
  |  |  |  |  |  |  |  |  114|    808|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|    808|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|    808|                ct = 7; \
  |  |  |  |  |  |  |  |  117|    808|            } \
  |  |  |  |  |  |  |  |  118|  29.0k|        } else { \
  |  |  |  |  |  |  |  |  119|  5.79k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  5.79k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  5.79k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  5.79k|        } \
  |  |  |  |  |  |  |  |  123|  34.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  34.8k|        } \
  |  |  |  |  |  |  132|   291k|        a <<= 1; \
  |  |  |  |  |  |  133|   291k|        c <<= 1; \
  |  |  |  |  |  |  134|   291k|        ct--; \
  |  |  |  |  |  |  135|   291k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 61.4k, False: 230k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   230k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   230k|        } else { \
  |  |  |  |  154|  50.9k|            d = (*curctx)->mps; \
  |  |  |  |  155|  50.9k|        } \
  |  |  |  |  156|   281k|    } \
  |  |  |  |  157|   563k|}
  |  |  ------------------
  |  | 1277|   563k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   563k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   563k|{ \
  |  |  |  |  140|   563k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   563k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   563k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   563k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   563k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   563k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 272k, False: 291k]
  |  |  |  |  ------------------
  |  |  |  |  146|   272k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   272k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   272k|{ \
  |  |  |  |  |  |   57|   272k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 68.4k, False: 203k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  68.4k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  68.4k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  68.4k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   203k|    } else { \
  |  |  |  |  |  |   62|   203k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   203k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   203k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   203k|    } \
  |  |  |  |  |  |   66|   272k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   272k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   272k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   272k|{ \
  |  |  |  |  |  |  128|   272k|    do { \
  |  |  |  |  |  |  129|   272k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 35.7k, False: 236k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  35.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  35.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  35.7k|{ \
  |  |  |  |  |  |  |  |  104|  35.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  35.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  35.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  35.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  35.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 30.7k, False: 4.91k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  30.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 29.0k, False: 1.76k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  29.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  29.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  29.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  29.0k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.76k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.76k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.76k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.76k|            } \
  |  |  |  |  |  |  |  |  118|  30.7k|        } else { \
  |  |  |  |  |  |  |  |  119|  4.91k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  4.91k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  4.91k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  4.91k|        } \
  |  |  |  |  |  |  |  |  123|  35.7k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  35.7k|        } \
  |  |  |  |  |  |  132|   272k|        a <<= 1; \
  |  |  |  |  |  |  133|   272k|        c <<= 1; \
  |  |  |  |  |  |  134|   272k|        ct--; \
  |  |  |  |  |  |  135|   272k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 272k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   272k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   291k|    } else {  \
  |  |  |  |  149|   291k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   291k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 246k, False: 45.0k]
  |  |  |  |  ------------------
  |  |  |  |  151|   246k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   246k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   246k|{ \
  |  |  |  |  |  |   45|   246k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 52.6k, False: 194k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  52.6k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  52.6k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   194k|    } else { \
  |  |  |  |  |  |   49|   194k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   194k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   194k|    } \
  |  |  |  |  |  |   52|   246k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   246k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   246k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   246k|{ \
  |  |  |  |  |  |  128|   278k|    do { \
  |  |  |  |  |  |  129|   278k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 31.3k, False: 246k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  31.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  31.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  31.3k|{ \
  |  |  |  |  |  |  |  |  104|  31.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  31.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  31.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  31.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  31.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 27.4k, False: 3.96k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  27.4k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 25.0k, False: 2.38k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  25.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  25.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  25.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  25.0k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.38k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.38k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.38k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.38k|            } \
  |  |  |  |  |  |  |  |  118|  27.4k|        } else { \
  |  |  |  |  |  |  |  |  119|  3.96k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  3.96k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  3.96k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  3.96k|        } \
  |  |  |  |  |  |  |  |  123|  31.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  31.3k|        } \
  |  |  |  |  |  |  132|   278k|        a <<= 1; \
  |  |  |  |  |  |  133|   278k|        c <<= 1; \
  |  |  |  |  |  |  134|   278k|        ct--; \
  |  |  |  |  |  |  135|   278k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 31.5k, False: 246k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   246k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   246k|        } else { \
  |  |  |  |  154|  45.0k|            d = (*curctx)->mps; \
  |  |  |  |  155|  45.0k|        } \
  |  |  |  |  156|   291k|    } \
  |  |  |  |  157|   563k|}
  |  |  ------------------
  |  | 1278|   563k|                runlen = (runlen << 1) | v; \
  |  | 1279|   563k|                switch(runlen) { \
  |  |  ------------------
  |  |  |  Branch (1279:24): [True: 0, False: 563k]
  |  |  ------------------
  |  | 1280|   173k|                    case 0: \
  |  |  ------------------
  |  |  |  Branch (1280:21): [True: 173k, False: 389k]
  |  |  ------------------
  |  | 1281|   173k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, OPJ_TRUE,\
  |  |  ------------------
  |  |  |  | 1118|   173k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   173k|{ \
  |  |  |  | 1120|   173k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   173k|        do { \
  |  |  |  | 1122|   173k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|      0|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|      0|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|      0|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|      0|{ \
  |  |  |  |  |  |  140|      0|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|      0|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|      0|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|      0|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|      0|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|      0|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      0|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|      0|{ \
  |  |  |  |  |  |  |  |   57|      0|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|      0|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|      0|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|      0|    } else { \
  |  |  |  |  |  |  |  |   62|      0|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|      0|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|      0|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|      0|    } \
  |  |  |  |  |  |  |  |   66|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|      0|{ \
  |  |  |  |  |  |  |  |  128|      0|    do { \
  |  |  |  |  |  |  |  |  129|      0|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|      0|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|      0|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|      0|{ \
  |  |  |  |  |  |  |  |  |  |  104|      0|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|      0|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|      0|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|      0|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|      0|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|      0|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|      0|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|      0|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|      0|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|      0|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|      0|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|      0|            } \
  |  |  |  |  |  |  |  |  |  |  118|      0|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|      0|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|      0|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|      0|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|      0|        } \
  |  |  |  |  |  |  |  |  |  |  123|      0|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|        } \
  |  |  |  |  |  |  |  |  132|      0|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|      0|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|      0|        ct--; \
  |  |  |  |  |  |  |  |  135|      0|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|    } else {  \
  |  |  |  |  |  |  149|      0|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|      0|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|      0|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|      0|{ \
  |  |  |  |  |  |  |  |   45|      0|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|      0|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|      0|    } else { \
  |  |  |  |  |  |  |  |   49|      0|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|      0|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|      0|    } \
  |  |  |  |  |  |  |  |   52|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|      0|{ \
  |  |  |  |  |  |  |  |  128|      0|    do { \
  |  |  |  |  |  |  |  |  129|      0|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|      0|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|      0|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|      0|{ \
  |  |  |  |  |  |  |  |  |  |  104|      0|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|      0|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|      0|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|      0|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|      0|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|      0|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|      0|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|      0|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|      0|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|      0|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|      0|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|      0|            } \
  |  |  |  |  |  |  |  |  |  |  118|      0|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|      0|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|      0|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|      0|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|      0|        } \
  |  |  |  |  |  |  |  |  |  |  123|      0|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|        } \
  |  |  |  |  |  |  |  |  132|      0|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|      0|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|      0|        ct--; \
  |  |  |  |  |  |  |  |  135|      0|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        } else { \
  |  |  |  |  |  |  154|      0|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|      0|        } \
  |  |  |  |  |  |  156|      0|    } \
  |  |  |  |  |  |  157|      0|}
  |  |  |  |  ------------------
  |  |  |  | 1126|      0|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1127|      0|                    break; \
  |  |  |  | 1128|      0|            } \
  |  |  |  | 1129|   173k|            { \
  |  |  |  | 1130|   173k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   173k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   173k|                                    ci); \
  |  |  |  | 1133|   173k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   173k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   173k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   173k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   173k|{ \
  |  |  |  |  |  |  140|   173k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   173k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   173k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   173k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   173k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   173k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 49.2k, False: 124k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  49.2k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  49.2k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  49.2k|{ \
  |  |  |  |  |  |  |  |   57|  49.2k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 1.76k, False: 47.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.76k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  1.76k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  1.76k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  47.5k|    } else { \
  |  |  |  |  |  |  |  |   62|  47.5k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  47.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  47.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  47.5k|    } \
  |  |  |  |  |  |  |  |   66|  49.2k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  49.2k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  49.2k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  49.2k|{ \
  |  |  |  |  |  |  |  |  128|  78.4k|    do { \
  |  |  |  |  |  |  |  |  129|  78.4k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 9.12k, False: 69.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  9.12k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  9.12k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  9.12k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  9.12k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  9.12k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  9.12k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  9.12k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  9.12k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 7.77k, False: 1.35k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  7.77k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 7.44k, False: 327]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  7.44k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  7.44k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  7.44k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  7.44k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    327|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    327|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    327|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    327|            } \
  |  |  |  |  |  |  |  |  |  |  118|  7.77k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.35k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.35k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.35k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.35k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  9.12k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  9.12k|        } \
  |  |  |  |  |  |  |  |  132|  78.4k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  78.4k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  78.4k|        ct--; \
  |  |  |  |  |  |  |  |  135|  78.4k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 29.2k, False: 49.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  49.2k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   124k|    } else {  \
  |  |  |  |  |  |  149|   124k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   124k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 57.9k, False: 66.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  57.9k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  57.9k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  57.9k|{ \
  |  |  |  |  |  |  |  |   45|  57.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 3.00k, False: 54.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.00k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  3.00k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  54.9k|    } else { \
  |  |  |  |  |  |  |  |   49|  54.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  54.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  54.9k|    } \
  |  |  |  |  |  |  |  |   52|  57.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  57.9k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  57.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  57.9k|{ \
  |  |  |  |  |  |  |  |  128|  58.2k|    do { \
  |  |  |  |  |  |  |  |  129|  58.2k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 7.34k, False: 50.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  7.34k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  7.34k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  7.34k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  7.34k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  7.34k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  7.34k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  7.34k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  7.34k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 6.63k, False: 719]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  6.63k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 6.10k, False: 530]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  6.10k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  6.10k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  6.10k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  6.10k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    530|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    530|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    530|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    530|            } \
  |  |  |  |  |  |  |  |  |  |  118|  6.63k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    719|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    719|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    719|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    719|        } \
  |  |  |  |  |  |  |  |  |  |  123|  7.34k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  7.34k|        } \
  |  |  |  |  |  |  |  |  132|  58.2k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  58.2k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  58.2k|        ct--; \
  |  |  |  |  |  |  |  |  135|  58.2k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 363, False: 57.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  57.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  66.6k|        } else { \
  |  |  |  |  |  |  154|  66.6k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  66.6k|        } \
  |  |  |  |  |  |  156|   124k|    } \
  |  |  |  |  |  |  157|   173k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   173k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   173k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 91.9k, False: 81.8k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   173k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   173k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   173k|{ \
  |  |  |  |  |  |  323|   173k|    /* east */ \
  |  |  |  |  |  |  324|   173k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   173k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   173k| \
  |  |  |  |  |  |  326|   173k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   173k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   173k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   173k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   173k| \
  |  |  |  |  |  |  329|   173k|    /* west */ \
  |  |  |  |  |  |  330|   173k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   173k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   173k| \
  |  |  |  |  |  |  332|   173k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   173k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   173k| \
  |  |  |  |  |  |  340|   173k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   173k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   173k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   173k|            } \
  |  |  |  | 1139|   173k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   173k|    } \
  |  |  |  | 1141|   173k|}
  |  |  ------------------
  |  | 1282|   173k|                                            flags, flagsp, flags_stride, data, \
  |  | 1283|   173k|                                            l_w, 0, mqc, curctx, \
  |  | 1284|   173k|                                            v, a, c, ct, oneplushalf, vsc); \
  |  | 1285|   173k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   173k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1286|   173k|                        /* FALLTHRU */ \
  |  | 1287|   324k|                    case 1: \
  |  |  ------------------
  |  |  |  Branch (1287:21): [True: 150k, False: 413k]
  |  |  ------------------
  |  | 1288|   324k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   324k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   324k|{ \
  |  |  |  | 1120|   324k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   324k|        do { \
  |  |  |  | 1122|   324k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 173k, False: 150k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   173k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   173k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   173k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   173k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   173k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   173k|{ \
  |  |  |  |  |  |  140|   173k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   173k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   173k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   173k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   173k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   173k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 50.5k, False: 123k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  50.5k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  50.5k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  50.5k|{ \
  |  |  |  |  |  |  |  |   57|  50.5k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 9.38k, False: 41.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  9.38k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  9.38k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  9.38k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  41.1k|    } else { \
  |  |  |  |  |  |  |  |   62|  41.1k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  41.1k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  41.1k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  41.1k|    } \
  |  |  |  |  |  |  |  |   66|  50.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  50.5k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  50.5k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  50.5k|{ \
  |  |  |  |  |  |  |  |  128|  81.3k|    do { \
  |  |  |  |  |  |  |  |  129|  81.3k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 11.1k, False: 70.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  11.1k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  11.1k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  11.1k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  11.1k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  11.1k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  11.1k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  11.1k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  11.1k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 8.24k, False: 2.95k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  8.24k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 7.79k, False: 448]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  7.79k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  7.79k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  7.79k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  7.79k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    448|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    448|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    448|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    448|            } \
  |  |  |  |  |  |  |  |  |  |  118|  8.24k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.95k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.95k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.95k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.95k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  11.1k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  11.1k|        } \
  |  |  |  |  |  |  |  |  132|  81.3k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  81.3k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  81.3k|        ct--; \
  |  |  |  |  |  |  |  |  135|  81.3k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 30.7k, False: 50.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  50.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   123k|    } else {  \
  |  |  |  |  |  |  149|   123k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   123k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 48.5k, False: 74.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  48.5k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  48.5k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  48.5k|{ \
  |  |  |  |  |  |  |  |   45|  48.5k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 7.59k, False: 40.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  7.59k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  7.59k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  40.9k|    } else { \
  |  |  |  |  |  |  |  |   49|  40.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  40.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  40.9k|    } \
  |  |  |  |  |  |  |  |   52|  48.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  48.5k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  48.5k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  48.5k|{ \
  |  |  |  |  |  |  |  |  128|  53.2k|    do { \
  |  |  |  |  |  |  |  |  129|  53.2k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 6.09k, False: 47.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  6.09k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  6.09k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  6.09k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  6.09k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  6.09k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  6.09k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  6.09k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  6.09k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 4.78k, False: 1.31k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  4.78k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.51k, False: 265]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.51k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.51k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.51k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.51k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    265|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    265|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    265|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    265|            } \
  |  |  |  |  |  |  |  |  |  |  118|  4.78k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.31k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.31k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.31k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.31k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  6.09k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  6.09k|        } \
  |  |  |  |  |  |  |  |  132|  53.2k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  53.2k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  53.2k|        ct--; \
  |  |  |  |  |  |  |  |  135|  53.2k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 4.70k, False: 48.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  48.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  74.6k|        } else { \
  |  |  |  |  |  |  154|  74.6k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  74.6k|        } \
  |  |  |  |  |  |  156|   123k|    } \
  |  |  |  |  |  |  157|   173k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   173k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 107k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   173k|                    break; \
  |  |  |  | 1128|   173k|            } \
  |  |  |  | 1129|   324k|            { \
  |  |  |  | 1130|   216k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   216k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   216k|                                    ci); \
  |  |  |  | 1133|   216k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   216k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   216k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   216k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   216k|{ \
  |  |  |  |  |  |  140|   216k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   216k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   216k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   216k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   216k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   216k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 65.1k, False: 151k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  65.1k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  65.1k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  65.1k|{ \
  |  |  |  |  |  |  |  |   57|  65.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 4.82k, False: 60.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.82k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  4.82k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  4.82k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  60.3k|    } else { \
  |  |  |  |  |  |  |  |   62|  60.3k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  60.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  60.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  60.3k|    } \
  |  |  |  |  |  |  |  |   66|  65.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  65.1k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  65.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  65.1k|{ \
  |  |  |  |  |  |  |  |  128|  98.1k|    do { \
  |  |  |  |  |  |  |  |  129|  98.1k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 11.3k, False: 86.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  11.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  11.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  11.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  11.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  11.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  11.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  11.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  11.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 9.54k, False: 1.83k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  9.54k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 9.20k, False: 346]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  9.20k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  9.20k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  9.20k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  9.20k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    346|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    346|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    346|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    346|            } \
  |  |  |  |  |  |  |  |  |  |  118|  9.54k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.83k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.83k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.83k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.83k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  11.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  11.3k|        } \
  |  |  |  |  |  |  |  |  132|  98.1k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  98.1k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  98.1k|        ct--; \
  |  |  |  |  |  |  |  |  135|  98.1k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 33.0k, False: 65.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  65.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   151k|    } else {  \
  |  |  |  |  |  |  149|   151k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   151k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 64.9k, False: 86.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  64.9k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  64.9k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  64.9k|{ \
  |  |  |  |  |  |  |  |   45|  64.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 3.40k, False: 61.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.40k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  3.40k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  61.5k|    } else { \
  |  |  |  |  |  |  |  |   49|  61.5k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  61.5k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  61.5k|    } \
  |  |  |  |  |  |  |  |   52|  64.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  64.9k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  64.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  64.9k|{ \
  |  |  |  |  |  |  |  |  128|  66.8k|    do { \
  |  |  |  |  |  |  |  |  129|  66.8k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 8.54k, False: 58.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  8.54k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  8.54k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  8.54k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  8.54k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  8.54k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  8.54k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  8.54k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  8.54k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 7.58k, False: 962]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  7.58k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 7.37k, False: 211]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  7.37k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  7.37k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  7.37k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  7.37k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    211|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    211|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    211|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    211|            } \
  |  |  |  |  |  |  |  |  |  |  118|  7.58k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    962|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    962|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    962|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    962|        } \
  |  |  |  |  |  |  |  |  |  |  123|  8.54k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  8.54k|        } \
  |  |  |  |  |  |  |  |  132|  66.8k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  66.8k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  66.8k|        ct--; \
  |  |  |  |  |  |  |  |  135|  66.8k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.87k, False: 64.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  64.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  86.3k|        } else { \
  |  |  |  |  |  |  154|  86.3k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  86.3k|        } \
  |  |  |  |  |  |  156|   151k|    } \
  |  |  |  |  |  |  157|   216k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   216k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   216k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 110k, False: 105k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   216k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   216k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   216k|{ \
  |  |  |  |  |  |  323|   216k|    /* east */ \
  |  |  |  |  |  |  324|   216k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   216k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   216k| \
  |  |  |  |  |  |  326|   216k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   216k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   216k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   216k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   216k| \
  |  |  |  |  |  |  329|   216k|    /* west */ \
  |  |  |  |  |  |  330|   216k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   216k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   216k| \
  |  |  |  |  |  |  332|   216k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   216k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   216k| \
  |  |  |  |  |  |  340|   216k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   216k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   216k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   216k|            } \
  |  |  |  | 1139|   216k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   324k|    } \
  |  |  |  | 1141|   324k|}
  |  |  ------------------
  |  | 1289|   324k|                                            flags, flagsp, flags_stride, data, \
  |  | 1290|   324k|                                            l_w, 1, mqc, curctx, \
  |  | 1291|   324k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1292|   324k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   324k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1293|   324k|                        /* FALLTHRU */ \
  |  | 1294|   457k|                    case 2: \
  |  |  ------------------
  |  |  |  Branch (1294:21): [True: 133k, False: 430k]
  |  |  ------------------
  |  | 1295|   457k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   457k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   457k|{ \
  |  |  |  | 1120|   457k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   457k|        do { \
  |  |  |  | 1122|   457k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 324k, False: 133k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   324k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   324k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   324k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   324k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   324k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   324k|{ \
  |  |  |  |  |  |  140|   324k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   324k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   324k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   324k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   324k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   324k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 71.9k, False: 252k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  71.9k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  71.9k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  71.9k|{ \
  |  |  |  |  |  |  |  |   57|  71.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 17.0k, False: 54.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  17.0k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  17.0k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  17.0k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  54.8k|    } else { \
  |  |  |  |  |  |  |  |   62|  54.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  54.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  54.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  54.8k|    } \
  |  |  |  |  |  |  |  |   66|  71.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  71.9k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  71.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  71.9k|{ \
  |  |  |  |  |  |  |  |  128|   118k|    do { \
  |  |  |  |  |  |  |  |  129|   118k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 12.8k, False: 105k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  12.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  12.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  12.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  12.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  12.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  12.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  12.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  12.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 11.6k, False: 1.26k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  11.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 10.8k, False: 746]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  10.8k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  10.8k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  10.8k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  10.8k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    746|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    746|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    746|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    746|            } \
  |  |  |  |  |  |  |  |  |  |  118|  11.6k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.26k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.26k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.26k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.26k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  12.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  12.8k|        } \
  |  |  |  |  |  |  |  |  132|   118k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   118k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   118k|        ct--; \
  |  |  |  |  |  |  |  |  135|   118k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 46.6k, False: 71.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  71.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   252k|    } else {  \
  |  |  |  |  |  |  149|   252k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   252k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 72.9k, False: 179k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  72.9k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  72.9k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  72.9k|{ \
  |  |  |  |  |  |  |  |   45|  72.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 10.5k, False: 62.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  10.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  10.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  62.3k|    } else { \
  |  |  |  |  |  |  |  |   49|  62.3k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  62.3k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  62.3k|    } \
  |  |  |  |  |  |  |  |   52|  72.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  72.9k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  72.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  72.9k|{ \
  |  |  |  |  |  |  |  |  128|  77.5k|    do { \
  |  |  |  |  |  |  |  |  129|  77.5k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 10.8k, False: 66.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  10.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  10.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  10.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  10.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  10.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  10.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  10.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  10.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 8.87k, False: 1.97k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  8.87k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 8.04k, False: 831]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  8.04k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  8.04k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  8.04k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  8.04k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    831|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    831|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    831|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    831|            } \
  |  |  |  |  |  |  |  |  |  |  118|  8.87k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.97k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.97k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.97k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.97k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  10.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  10.8k|        } \
  |  |  |  |  |  |  |  |  132|  77.5k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  77.5k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  77.5k|        ct--; \
  |  |  |  |  |  |  |  |  135|  77.5k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 4.63k, False: 72.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  72.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   179k|        } else { \
  |  |  |  |  |  |  154|   179k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   179k|        } \
  |  |  |  |  |  |  156|   252k|    } \
  |  |  |  |  |  |  157|   324k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   324k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 222k, False: 101k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   324k|                    break; \
  |  |  |  | 1128|   324k|            } \
  |  |  |  | 1129|   457k|            { \
  |  |  |  | 1130|   234k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   234k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   234k|                                    ci); \
  |  |  |  | 1133|   234k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   234k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   234k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   234k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   234k|{ \
  |  |  |  |  |  |  140|   234k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   234k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   234k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   234k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   234k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   234k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 70.0k, False: 164k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  70.0k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  70.0k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  70.0k|{ \
  |  |  |  |  |  |  |  |   57|  70.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 9.45k, False: 60.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  9.45k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  9.45k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  9.45k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  60.5k|    } else { \
  |  |  |  |  |  |  |  |   62|  60.5k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  60.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  60.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  60.5k|    } \
  |  |  |  |  |  |  |  |   66|  70.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  70.0k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  70.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  70.0k|{ \
  |  |  |  |  |  |  |  |  128|   112k|    do { \
  |  |  |  |  |  |  |  |  129|   112k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 14.2k, False: 98.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  14.2k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  14.2k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  14.2k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  14.2k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  14.2k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  14.2k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  14.2k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  14.2k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 12.6k, False: 1.63k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  12.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 11.6k, False: 1.00k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  11.6k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  11.6k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  11.6k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  11.6k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.00k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.00k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.00k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.00k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  12.6k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.63k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.63k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.63k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.63k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  14.2k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  14.2k|        } \
  |  |  |  |  |  |  |  |  132|   112k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   112k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   112k|        ct--; \
  |  |  |  |  |  |  |  |  135|   112k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 42.8k, False: 70.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  70.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   164k|    } else {  \
  |  |  |  |  |  |  149|   164k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   164k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 73.9k, False: 91.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  73.9k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  73.9k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  73.9k|{ \
  |  |  |  |  |  |  |  |   45|  73.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 6.23k, False: 67.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  6.23k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  6.23k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  67.7k|    } else { \
  |  |  |  |  |  |  |  |   49|  67.7k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  67.7k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  67.7k|    } \
  |  |  |  |  |  |  |  |   52|  73.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  73.9k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  73.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  73.9k|{ \
  |  |  |  |  |  |  |  |  128|  77.9k|    do { \
  |  |  |  |  |  |  |  |  129|  77.9k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 8.94k, False: 68.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  8.94k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  8.94k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  8.94k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  8.94k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  8.94k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  8.94k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  8.94k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  8.94k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 6.56k, False: 2.37k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  6.56k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 6.32k, False: 244]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  6.32k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  6.32k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  6.32k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  6.32k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    244|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    244|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    244|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    244|            } \
  |  |  |  |  |  |  |  |  |  |  118|  6.56k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.37k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.37k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.37k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.37k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  8.94k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  8.94k|        } \
  |  |  |  |  |  |  |  |  132|  77.9k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  77.9k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  77.9k|        ct--; \
  |  |  |  |  |  |  |  |  135|  77.9k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 3.97k, False: 73.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  73.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  91.0k|        } else { \
  |  |  |  |  |  |  154|  91.0k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  91.0k|        } \
  |  |  |  |  |  |  156|   164k|    } \
  |  |  |  |  |  |  157|   234k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   234k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   234k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 118k, False: 116k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   234k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   234k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   234k|{ \
  |  |  |  |  |  |  323|   234k|    /* east */ \
  |  |  |  |  |  |  324|   234k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   234k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   234k| \
  |  |  |  |  |  |  326|   234k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   234k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   234k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   234k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   234k| \
  |  |  |  |  |  |  329|   234k|    /* west */ \
  |  |  |  |  |  |  330|   234k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   234k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   234k| \
  |  |  |  |  |  |  332|   234k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   234k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   234k| \
  |  |  |  |  |  |  340|   234k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   234k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   234k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   234k|            } \
  |  |  |  | 1139|   234k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   457k|    } \
  |  |  |  | 1141|   457k|}
  |  |  ------------------
  |  | 1296|   457k|                                            flags, flagsp, flags_stride, data, \
  |  | 1297|   457k|                                            l_w, 2, mqc, curctx, \
  |  | 1298|   457k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1299|   457k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   457k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1300|   457k|                        /* FALLTHRU */ \
  |  | 1301|   563k|                    case 3: \
  |  |  ------------------
  |  |  |  Branch (1301:21): [True: 106k, False: 457k]
  |  |  ------------------
  |  | 1302|   563k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   563k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   563k|{ \
  |  |  |  | 1120|   563k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   563k|        do { \
  |  |  |  | 1122|   563k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 457k, False: 106k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   457k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   457k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   457k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   457k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   457k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   457k|{ \
  |  |  |  |  |  |  140|   457k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   457k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   457k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   457k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   457k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   457k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 78.1k, False: 379k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  78.1k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  78.1k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  78.1k|{ \
  |  |  |  |  |  |  |  |   57|  78.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 17.3k, False: 60.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  17.3k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  17.3k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  17.3k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  60.8k|    } else { \
  |  |  |  |  |  |  |  |   62|  60.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  60.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  60.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  60.8k|    } \
  |  |  |  |  |  |  |  |   66|  78.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  78.1k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  78.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  78.1k|{ \
  |  |  |  |  |  |  |  |  128|   135k|    do { \
  |  |  |  |  |  |  |  |  129|   135k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 15.9k, False: 119k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  15.9k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  15.9k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  15.9k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  15.9k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  15.9k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  15.9k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  15.9k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  15.9k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 13.3k, False: 2.56k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  13.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 12.7k, False: 617]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  12.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  12.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  12.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  12.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    617|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    617|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    617|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    617|            } \
  |  |  |  |  |  |  |  |  |  |  118|  13.3k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.56k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.56k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.56k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.56k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  15.9k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  15.9k|        } \
  |  |  |  |  |  |  |  |  132|   135k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   135k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   135k|        ct--; \
  |  |  |  |  |  |  |  |  135|   135k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 57.5k, False: 78.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  78.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   379k|    } else {  \
  |  |  |  |  |  |  149|   379k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   379k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 82.9k, False: 296k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  82.9k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  82.9k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  82.9k|{ \
  |  |  |  |  |  |  |  |   45|  82.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 12.0k, False: 70.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  12.0k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  12.0k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  70.9k|    } else { \
  |  |  |  |  |  |  |  |   49|  70.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  70.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  70.9k|    } \
  |  |  |  |  |  |  |  |   52|  82.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  82.9k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  82.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  82.9k|{ \
  |  |  |  |  |  |  |  |  128|  89.1k|    do { \
  |  |  |  |  |  |  |  |  129|  89.1k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 11.5k, False: 77.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  11.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  11.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  11.5k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  11.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  11.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  11.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  11.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  11.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 9.87k, False: 1.65k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  9.87k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 9.08k, False: 792]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  9.08k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  9.08k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  9.08k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  9.08k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    792|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    792|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    792|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    792|            } \
  |  |  |  |  |  |  |  |  |  |  118|  9.87k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.65k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.65k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.65k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.65k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  11.5k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  11.5k|        } \
  |  |  |  |  |  |  |  |  132|  89.1k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  89.1k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  89.1k|        ct--; \
  |  |  |  |  |  |  |  |  135|  89.1k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 6.16k, False: 82.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  82.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   296k|        } else { \
  |  |  |  |  |  |  154|   296k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   296k|        } \
  |  |  |  |  |  |  156|   379k|    } \
  |  |  |  |  |  |  157|   457k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   457k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 336k, False: 121k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   457k|                    break; \
  |  |  |  | 1128|   457k|            } \
  |  |  |  | 1129|   563k|            { \
  |  |  |  | 1130|   227k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   227k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   227k|                                    ci); \
  |  |  |  | 1133|   227k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   227k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   227k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   227k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   227k|{ \
  |  |  |  |  |  |  140|   227k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   227k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   227k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   227k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   227k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   227k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 70.0k, False: 157k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  70.0k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  70.0k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  70.0k|{ \
  |  |  |  |  |  |  |  |   57|  70.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 11.2k, False: 58.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  11.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  11.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  11.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  58.8k|    } else { \
  |  |  |  |  |  |  |  |   62|  58.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  58.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  58.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  58.8k|    } \
  |  |  |  |  |  |  |  |   66|  70.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  70.0k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  70.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  70.0k|{ \
  |  |  |  |  |  |  |  |  128|   109k|    do { \
  |  |  |  |  |  |  |  |  129|   109k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 14.2k, False: 95.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  14.2k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  14.2k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  14.2k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  14.2k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  14.2k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  14.2k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  14.2k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  14.2k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 12.3k, False: 1.85k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  12.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 12.0k, False: 328]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  12.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  12.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  12.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  12.0k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    328|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    328|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    328|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    328|            } \
  |  |  |  |  |  |  |  |  |  |  118|  12.3k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.85k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.85k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.85k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.85k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  14.2k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  14.2k|        } \
  |  |  |  |  |  |  |  |  132|   109k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   109k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   109k|        ct--; \
  |  |  |  |  |  |  |  |  135|   109k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 39.8k, False: 70.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  70.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   157k|    } else {  \
  |  |  |  |  |  |  149|   157k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   157k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 70.5k, False: 86.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  70.5k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  70.5k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  70.5k|{ \
  |  |  |  |  |  |  |  |   45|  70.5k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 7.23k, False: 63.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  7.23k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  7.23k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  63.3k|    } else { \
  |  |  |  |  |  |  |  |   49|  63.3k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  63.3k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  63.3k|    } \
  |  |  |  |  |  |  |  |   52|  70.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  70.5k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  70.5k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  70.5k|{ \
  |  |  |  |  |  |  |  |  128|  74.4k|    do { \
  |  |  |  |  |  |  |  |  129|  74.4k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 9.72k, False: 64.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  9.72k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  9.72k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  9.72k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  9.72k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  9.72k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  9.72k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  9.72k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  9.72k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 8.16k, False: 1.55k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  8.16k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 7.91k, False: 247]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  7.91k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  7.91k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  7.91k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  7.91k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    247|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    247|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    247|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    247|            } \
  |  |  |  |  |  |  |  |  |  |  118|  8.16k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.55k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.55k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.55k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.55k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  9.72k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  9.72k|        } \
  |  |  |  |  |  |  |  |  132|  74.4k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  74.4k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  74.4k|        ct--; \
  |  |  |  |  |  |  |  |  135|  74.4k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 3.92k, False: 70.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  70.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  86.6k|        } else { \
  |  |  |  |  |  |  154|  86.6k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  86.6k|        } \
  |  |  |  |  |  |  156|   157k|    } \
  |  |  |  |  |  |  157|   227k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   227k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   227k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 116k, False: 111k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   227k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   227k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   227k|{ \
  |  |  |  |  |  |  323|   227k|    /* east */ \
  |  |  |  |  |  |  324|   227k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   227k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   227k| \
  |  |  |  |  |  |  326|   227k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   227k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   227k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   227k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   227k| \
  |  |  |  |  |  |  329|   227k|    /* west */ \
  |  |  |  |  |  |  330|   227k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   227k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   227k| \
  |  |  |  |  |  |  332|   227k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   227k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   227k| \
  |  |  |  |  |  |  340|   227k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   227k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|   227k|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|   227k|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|   227k|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|   227k|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   227k|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|   227k|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|   227k|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|   227k|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|   227k|    } \
  |  |  |  |  |  |  347|   227k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   227k|            } \
  |  |  |  | 1139|   227k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   563k|    } \
  |  |  |  | 1141|   563k|}
  |  |  ------------------
  |  | 1303|   563k|                                            flags, flagsp, flags_stride, data, \
  |  | 1304|   563k|                                            l_w, 3, mqc, curctx, \
  |  | 1305|   563k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1306|   563k|                        break; \
  |  | 1307|   563k|                } \
  |  | 1308|  66.3M|            } else { \
  |  | 1309|  66.3M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  66.3M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  66.3M|{ \
  |  |  |  | 1120|  66.3M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  66.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  66.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  66.3M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  66.3M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 9.99M, False: 56.3M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  9.99M|        do { \
  |  |  |  | 1122|  9.99M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  9.99M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  9.99M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  9.99M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  9.99M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  9.99M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  9.99M|{ \
  |  |  |  |  |  |  140|  9.99M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  9.99M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  9.99M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  9.99M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  9.99M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  9.99M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.31M, False: 7.67M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.31M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.31M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.31M|{ \
  |  |  |  |  |  |  |  |   57|  2.31M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 504k, False: 1.81M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   504k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   504k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   504k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.81M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.81M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.81M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.81M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.81M|    } \
  |  |  |  |  |  |  |  |   66|  2.31M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.31M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.31M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.31M|{ \
  |  |  |  |  |  |  |  |  128|  3.77M|    do { \
  |  |  |  |  |  |  |  |  129|  3.77M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 475k, False: 3.30M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   475k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   475k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   475k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   475k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   475k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   475k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   475k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   475k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 452k, False: 22.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   452k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 445k, False: 7.36k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   445k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   445k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   445k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   445k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  7.36k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  7.36k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  7.36k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  7.36k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   452k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  22.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  22.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  22.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  22.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   475k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   475k|        } \
  |  |  |  |  |  |  |  |  132|  3.77M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.77M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.77M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.77M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.46M, False: 2.31M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.31M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  7.67M|    } else {  \
  |  |  |  |  |  |  149|  7.67M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  7.67M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.40M, False: 5.27M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.40M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.40M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.40M|{ \
  |  |  |  |  |  |  |  |   45|  2.40M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 398k, False: 2.00M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   398k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   398k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.00M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.00M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.00M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.00M|    } \
  |  |  |  |  |  |  |  |   52|  2.40M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.40M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.40M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.40M|{ \
  |  |  |  |  |  |  |  |  128|  2.58M|    do { \
  |  |  |  |  |  |  |  |  129|  2.58M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 315k, False: 2.27M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   315k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   315k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   315k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   315k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   315k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   315k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   315k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   315k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 300k, False: 14.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   300k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 296k, False: 4.24k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   296k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   296k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   296k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   296k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.24k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.24k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.24k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.24k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   300k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  14.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  14.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  14.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  14.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   315k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   315k|        } \
  |  |  |  |  |  |  |  |  132|  2.58M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.58M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.58M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.58M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 184k, False: 2.40M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.40M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.27M|        } else { \
  |  |  |  |  |  |  154|  5.27M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  5.27M|        } \
  |  |  |  |  |  |  156|  7.67M|    } \
  |  |  |  |  |  |  157|  9.99M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  9.99M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 5.21M, False: 4.77M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  9.99M|                    break; \
  |  |  |  | 1128|  9.99M|            } \
  |  |  |  | 1129|  9.99M|            { \
  |  |  |  | 1130|  4.77M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  4.77M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  4.77M|                                    ci); \
  |  |  |  | 1133|  4.77M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  4.77M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  4.77M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  4.77M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  4.77M|{ \
  |  |  |  |  |  |  140|  4.77M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  4.77M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  4.77M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  4.77M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  4.77M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  4.77M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.20M, False: 3.57M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.20M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.20M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.20M|{ \
  |  |  |  |  |  |  |  |   57|  1.20M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 252k, False: 951k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   252k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   252k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   252k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   951k|    } else { \
  |  |  |  |  |  |  |  |   62|   951k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   951k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   951k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   951k|    } \
  |  |  |  |  |  |  |  |   66|  1.20M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.20M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.20M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.20M|{ \
  |  |  |  |  |  |  |  |  128|  1.95M|    do { \
  |  |  |  |  |  |  |  |  129|  1.95M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 239k, False: 1.72M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   239k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   239k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   239k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   239k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   239k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   239k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   239k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   239k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 229k, False: 9.83k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   229k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 227k, False: 1.95k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   227k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   227k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   227k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   227k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.95k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.95k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.95k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.95k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   229k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  9.83k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  9.83k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  9.83k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  9.83k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   239k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   239k|        } \
  |  |  |  |  |  |  |  |  132|  1.95M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.95M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.95M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.95M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 755k, False: 1.20M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.20M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  3.57M|    } else {  \
  |  |  |  |  |  |  149|  3.57M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  3.57M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.28M, False: 2.28M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.28M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.28M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.28M|{ \
  |  |  |  |  |  |  |  |   45|  1.28M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 201k, False: 1.08M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   201k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   201k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.08M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.08M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.08M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.08M|    } \
  |  |  |  |  |  |  |  |   52|  1.28M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.28M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.28M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.28M|{ \
  |  |  |  |  |  |  |  |  128|  1.37M|    do { \
  |  |  |  |  |  |  |  |  129|  1.37M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 169k, False: 1.20M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   169k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   169k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   169k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   169k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   169k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   169k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   169k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   169k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 162k, False: 6.92k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   162k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 160k, False: 1.93k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   160k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   160k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   160k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   160k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.93k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.93k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.93k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.93k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   162k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  6.92k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  6.92k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  6.92k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  6.92k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   169k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   169k|        } \
  |  |  |  |  |  |  |  |  132|  1.37M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.37M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.37M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.37M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 88.2k, False: 1.28M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.28M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.28M|        } else { \
  |  |  |  |  |  |  154|  2.28M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.28M|        } \
  |  |  |  |  |  |  156|  3.57M|    } \
  |  |  |  |  |  |  157|  4.77M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  4.77M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  4.77M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 2.40M, False: 2.36M]
  |  |  |  |  ------------------
  |  |  |  | 1137|  4.77M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  4.77M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  4.77M|{ \
  |  |  |  |  |  |  323|  4.77M|    /* east */ \
  |  |  |  |  |  |  324|  4.77M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.77M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  4.77M| \
  |  |  |  |  |  |  326|  4.77M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  4.77M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  4.77M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  4.77M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  4.77M| \
  |  |  |  |  |  |  329|  4.77M|    /* west */ \
  |  |  |  |  |  |  330|  4.77M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  4.77M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  4.77M| \
  |  |  |  |  |  |  332|  4.77M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  4.77M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  4.77M| \
  |  |  |  |  |  |  340|  4.77M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  4.77M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  4.77M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  4.77M|            } \
  |  |  |  | 1139|  4.77M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  9.99M|    } \
  |  |  |  | 1141|  66.3M|}
  |  |  ------------------
  |  | 1310|  66.3M|                                    flags, flagsp, flags_stride, data, \
  |  | 1311|  66.3M|                                    l_w, 0, mqc, curctx, \
  |  | 1312|  66.3M|                                    v, a, c, ct, oneplushalf, vsc); \
  |  | 1313|  66.3M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  66.3M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  66.3M|{ \
  |  |  |  | 1120|  66.3M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  66.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  66.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  66.3M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  66.3M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 9.98M, False: 56.3M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  9.98M|        do { \
  |  |  |  | 1122|  9.98M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  9.98M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  9.98M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  9.98M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  9.98M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  9.98M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  9.98M|{ \
  |  |  |  |  |  |  140|  9.98M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  9.98M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  9.98M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  9.98M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  9.98M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  9.98M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.23M, False: 7.75M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.23M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.23M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.23M|{ \
  |  |  |  |  |  |  |  |   57|  2.23M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 472k, False: 1.76M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   472k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   472k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   472k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.76M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.76M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.76M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.76M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.76M|    } \
  |  |  |  |  |  |  |  |   66|  2.23M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.23M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.23M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.23M|{ \
  |  |  |  |  |  |  |  |  128|  3.69M|    do { \
  |  |  |  |  |  |  |  |  129|  3.69M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 472k, False: 3.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   472k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   472k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   472k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   472k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   472k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   472k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   472k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   472k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 450k, False: 21.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   450k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 444k, False: 6.16k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   444k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   444k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   444k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   444k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  6.16k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  6.16k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  6.16k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  6.16k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   450k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  21.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  21.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  21.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  21.9k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   472k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   472k|        } \
  |  |  |  |  |  |  |  |  132|  3.69M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.69M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.69M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.69M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.45M, False: 2.23M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.23M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  7.75M|    } else {  \
  |  |  |  |  |  |  149|  7.75M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  7.75M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.38M, False: 5.36M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.38M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.38M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.38M|{ \
  |  |  |  |  |  |  |  |   45|  2.38M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 365k, False: 2.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   365k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   365k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.02M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.02M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.02M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.02M|    } \
  |  |  |  |  |  |  |  |   52|  2.38M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.38M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.38M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.38M|{ \
  |  |  |  |  |  |  |  |  128|  2.55M|    do { \
  |  |  |  |  |  |  |  |  129|  2.55M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 317k, False: 2.23M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   317k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   317k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   317k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   317k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   317k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   317k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   317k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   317k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 301k, False: 15.1k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   301k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 297k, False: 4.55k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   297k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   297k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   297k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   297k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.55k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.55k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.55k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.55k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   301k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  15.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  15.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  15.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  15.1k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   317k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   317k|        } \
  |  |  |  |  |  |  |  |  132|  2.55M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.55M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.55M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.55M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 163k, False: 2.38M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.38M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.36M|        } else { \
  |  |  |  |  |  |  154|  5.36M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  5.36M|        } \
  |  |  |  |  |  |  156|  7.75M|    } \
  |  |  |  |  |  |  157|  9.98M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  9.98M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 5.32M, False: 4.66M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  9.98M|                    break; \
  |  |  |  | 1128|  9.98M|            } \
  |  |  |  | 1129|  9.98M|            { \
  |  |  |  | 1130|  4.66M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  4.66M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  4.66M|                                    ci); \
  |  |  |  | 1133|  4.66M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  4.66M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  4.66M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  4.66M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  4.66M|{ \
  |  |  |  |  |  |  140|  4.66M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  4.66M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  4.66M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  4.66M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  4.66M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  4.66M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.17M, False: 3.49M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.17M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.17M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.17M|{ \
  |  |  |  |  |  |  |  |   57|  1.17M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 252k, False: 917k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   252k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   252k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   252k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   917k|    } else { \
  |  |  |  |  |  |  |  |   62|   917k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   917k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   917k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   917k|    } \
  |  |  |  |  |  |  |  |   66|  1.17M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.17M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.17M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.17M|{ \
  |  |  |  |  |  |  |  |  128|  1.90M|    do { \
  |  |  |  |  |  |  |  |  129|  1.90M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 232k, False: 1.67M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   232k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   232k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   232k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   232k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   232k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   232k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   232k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   232k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 224k, False: 8.56k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   224k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 220k, False: 3.20k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   220k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   220k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   220k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   220k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.20k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.20k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.20k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.20k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   224k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.56k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.56k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.56k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.56k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   232k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   232k|        } \
  |  |  |  |  |  |  |  |  132|  1.90M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.90M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.90M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.90M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 734k, False: 1.17M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.17M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  3.49M|    } else {  \
  |  |  |  |  |  |  149|  3.49M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  3.49M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.23M, False: 2.25M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.23M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.23M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.23M|{ \
  |  |  |  |  |  |  |  |   45|  1.23M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 196k, False: 1.04M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   196k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   196k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.04M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.04M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.04M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.04M|    } \
  |  |  |  |  |  |  |  |   52|  1.23M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.23M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.23M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.23M|{ \
  |  |  |  |  |  |  |  |  128|  1.32M|    do { \
  |  |  |  |  |  |  |  |  129|  1.32M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 171k, False: 1.15M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   171k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   171k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   171k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   171k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   171k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   171k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   171k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   171k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 164k, False: 7.26k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   164k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 162k, False: 1.85k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   162k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   162k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   162k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   162k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.85k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.85k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.85k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.85k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   164k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  7.26k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  7.26k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  7.26k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  7.26k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   171k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   171k|        } \
  |  |  |  |  |  |  |  |  132|  1.32M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.32M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.32M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.32M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 87.2k, False: 1.23M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.23M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.25M|        } else { \
  |  |  |  |  |  |  154|  2.25M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.25M|        } \
  |  |  |  |  |  |  156|  3.49M|    } \
  |  |  |  |  |  |  157|  4.66M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  4.66M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  4.66M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 2.33M, False: 2.32M]
  |  |  |  |  ------------------
  |  |  |  | 1137|  4.66M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  4.66M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  4.66M|{ \
  |  |  |  |  |  |  323|  4.66M|    /* east */ \
  |  |  |  |  |  |  324|  4.66M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.66M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  4.66M| \
  |  |  |  |  |  |  326|  4.66M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  4.66M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  4.66M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  4.66M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  4.66M| \
  |  |  |  |  |  |  329|  4.66M|    /* west */ \
  |  |  |  |  |  |  330|  4.66M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  4.66M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  4.66M| \
  |  |  |  |  |  |  332|  4.66M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  4.66M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  4.66M| \
  |  |  |  |  |  |  340|  4.66M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  4.66M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  4.66M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  4.66M|            } \
  |  |  |  | 1139|  4.66M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  9.98M|    } \
  |  |  |  | 1141|  66.3M|}
  |  |  ------------------
  |  | 1314|  66.3M|                                    flags, flagsp, flags_stride, data, \
  |  | 1315|  66.3M|                                    l_w, 1, mqc, curctx, \
  |  | 1316|  66.3M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1317|  66.3M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  66.3M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  66.3M|{ \
  |  |  |  | 1120|  66.3M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  66.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  66.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  66.3M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  66.3M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 10.1M, False: 56.2M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  10.1M|        do { \
  |  |  |  | 1122|  10.1M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  10.1M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  10.1M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  10.1M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  10.1M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  10.1M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  10.1M|{ \
  |  |  |  |  |  |  140|  10.1M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  10.1M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  10.1M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  10.1M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  10.1M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  10.1M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.16M, False: 7.94M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.16M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.16M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.16M|{ \
  |  |  |  |  |  |  |  |   57|  2.16M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 445k, False: 1.72M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   445k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   445k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   445k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.72M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.72M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.72M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.72M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.72M|    } \
  |  |  |  |  |  |  |  |   66|  2.16M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.16M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.16M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.16M|{ \
  |  |  |  |  |  |  |  |  128|  3.60M|    do { \
  |  |  |  |  |  |  |  |  129|  3.60M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 452k, False: 3.15M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   452k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   452k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   452k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   452k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   452k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   452k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   452k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   452k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 432k, False: 20.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   432k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 426k, False: 5.31k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   426k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   426k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   426k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   426k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  5.31k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  5.31k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  5.31k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  5.31k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   432k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  20.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  20.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  20.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  20.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   452k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   452k|        } \
  |  |  |  |  |  |  |  |  132|  3.60M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.60M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.60M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.60M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.44M, False: 2.16M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.16M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  7.94M|    } else {  \
  |  |  |  |  |  |  149|  7.94M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  7.94M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.35M, False: 5.58M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.35M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.35M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.35M|{ \
  |  |  |  |  |  |  |  |   45|  2.35M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 360k, False: 1.99M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   360k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   360k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.99M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.99M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.99M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.99M|    } \
  |  |  |  |  |  |  |  |   52|  2.35M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.35M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.35M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.35M|{ \
  |  |  |  |  |  |  |  |  128|  2.52M|    do { \
  |  |  |  |  |  |  |  |  129|  2.52M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 313k, False: 2.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   313k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   313k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   313k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   313k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   313k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   313k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   313k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   313k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 295k, False: 18.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   295k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 291k, False: 3.91k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   291k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   291k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   291k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   291k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.91k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.91k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.91k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.91k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   295k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  18.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  18.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  18.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  18.0k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   313k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   313k|        } \
  |  |  |  |  |  |  |  |  132|  2.52M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.52M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.52M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.52M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 168k, False: 2.35M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.35M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.58M|        } else { \
  |  |  |  |  |  |  154|  5.58M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  5.58M|        } \
  |  |  |  |  |  |  156|  7.94M|    } \
  |  |  |  |  |  |  157|  10.1M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  10.1M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 5.51M, False: 4.59M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  10.1M|                    break; \
  |  |  |  | 1128|  10.1M|            } \
  |  |  |  | 1129|  10.1M|            { \
  |  |  |  | 1130|  4.59M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  4.59M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  4.59M|                                    ci); \
  |  |  |  | 1133|  4.59M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  4.59M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  4.59M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  4.59M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  4.59M|{ \
  |  |  |  |  |  |  140|  4.59M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  4.59M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  4.59M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  4.59M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  4.59M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  4.59M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.13M, False: 3.45M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.13M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.13M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.13M|{ \
  |  |  |  |  |  |  |  |   57|  1.13M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 241k, False: 897k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   241k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   241k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   241k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   897k|    } else { \
  |  |  |  |  |  |  |  |   62|   897k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   897k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   897k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   897k|    } \
  |  |  |  |  |  |  |  |   66|  1.13M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.13M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.13M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.13M|{ \
  |  |  |  |  |  |  |  |  128|  1.85M|    do { \
  |  |  |  |  |  |  |  |  129|  1.85M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 242k, False: 1.61M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   242k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   242k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   242k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   242k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   242k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   242k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   242k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   242k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 232k, False: 10.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   232k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 229k, False: 2.77k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   229k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   229k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   229k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   229k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.77k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.77k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.77k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.77k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   232k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  10.7k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  10.7k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  10.7k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  10.7k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   242k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   242k|        } \
  |  |  |  |  |  |  |  |  132|  1.85M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.85M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.85M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.85M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 720k, False: 1.13M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.13M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  3.45M|    } else {  \
  |  |  |  |  |  |  149|  3.45M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  3.45M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.21M, False: 2.24M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.21M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.21M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.21M|{ \
  |  |  |  |  |  |  |  |   45|  1.21M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 190k, False: 1.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   190k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   190k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.02M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.02M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.02M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.02M|    } \
  |  |  |  |  |  |  |  |   52|  1.21M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.21M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.21M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.21M|{ \
  |  |  |  |  |  |  |  |  128|  1.30M|    do { \
  |  |  |  |  |  |  |  |  129|  1.30M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 163k, False: 1.13M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   163k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   163k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   163k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   163k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   163k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   163k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   163k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   163k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 156k, False: 7.22k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   156k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 152k, False: 3.35k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   152k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   152k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   152k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   152k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.35k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.35k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.35k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.35k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   156k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  7.22k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  7.22k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  7.22k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  7.22k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   163k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   163k|        } \
  |  |  |  |  |  |  |  |  132|  1.30M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.30M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.30M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.30M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 83.5k, False: 1.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.21M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.24M|        } else { \
  |  |  |  |  |  |  154|  2.24M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.24M|        } \
  |  |  |  |  |  |  156|  3.45M|    } \
  |  |  |  |  |  |  157|  4.59M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  4.59M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  4.59M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 2.30M, False: 2.29M]
  |  |  |  |  ------------------
  |  |  |  | 1137|  4.59M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  4.59M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  4.59M|{ \
  |  |  |  |  |  |  323|  4.59M|    /* east */ \
  |  |  |  |  |  |  324|  4.59M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.59M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  4.59M| \
  |  |  |  |  |  |  326|  4.59M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  4.59M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  4.59M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  4.59M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  4.59M| \
  |  |  |  |  |  |  329|  4.59M|    /* west */ \
  |  |  |  |  |  |  330|  4.59M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  4.59M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  4.59M| \
  |  |  |  |  |  |  332|  4.59M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  4.59M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  4.59M| \
  |  |  |  |  |  |  340|  4.59M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  4.59M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  4.59M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  4.59M|            } \
  |  |  |  | 1139|  4.59M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  10.1M|    } \
  |  |  |  | 1141|  66.3M|}
  |  |  ------------------
  |  | 1318|  66.3M|                                    flags, flagsp, flags_stride, data, \
  |  | 1319|  66.3M|                                    l_w, 2, mqc, curctx, \
  |  | 1320|  66.3M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1321|  66.3M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  66.3M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  66.3M|{ \
  |  |  |  | 1120|  66.3M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  66.3M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  66.3M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  66.3M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  66.3M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 10.4M, False: 55.8M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  10.4M|        do { \
  |  |  |  | 1122|  10.4M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  10.4M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  10.4M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  10.4M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  10.4M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  10.4M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  10.4M|{ \
  |  |  |  |  |  |  140|  10.4M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  10.4M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  10.4M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  10.4M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  10.4M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  10.4M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.09M, False: 8.38M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.09M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.09M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.09M|{ \
  |  |  |  |  |  |  |  |   57|  2.09M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 406k, False: 1.69M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   406k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   406k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   406k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.69M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.69M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.69M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.69M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.69M|    } \
  |  |  |  |  |  |  |  |   66|  2.09M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.09M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.09M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.09M|{ \
  |  |  |  |  |  |  |  |  128|  3.58M|    do { \
  |  |  |  |  |  |  |  |  129|  3.58M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 443k, False: 3.13M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   443k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   443k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   443k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   443k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   443k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   443k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   443k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   443k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 423k, False: 20.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   423k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 418k, False: 4.35k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   418k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   418k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   418k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   418k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.35k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.35k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.35k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.35k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   423k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  20.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  20.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  20.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  20.6k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   443k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   443k|        } \
  |  |  |  |  |  |  |  |  132|  3.58M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.58M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.58M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.58M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.48M, False: 2.09M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.09M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  8.38M|    } else {  \
  |  |  |  |  |  |  149|  8.38M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  8.38M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.22M, False: 6.16M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.22M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.22M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.22M|{ \
  |  |  |  |  |  |  |  |   45|  2.22M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 311k, False: 1.91M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   311k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   311k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.91M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.91M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.91M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.91M|    } \
  |  |  |  |  |  |  |  |   52|  2.22M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.22M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.22M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.22M|{ \
  |  |  |  |  |  |  |  |  128|  2.36M|    do { \
  |  |  |  |  |  |  |  |  129|  2.36M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 304k, False: 2.06M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   304k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   304k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   304k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   304k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   304k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   304k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   304k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   304k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 291k, False: 13.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   291k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 287k, False: 3.57k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   287k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   287k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   287k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   287k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.57k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.57k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.57k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.57k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   291k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  13.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  13.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  13.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  13.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   304k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   304k|        } \
  |  |  |  |  |  |  |  |  132|  2.36M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.36M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.36M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.36M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 142k, False: 2.22M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.22M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  6.16M|        } else { \
  |  |  |  |  |  |  154|  6.16M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  6.16M|        } \
  |  |  |  |  |  |  156|  8.38M|    } \
  |  |  |  |  |  |  157|  10.4M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  10.4M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 6.02M, False: 4.46M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  10.4M|                    break; \
  |  |  |  | 1128|  10.4M|            } \
  |  |  |  | 1129|  10.4M|            { \
  |  |  |  | 1130|  4.46M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  4.46M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  4.46M|                                    ci); \
  |  |  |  | 1133|  4.46M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  4.46M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  4.46M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  4.46M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  4.46M|{ \
  |  |  |  |  |  |  140|  4.46M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  4.46M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  4.46M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  4.46M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  4.46M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  4.46M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.11M, False: 3.34M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.11M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.11M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.11M|{ \
  |  |  |  |  |  |  |  |   57|  1.11M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 249k, False: 868k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   249k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   249k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   249k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   868k|    } else { \
  |  |  |  |  |  |  |  |   62|   868k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   868k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   868k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   868k|    } \
  |  |  |  |  |  |  |  |   66|  1.11M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.11M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.11M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.11M|{ \
  |  |  |  |  |  |  |  |  128|  1.82M|    do { \
  |  |  |  |  |  |  |  |  129|  1.82M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 225k, False: 1.59M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   225k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   225k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   225k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   225k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   225k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   225k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   225k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   225k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 214k, False: 11.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   214k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 212k, False: 2.33k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   212k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   212k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   212k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   212k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.33k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.33k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.33k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.33k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   214k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  11.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  11.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  11.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  11.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   225k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   225k|        } \
  |  |  |  |  |  |  |  |  132|  1.82M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.82M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.82M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.82M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 706k, False: 1.11M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.11M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  3.34M|    } else {  \
  |  |  |  |  |  |  149|  3.34M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  3.34M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.17M, False: 2.16M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.17M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.17M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.17M|{ \
  |  |  |  |  |  |  |  |   45|  1.17M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 189k, False: 984k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   189k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   189k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   984k|    } else { \
  |  |  |  |  |  |  |  |   49|   984k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   984k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   984k|    } \
  |  |  |  |  |  |  |  |   52|  1.17M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.17M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.17M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.17M|{ \
  |  |  |  |  |  |  |  |  128|  1.25M|    do { \
  |  |  |  |  |  |  |  |  129|  1.25M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 157k, False: 1.10M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   157k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   157k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   157k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   157k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   157k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   157k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   157k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   157k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 152k, False: 4.83k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   152k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 150k, False: 2.37k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   150k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   150k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   150k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   150k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.37k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.37k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.37k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.37k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   152k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.83k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.83k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.83k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.83k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   157k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   157k|        } \
  |  |  |  |  |  |  |  |  132|  1.25M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.25M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.25M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.25M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 85.6k, False: 1.17M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.17M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.16M|        } else { \
  |  |  |  |  |  |  154|  2.16M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.16M|        } \
  |  |  |  |  |  |  156|  3.34M|    } \
  |  |  |  |  |  |  157|  4.46M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  4.46M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  4.46M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 2.22M, False: 2.23M]
  |  |  |  |  ------------------
  |  |  |  | 1137|  4.46M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  4.46M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  4.46M|{ \
  |  |  |  |  |  |  323|  4.46M|    /* east */ \
  |  |  |  |  |  |  324|  4.46M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.46M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  4.46M| \
  |  |  |  |  |  |  326|  4.46M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  4.46M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  4.46M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  4.46M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  4.46M| \
  |  |  |  |  |  |  329|  4.46M|    /* west */ \
  |  |  |  |  |  |  330|  4.46M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  4.46M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  4.46M| \
  |  |  |  |  |  |  332|  4.46M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  4.46M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  4.46M| \
  |  |  |  |  |  |  340|  4.46M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  4.46M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  4.46M|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|  4.46M|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  4.46M|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  4.46M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  4.46M|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  4.46M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  4.46M|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  4.46M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|  4.46M|    } \
  |  |  |  |  |  |  347|  4.46M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  4.46M|            } \
  |  |  |  | 1139|  4.46M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  10.4M|    } \
  |  |  |  | 1141|  66.3M|}
  |  |  ------------------
  |  | 1322|  66.3M|                                    flags, flagsp, flags_stride, data, \
  |  | 1323|  66.3M|                                    l_w, 3, mqc, curctx, \
  |  | 1324|  66.3M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1325|  66.3M|            } \
  |  | 1326|   102M|            *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  115|  66.9M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  119|  66.9M|#define T1_PI_1     (1U << 24)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  122|  66.9M|#define T1_PI_2     (1U << 27)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  125|  66.9M|#define T1_PI_3     (1U << 30)
  |  |  ------------------
  |  | 1327|  66.9M|        } \
  |  | 1328|  1.60M|    } \
  |  | 1329|   100k|    UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|   100k|        mqc->curctx = curctx; \
  |  |  |  |  167|   100k|        mqc->c = c; \
  |  |  |  |  168|   100k|        mqc->a = a; \
  |  |  |  |  169|   100k|        mqc->ct = ct;
  |  |  ------------------
  |  | 1330|   100k|    if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (1330:9): [True: 0, False: 100k]
  |  |  ------------------
  |  | 1331|      0|        for (i = 0; i < l_w; ++i, ++flagsp, ++data) { \
  |  |  ------------------
  |  |  |  Branch (1331:21): [True: 0, False: 0]
  |  |  ------------------
  |  | 1332|      0|            for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (1332:25): [True: 0, False: 0]
  |  |  ------------------
  |  | 1333|      0|                opj_t1_dec_clnpass_step(t1, flagsp, data + j * l_w, oneplushalf, j, vsc); \
  |  | 1334|      0|            } \
  |  | 1335|      0|            *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  119|      0|#define T1_PI_1     (1U << 24)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  122|      0|#define T1_PI_2     (1U << 27)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  125|      0|#define T1_PI_3     (1U << 30)
  |  |  ------------------
  |  | 1336|      0|        } \
  |  | 1337|      0|    } \
  |  | 1338|   100k|}
  ------------------
 1373|   100k|}
t1.c:opj_t1_dec_clnpass_step:
 1150|  5.87M|{
 1151|  5.87M|    OPJ_UINT32 v;
 1152|       |
 1153|  5.87M|    opj_mqc_t *mqc = &(t1->mqc);   /* MQC component */
 1154|  5.87M|    opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE,
  ------------------
  |  | 1118|  5.87M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  | 1119|  5.87M|{ \
  |  | 1120|  5.87M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  ------------------
  |  |  |  |  153|  5.87M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|  5.87M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  ------------------
  |  |  |  |  163|  5.87M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  ------------------
  |  |  |  |  |  |  115|  5.87M|#define T1_PI_0     (1U << 21)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  Branch (1120:26): [True: 3.07M, False: 2.79M]
  |  |  ------------------
  |  | 1121|  3.07M|        do { \
  |  | 1122|  3.07M|            if( !partial ) { \
  |  |  ------------------
  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  ------------------
  |  | 1123|  3.07M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  | 1124|  3.07M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  ------------------
  |  |  |  |   62|  3.07M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1125|  3.07M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|  3.07M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|  3.07M|{ \
  |  |  |  |  140|  3.07M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|  3.07M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|  3.07M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|  3.07M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|  3.07M|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|  3.07M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 186k, False: 2.88M]
  |  |  |  |  ------------------
  |  |  |  |  146|   186k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   186k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   186k|{ \
  |  |  |  |  |  |   57|   186k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 32.8k, False: 153k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  32.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  32.8k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  32.8k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   153k|    } else { \
  |  |  |  |  |  |   62|   153k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   153k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   153k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   153k|    } \
  |  |  |  |  |  |   66|   186k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   186k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   186k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   186k|{ \
  |  |  |  |  |  |  128|   366k|    do { \
  |  |  |  |  |  |  129|   366k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 46.9k, False: 319k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  46.9k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  46.9k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  46.9k|{ \
  |  |  |  |  |  |  |  |  104|  46.9k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  46.9k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  46.9k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  46.9k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  46.9k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 34.6k, False: 12.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  34.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 30.0k, False: 4.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  30.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  30.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  30.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  30.0k|            } else { \
  |  |  |  |  |  |  |  |  114|  4.58k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  4.58k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  4.58k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  4.58k|            } \
  |  |  |  |  |  |  |  |  118|  34.6k|        } else { \
  |  |  |  |  |  |  |  |  119|  12.2k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  12.2k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  12.2k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  12.2k|        } \
  |  |  |  |  |  |  |  |  123|  46.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  46.9k|        } \
  |  |  |  |  |  |  132|   366k|        a <<= 1; \
  |  |  |  |  |  |  133|   366k|        c <<= 1; \
  |  |  |  |  |  |  134|   366k|        ct--; \
  |  |  |  |  |  |  135|   366k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 180k, False: 186k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   186k|}
  |  |  |  |  ------------------
  |  |  |  |  148|  2.88M|    } else {  \
  |  |  |  |  149|  2.88M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|  2.88M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 229k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  |  |  151|   229k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   229k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   229k|{ \
  |  |  |  |  |  |   45|   229k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 27.0k, False: 201k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  27.0k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  27.0k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   201k|    } else { \
  |  |  |  |  |  |   49|   201k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   201k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   201k|    } \
  |  |  |  |  |  |   52|   229k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   229k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   229k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   229k|{ \
  |  |  |  |  |  |  128|   240k|    do { \
  |  |  |  |  |  |  129|   240k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 33.5k, False: 206k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  33.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  33.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  33.5k|{ \
  |  |  |  |  |  |  |  |  104|  33.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  33.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  33.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  33.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  33.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 25.0k, False: 8.50k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  25.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 22.3k, False: 2.64k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  22.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  22.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  22.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  22.3k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.64k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.64k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.64k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.64k|            } \
  |  |  |  |  |  |  |  |  118|  25.0k|        } else { \
  |  |  |  |  |  |  |  |  119|  8.50k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  8.50k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  8.50k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  8.50k|        } \
  |  |  |  |  |  |  |  |  123|  33.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  33.5k|        } \
  |  |  |  |  |  |  132|   240k|        a <<= 1; \
  |  |  |  |  |  |  133|   240k|        c <<= 1; \
  |  |  |  |  |  |  134|   240k|        ct--; \
  |  |  |  |  |  |  135|   240k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 11.0k, False: 229k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   229k|}
  |  |  |  |  ------------------
  |  |  |  |  153|  2.65M|        } else { \
  |  |  |  |  154|  2.65M|            d = (*curctx)->mps; \
  |  |  |  |  155|  2.65M|        } \
  |  |  |  |  156|  2.88M|    } \
  |  |  |  |  157|  3.07M|}
  |  |  ------------------
  |  | 1126|  3.07M|                if( !v ) \
  |  |  ------------------
  |  |  |  Branch (1126:21): [True: 2.75M, False: 322k]
  |  |  ------------------
  |  | 1127|  3.07M|                    break; \
  |  | 1128|  3.07M|            } \
  |  | 1129|  3.07M|            { \
  |  | 1130|   322k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  | 1131|   322k|                                    flags, flagsp[-1], flagsp[1], \
  |  | 1132|   322k|                                    ci); \
  |  | 1133|   322k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  ------------------
  |  |  |  |   62|   322k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1134|   322k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   322k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   322k|{ \
  |  |  |  |  140|   322k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   322k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   322k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   322k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   322k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   322k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 91.1k, False: 231k]
  |  |  |  |  ------------------
  |  |  |  |  146|  91.1k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|  91.1k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|  91.1k|{ \
  |  |  |  |  |  |   57|  91.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 23.9k, False: 67.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  23.9k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  23.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  23.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|  67.1k|    } else { \
  |  |  |  |  |  |   62|  67.1k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|  67.1k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|  67.1k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|  67.1k|    } \
  |  |  |  |  |  |   66|  91.1k|}
  |  |  |  |  ------------------
  |  |  |  |  147|  91.1k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|  91.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|  91.1k|{ \
  |  |  |  |  |  |  128|   139k|    do { \
  |  |  |  |  |  |  129|   139k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 18.0k, False: 121k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  18.0k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  18.0k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  18.0k|{ \
  |  |  |  |  |  |  |  |  104|  18.0k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  18.0k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  18.0k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  18.0k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  18.0k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 14.1k, False: 3.84k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  14.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 12.9k, False: 1.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  12.9k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  12.9k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  12.9k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  12.9k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.19k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.19k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.19k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.19k|            } \
  |  |  |  |  |  |  |  |  118|  14.1k|        } else { \
  |  |  |  |  |  |  |  |  119|  3.84k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  3.84k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  3.84k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  3.84k|        } \
  |  |  |  |  |  |  |  |  123|  18.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  18.0k|        } \
  |  |  |  |  |  |  132|   139k|        a <<= 1; \
  |  |  |  |  |  |  133|   139k|        c <<= 1; \
  |  |  |  |  |  |  134|   139k|        ct--; \
  |  |  |  |  |  |  135|   139k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 48.6k, False: 91.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  91.1k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   231k|    } else {  \
  |  |  |  |  149|   231k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   231k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 95.8k, False: 135k]
  |  |  |  |  ------------------
  |  |  |  |  151|  95.8k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  95.8k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|  95.8k|{ \
  |  |  |  |  |  |   45|  95.8k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 19.5k, False: 76.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  19.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  19.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|  76.2k|    } else { \
  |  |  |  |  |  |   49|  76.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|  76.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|  76.2k|    } \
  |  |  |  |  |  |   52|  95.8k|}
  |  |  |  |  ------------------
  |  |  |  |  152|  95.8k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|  95.8k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|  95.8k|{ \
  |  |  |  |  |  |  128|   105k|    do { \
  |  |  |  |  |  |  129|   105k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 12.8k, False: 92.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  12.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  12.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  12.8k|{ \
  |  |  |  |  |  |  |  |  104|  12.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  12.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  12.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  12.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  12.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 10.0k, False: 2.74k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  10.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 9.11k, False: 973]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  9.11k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  9.11k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  9.11k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  9.11k|            } else { \
  |  |  |  |  |  |  |  |  114|    973|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|    973|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|    973|                ct = 7; \
  |  |  |  |  |  |  |  |  117|    973|            } \
  |  |  |  |  |  |  |  |  118|  10.0k|        } else { \
  |  |  |  |  |  |  |  |  119|  2.74k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  2.74k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  2.74k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  2.74k|        } \
  |  |  |  |  |  |  |  |  123|  12.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  12.8k|        } \
  |  |  |  |  |  |  132|   105k|        a <<= 1; \
  |  |  |  |  |  |  133|   105k|        c <<= 1; \
  |  |  |  |  |  |  134|   105k|        ct--; \
  |  |  |  |  |  |  135|   105k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 9.39k, False: 95.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  95.8k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   135k|        } else { \
  |  |  |  |  154|   135k|            d = (*curctx)->mps; \
  |  |  |  |  155|   135k|        } \
  |  |  |  |  156|   231k|    } \
  |  |  |  |  157|   322k|}
  |  |  ------------------
  |  | 1135|   322k|                v = v ^ opj_t1_getspb(lu); \
  |  | 1136|   322k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  ------------------
  |  |  |  Branch (1136:40): [True: 157k, False: 164k]
  |  |  ------------------
  |  | 1137|   322k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  ------------------
  |  |  |  |  321|   322k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  322|   322k|{ \
  |  |  |  |  323|   322k|    /* east */ \
  |  |  |  |  324|   322k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   322k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  ------------------
  |  |  |  |  325|   322k| \
  |  |  |  |  326|   322k|    /* mark target as significant */ \
  |  |  |  |  327|   322k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|   322k|#define T1_CHI_1_I  19
  |  |  |  |  ------------------
  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|   322k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  ------------------
  |  |  |  |  328|   322k| \
  |  |  |  |  329|   322k|    /* west */ \
  |  |  |  |  330|   322k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|   322k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  ------------------
  |  |  |  |  331|   322k| \
  |  |  |  |  332|   322k|    /* north-west, north, north-east */ \
  |  |  |  |  333|   322k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (333:9): [True: 159k, False: 163k]
  |  |  |  |  |  Branch (333:21): [True: 78.2k, False: 80.9k]
  |  |  |  |  ------------------
  |  |  |  |  334|  78.2k|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  335|  78.2k|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  78.2k|#define T1_CHI_5_I  31
  |  |  |  |  ------------------
  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|  78.2k|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  ------------------
  |  |  |  |  336|  78.2k|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  78.2k|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  ------------------
  |  |  |  |  337|  78.2k|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|  78.2k|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  ------------------
  |  |  |  |  338|  78.2k|    } \
  |  |  |  |  339|   322k| \
  |  |  |  |  340|   322k|    /* south-west, south, south-east */ \
  |  |  |  |  341|   322k|    if (ci == 3U) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (341:9): [True: 0, False: 322k]
  |  |  |  |  ------------------
  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  ------------------
  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  ------------------
  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  ------------------
  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  ------------------
  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  ------------------
  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  ------------------
  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  ------------------
  |  |  |  |  346|      0|    } \
  |  |  |  |  347|   322k|}
  |  |  ------------------
  |  | 1138|   322k|            } \
  |  | 1139|   322k|        } while(0); \
  |  |  ------------------
  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  ------------------
  |  | 1140|  3.07M|    } \
  |  | 1141|  5.87M|}
  ------------------
 1155|  5.87M|                                  *flagsp, flagsp, t1->w + 2U, datap,
 1156|  5.87M|                                  0, ci, mqc, mqc->curctx,
 1157|  5.87M|                                  v, mqc->a, mqc->c, mqc->ct, oneplushalf, vsc);
 1158|  5.87M|}
t1.c:opj_t1_dec_clnpass_64x64_novsc:
 1364|  93.9k|{
 1365|  93.9k|    opj_t1_dec_clnpass_internal(t1, bpno, OPJ_FALSE, 64, 64, 66);
  ------------------
  |  | 1251|  93.9k|#define opj_t1_dec_clnpass_internal(t1, bpno, vsc, w, h, flags_stride) \
  |  | 1252|  93.9k|{ \
  |  | 1253|  93.9k|    OPJ_INT32 one, half, oneplushalf; \
  |  | 1254|  93.9k|    OPJ_UINT32 runlen; \
  |  | 1255|  93.9k|    OPJ_UINT32 i, j, k; \
  |  | 1256|  93.9k|    const OPJ_UINT32 l_w = w; \
  |  | 1257|  93.9k|    opj_mqc_t* mqc = &(t1->mqc); \
  |  | 1258|  93.9k|    register OPJ_INT32 *data = t1->data; \
  |  | 1259|  93.9k|    register opj_flag_t *flagsp = &t1->flags[flags_stride + 1]; \
  |  | 1260|  93.9k|    DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|  93.9k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|  93.9k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|  93.9k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|  93.9k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  | 1261|  93.9k|    register OPJ_UINT32 v; \
  |  | 1262|  93.9k|    one = 1 << bpno; \
  |  | 1263|  93.9k|    half = one >> 1; \
  |  | 1264|  93.9k|    oneplushalf = one | half; \
  |  | 1265|  1.59M|    for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (1265:17): [True: 1.50M, False: 93.9k]
  |  |  ------------------
  |  | 1266|  97.7M|        for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (1266:21): [True: 96.2M, False: 1.50M]
  |  |  ------------------
  |  | 1267|  96.2M|            opj_flag_t flags = *flagsp; \
  |  | 1268|  96.2M|            if (flags == 0) { \
  |  |  ------------------
  |  |  |  Branch (1268:17): [True: 28.1M, False: 68.0M]
  |  |  ------------------
  |  | 1269|  28.1M|                OPJ_UINT32 partial = OPJ_TRUE; \
  |  |  ------------------
  |  |  |  |  117|  28.1M|#define OPJ_TRUE 1
  |  |  ------------------
  |  | 1270|  28.1M|                opj_t1_setcurctx(curctx, T1_CTXNO_AGG); \
  |  |  ------------------
  |  |  |  |   62|  28.1M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1271|  28.1M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|  28.1M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|  28.1M|{ \
  |  |  |  |  140|  28.1M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|  28.1M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|  28.1M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|  28.1M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|  28.1M|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|  28.1M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 619k, False: 27.4M]
  |  |  |  |  ------------------
  |  |  |  |  146|   619k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   619k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   619k|{ \
  |  |  |  |  |  |   57|   619k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 65.8k, False: 553k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  65.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  65.8k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  65.8k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   553k|    } else { \
  |  |  |  |  |  |   62|   553k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   553k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   553k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   553k|    } \
  |  |  |  |  |  |   66|   619k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   619k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   619k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   619k|{ \
  |  |  |  |  |  |  128|  1.58M|    do { \
  |  |  |  |  |  |  129|  1.58M|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 202k, False: 1.38M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|   202k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|   202k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|   202k|{ \
  |  |  |  |  |  |  |  |  104|   202k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|   202k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|   202k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|   202k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|   202k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 132k, False: 69.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|   132k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 125k, False: 7.09k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|   125k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|   125k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|   125k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|   125k|            } else { \
  |  |  |  |  |  |  |  |  114|  7.09k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  7.09k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  7.09k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  7.09k|            } \
  |  |  |  |  |  |  |  |  118|   132k|        } else { \
  |  |  |  |  |  |  |  |  119|  69.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  69.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  69.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  69.8k|        } \
  |  |  |  |  |  |  |  |  123|   202k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   202k|        } \
  |  |  |  |  |  |  132|  1.58M|        a <<= 1; \
  |  |  |  |  |  |  133|  1.58M|        c <<= 1; \
  |  |  |  |  |  |  134|  1.58M|        ct--; \
  |  |  |  |  |  |  135|  1.58M|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 966k, False: 619k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   619k|}
  |  |  |  |  ------------------
  |  |  |  |  148|  27.4M|    } else {  \
  |  |  |  |  149|  27.4M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|  27.4M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 832k, False: 26.6M]
  |  |  |  |  ------------------
  |  |  |  |  151|   832k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   832k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   832k|{ \
  |  |  |  |  |  |   45|   832k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 50.3k, False: 781k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  50.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  50.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   781k|    } else { \
  |  |  |  |  |  |   49|   781k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   781k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   781k|    } \
  |  |  |  |  |  |   52|   832k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   832k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   832k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   832k|{ \
  |  |  |  |  |  |  128|   857k|    do { \
  |  |  |  |  |  |  129|   857k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 108k, False: 749k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|   108k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|   108k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|   108k|{ \
  |  |  |  |  |  |  |  |  104|   108k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|   108k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|   108k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|   108k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|   108k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 73.8k, False: 34.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  73.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 70.4k, False: 3.36k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  70.4k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  70.4k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  70.4k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  70.4k|            } else { \
  |  |  |  |  |  |  |  |  114|  3.36k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  3.36k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  3.36k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  3.36k|            } \
  |  |  |  |  |  |  |  |  118|  73.8k|        } else { \
  |  |  |  |  |  |  |  |  119|  34.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  34.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  34.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  34.4k|        } \
  |  |  |  |  |  |  |  |  123|   108k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   108k|        } \
  |  |  |  |  |  |  132|   857k|        a <<= 1; \
  |  |  |  |  |  |  133|   857k|        c <<= 1; \
  |  |  |  |  |  |  134|   857k|        ct--; \
  |  |  |  |  |  |  135|   857k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 25.2k, False: 832k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   832k|}
  |  |  |  |  ------------------
  |  |  |  |  153|  26.6M|        } else { \
  |  |  |  |  154|  26.6M|            d = (*curctx)->mps; \
  |  |  |  |  155|  26.6M|        } \
  |  |  |  |  156|  27.4M|    } \
  |  |  |  |  157|  28.1M|}
  |  |  ------------------
  |  | 1272|  28.1M|                if (!v) { \
  |  |  ------------------
  |  |  |  Branch (1272:21): [True: 27.4M, False: 649k]
  |  |  ------------------
  |  | 1273|  27.4M|                    continue; \
  |  | 1274|  27.4M|                } \
  |  | 1275|  28.1M|                opj_t1_setcurctx(curctx, T1_CTXNO_UNI); \
  |  |  ------------------
  |  |  |  |   62|   649k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1276|   649k|                opj_mqc_decode_macro(runlen, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   649k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   649k|{ \
  |  |  |  |  140|   649k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   649k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   649k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   649k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   649k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   649k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 315k, False: 334k]
  |  |  |  |  ------------------
  |  |  |  |  146|   315k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   315k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   315k|{ \
  |  |  |  |  |  |   57|   315k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 197k, False: 118k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|   197k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|   197k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|   197k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   197k|    } else { \
  |  |  |  |  |  |   62|   118k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   118k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   118k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   118k|    } \
  |  |  |  |  |  |   66|   315k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   315k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   315k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   315k|{ \
  |  |  |  |  |  |  128|   315k|    do { \
  |  |  |  |  |  |  129|   315k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 38.7k, False: 276k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  38.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  38.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  38.7k|{ \
  |  |  |  |  |  |  |  |  104|  38.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  38.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  38.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  38.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  38.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 28.9k, False: 9.71k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  28.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 27.8k, False: 1.10k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  27.8k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  27.8k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  27.8k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  27.8k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.10k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.10k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.10k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.10k|            } \
  |  |  |  |  |  |  |  |  118|  28.9k|        } else { \
  |  |  |  |  |  |  |  |  119|  9.71k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  9.71k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  9.71k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  9.71k|        } \
  |  |  |  |  |  |  |  |  123|  38.7k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  38.7k|        } \
  |  |  |  |  |  |  132|   315k|        a <<= 1; \
  |  |  |  |  |  |  133|   315k|        c <<= 1; \
  |  |  |  |  |  |  134|   315k|        ct--; \
  |  |  |  |  |  |  135|   315k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 315k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   315k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   334k|    } else {  \
  |  |  |  |  149|   334k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   334k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 276k, False: 57.7k]
  |  |  |  |  ------------------
  |  |  |  |  151|   276k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   276k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   276k|{ \
  |  |  |  |  |  |   45|   276k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 165k, False: 110k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|   165k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|   165k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   165k|    } else { \
  |  |  |  |  |  |   49|   110k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   110k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   110k|    } \
  |  |  |  |  |  |   52|   276k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   276k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   276k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   276k|{ \
  |  |  |  |  |  |  128|   358k|    do { \
  |  |  |  |  |  |  129|   358k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 46.1k, False: 311k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  46.1k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  46.1k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  46.1k|{ \
  |  |  |  |  |  |  |  |  104|  46.1k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  46.1k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  46.1k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  46.1k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  46.1k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 34.0k, False: 12.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  34.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 32.9k, False: 1.05k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  32.9k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  32.9k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  32.9k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  32.9k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.05k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.05k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.05k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.05k|            } \
  |  |  |  |  |  |  |  |  118|  34.0k|        } else { \
  |  |  |  |  |  |  |  |  119|  12.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  12.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  12.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  12.1k|        } \
  |  |  |  |  |  |  |  |  123|  46.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  46.1k|        } \
  |  |  |  |  |  |  132|   358k|        a <<= 1; \
  |  |  |  |  |  |  133|   358k|        c <<= 1; \
  |  |  |  |  |  |  134|   358k|        ct--; \
  |  |  |  |  |  |  135|   358k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 81.6k, False: 276k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   276k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   276k|        } else { \
  |  |  |  |  154|  57.7k|            d = (*curctx)->mps; \
  |  |  |  |  155|  57.7k|        } \
  |  |  |  |  156|   334k|    } \
  |  |  |  |  157|   649k|}
  |  |  ------------------
  |  | 1277|   649k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   649k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   649k|{ \
  |  |  |  |  140|   649k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   649k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   649k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   649k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   649k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   649k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 313k, False: 336k]
  |  |  |  |  ------------------
  |  |  |  |  146|   313k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   313k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   313k|{ \
  |  |  |  |  |  |   57|   313k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 80.4k, False: 233k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  80.4k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  80.4k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  80.4k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   233k|    } else { \
  |  |  |  |  |  |   62|   233k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   233k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   233k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   233k|    } \
  |  |  |  |  |  |   66|   313k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   313k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   313k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   313k|{ \
  |  |  |  |  |  |  128|   313k|    do { \
  |  |  |  |  |  |  129|   313k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 40.4k, False: 273k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  40.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  40.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  40.4k|{ \
  |  |  |  |  |  |  |  |  104|  40.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  40.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  40.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  40.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  40.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 31.3k, False: 9.08k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  31.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 30.2k, False: 1.12k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  30.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  30.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  30.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  30.2k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.12k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.12k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.12k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.12k|            } \
  |  |  |  |  |  |  |  |  118|  31.3k|        } else { \
  |  |  |  |  |  |  |  |  119|  9.08k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  9.08k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  9.08k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  9.08k|        } \
  |  |  |  |  |  |  |  |  123|  40.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  40.4k|        } \
  |  |  |  |  |  |  132|   313k|        a <<= 1; \
  |  |  |  |  |  |  133|   313k|        c <<= 1; \
  |  |  |  |  |  |  134|   313k|        ct--; \
  |  |  |  |  |  |  135|   313k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 313k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   313k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   336k|    } else {  \
  |  |  |  |  149|   336k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   336k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 285k, False: 50.9k]
  |  |  |  |  ------------------
  |  |  |  |  151|   285k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   285k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   285k|{ \
  |  |  |  |  |  |   45|   285k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 61.7k, False: 223k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  61.7k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  61.7k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   223k|    } else { \
  |  |  |  |  |  |   49|   223k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   223k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   223k|    } \
  |  |  |  |  |  |   52|   285k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   285k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   285k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   285k|{ \
  |  |  |  |  |  |  128|   322k|    do { \
  |  |  |  |  |  |  129|   322k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 34.7k, False: 287k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  34.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  34.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  34.7k|{ \
  |  |  |  |  |  |  |  |  104|  34.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  34.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  34.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  34.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  34.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 26.1k, False: 8.57k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  26.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 24.9k, False: 1.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  24.9k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  24.9k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  24.9k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  24.9k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.19k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.19k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.19k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.19k|            } \
  |  |  |  |  |  |  |  |  118|  26.1k|        } else { \
  |  |  |  |  |  |  |  |  119|  8.57k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  8.57k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  8.57k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  8.57k|        } \
  |  |  |  |  |  |  |  |  123|  34.7k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  34.7k|        } \
  |  |  |  |  |  |  132|   322k|        a <<= 1; \
  |  |  |  |  |  |  133|   322k|        c <<= 1; \
  |  |  |  |  |  |  134|   322k|        ct--; \
  |  |  |  |  |  |  135|   322k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 37.3k, False: 285k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   285k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   285k|        } else { \
  |  |  |  |  154|  50.9k|            d = (*curctx)->mps; \
  |  |  |  |  155|  50.9k|        } \
  |  |  |  |  156|   336k|    } \
  |  |  |  |  157|   649k|}
  |  |  ------------------
  |  | 1278|   649k|                runlen = (runlen << 1) | v; \
  |  | 1279|   649k|                switch(runlen) { \
  |  |  ------------------
  |  |  |  Branch (1279:24): [True: 0, False: 649k]
  |  |  ------------------
  |  | 1280|   198k|                    case 0: \
  |  |  ------------------
  |  |  |  Branch (1280:21): [True: 198k, False: 451k]
  |  |  ------------------
  |  | 1281|   198k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, OPJ_TRUE,\
  |  |  ------------------
  |  |  |  | 1118|   198k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   198k|{ \
  |  |  |  | 1120|   198k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   198k|        do { \
  |  |  |  | 1122|   198k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|      0|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|      0|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|      0|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|      0|{ \
  |  |  |  |  |  |  140|      0|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|      0|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|      0|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|      0|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|      0|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|      0|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      0|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|      0|{ \
  |  |  |  |  |  |  |  |   57|      0|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|      0|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|      0|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|      0|    } else { \
  |  |  |  |  |  |  |  |   62|      0|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|      0|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|      0|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|      0|    } \
  |  |  |  |  |  |  |  |   66|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|      0|{ \
  |  |  |  |  |  |  |  |  128|      0|    do { \
  |  |  |  |  |  |  |  |  129|      0|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|      0|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|      0|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|      0|{ \
  |  |  |  |  |  |  |  |  |  |  104|      0|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|      0|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|      0|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|      0|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|      0|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|      0|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|      0|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|      0|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|      0|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|      0|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|      0|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|      0|            } \
  |  |  |  |  |  |  |  |  |  |  118|      0|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|      0|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|      0|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|      0|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|      0|        } \
  |  |  |  |  |  |  |  |  |  |  123|      0|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|        } \
  |  |  |  |  |  |  |  |  132|      0|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|      0|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|      0|        ct--; \
  |  |  |  |  |  |  |  |  135|      0|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|    } else {  \
  |  |  |  |  |  |  149|      0|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|      0|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|      0|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|      0|{ \
  |  |  |  |  |  |  |  |   45|      0|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|      0|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|      0|    } else { \
  |  |  |  |  |  |  |  |   49|      0|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|      0|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|      0|    } \
  |  |  |  |  |  |  |  |   52|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|      0|{ \
  |  |  |  |  |  |  |  |  128|      0|    do { \
  |  |  |  |  |  |  |  |  129|      0|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|      0|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|      0|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|      0|{ \
  |  |  |  |  |  |  |  |  |  |  104|      0|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|      0|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|      0|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|      0|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|      0|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|      0|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|      0|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|      0|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|      0|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|      0|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|      0|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|      0|            } \
  |  |  |  |  |  |  |  |  |  |  118|      0|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|      0|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|      0|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|      0|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|      0|        } \
  |  |  |  |  |  |  |  |  |  |  123|      0|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|        } \
  |  |  |  |  |  |  |  |  132|      0|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|      0|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|      0|        ct--; \
  |  |  |  |  |  |  |  |  135|      0|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        } else { \
  |  |  |  |  |  |  154|      0|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|      0|        } \
  |  |  |  |  |  |  156|      0|    } \
  |  |  |  |  |  |  157|      0|}
  |  |  |  |  ------------------
  |  |  |  | 1126|      0|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1127|      0|                    break; \
  |  |  |  | 1128|      0|            } \
  |  |  |  | 1129|   198k|            { \
  |  |  |  | 1130|   198k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   198k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   198k|                                    ci); \
  |  |  |  | 1133|   198k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   198k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   198k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   198k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   198k|{ \
  |  |  |  |  |  |  140|   198k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   198k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   198k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   198k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   198k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   198k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 62.2k, False: 136k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  62.2k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  62.2k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  62.2k|{ \
  |  |  |  |  |  |  |  |   57|  62.2k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 2.45k, False: 59.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  2.45k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  2.45k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  2.45k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  59.8k|    } else { \
  |  |  |  |  |  |  |  |   62|  59.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  59.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  59.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  59.8k|    } \
  |  |  |  |  |  |  |  |   66|  62.2k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  62.2k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  62.2k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  62.2k|{ \
  |  |  |  |  |  |  |  |  128|  99.5k|    do { \
  |  |  |  |  |  |  |  |  129|  99.5k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 14.1k, False: 85.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  14.1k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  14.1k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  14.1k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  14.1k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  14.1k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  14.1k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  14.1k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  14.1k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 11.6k, False: 2.54k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  11.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 11.2k, False: 344]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  11.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  11.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  11.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  11.2k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    344|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    344|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    344|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    344|            } \
  |  |  |  |  |  |  |  |  |  |  118|  11.6k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.54k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.54k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.54k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.54k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  14.1k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  14.1k|        } \
  |  |  |  |  |  |  |  |  132|  99.5k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  99.5k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  99.5k|        ct--; \
  |  |  |  |  |  |  |  |  135|  99.5k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 37.2k, False: 62.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  62.2k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   136k|    } else {  \
  |  |  |  |  |  |  149|   136k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   136k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 69.6k, False: 66.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  69.6k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  69.6k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  69.6k|{ \
  |  |  |  |  |  |  |  |   45|  69.6k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 3.36k, False: 66.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.36k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  3.36k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  66.2k|    } else { \
  |  |  |  |  |  |  |  |   49|  66.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  66.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  66.2k|    } \
  |  |  |  |  |  |  |  |   52|  69.6k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  69.6k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  69.6k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  69.6k|{ \
  |  |  |  |  |  |  |  |  128|  70.0k|    do { \
  |  |  |  |  |  |  |  |  129|  70.0k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 8.19k, False: 61.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  8.19k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  8.19k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  8.19k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  8.19k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  8.19k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  8.19k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  8.19k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  8.19k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 6.44k, False: 1.74k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  6.44k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 5.22k, False: 1.22k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  5.22k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  5.22k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  5.22k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  5.22k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.22k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.22k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.22k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.22k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  6.44k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.74k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.74k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.74k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.74k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  8.19k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  8.19k|        } \
  |  |  |  |  |  |  |  |  132|  70.0k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  70.0k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  70.0k|        ct--; \
  |  |  |  |  |  |  |  |  135|  70.0k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 445, False: 69.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  69.6k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  69.6k|        } else { \
  |  |  |  |  |  |  154|  66.3k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  66.3k|        } \
  |  |  |  |  |  |  156|   136k|    } \
  |  |  |  |  |  |  157|   198k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   198k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   198k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 98.1k, False: 100k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   198k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   198k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   198k|{ \
  |  |  |  |  |  |  323|   198k|    /* east */ \
  |  |  |  |  |  |  324|   198k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   198k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   198k| \
  |  |  |  |  |  |  326|   198k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   198k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   198k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   198k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   198k| \
  |  |  |  |  |  |  329|   198k|    /* west */ \
  |  |  |  |  |  |  330|   198k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   198k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   198k| \
  |  |  |  |  |  |  332|   198k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   198k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|   198k|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|   198k|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|   198k|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|   198k|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|   198k|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|   198k|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|   198k|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|   198k|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|   198k|    } \
  |  |  |  |  |  |  339|   198k| \
  |  |  |  |  |  |  340|   198k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   198k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   198k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   198k|            } \
  |  |  |  | 1139|   198k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   198k|    } \
  |  |  |  | 1141|   198k|}
  |  |  ------------------
  |  | 1282|   198k|                                            flags, flagsp, flags_stride, data, \
  |  | 1283|   198k|                                            l_w, 0, mqc, curctx, \
  |  | 1284|   198k|                                            v, a, c, ct, oneplushalf, vsc); \
  |  | 1285|   198k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   198k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1286|   198k|                        /* FALLTHRU */ \
  |  | 1287|   365k|                    case 1: \
  |  |  ------------------
  |  |  |  Branch (1287:21): [True: 167k, False: 482k]
  |  |  ------------------
  |  | 1288|   365k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   365k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   365k|{ \
  |  |  |  | 1120|   365k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   365k|        do { \
  |  |  |  | 1122|   365k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 198k, False: 167k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   198k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   198k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   198k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   198k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   198k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   198k|{ \
  |  |  |  |  |  |  140|   198k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   198k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   198k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   198k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   198k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   198k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 57.9k, False: 140k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  57.9k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  57.9k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  57.9k|{ \
  |  |  |  |  |  |  |  |   57|  57.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 10.2k, False: 47.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  10.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  10.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  10.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  47.7k|    } else { \
  |  |  |  |  |  |  |  |   62|  47.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  47.7k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  47.7k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  47.7k|    } \
  |  |  |  |  |  |  |  |   66|  57.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  57.9k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  57.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  57.9k|{ \
  |  |  |  |  |  |  |  |  128|   100k|    do { \
  |  |  |  |  |  |  |  |  129|   100k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 12.5k, False: 88.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  12.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  12.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  12.5k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  12.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  12.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  12.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  12.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  12.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 9.53k, False: 2.98k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  9.53k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 9.07k, False: 464]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  9.07k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  9.07k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  9.07k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  9.07k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    464|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    464|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    464|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    464|            } \
  |  |  |  |  |  |  |  |  |  |  118|  9.53k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.98k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.98k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.98k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.98k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  12.5k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  12.5k|        } \
  |  |  |  |  |  |  |  |  132|   100k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   100k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   100k|        ct--; \
  |  |  |  |  |  |  |  |  135|   100k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 42.8k, False: 57.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  57.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   140k|    } else {  \
  |  |  |  |  |  |  149|   140k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   140k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 52.8k, False: 87.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  52.8k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  52.8k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  52.8k|{ \
  |  |  |  |  |  |  |  |   45|  52.8k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 7.81k, False: 44.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  7.81k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  7.81k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  44.9k|    } else { \
  |  |  |  |  |  |  |  |   49|  44.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  44.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  44.9k|    } \
  |  |  |  |  |  |  |  |   52|  52.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  52.8k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  52.8k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  52.8k|{ \
  |  |  |  |  |  |  |  |  128|  57.9k|    do { \
  |  |  |  |  |  |  |  |  129|  57.9k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 7.70k, False: 50.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  7.70k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  7.70k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  7.70k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  7.70k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  7.70k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  7.70k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  7.70k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  7.70k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.56k, False: 2.13k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.56k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 5.26k, False: 303]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  5.26k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  5.26k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  5.26k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  5.26k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    303|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    303|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    303|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    303|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.56k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.13k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.13k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.13k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.13k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  7.70k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  7.70k|        } \
  |  |  |  |  |  |  |  |  132|  57.9k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  57.9k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  57.9k|        ct--; \
  |  |  |  |  |  |  |  |  135|  57.9k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 5.18k, False: 52.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  52.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  87.5k|        } else { \
  |  |  |  |  |  |  154|  87.5k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  87.5k|        } \
  |  |  |  |  |  |  156|   140k|    } \
  |  |  |  |  |  |  157|   198k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   198k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 129k, False: 69.0k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   198k|                    break; \
  |  |  |  | 1128|   198k|            } \
  |  |  |  | 1129|   365k|            { \
  |  |  |  | 1130|   236k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   236k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   236k|                                    ci); \
  |  |  |  | 1133|   236k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   236k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   236k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   236k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   236k|{ \
  |  |  |  |  |  |  140|   236k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   236k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   236k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   236k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   236k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   236k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 79.4k, False: 156k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  79.4k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  79.4k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  79.4k|{ \
  |  |  |  |  |  |  |  |   57|  79.4k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 4.82k, False: 74.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  4.82k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  4.82k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  4.82k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  74.6k|    } else { \
  |  |  |  |  |  |  |  |   62|  74.6k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  74.6k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  74.6k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  74.6k|    } \
  |  |  |  |  |  |  |  |   66|  79.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  79.4k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  79.4k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  79.4k|{ \
  |  |  |  |  |  |  |  |  128|   122k|    do { \
  |  |  |  |  |  |  |  |  129|   122k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 16.7k, False: 105k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  16.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  16.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  16.7k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  16.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  16.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  16.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  16.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  16.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 12.4k, False: 4.31k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  12.4k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 12.1k, False: 369]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  12.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  12.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  12.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  12.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    369|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    369|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    369|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    369|            } \
  |  |  |  |  |  |  |  |  |  |  118|  12.4k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.31k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.31k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.31k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.31k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  16.7k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  16.7k|        } \
  |  |  |  |  |  |  |  |  132|   122k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   122k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   122k|        ct--; \
  |  |  |  |  |  |  |  |  135|   122k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 43.1k, False: 79.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  79.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   156k|    } else {  \
  |  |  |  |  |  |  149|   156k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   156k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 74.8k, False: 82.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  74.8k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  74.8k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  74.8k|{ \
  |  |  |  |  |  |  |  |   45|  74.8k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 3.01k, False: 71.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  3.01k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  3.01k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  71.8k|    } else { \
  |  |  |  |  |  |  |  |   49|  71.8k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  71.8k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  71.8k|    } \
  |  |  |  |  |  |  |  |   52|  74.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  74.8k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  74.8k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  74.8k|{ \
  |  |  |  |  |  |  |  |  128|  76.8k|    do { \
  |  |  |  |  |  |  |  |  129|  76.8k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 11.9k, False: 64.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  11.9k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  11.9k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  11.9k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  11.9k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  11.9k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  11.9k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  11.9k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  11.9k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 8.95k, False: 2.95k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  8.95k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 8.54k, False: 406]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  8.54k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  8.54k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  8.54k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  8.54k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    406|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    406|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    406|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    406|            } \
  |  |  |  |  |  |  |  |  |  |  118|  8.95k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.95k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.95k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.95k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.95k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  11.9k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  11.9k|        } \
  |  |  |  |  |  |  |  |  132|  76.8k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  76.8k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  76.8k|        ct--; \
  |  |  |  |  |  |  |  |  135|  76.8k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.95k, False: 74.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  74.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  82.0k|        } else { \
  |  |  |  |  |  |  154|  82.0k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  82.0k|        } \
  |  |  |  |  |  |  156|   156k|    } \
  |  |  |  |  |  |  157|   236k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   236k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   236k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 118k, False: 117k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   236k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   236k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   236k|{ \
  |  |  |  |  |  |  323|   236k|    /* east */ \
  |  |  |  |  |  |  324|   236k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   236k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   236k| \
  |  |  |  |  |  |  326|   236k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   236k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   236k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   236k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   236k| \
  |  |  |  |  |  |  329|   236k|    /* west */ \
  |  |  |  |  |  |  330|   236k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   236k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   236k| \
  |  |  |  |  |  |  332|   236k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   236k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   236k| \
  |  |  |  |  |  |  340|   236k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   236k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   236k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   236k|            } \
  |  |  |  | 1139|   236k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   365k|    } \
  |  |  |  | 1141|   365k|}
  |  |  ------------------
  |  | 1289|   365k|                                            flags, flagsp, flags_stride, data, \
  |  | 1290|   365k|                                            l_w, 1, mqc, curctx, \
  |  | 1291|   365k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1292|   365k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   365k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1293|   365k|                        /* FALLTHRU */ \
  |  | 1294|   522k|                    case 2: \
  |  |  ------------------
  |  |  |  Branch (1294:21): [True: 156k, False: 493k]
  |  |  ------------------
  |  | 1295|   522k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   522k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   522k|{ \
  |  |  |  | 1120|   522k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   522k|        do { \
  |  |  |  | 1122|   522k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 365k, False: 156k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   365k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   365k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   365k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   365k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   365k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   365k|{ \
  |  |  |  |  |  |  140|   365k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   365k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   365k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   365k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   365k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   365k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 77.0k, False: 288k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  77.0k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  77.0k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  77.0k|{ \
  |  |  |  |  |  |  |  |   57|  77.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 16.7k, False: 60.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  16.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  16.7k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  16.7k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  60.2k|    } else { \
  |  |  |  |  |  |  |  |   62|  60.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  60.2k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  60.2k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  60.2k|    } \
  |  |  |  |  |  |  |  |   66|  77.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  77.0k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  77.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  77.0k|{ \
  |  |  |  |  |  |  |  |  128|   129k|    do { \
  |  |  |  |  |  |  |  |  129|   129k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 12.8k, False: 116k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  12.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  12.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  12.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  12.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  12.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  12.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  12.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  12.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 10.0k, False: 2.79k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  10.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 9.46k, False: 567]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  9.46k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  9.46k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  9.46k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  9.46k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    567|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    567|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    567|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    567|            } \
  |  |  |  |  |  |  |  |  |  |  118|  10.0k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.79k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.79k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.79k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.79k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  12.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  12.8k|        } \
  |  |  |  |  |  |  |  |  132|   129k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   129k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   129k|        ct--; \
  |  |  |  |  |  |  |  |  135|   129k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 52.7k, False: 77.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  77.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   288k|    } else {  \
  |  |  |  |  |  |  149|   288k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   288k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 82.6k, False: 206k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  82.6k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  82.6k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  82.6k|{ \
  |  |  |  |  |  |  |  |   45|  82.6k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 9.31k, False: 73.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  9.31k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  9.31k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  73.3k|    } else { \
  |  |  |  |  |  |  |  |   49|  73.3k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  73.3k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  73.3k|    } \
  |  |  |  |  |  |  |  |   52|  82.6k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  82.6k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  82.6k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  82.6k|{ \
  |  |  |  |  |  |  |  |  128|  87.1k|    do { \
  |  |  |  |  |  |  |  |  129|  87.1k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 9.80k, False: 77.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  9.80k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  9.80k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  9.80k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  9.80k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  9.80k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  9.80k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  9.80k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  9.80k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 7.46k, False: 2.33k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  7.46k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 7.06k, False: 406]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  7.06k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  7.06k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  7.06k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  7.06k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    406|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    406|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    406|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    406|            } \
  |  |  |  |  |  |  |  |  |  |  118|  7.46k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.33k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.33k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.33k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.33k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  9.80k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  9.80k|        } \
  |  |  |  |  |  |  |  |  132|  87.1k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  87.1k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  87.1k|        ct--; \
  |  |  |  |  |  |  |  |  135|  87.1k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 4.53k, False: 82.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  82.6k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   206k|        } else { \
  |  |  |  |  |  |  154|   206k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   206k|        } \
  |  |  |  |  |  |  156|   288k|    } \
  |  |  |  |  |  |  157|   365k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   365k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 266k, False: 98.9k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   365k|                    break; \
  |  |  |  | 1128|   365k|            } \
  |  |  |  | 1129|   522k|            { \
  |  |  |  | 1130|   255k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   255k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   255k|                                    ci); \
  |  |  |  | 1133|   255k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   255k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   255k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   255k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   255k|{ \
  |  |  |  |  |  |  140|   255k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   255k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   255k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   255k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   255k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   255k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 78.0k, False: 177k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  78.0k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  78.0k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  78.0k|{ \
  |  |  |  |  |  |  |  |   57|  78.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 9.40k, False: 68.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  9.40k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  9.40k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  9.40k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  68.6k|    } else { \
  |  |  |  |  |  |  |  |   62|  68.6k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  68.6k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  68.6k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  68.6k|    } \
  |  |  |  |  |  |  |  |   66|  78.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  78.0k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  78.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  78.0k|{ \
  |  |  |  |  |  |  |  |  128|   123k|    do { \
  |  |  |  |  |  |  |  |  129|   123k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 16.0k, False: 107k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  16.0k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  16.0k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  16.0k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  16.0k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  16.0k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  16.0k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  16.0k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  16.0k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 13.4k, False: 2.57k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  13.4k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 12.7k, False: 704]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  12.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  12.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  12.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  12.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    704|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    704|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    704|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    704|            } \
  |  |  |  |  |  |  |  |  |  |  118|  13.4k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.57k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.57k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.57k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.57k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  16.0k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  16.0k|        } \
  |  |  |  |  |  |  |  |  132|   123k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   123k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   123k|        ct--; \
  |  |  |  |  |  |  |  |  135|   123k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 45.1k, False: 78.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  78.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   177k|    } else {  \
  |  |  |  |  |  |  149|   177k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   177k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 86.3k, False: 91.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  86.3k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  86.3k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  86.3k|{ \
  |  |  |  |  |  |  |  |   45|  86.3k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 6.80k, False: 79.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  6.80k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  6.80k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  79.5k|    } else { \
  |  |  |  |  |  |  |  |   49|  79.5k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  79.5k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  79.5k|    } \
  |  |  |  |  |  |  |  |   52|  86.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  86.3k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  86.3k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  86.3k|{ \
  |  |  |  |  |  |  |  |  128|  89.7k|    do { \
  |  |  |  |  |  |  |  |  129|  89.7k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 11.8k, False: 77.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  11.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  11.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  11.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  11.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  11.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  11.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  11.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  11.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 8.37k, False: 3.44k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  8.37k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 7.98k, False: 390]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  7.98k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  7.98k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  7.98k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  7.98k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    390|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    390|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    390|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    390|            } \
  |  |  |  |  |  |  |  |  |  |  118|  8.37k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.44k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.44k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.44k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.44k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  11.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  11.8k|        } \
  |  |  |  |  |  |  |  |  132|  89.7k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  89.7k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  89.7k|        ct--; \
  |  |  |  |  |  |  |  |  135|  89.7k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 3.38k, False: 86.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  86.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  91.0k|        } else { \
  |  |  |  |  |  |  154|  91.0k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  91.0k|        } \
  |  |  |  |  |  |  156|   177k|    } \
  |  |  |  |  |  |  157|   255k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   255k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   255k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 121k, False: 133k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   255k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   255k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   255k|{ \
  |  |  |  |  |  |  323|   255k|    /* east */ \
  |  |  |  |  |  |  324|   255k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   255k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   255k| \
  |  |  |  |  |  |  326|   255k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   255k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   255k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   255k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   255k| \
  |  |  |  |  |  |  329|   255k|    /* west */ \
  |  |  |  |  |  |  330|   255k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   255k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   255k| \
  |  |  |  |  |  |  332|   255k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   255k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   255k| \
  |  |  |  |  |  |  340|   255k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   255k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   255k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   255k|            } \
  |  |  |  | 1139|   255k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   522k|    } \
  |  |  |  | 1141|   522k|}
  |  |  ------------------
  |  | 1296|   522k|                                            flags, flagsp, flags_stride, data, \
  |  | 1297|   522k|                                            l_w, 2, mqc, curctx, \
  |  | 1298|   522k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1299|   522k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   522k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1300|   522k|                        /* FALLTHRU */ \
  |  | 1301|   649k|                    case 3: \
  |  |  ------------------
  |  |  |  Branch (1301:21): [True: 127k, False: 522k]
  |  |  ------------------
  |  | 1302|   649k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   649k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   649k|{ \
  |  |  |  | 1120|   649k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   649k|        do { \
  |  |  |  | 1122|   649k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 522k, False: 127k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   522k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   522k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   522k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   522k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   522k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   522k|{ \
  |  |  |  |  |  |  140|   522k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   522k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   522k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   522k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   522k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   522k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 85.4k, False: 436k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  85.4k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  85.4k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  85.4k|{ \
  |  |  |  |  |  |  |  |   57|  85.4k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 16.8k, False: 68.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  16.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  16.8k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  16.8k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  68.5k|    } else { \
  |  |  |  |  |  |  |  |   62|  68.5k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  68.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  68.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  68.5k|    } \
  |  |  |  |  |  |  |  |   66|  85.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  85.4k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  85.4k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  85.4k|{ \
  |  |  |  |  |  |  |  |  128|   151k|    do { \
  |  |  |  |  |  |  |  |  129|   151k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 16.7k, False: 134k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  16.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  16.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  16.7k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  16.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  16.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  16.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  16.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  16.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 13.1k, False: 3.60k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  13.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 12.3k, False: 823]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  12.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  12.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  12.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  12.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    823|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    823|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    823|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    823|            } \
  |  |  |  |  |  |  |  |  |  |  118|  13.1k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.60k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.60k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.60k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.60k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  16.7k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  16.7k|        } \
  |  |  |  |  |  |  |  |  132|   151k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   151k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   151k|        ct--; \
  |  |  |  |  |  |  |  |  135|   151k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 65.8k, False: 85.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  85.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   436k|    } else {  \
  |  |  |  |  |  |  149|   436k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   436k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 94.9k, False: 341k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  94.9k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  94.9k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  94.9k|{ \
  |  |  |  |  |  |  |  |   45|  94.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 11.5k, False: 83.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  11.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  11.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  83.4k|    } else { \
  |  |  |  |  |  |  |  |   49|  83.4k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  83.4k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  83.4k|    } \
  |  |  |  |  |  |  |  |   52|  94.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  94.9k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  94.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  94.9k|{ \
  |  |  |  |  |  |  |  |  128|   100k|    do { \
  |  |  |  |  |  |  |  |  129|   100k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 12.5k, False: 88.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  12.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  12.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  12.5k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  12.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  12.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  12.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  12.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  12.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 8.81k, False: 3.75k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  8.81k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 8.20k, False: 609]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  8.20k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  8.20k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  8.20k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  8.20k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    609|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    609|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    609|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    609|            } \
  |  |  |  |  |  |  |  |  |  |  118|  8.81k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.75k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.75k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.75k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.75k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  12.5k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  12.5k|        } \
  |  |  |  |  |  |  |  |  132|   100k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   100k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   100k|        ct--; \
  |  |  |  |  |  |  |  |  135|   100k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 6.01k, False: 94.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  94.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   341k|        } else { \
  |  |  |  |  |  |  154|   341k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   341k|        } \
  |  |  |  |  |  |  156|   436k|    } \
  |  |  |  |  |  |  157|   522k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   522k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 404k, False: 117k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   522k|                    break; \
  |  |  |  | 1128|   522k|            } \
  |  |  |  | 1129|   649k|            { \
  |  |  |  | 1130|   245k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   245k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   245k|                                    ci); \
  |  |  |  | 1133|   245k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   245k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   245k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   245k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   245k|{ \
  |  |  |  |  |  |  140|   245k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   245k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   245k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   245k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   245k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   245k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 78.4k, False: 167k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  78.4k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  78.4k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  78.4k|{ \
  |  |  |  |  |  |  |  |   57|  78.4k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 11.9k, False: 66.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  11.9k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  11.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  11.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  66.5k|    } else { \
  |  |  |  |  |  |  |  |   62|  66.5k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  66.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  66.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  66.5k|    } \
  |  |  |  |  |  |  |  |   66|  78.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  78.4k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  78.4k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  78.4k|{ \
  |  |  |  |  |  |  |  |  128|   120k|    do { \
  |  |  |  |  |  |  |  |  129|   120k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 14.7k, False: 105k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  14.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  14.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  14.7k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  14.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  14.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  14.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  14.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  14.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 10.7k, False: 4.01k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  10.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 10.3k, False: 403]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  10.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  10.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  10.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  10.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    403|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    403|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    403|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    403|            } \
  |  |  |  |  |  |  |  |  |  |  118|  10.7k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.01k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.01k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.01k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.01k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  14.7k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  14.7k|        } \
  |  |  |  |  |  |  |  |  132|   120k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   120k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   120k|        ct--; \
  |  |  |  |  |  |  |  |  135|   120k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 41.9k, False: 78.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  78.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   167k|    } else {  \
  |  |  |  |  |  |  149|   167k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   167k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 80.1k, False: 87.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  80.1k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  80.1k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  80.1k|{ \
  |  |  |  |  |  |  |  |   45|  80.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 7.79k, False: 72.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  7.79k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  7.79k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  72.3k|    } else { \
  |  |  |  |  |  |  |  |   49|  72.3k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  72.3k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  72.3k|    } \
  |  |  |  |  |  |  |  |   52|  80.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  80.1k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  80.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  80.1k|{ \
  |  |  |  |  |  |  |  |  128|  84.0k|    do { \
  |  |  |  |  |  |  |  |  129|  84.0k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 12.3k, False: 71.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  12.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  12.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  12.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  12.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  12.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  12.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  12.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  12.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 9.53k, False: 2.84k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  9.53k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 9.06k, False: 471]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  9.06k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  9.06k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  9.06k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  9.06k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    471|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    471|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    471|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    471|            } \
  |  |  |  |  |  |  |  |  |  |  118|  9.53k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.84k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.84k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.84k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.84k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  12.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  12.3k|        } \
  |  |  |  |  |  |  |  |  132|  84.0k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  84.0k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  84.0k|        ct--; \
  |  |  |  |  |  |  |  |  135|  84.0k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 3.93k, False: 80.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  80.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  87.1k|        } else { \
  |  |  |  |  |  |  154|  87.1k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  87.1k|        } \
  |  |  |  |  |  |  156|   167k|    } \
  |  |  |  |  |  |  157|   245k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   245k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   245k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 120k, False: 125k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   245k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   245k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   245k|{ \
  |  |  |  |  |  |  323|   245k|    /* east */ \
  |  |  |  |  |  |  324|   245k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   245k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   245k| \
  |  |  |  |  |  |  326|   245k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   245k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   245k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   245k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   245k| \
  |  |  |  |  |  |  329|   245k|    /* west */ \
  |  |  |  |  |  |  330|   245k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   245k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   245k| \
  |  |  |  |  |  |  332|   245k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   245k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   245k| \
  |  |  |  |  |  |  340|   245k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   245k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|   245k|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|   245k|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|   245k|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|   245k|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   245k|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|   245k|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|   245k|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|   245k|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|   245k|    } \
  |  |  |  |  |  |  347|   245k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   245k|            } \
  |  |  |  | 1139|   245k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   649k|    } \
  |  |  |  | 1141|   649k|}
  |  |  ------------------
  |  | 1303|   649k|                                            flags, flagsp, flags_stride, data, \
  |  | 1304|   649k|                                            l_w, 3, mqc, curctx, \
  |  | 1305|   649k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1306|   649k|                        break; \
  |  | 1307|   649k|                } \
  |  | 1308|  68.0M|            } else { \
  |  | 1309|  68.0M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  68.0M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  68.0M|{ \
  |  |  |  | 1120|  68.0M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  68.0M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  68.0M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  68.0M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  68.0M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 10.2M, False: 57.8M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  10.2M|        do { \
  |  |  |  | 1122|  10.2M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  10.2M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  10.2M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  10.2M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  10.2M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  10.2M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  10.2M|{ \
  |  |  |  |  |  |  140|  10.2M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  10.2M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  10.2M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  10.2M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  10.2M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  10.2M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.29M, False: 7.92M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.29M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.29M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.29M|{ \
  |  |  |  |  |  |  |  |   57|  2.29M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 486k, False: 1.80M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   486k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   486k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   486k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.80M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.80M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.80M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.80M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.80M|    } \
  |  |  |  |  |  |  |  |   66|  2.29M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.29M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.29M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.29M|{ \
  |  |  |  |  |  |  |  |  128|  3.79M|    do { \
  |  |  |  |  |  |  |  |  129|  3.79M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 465k, False: 3.33M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   465k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   465k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   465k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   465k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   465k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   465k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   465k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   465k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 425k, False: 40.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   425k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 417k, False: 7.66k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   417k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   417k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   417k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   417k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  7.66k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  7.66k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  7.66k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  7.66k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   425k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  40.7k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  40.7k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  40.7k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  40.7k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   465k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   465k|        } \
  |  |  |  |  |  |  |  |  132|  3.79M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.79M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.79M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.79M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.50M, False: 2.29M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.29M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  7.92M|    } else {  \
  |  |  |  |  |  |  149|  7.92M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  7.92M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.40M, False: 5.52M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.40M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.40M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.40M|{ \
  |  |  |  |  |  |  |  |   45|  2.40M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 381k, False: 2.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   381k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   381k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.02M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.02M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.02M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.02M|    } \
  |  |  |  |  |  |  |  |   52|  2.40M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.40M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.40M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.40M|{ \
  |  |  |  |  |  |  |  |  128|  2.57M|    do { \
  |  |  |  |  |  |  |  |  129|  2.57M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 324k, False: 2.24M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   324k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   324k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   324k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   324k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   324k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   324k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   324k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   324k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 298k, False: 26.2k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   298k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 294k, False: 4.23k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   294k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   294k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   294k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   294k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.23k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.23k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.23k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.23k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   298k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  26.2k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  26.2k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  26.2k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  26.2k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   324k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   324k|        } \
  |  |  |  |  |  |  |  |  132|  2.57M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.57M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.57M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.57M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 167k, False: 2.40M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.40M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.52M|        } else { \
  |  |  |  |  |  |  154|  5.52M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  5.52M|        } \
  |  |  |  |  |  |  156|  7.92M|    } \
  |  |  |  |  |  |  157|  10.2M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  10.2M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 5.71M, False: 4.50M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  10.2M|                    break; \
  |  |  |  | 1128|  10.2M|            } \
  |  |  |  | 1129|  10.2M|            { \
  |  |  |  | 1130|  4.50M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  4.50M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  4.50M|                                    ci); \
  |  |  |  | 1133|  4.50M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  4.50M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  4.50M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  4.50M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  4.50M|{ \
  |  |  |  |  |  |  140|  4.50M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  4.50M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  4.50M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  4.50M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  4.50M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  4.50M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.16M, False: 3.33M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.16M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.16M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.16M|{ \
  |  |  |  |  |  |  |  |   57|  1.16M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 246k, False: 920k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   246k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   246k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   246k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   920k|    } else { \
  |  |  |  |  |  |  |  |   62|   920k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   920k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   920k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   920k|    } \
  |  |  |  |  |  |  |  |   66|  1.16M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.16M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.16M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.16M|{ \
  |  |  |  |  |  |  |  |  128|  1.88M|    do { \
  |  |  |  |  |  |  |  |  129|  1.88M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 238k, False: 1.64M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   238k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   238k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   238k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   238k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   238k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   238k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   238k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   238k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 225k, False: 13.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   225k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 222k, False: 3.40k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   222k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   222k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   222k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   222k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.40k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.40k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.40k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.40k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   225k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  13.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  13.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  13.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  13.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   238k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   238k|        } \
  |  |  |  |  |  |  |  |  132|  1.88M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.88M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.88M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.88M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 716k, False: 1.16M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.16M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  3.33M|    } else {  \
  |  |  |  |  |  |  149|  3.33M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  3.33M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.24M, False: 2.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.24M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.24M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.24M|{ \
  |  |  |  |  |  |  |  |   45|  1.24M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 189k, False: 1.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   189k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   189k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.05M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.05M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.05M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.05M|    } \
  |  |  |  |  |  |  |  |   52|  1.24M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.24M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.24M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.24M|{ \
  |  |  |  |  |  |  |  |  128|  1.32M|    do { \
  |  |  |  |  |  |  |  |  129|  1.32M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 162k, False: 1.16M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   162k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   162k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   162k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   162k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   162k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   162k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   162k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   162k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 151k, False: 10.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   151k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 149k, False: 2.46k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   149k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   149k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   149k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   149k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.46k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.46k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.46k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.46k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   151k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  10.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  10.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  10.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  10.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   162k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   162k|        } \
  |  |  |  |  |  |  |  |  132|  1.32M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.32M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.32M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.32M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 85.6k, False: 1.24M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.24M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.09M|        } else { \
  |  |  |  |  |  |  154|  2.09M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.09M|        } \
  |  |  |  |  |  |  156|  3.33M|    } \
  |  |  |  |  |  |  157|  4.50M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  4.50M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  4.50M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 2.23M, False: 2.26M]
  |  |  |  |  ------------------
  |  |  |  | 1137|  4.50M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  4.50M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  4.50M|{ \
  |  |  |  |  |  |  323|  4.50M|    /* east */ \
  |  |  |  |  |  |  324|  4.50M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.50M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  4.50M| \
  |  |  |  |  |  |  326|  4.50M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  4.50M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  4.50M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  4.50M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  4.50M| \
  |  |  |  |  |  |  329|  4.50M|    /* west */ \
  |  |  |  |  |  |  330|  4.50M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  4.50M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  4.50M| \
  |  |  |  |  |  |  332|  4.50M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  4.50M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|  4.50M|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|  4.50M|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  4.50M|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|  4.50M|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|  4.50M|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|  4.50M|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|  4.50M|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|  4.50M|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|  4.50M|    } \
  |  |  |  |  |  |  339|  4.50M| \
  |  |  |  |  |  |  340|  4.50M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  4.50M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  4.50M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  4.50M|            } \
  |  |  |  | 1139|  4.50M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  10.2M|    } \
  |  |  |  | 1141|  68.0M|}
  |  |  ------------------
  |  | 1310|  68.0M|                                    flags, flagsp, flags_stride, data, \
  |  | 1311|  68.0M|                                    l_w, 0, mqc, curctx, \
  |  | 1312|  68.0M|                                    v, a, c, ct, oneplushalf, vsc); \
  |  | 1313|  68.0M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  68.0M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  68.0M|{ \
  |  |  |  | 1120|  68.0M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  68.0M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  68.0M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  68.0M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  68.0M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 10.1M, False: 57.9M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  10.1M|        do { \
  |  |  |  | 1122|  10.1M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  10.1M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  10.1M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  10.1M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  10.1M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  10.1M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  10.1M|{ \
  |  |  |  |  |  |  140|  10.1M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  10.1M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  10.1M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  10.1M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  10.1M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  10.1M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.21M, False: 7.97M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.21M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.21M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.21M|{ \
  |  |  |  |  |  |  |  |   57|  2.21M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 453k, False: 1.75M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   453k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   453k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   453k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.75M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.75M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.75M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.75M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.75M|    } \
  |  |  |  |  |  |  |  |   66|  2.21M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.21M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.21M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.21M|{ \
  |  |  |  |  |  |  |  |  128|  3.70M|    do { \
  |  |  |  |  |  |  |  |  129|  3.70M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 470k, False: 3.23M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   470k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   470k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   470k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   470k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   470k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   470k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   470k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   470k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 432k, False: 37.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   432k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 427k, False: 5.68k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   427k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   427k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   427k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   427k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  5.68k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  5.68k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  5.68k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  5.68k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   432k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  37.7k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  37.7k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  37.7k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  37.7k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   470k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   470k|        } \
  |  |  |  |  |  |  |  |  132|  3.70M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.70M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.70M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.70M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.49M, False: 2.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.21M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  7.97M|    } else {  \
  |  |  |  |  |  |  149|  7.97M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  7.97M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.39M, False: 5.57M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.39M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.39M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.39M|{ \
  |  |  |  |  |  |  |  |   45|  2.39M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 363k, False: 2.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   363k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   363k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.02M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.02M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.02M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.02M|    } \
  |  |  |  |  |  |  |  |   52|  2.39M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.39M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.39M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.39M|{ \
  |  |  |  |  |  |  |  |  128|  2.55M|    do { \
  |  |  |  |  |  |  |  |  129|  2.55M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 324k, False: 2.23M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   324k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   324k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   324k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   324k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   324k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   324k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   324k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   324k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 298k, False: 25.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   298k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 293k, False: 5.65k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   293k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   293k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   293k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   293k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  5.65k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  5.65k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  5.65k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  5.65k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   298k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  25.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  25.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  25.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  25.9k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   324k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   324k|        } \
  |  |  |  |  |  |  |  |  132|  2.55M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.55M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.55M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.55M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 162k, False: 2.39M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.39M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.57M|        } else { \
  |  |  |  |  |  |  154|  5.57M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  5.57M|        } \
  |  |  |  |  |  |  156|  7.97M|    } \
  |  |  |  |  |  |  157|  10.1M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  10.1M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 5.82M, False: 4.36M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  10.1M|                    break; \
  |  |  |  | 1128|  10.1M|            } \
  |  |  |  | 1129|  10.1M|            { \
  |  |  |  | 1130|  4.36M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  4.36M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  4.36M|                                    ci); \
  |  |  |  | 1133|  4.36M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  4.36M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  4.36M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  4.36M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  4.36M|{ \
  |  |  |  |  |  |  140|  4.36M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  4.36M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  4.36M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  4.36M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  4.36M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  4.36M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.14M, False: 3.21M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.14M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.14M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.14M|{ \
  |  |  |  |  |  |  |  |   57|  1.14M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 243k, False: 900k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   243k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   243k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   243k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   900k|    } else { \
  |  |  |  |  |  |  |  |   62|   900k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   900k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   900k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   900k|    } \
  |  |  |  |  |  |  |  |   66|  1.14M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.14M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.14M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.14M|{ \
  |  |  |  |  |  |  |  |  128|  1.84M|    do { \
  |  |  |  |  |  |  |  |  129|  1.84M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 230k, False: 1.61M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   230k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   230k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   230k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   230k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   230k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   230k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   230k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   230k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 217k, False: 13.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   217k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 214k, False: 2.94k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   214k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   214k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   214k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   214k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.94k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.94k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.94k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.94k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   217k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  13.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  13.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  13.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  13.0k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   230k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   230k|        } \
  |  |  |  |  |  |  |  |  132|  1.84M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.84M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.84M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.84M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 701k, False: 1.14M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.14M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  3.21M|    } else {  \
  |  |  |  |  |  |  149|  3.21M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  3.21M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.19M, False: 2.01M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.19M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.19M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.19M|{ \
  |  |  |  |  |  |  |  |   45|  1.19M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 191k, False: 1.00M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   191k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   191k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.00M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.00M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.00M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.00M|    } \
  |  |  |  |  |  |  |  |   52|  1.19M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.19M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.19M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.19M|{ \
  |  |  |  |  |  |  |  |  128|  1.28M|    do { \
  |  |  |  |  |  |  |  |  129|  1.28M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 167k, False: 1.11M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   167k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   167k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   167k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   167k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   167k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   167k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   167k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   167k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 156k, False: 10.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   156k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 153k, False: 2.63k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   153k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   153k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   153k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   153k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.63k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.63k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.63k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.63k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   156k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  10.8k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  10.8k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  10.8k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  10.8k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   167k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   167k|        } \
  |  |  |  |  |  |  |  |  132|  1.28M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.28M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.28M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.28M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 87.4k, False: 1.19M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.19M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.01M|        } else { \
  |  |  |  |  |  |  154|  2.01M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.01M|        } \
  |  |  |  |  |  |  156|  3.21M|    } \
  |  |  |  |  |  |  157|  4.36M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  4.36M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  4.36M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 2.15M, False: 2.20M]
  |  |  |  |  ------------------
  |  |  |  | 1137|  4.36M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  4.36M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  4.36M|{ \
  |  |  |  |  |  |  323|  4.36M|    /* east */ \
  |  |  |  |  |  |  324|  4.36M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.36M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  4.36M| \
  |  |  |  |  |  |  326|  4.36M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  4.36M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  4.36M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  4.36M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  4.36M| \
  |  |  |  |  |  |  329|  4.36M|    /* west */ \
  |  |  |  |  |  |  330|  4.36M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  4.36M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  4.36M| \
  |  |  |  |  |  |  332|  4.36M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  4.36M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  4.36M| \
  |  |  |  |  |  |  340|  4.36M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  4.36M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  4.36M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  4.36M|            } \
  |  |  |  | 1139|  4.36M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  10.1M|    } \
  |  |  |  | 1141|  68.0M|}
  |  |  ------------------
  |  | 1314|  68.0M|                                    flags, flagsp, flags_stride, data, \
  |  | 1315|  68.0M|                                    l_w, 1, mqc, curctx, \
  |  | 1316|  68.0M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1317|  68.0M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  68.0M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  68.0M|{ \
  |  |  |  | 1120|  68.0M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  68.0M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  68.0M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  68.0M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  68.0M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 10.1M, False: 57.9M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  10.1M|        do { \
  |  |  |  | 1122|  10.1M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  10.1M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  10.1M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  10.1M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  10.1M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  10.1M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  10.1M|{ \
  |  |  |  |  |  |  140|  10.1M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  10.1M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  10.1M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  10.1M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  10.1M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  10.1M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.15M, False: 8.01M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.15M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.15M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.15M|{ \
  |  |  |  |  |  |  |  |   57|  2.15M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 425k, False: 1.73M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   425k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   425k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   425k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.73M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.73M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.73M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.73M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.73M|    } \
  |  |  |  |  |  |  |  |   66|  2.15M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.15M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.15M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.15M|{ \
  |  |  |  |  |  |  |  |  128|  3.62M|    do { \
  |  |  |  |  |  |  |  |  129|  3.62M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 454k, False: 3.17M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   454k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   454k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   454k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   454k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   454k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   454k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   454k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   454k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 417k, False: 37.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   417k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 408k, False: 8.44k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   408k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   408k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   408k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   408k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  8.44k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  8.44k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  8.44k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  8.44k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   417k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  37.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  37.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  37.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  37.0k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   454k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   454k|        } \
  |  |  |  |  |  |  |  |  132|  3.62M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.62M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.62M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.62M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.46M, False: 2.15M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.15M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  8.01M|    } else {  \
  |  |  |  |  |  |  149|  8.01M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  8.01M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.34M, False: 5.67M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.34M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.34M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.34M|{ \
  |  |  |  |  |  |  |  |   45|  2.34M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 337k, False: 2.00M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   337k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   337k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  2.00M|    } else { \
  |  |  |  |  |  |  |  |   49|  2.00M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  2.00M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  2.00M|    } \
  |  |  |  |  |  |  |  |   52|  2.34M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.34M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.34M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.34M|{ \
  |  |  |  |  |  |  |  |  128|  2.50M|    do { \
  |  |  |  |  |  |  |  |  129|  2.50M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 313k, False: 2.19M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   313k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   313k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   313k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   313k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   313k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   313k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   313k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   313k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 285k, False: 28.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   285k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 280k, False: 4.68k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   280k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   280k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   280k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   280k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.68k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.68k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.68k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.68k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   285k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  28.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  28.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  28.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  28.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   313k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   313k|        } \
  |  |  |  |  |  |  |  |  132|  2.50M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.50M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.50M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.50M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 158k, False: 2.34M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.34M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.67M|        } else { \
  |  |  |  |  |  |  154|  5.67M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  5.67M|        } \
  |  |  |  |  |  |  156|  8.01M|    } \
  |  |  |  |  |  |  157|  10.1M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  10.1M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 5.86M, False: 4.31M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  10.1M|                    break; \
  |  |  |  | 1128|  10.1M|            } \
  |  |  |  | 1129|  10.1M|            { \
  |  |  |  | 1130|  4.31M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  4.31M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  4.31M|                                    ci); \
  |  |  |  | 1133|  4.31M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  4.31M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  4.31M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  4.31M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  4.31M|{ \
  |  |  |  |  |  |  140|  4.31M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  4.31M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  4.31M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  4.31M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  4.31M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  4.31M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.12M, False: 3.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.12M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.12M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.12M|{ \
  |  |  |  |  |  |  |  |   57|  1.12M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 244k, False: 877k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   244k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   244k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   244k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   877k|    } else { \
  |  |  |  |  |  |  |  |   62|   877k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   877k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   877k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   877k|    } \
  |  |  |  |  |  |  |  |   66|  1.12M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.12M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.12M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.12M|{ \
  |  |  |  |  |  |  |  |  128|  1.80M|    do { \
  |  |  |  |  |  |  |  |  129|  1.80M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 223k, False: 1.58M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   223k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   223k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   223k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   223k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   223k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   223k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   223k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   223k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 210k, False: 13.1k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   210k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 206k, False: 3.91k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   206k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   206k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   206k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   206k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.91k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.91k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.91k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.91k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   210k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  13.1k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  13.1k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  13.1k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  13.1k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   223k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   223k|        } \
  |  |  |  |  |  |  |  |  132|  1.80M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.80M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.80M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.80M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 687k, False: 1.12M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.12M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  3.18M|    } else {  \
  |  |  |  |  |  |  149|  3.18M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  3.18M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.16M, False: 2.02M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.16M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.16M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.16M|{ \
  |  |  |  |  |  |  |  |   45|  1.16M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 183k, False: 978k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   183k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   183k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   978k|    } else { \
  |  |  |  |  |  |  |  |   49|   978k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   978k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   978k|    } \
  |  |  |  |  |  |  |  |   52|  1.16M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.16M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.16M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.16M|{ \
  |  |  |  |  |  |  |  |  128|  1.24M|    do { \
  |  |  |  |  |  |  |  |  129|  1.24M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 155k, False: 1.08M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   155k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   155k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   155k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   155k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   155k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   155k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   155k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   155k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 146k, False: 8.93k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   146k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 143k, False: 3.00k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   143k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   143k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   143k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   143k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.00k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.00k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.00k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.00k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   146k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.93k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.93k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.93k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.93k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   155k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   155k|        } \
  |  |  |  |  |  |  |  |  132|  1.24M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.24M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.24M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.24M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 82.1k, False: 1.16M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.16M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.02M|        } else { \
  |  |  |  |  |  |  154|  2.02M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  2.02M|        } \
  |  |  |  |  |  |  156|  3.18M|    } \
  |  |  |  |  |  |  157|  4.31M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  4.31M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  4.31M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 2.14M, False: 2.16M]
  |  |  |  |  ------------------
  |  |  |  | 1137|  4.31M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  4.31M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  4.31M|{ \
  |  |  |  |  |  |  323|  4.31M|    /* east */ \
  |  |  |  |  |  |  324|  4.31M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.31M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  4.31M| \
  |  |  |  |  |  |  326|  4.31M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  4.31M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  4.31M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  4.31M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  4.31M| \
  |  |  |  |  |  |  329|  4.31M|    /* west */ \
  |  |  |  |  |  |  330|  4.31M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  4.31M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  4.31M| \
  |  |  |  |  |  |  332|  4.31M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  4.31M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  4.31M| \
  |  |  |  |  |  |  340|  4.31M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  4.31M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  4.31M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  4.31M|            } \
  |  |  |  | 1139|  4.31M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  10.1M|    } \
  |  |  |  | 1141|  68.0M|}
  |  |  ------------------
  |  | 1318|  68.0M|                                    flags, flagsp, flags_stride, data, \
  |  | 1319|  68.0M|                                    l_w, 2, mqc, curctx, \
  |  | 1320|  68.0M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1321|  68.0M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  68.0M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  68.0M|{ \
  |  |  |  | 1120|  68.0M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  68.0M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  68.0M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  68.0M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  68.0M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 10.2M, False: 57.8M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  10.2M|        do { \
  |  |  |  | 1122|  10.2M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  10.2M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  10.2M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  10.2M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  10.2M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  10.2M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  10.2M|{ \
  |  |  |  |  |  |  140|  10.2M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  10.2M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  10.2M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  10.2M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  10.2M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  10.2M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 2.02M, False: 8.18M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  2.02M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  2.02M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  2.02M|{ \
  |  |  |  |  |  |  |  |   57|  2.02M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 394k, False: 1.63M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   394k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   394k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   394k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  1.63M|    } else { \
  |  |  |  |  |  |  |  |   62|  1.63M|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  1.63M|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  1.63M|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  1.63M|    } \
  |  |  |  |  |  |  |  |   66|  2.02M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  2.02M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.02M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.02M|{ \
  |  |  |  |  |  |  |  |  128|  3.45M|    do { \
  |  |  |  |  |  |  |  |  129|  3.45M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 433k, False: 3.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   433k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   433k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   433k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   433k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   433k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   433k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   433k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   433k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 395k, False: 38.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   395k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 389k, False: 5.94k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   389k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   389k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   389k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   389k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  5.94k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  5.94k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  5.94k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  5.94k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   395k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  38.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  38.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  38.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  38.0k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   433k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   433k|        } \
  |  |  |  |  |  |  |  |  132|  3.45M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  3.45M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  3.45M|        ct--; \
  |  |  |  |  |  |  |  |  135|  3.45M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.43M, False: 2.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.02M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  8.18M|    } else {  \
  |  |  |  |  |  |  149|  8.18M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  8.18M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 2.21M, False: 5.96M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  2.21M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  2.21M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  2.21M|{ \
  |  |  |  |  |  |  |  |   45|  2.21M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 316k, False: 1.90M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   316k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   316k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  1.90M|    } else { \
  |  |  |  |  |  |  |  |   49|  1.90M|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  1.90M|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  1.90M|    } \
  |  |  |  |  |  |  |  |   52|  2.21M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  2.21M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  2.21M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  2.21M|{ \
  |  |  |  |  |  |  |  |  128|  2.35M|    do { \
  |  |  |  |  |  |  |  |  129|  2.35M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 299k, False: 2.05M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   299k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   299k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   299k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   299k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   299k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   299k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   299k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   299k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 273k, False: 25.2k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   273k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 269k, False: 3.93k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   269k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   269k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   269k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   269k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.93k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.93k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.93k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.93k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   273k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  25.2k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  25.2k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  25.2k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  25.2k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   299k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   299k|        } \
  |  |  |  |  |  |  |  |  132|  2.35M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  2.35M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  2.35M|        ct--; \
  |  |  |  |  |  |  |  |  135|  2.35M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 137k, False: 2.21M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  2.21M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  5.96M|        } else { \
  |  |  |  |  |  |  154|  5.96M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  5.96M|        } \
  |  |  |  |  |  |  156|  8.18M|    } \
  |  |  |  |  |  |  157|  10.2M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  10.2M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 6.09M, False: 4.11M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  10.2M|                    break; \
  |  |  |  | 1128|  10.2M|            } \
  |  |  |  | 1129|  10.2M|            { \
  |  |  |  | 1130|  4.11M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  4.11M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  4.11M|                                    ci); \
  |  |  |  | 1133|  4.11M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  4.11M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  4.11M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  4.11M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  4.11M|{ \
  |  |  |  |  |  |  140|  4.11M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  4.11M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  4.11M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  4.11M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  4.11M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  4.11M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 1.04M, False: 3.06M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  1.04M|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  1.04M|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  1.04M|{ \
  |  |  |  |  |  |  |  |   57|  1.04M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 232k, False: 813k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   232k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   232k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   232k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   813k|    } else { \
  |  |  |  |  |  |  |  |   62|   813k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   813k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   813k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   813k|    } \
  |  |  |  |  |  |  |  |   66|  1.04M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  1.04M|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.04M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.04M|{ \
  |  |  |  |  |  |  |  |  128|  1.68M|    do { \
  |  |  |  |  |  |  |  |  129|  1.68M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 209k, False: 1.47M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   209k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   209k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   209k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   209k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   209k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   209k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   209k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   209k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 193k, False: 16.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   193k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 190k, False: 2.78k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   190k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   190k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   190k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   190k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.78k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.78k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.78k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.78k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   193k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  16.0k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  16.0k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  16.0k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  16.0k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   209k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   209k|        } \
  |  |  |  |  |  |  |  |  132|  1.68M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.68M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.68M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.68M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 640k, False: 1.04M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.04M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  3.06M|    } else {  \
  |  |  |  |  |  |  149|  3.06M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  3.06M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 1.12M, False: 1.93M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  1.12M|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  1.12M|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  1.12M|{ \
  |  |  |  |  |  |  |  |   45|  1.12M|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 183k, False: 945k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   183k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   183k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   945k|    } else { \
  |  |  |  |  |  |  |  |   49|   945k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   945k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   945k|    } \
  |  |  |  |  |  |  |  |   52|  1.12M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  1.12M|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  1.12M|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  1.12M|{ \
  |  |  |  |  |  |  |  |  128|  1.21M|    do { \
  |  |  |  |  |  |  |  |  129|  1.21M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 148k, False: 1.06M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   148k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   148k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   148k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   148k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   148k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   148k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   148k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   148k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 140k, False: 8.15k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   140k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 138k, False: 2.12k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   138k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   138k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   138k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   138k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.12k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.12k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.12k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.12k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   140k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.15k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.15k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.15k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.15k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   148k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   148k|        } \
  |  |  |  |  |  |  |  |  132|  1.21M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.21M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.21M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.21M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 81.6k, False: 1.12M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  1.12M|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.93M|        } else { \
  |  |  |  |  |  |  154|  1.93M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.93M|        } \
  |  |  |  |  |  |  156|  3.06M|    } \
  |  |  |  |  |  |  157|  4.11M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  4.11M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  4.11M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 2.02M, False: 2.08M]
  |  |  |  |  ------------------
  |  |  |  | 1137|  4.11M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  4.11M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  4.11M|{ \
  |  |  |  |  |  |  323|  4.11M|    /* east */ \
  |  |  |  |  |  |  324|  4.11M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  4.11M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  4.11M| \
  |  |  |  |  |  |  326|  4.11M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  4.11M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  4.11M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  4.11M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  4.11M| \
  |  |  |  |  |  |  329|  4.11M|    /* west */ \
  |  |  |  |  |  |  330|  4.11M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  4.11M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  4.11M| \
  |  |  |  |  |  |  332|  4.11M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  4.11M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  4.11M| \
  |  |  |  |  |  |  340|  4.11M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  4.11M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  4.11M|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|  4.11M|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  4.11M|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  4.11M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  4.11M|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  4.11M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  4.11M|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  4.11M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|  4.11M|    } \
  |  |  |  |  |  |  347|  4.11M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  4.11M|            } \
  |  |  |  | 1139|  4.11M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  10.2M|    } \
  |  |  |  | 1141|  68.0M|}
  |  |  ------------------
  |  | 1322|  68.0M|                                    flags, flagsp, flags_stride, data, \
  |  | 1323|  68.0M|                                    l_w, 3, mqc, curctx, \
  |  | 1324|  68.0M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1325|  68.0M|            } \
  |  | 1326|  96.2M|            *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  115|  68.7M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  119|  68.7M|#define T1_PI_1     (1U << 24)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  122|  68.7M|#define T1_PI_2     (1U << 27)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  125|  68.7M|#define T1_PI_3     (1U << 30)
  |  |  ------------------
  |  | 1327|  68.7M|        } \
  |  | 1328|  1.50M|    } \
  |  | 1329|  93.9k|    UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|  93.9k|        mqc->curctx = curctx; \
  |  |  |  |  167|  93.9k|        mqc->c = c; \
  |  |  |  |  168|  93.9k|        mqc->a = a; \
  |  |  |  |  169|  93.9k|        mqc->ct = ct;
  |  |  ------------------
  |  | 1330|  93.9k|    if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (1330:9): [True: 0, False: 93.9k]
  |  |  ------------------
  |  | 1331|      0|        for (i = 0; i < l_w; ++i, ++flagsp, ++data) { \
  |  |  ------------------
  |  |  |  Branch (1331:21): [True: 0, False: 0]
  |  |  ------------------
  |  | 1332|      0|            for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (1332:25): [True: 0, False: 0]
  |  |  ------------------
  |  | 1333|      0|                opj_t1_dec_clnpass_step(t1, flagsp, data + j * l_w, oneplushalf, j, vsc); \
  |  | 1334|      0|            } \
  |  | 1335|      0|            *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  119|      0|#define T1_PI_1     (1U << 24)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  122|      0|#define T1_PI_2     (1U << 27)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  125|      0|#define T1_PI_3     (1U << 30)
  |  |  ------------------
  |  | 1336|      0|        } \
  |  | 1337|      0|    } \
  |  | 1338|  93.9k|}
  ------------------
 1366|  93.9k|}
t1.c:opj_t1_dec_clnpass_generic_vsc:
 1386|   180k|{
 1387|   180k|    opj_t1_dec_clnpass_internal(t1, bpno, OPJ_TRUE, t1->w, t1->h,
  ------------------
  |  | 1251|   180k|#define opj_t1_dec_clnpass_internal(t1, bpno, vsc, w, h, flags_stride) \
  |  | 1252|   180k|{ \
  |  | 1253|   180k|    OPJ_INT32 one, half, oneplushalf; \
  |  | 1254|   180k|    OPJ_UINT32 runlen; \
  |  | 1255|   180k|    OPJ_UINT32 i, j, k; \
  |  | 1256|   180k|    const OPJ_UINT32 l_w = w; \
  |  | 1257|   180k|    opj_mqc_t* mqc = &(t1->mqc); \
  |  | 1258|   180k|    register OPJ_INT32 *data = t1->data; \
  |  | 1259|   180k|    register opj_flag_t *flagsp = &t1->flags[flags_stride + 1]; \
  |  | 1260|   180k|    DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|   180k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|   180k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|   180k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|   180k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  | 1261|   180k|    register OPJ_UINT32 v; \
  |  | 1262|   180k|    one = 1 << bpno; \
  |  | 1263|   180k|    half = one >> 1; \
  |  | 1264|   180k|    oneplushalf = one | half; \
  |  | 1265|  1.93M|    for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (1265:17): [True: 1.75M, False: 180k]
  |  |  ------------------
  |  | 1266|  23.6M|        for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (1266:21): [True: 21.8M, False: 1.75M]
  |  |  ------------------
  |  | 1267|  21.8M|            opj_flag_t flags = *flagsp; \
  |  | 1268|  21.8M|            if (flags == 0) { \
  |  |  ------------------
  |  |  |  Branch (1268:17): [True: 8.19M, False: 13.6M]
  |  |  ------------------
  |  | 1269|  8.19M|                OPJ_UINT32 partial = OPJ_TRUE; \
  |  |  ------------------
  |  |  |  |  117|  8.19M|#define OPJ_TRUE 1
  |  |  ------------------
  |  | 1270|  8.19M|                opj_t1_setcurctx(curctx, T1_CTXNO_AGG); \
  |  |  ------------------
  |  |  |  |   62|  8.19M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1271|  8.19M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|  8.19M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|  8.19M|{ \
  |  |  |  |  140|  8.19M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|  8.19M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|  8.19M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|  8.19M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|  8.19M|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|  8.19M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 333k, False: 7.86M]
  |  |  |  |  ------------------
  |  |  |  |  146|   333k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   333k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   333k|{ \
  |  |  |  |  |  |   57|   333k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 29.8k, False: 303k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  29.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  29.8k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  29.8k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   303k|    } else { \
  |  |  |  |  |  |   62|   303k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   303k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   303k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   303k|    } \
  |  |  |  |  |  |   66|   333k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   333k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   333k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   333k|{ \
  |  |  |  |  |  |  128|   805k|    do { \
  |  |  |  |  |  |  129|   805k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 105k, False: 700k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|   105k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|   105k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|   105k|{ \
  |  |  |  |  |  |  |  |  104|   105k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|   105k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|   105k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|   105k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|   105k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 82.3k, False: 22.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  82.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 72.8k, False: 9.42k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  72.8k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  72.8k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  72.8k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  72.8k|            } else { \
  |  |  |  |  |  |  |  |  114|  9.42k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  9.42k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  9.42k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  9.42k|            } \
  |  |  |  |  |  |  |  |  118|  82.3k|        } else { \
  |  |  |  |  |  |  |  |  119|  22.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  22.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  22.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  22.9k|        } \
  |  |  |  |  |  |  |  |  123|   105k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   105k|        } \
  |  |  |  |  |  |  132|   805k|        a <<= 1; \
  |  |  |  |  |  |  133|   805k|        c <<= 1; \
  |  |  |  |  |  |  134|   805k|        ct--; \
  |  |  |  |  |  |  135|   805k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 472k, False: 333k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   333k|}
  |  |  |  |  ------------------
  |  |  |  |  148|  7.86M|    } else {  \
  |  |  |  |  149|  7.86M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|  7.86M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 476k, False: 7.38M]
  |  |  |  |  ------------------
  |  |  |  |  151|   476k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   476k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   476k|{ \
  |  |  |  |  |  |   45|   476k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 25.5k, False: 451k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  25.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  25.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   451k|    } else { \
  |  |  |  |  |  |   49|   451k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   451k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   451k|    } \
  |  |  |  |  |  |   52|   476k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   476k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   476k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   476k|{ \
  |  |  |  |  |  |  128|   488k|    do { \
  |  |  |  |  |  |  129|   488k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 74.3k, False: 414k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  74.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  74.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  74.3k|{ \
  |  |  |  |  |  |  |  |  104|  74.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  74.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  74.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  74.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  74.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 56.6k, False: 17.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  56.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 54.6k, False: 2.00k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  54.6k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  54.6k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  54.6k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  54.6k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.00k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.00k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.00k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.00k|            } \
  |  |  |  |  |  |  |  |  118|  56.6k|        } else { \
  |  |  |  |  |  |  |  |  119|  17.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  17.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  17.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  17.6k|        } \
  |  |  |  |  |  |  |  |  123|  74.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  74.3k|        } \
  |  |  |  |  |  |  132|   488k|        a <<= 1; \
  |  |  |  |  |  |  133|   488k|        c <<= 1; \
  |  |  |  |  |  |  134|   488k|        ct--; \
  |  |  |  |  |  |  135|   488k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 11.8k, False: 476k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   476k|}
  |  |  |  |  ------------------
  |  |  |  |  153|  7.38M|        } else { \
  |  |  |  |  154|  7.38M|            d = (*curctx)->mps; \
  |  |  |  |  155|  7.38M|        } \
  |  |  |  |  156|  7.86M|    } \
  |  |  |  |  157|  8.19M|}
  |  |  ------------------
  |  | 1272|  8.19M|                if (!v) { \
  |  |  ------------------
  |  |  |  Branch (1272:21): [True: 7.85M, False: 346k]
  |  |  ------------------
  |  | 1273|  7.85M|                    continue; \
  |  | 1274|  7.85M|                } \
  |  | 1275|  8.19M|                opj_t1_setcurctx(curctx, T1_CTXNO_UNI); \
  |  |  ------------------
  |  |  |  |   62|   346k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1276|   346k|                opj_mqc_decode_macro(runlen, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   346k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   346k|{ \
  |  |  |  |  140|   346k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   346k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   346k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   346k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   346k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   346k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 175k, False: 170k]
  |  |  |  |  ------------------
  |  |  |  |  146|   175k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   175k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   175k|{ \
  |  |  |  |  |  |   57|   175k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 96.9k, False: 78.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  96.9k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  96.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  96.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|  96.9k|    } else { \
  |  |  |  |  |  |   62|  78.6k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|  78.6k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|  78.6k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|  78.6k|    } \
  |  |  |  |  |  |   66|   175k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   175k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   175k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   175k|{ \
  |  |  |  |  |  |  128|   175k|    do { \
  |  |  |  |  |  |  129|   175k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 21.3k, False: 154k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  21.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  21.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  21.3k|{ \
  |  |  |  |  |  |  |  |  104|  21.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  21.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  21.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  21.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  21.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 17.7k, False: 3.60k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  17.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 17.1k, False: 560]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  17.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  17.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  17.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  17.1k|            } else { \
  |  |  |  |  |  |  |  |  114|    560|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|    560|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|    560|                ct = 7; \
  |  |  |  |  |  |  |  |  117|    560|            } \
  |  |  |  |  |  |  |  |  118|  17.7k|        } else { \
  |  |  |  |  |  |  |  |  119|  3.60k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  3.60k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  3.60k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  3.60k|        } \
  |  |  |  |  |  |  |  |  123|  21.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  21.3k|        } \
  |  |  |  |  |  |  132|   175k|        a <<= 1; \
  |  |  |  |  |  |  133|   175k|        c <<= 1; \
  |  |  |  |  |  |  134|   175k|        ct--; \
  |  |  |  |  |  |  135|   175k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 175k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   175k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   175k|    } else {  \
  |  |  |  |  149|   170k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   170k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 143k, False: 27.2k]
  |  |  |  |  ------------------
  |  |  |  |  151|   143k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   143k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   143k|{ \
  |  |  |  |  |  |   45|   143k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 67.8k, False: 75.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  67.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  67.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|  75.5k|    } else { \
  |  |  |  |  |  |   49|  75.5k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|  75.5k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|  75.5k|    } \
  |  |  |  |  |  |   52|   143k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   143k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   143k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   143k|{ \
  |  |  |  |  |  |  128|   174k|    do { \
  |  |  |  |  |  |  129|   174k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 20.1k, False: 154k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  20.1k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  20.1k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  20.1k|{ \
  |  |  |  |  |  |  |  |  104|  20.1k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  20.1k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  20.1k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  20.1k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  20.1k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 16.2k, False: 3.87k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  16.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 15.3k, False: 920]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  15.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  15.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  15.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  15.3k|            } else { \
  |  |  |  |  |  |  |  |  114|    920|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|    920|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|    920|                ct = 7; \
  |  |  |  |  |  |  |  |  117|    920|            } \
  |  |  |  |  |  |  |  |  118|  16.2k|        } else { \
  |  |  |  |  |  |  |  |  119|  3.87k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  3.87k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  3.87k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  3.87k|        } \
  |  |  |  |  |  |  |  |  123|  20.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  20.1k|        } \
  |  |  |  |  |  |  132|   174k|        a <<= 1; \
  |  |  |  |  |  |  133|   174k|        c <<= 1; \
  |  |  |  |  |  |  134|   174k|        ct--; \
  |  |  |  |  |  |  135|   174k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 31.1k, False: 143k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   143k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   143k|        } else { \
  |  |  |  |  154|  27.2k|            d = (*curctx)->mps; \
  |  |  |  |  155|  27.2k|        } \
  |  |  |  |  156|   170k|    } \
  |  |  |  |  157|   346k|}
  |  |  ------------------
  |  | 1277|   346k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   346k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   346k|{ \
  |  |  |  |  140|   346k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   346k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   346k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   346k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   346k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   346k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 171k, False: 174k]
  |  |  |  |  ------------------
  |  |  |  |  146|   171k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   171k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   171k|{ \
  |  |  |  |  |  |   57|   171k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 35.7k, False: 135k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  35.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  35.7k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  35.7k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   135k|    } else { \
  |  |  |  |  |  |   62|   135k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   135k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   135k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   135k|    } \
  |  |  |  |  |  |   66|   171k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   171k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   171k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   171k|{ \
  |  |  |  |  |  |  128|   171k|    do { \
  |  |  |  |  |  |  129|   171k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 18.8k, False: 152k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  18.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  18.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  18.8k|{ \
  |  |  |  |  |  |  |  |  104|  18.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  18.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  18.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  18.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  18.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 15.6k, False: 3.15k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  15.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 14.4k, False: 1.19k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  14.4k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  14.4k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  14.4k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  14.4k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.19k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.19k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.19k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.19k|            } \
  |  |  |  |  |  |  |  |  118|  15.6k|        } else { \
  |  |  |  |  |  |  |  |  119|  3.15k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  3.15k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  3.15k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  3.15k|        } \
  |  |  |  |  |  |  |  |  123|  18.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  18.8k|        } \
  |  |  |  |  |  |  132|   171k|        a <<= 1; \
  |  |  |  |  |  |  133|   171k|        c <<= 1; \
  |  |  |  |  |  |  134|   171k|        ct--; \
  |  |  |  |  |  |  135|   171k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 171k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   171k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   174k|    } else {  \
  |  |  |  |  149|   174k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   174k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 147k, False: 27.4k]
  |  |  |  |  ------------------
  |  |  |  |  151|   147k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   147k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   147k|{ \
  |  |  |  |  |  |   45|   147k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 28.3k, False: 118k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  28.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  28.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   118k|    } else { \
  |  |  |  |  |  |   49|   118k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   118k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   118k|    } \
  |  |  |  |  |  |   52|   147k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   147k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   147k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   147k|{ \
  |  |  |  |  |  |  128|   165k|    do { \
  |  |  |  |  |  |  129|   165k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 20.8k, False: 144k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  20.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  20.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  20.8k|{ \
  |  |  |  |  |  |  |  |  104|  20.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  20.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  20.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  20.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  20.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 17.6k, False: 3.21k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  17.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 16.4k, False: 1.24k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  16.4k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  16.4k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  16.4k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  16.4k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.24k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.24k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.24k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.24k|            } \
  |  |  |  |  |  |  |  |  118|  17.6k|        } else { \
  |  |  |  |  |  |  |  |  119|  3.21k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  3.21k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  3.21k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  3.21k|        } \
  |  |  |  |  |  |  |  |  123|  20.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  20.8k|        } \
  |  |  |  |  |  |  132|   165k|        a <<= 1; \
  |  |  |  |  |  |  133|   165k|        c <<= 1; \
  |  |  |  |  |  |  134|   165k|        ct--; \
  |  |  |  |  |  |  135|   165k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 17.8k, False: 147k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   147k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   147k|        } else { \
  |  |  |  |  154|  27.4k|            d = (*curctx)->mps; \
  |  |  |  |  155|  27.4k|        } \
  |  |  |  |  156|   174k|    } \
  |  |  |  |  157|   346k|}
  |  |  ------------------
  |  | 1278|   346k|                runlen = (runlen << 1) | v; \
  |  | 1279|   346k|                switch(runlen) { \
  |  |  ------------------
  |  |  |  Branch (1279:24): [True: 0, False: 346k]
  |  |  ------------------
  |  | 1280|   106k|                    case 0: \
  |  |  ------------------
  |  |  |  Branch (1280:21): [True: 106k, False: 239k]
  |  |  ------------------
  |  | 1281|   106k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, OPJ_TRUE,\
  |  |  ------------------
  |  |  |  | 1118|   106k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   106k|{ \
  |  |  |  | 1120|   106k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   106k|        do { \
  |  |  |  | 1122|   106k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|      0|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|      0|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|      0|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|      0|{ \
  |  |  |  |  |  |  140|      0|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|      0|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|      0|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|      0|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|      0|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|      0|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      0|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|      0|{ \
  |  |  |  |  |  |  |  |   57|      0|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|      0|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|      0|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|      0|    } else { \
  |  |  |  |  |  |  |  |   62|      0|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|      0|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|      0|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|      0|    } \
  |  |  |  |  |  |  |  |   66|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|      0|{ \
  |  |  |  |  |  |  |  |  128|      0|    do { \
  |  |  |  |  |  |  |  |  129|      0|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|      0|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|      0|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|      0|{ \
  |  |  |  |  |  |  |  |  |  |  104|      0|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|      0|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|      0|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|      0|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|      0|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|      0|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|      0|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|      0|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|      0|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|      0|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|      0|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|      0|            } \
  |  |  |  |  |  |  |  |  |  |  118|      0|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|      0|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|      0|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|      0|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|      0|        } \
  |  |  |  |  |  |  |  |  |  |  123|      0|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|        } \
  |  |  |  |  |  |  |  |  132|      0|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|      0|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|      0|        ct--; \
  |  |  |  |  |  |  |  |  135|      0|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|    } else {  \
  |  |  |  |  |  |  149|      0|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|      0|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|      0|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|      0|{ \
  |  |  |  |  |  |  |  |   45|      0|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|      0|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|      0|    } else { \
  |  |  |  |  |  |  |  |   49|      0|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|      0|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|      0|    } \
  |  |  |  |  |  |  |  |   52|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|      0|{ \
  |  |  |  |  |  |  |  |  128|      0|    do { \
  |  |  |  |  |  |  |  |  129|      0|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|      0|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|      0|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|      0|{ \
  |  |  |  |  |  |  |  |  |  |  104|      0|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|      0|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|      0|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|      0|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|      0|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|      0|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|      0|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|      0|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|      0|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|      0|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|      0|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|      0|            } \
  |  |  |  |  |  |  |  |  |  |  118|      0|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|      0|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|      0|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|      0|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|      0|        } \
  |  |  |  |  |  |  |  |  |  |  123|      0|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|        } \
  |  |  |  |  |  |  |  |  132|      0|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|      0|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|      0|        ct--; \
  |  |  |  |  |  |  |  |  135|      0|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        } else { \
  |  |  |  |  |  |  154|      0|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|      0|        } \
  |  |  |  |  |  |  156|      0|    } \
  |  |  |  |  |  |  157|      0|}
  |  |  |  |  ------------------
  |  |  |  | 1126|      0|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1127|      0|                    break; \
  |  |  |  | 1128|      0|            } \
  |  |  |  | 1129|   106k|            { \
  |  |  |  | 1130|   106k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   106k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   106k|                                    ci); \
  |  |  |  | 1133|   106k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   106k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   106k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   106k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   106k|{ \
  |  |  |  |  |  |  140|   106k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   106k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   106k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   106k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   106k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   106k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 37.0k, False: 69.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  37.0k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  37.0k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  37.0k|{ \
  |  |  |  |  |  |  |  |   57|  37.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 2.96k, False: 34.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  2.96k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  2.96k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  2.96k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  34.0k|    } else { \
  |  |  |  |  |  |  |  |   62|  34.0k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  34.0k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  34.0k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  34.0k|    } \
  |  |  |  |  |  |  |  |   66|  37.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  37.0k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  37.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  37.0k|{ \
  |  |  |  |  |  |  |  |  128|  55.8k|    do { \
  |  |  |  |  |  |  |  |  129|  55.8k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 6.77k, False: 49.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  6.77k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  6.77k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  6.77k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  6.77k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  6.77k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  6.77k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  6.77k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  6.77k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 6.17k, False: 596]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  6.17k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.89k, False: 1.28k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.89k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.89k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.89k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.89k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.28k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.28k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.28k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.28k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  6.17k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    596|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    596|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    596|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    596|        } \
  |  |  |  |  |  |  |  |  |  |  123|  6.77k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  6.77k|        } \
  |  |  |  |  |  |  |  |  132|  55.8k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  55.8k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  55.8k|        ct--; \
  |  |  |  |  |  |  |  |  135|  55.8k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 18.8k, False: 37.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  37.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  69.3k|    } else {  \
  |  |  |  |  |  |  149|  69.3k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  69.3k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 38.0k, False: 31.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  38.0k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  38.0k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  38.0k|{ \
  |  |  |  |  |  |  |  |   45|  38.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 2.11k, False: 35.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  2.11k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  2.11k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  35.9k|    } else { \
  |  |  |  |  |  |  |  |   49|  35.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  35.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  35.9k|    } \
  |  |  |  |  |  |  |  |   52|  38.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  38.0k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  38.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  38.0k|{ \
  |  |  |  |  |  |  |  |  128|  38.2k|    do { \
  |  |  |  |  |  |  |  |  129|  38.2k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 5.99k, False: 32.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  5.99k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  5.99k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  5.99k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  5.99k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  5.99k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  5.99k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  5.99k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  5.99k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.39k, False: 592]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.39k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.79k, False: 601]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.79k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.79k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.79k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.79k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    601|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    601|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    601|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    601|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.39k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    592|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    592|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    592|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    592|        } \
  |  |  |  |  |  |  |  |  |  |  123|  5.99k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  5.99k|        } \
  |  |  |  |  |  |  |  |  132|  38.2k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  38.2k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  38.2k|        ct--; \
  |  |  |  |  |  |  |  |  135|  38.2k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 122, False: 38.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  38.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  38.0k|        } else { \
  |  |  |  |  |  |  154|  31.2k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  31.2k|        } \
  |  |  |  |  |  |  156|  69.3k|    } \
  |  |  |  |  |  |  157|   106k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   106k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   106k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 50.4k, False: 55.8k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   106k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   106k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   106k|{ \
  |  |  |  |  |  |  323|   106k|    /* east */ \
  |  |  |  |  |  |  324|   106k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   106k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   106k| \
  |  |  |  |  |  |  326|   106k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   106k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   106k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   106k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   106k| \
  |  |  |  |  |  |  329|   106k|    /* west */ \
  |  |  |  |  |  |  330|   106k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   106k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   106k| \
  |  |  |  |  |  |  332|   106k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   106k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   106k| \
  |  |  |  |  |  |  340|   106k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   106k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   106k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   106k|            } \
  |  |  |  | 1139|   106k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   106k|    } \
  |  |  |  | 1141|   106k|}
  |  |  ------------------
  |  | 1282|   106k|                                            flags, flagsp, flags_stride, data, \
  |  | 1283|   106k|                                            l_w, 0, mqc, curctx, \
  |  | 1284|   106k|                                            v, a, c, ct, oneplushalf, vsc); \
  |  | 1285|   106k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   106k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1286|   106k|                        /* FALLTHRU */ \
  |  | 1287|   199k|                    case 1: \
  |  |  ------------------
  |  |  |  Branch (1287:21): [True: 93.3k, False: 252k]
  |  |  ------------------
  |  | 1288|   199k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   199k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   199k|{ \
  |  |  |  | 1120|   199k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   199k|        do { \
  |  |  |  | 1122|   199k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 106k, False: 93.3k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   106k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   106k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   106k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   106k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   106k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   106k|{ \
  |  |  |  |  |  |  140|   106k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   106k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   106k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   106k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   106k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   106k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 31.0k, False: 75.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  31.0k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  31.0k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  31.0k|{ \
  |  |  |  |  |  |  |  |   57|  31.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 5.71k, False: 25.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  5.71k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  5.71k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  5.71k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  25.3k|    } else { \
  |  |  |  |  |  |  |  |   62|  25.3k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  25.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  25.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  25.3k|    } \
  |  |  |  |  |  |  |  |   66|  31.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  31.0k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  31.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  31.0k|{ \
  |  |  |  |  |  |  |  |  128|  45.6k|    do { \
  |  |  |  |  |  |  |  |  129|  45.6k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 5.70k, False: 39.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  5.70k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  5.70k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  5.70k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  5.70k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  5.70k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  5.70k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  5.70k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  5.70k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 4.92k, False: 777]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  4.92k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.40k, False: 521]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.40k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.40k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.40k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.40k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    521|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    521|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    521|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    521|            } \
  |  |  |  |  |  |  |  |  |  |  118|  4.92k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    777|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    777|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    777|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    777|        } \
  |  |  |  |  |  |  |  |  |  |  123|  5.70k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  5.70k|        } \
  |  |  |  |  |  |  |  |  132|  45.6k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  45.6k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  45.6k|        ct--; \
  |  |  |  |  |  |  |  |  135|  45.6k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 14.5k, False: 31.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  31.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  75.2k|    } else {  \
  |  |  |  |  |  |  149|  75.2k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  75.2k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 33.1k, False: 42.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  33.1k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  33.1k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  33.1k|{ \
  |  |  |  |  |  |  |  |   45|  33.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 4.08k, False: 29.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.08k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  4.08k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  29.0k|    } else { \
  |  |  |  |  |  |  |  |   49|  29.0k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  29.0k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  29.0k|    } \
  |  |  |  |  |  |  |  |   52|  33.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  33.1k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  33.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  33.1k|{ \
  |  |  |  |  |  |  |  |  128|  35.4k|    do { \
  |  |  |  |  |  |  |  |  129|  35.4k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 5.18k, False: 30.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  5.18k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  5.18k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  5.18k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  5.18k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  5.18k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  5.18k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  5.18k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  5.18k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 4.45k, False: 728]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  4.45k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.16k, False: 292]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.16k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.16k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.16k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.16k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    292|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    292|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    292|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    292|            } \
  |  |  |  |  |  |  |  |  |  |  118|  4.45k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    728|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    728|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    728|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    728|        } \
  |  |  |  |  |  |  |  |  |  |  123|  5.18k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  5.18k|        } \
  |  |  |  |  |  |  |  |  132|  35.4k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  35.4k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  35.4k|        ct--; \
  |  |  |  |  |  |  |  |  135|  35.4k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.32k, False: 33.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  33.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  42.1k|        } else { \
  |  |  |  |  |  |  154|  42.1k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  42.1k|        } \
  |  |  |  |  |  |  156|  75.2k|    } \
  |  |  |  |  |  |  157|   106k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   106k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 49.7k, False: 56.6k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   106k|                    break; \
  |  |  |  | 1128|   106k|            } \
  |  |  |  | 1129|   199k|            { \
  |  |  |  | 1130|   149k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   149k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   149k|                                    ci); \
  |  |  |  | 1133|   149k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   149k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   149k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   149k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   149k|{ \
  |  |  |  |  |  |  140|   149k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   149k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   149k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   149k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   149k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   149k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 48.3k, False: 101k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  48.3k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  48.3k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  48.3k|{ \
  |  |  |  |  |  |  |  |   57|  48.3k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 2.10k, False: 46.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  2.10k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  2.10k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  2.10k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  46.2k|    } else { \
  |  |  |  |  |  |  |  |   62|  46.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  46.2k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  46.2k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  46.2k|    } \
  |  |  |  |  |  |  |  |   66|  48.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  48.3k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  48.3k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  48.3k|{ \
  |  |  |  |  |  |  |  |  128|  74.6k|    do { \
  |  |  |  |  |  |  |  |  129|  74.6k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 8.01k, False: 66.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  8.01k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  8.01k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  8.01k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  8.01k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  8.01k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  8.01k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  8.01k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  8.01k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 7.07k, False: 936]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  7.07k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 6.40k, False: 671]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  6.40k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  6.40k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  6.40k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  6.40k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    671|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    671|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    671|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    671|            } \
  |  |  |  |  |  |  |  |  |  |  118|  7.07k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    936|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    936|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    936|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    936|        } \
  |  |  |  |  |  |  |  |  |  |  123|  8.01k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  8.01k|        } \
  |  |  |  |  |  |  |  |  132|  74.6k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  74.6k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  74.6k|        ct--; \
  |  |  |  |  |  |  |  |  135|  74.6k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 26.2k, False: 48.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  48.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   101k|    } else {  \
  |  |  |  |  |  |  149|   101k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   101k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 44.3k, False: 57.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  44.3k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  44.3k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  44.3k|{ \
  |  |  |  |  |  |  |  |   45|  44.3k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 1.94k, False: 42.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  1.94k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  1.94k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  42.3k|    } else { \
  |  |  |  |  |  |  |  |   49|  42.3k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  42.3k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  42.3k|    } \
  |  |  |  |  |  |  |  |   52|  44.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  44.3k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  44.3k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  44.3k|{ \
  |  |  |  |  |  |  |  |  128|  45.5k|    do { \
  |  |  |  |  |  |  |  |  129|  45.5k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 6.02k, False: 39.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  6.02k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  6.02k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  6.02k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  6.02k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  6.02k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  6.02k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  6.02k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  6.02k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.23k, False: 790]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.23k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.73k, False: 502]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.73k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.73k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.73k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.73k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    502|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    502|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    502|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    502|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.23k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    790|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    790|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    790|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    790|        } \
  |  |  |  |  |  |  |  |  |  |  123|  6.02k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  6.02k|        } \
  |  |  |  |  |  |  |  |  132|  45.5k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  45.5k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  45.5k|        ct--; \
  |  |  |  |  |  |  |  |  135|  45.5k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.18k, False: 44.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  44.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  57.2k|        } else { \
  |  |  |  |  |  |  154|  57.2k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  57.2k|        } \
  |  |  |  |  |  |  156|   101k|    } \
  |  |  |  |  |  |  157|   149k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   149k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   149k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 73.4k, False: 76.5k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   149k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   149k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   149k|{ \
  |  |  |  |  |  |  323|   149k|    /* east */ \
  |  |  |  |  |  |  324|   149k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   149k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   149k| \
  |  |  |  |  |  |  326|   149k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   149k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   149k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   149k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   149k| \
  |  |  |  |  |  |  329|   149k|    /* west */ \
  |  |  |  |  |  |  330|   149k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   149k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   149k| \
  |  |  |  |  |  |  332|   149k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   149k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   149k| \
  |  |  |  |  |  |  340|   149k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   149k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   149k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   149k|            } \
  |  |  |  | 1139|   149k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   199k|    } \
  |  |  |  | 1141|   199k|}
  |  |  ------------------
  |  | 1289|   199k|                                            flags, flagsp, flags_stride, data, \
  |  | 1290|   199k|                                            l_w, 1, mqc, curctx, \
  |  | 1291|   199k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1292|   199k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   199k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1293|   199k|                        /* FALLTHRU */ \
  |  | 1294|   275k|                    case 2: \
  |  |  ------------------
  |  |  |  Branch (1294:21): [True: 75.7k, False: 270k]
  |  |  ------------------
  |  | 1295|   275k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   275k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   275k|{ \
  |  |  |  | 1120|   275k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   275k|        do { \
  |  |  |  | 1122|   275k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 199k, False: 75.7k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   199k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   199k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   199k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   199k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   199k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   199k|{ \
  |  |  |  |  |  |  140|   199k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   199k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   199k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   199k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   199k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   199k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 50.9k, False: 148k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  50.9k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  50.9k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  50.9k|{ \
  |  |  |  |  |  |  |  |   57|  50.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 10.0k, False: 40.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  10.0k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  10.0k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  10.0k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  40.9k|    } else { \
  |  |  |  |  |  |  |  |   62|  40.9k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  40.9k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  40.9k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  40.9k|    } \
  |  |  |  |  |  |  |  |   66|  50.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  50.9k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  50.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  50.9k|{ \
  |  |  |  |  |  |  |  |  128|  80.6k|    do { \
  |  |  |  |  |  |  |  |  129|  80.6k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 9.20k, False: 71.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  9.20k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  9.20k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  9.20k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  9.20k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  9.20k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  9.20k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  9.20k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  9.20k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 6.93k, False: 2.26k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  6.93k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 6.50k, False: 435]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  6.50k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  6.50k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  6.50k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  6.50k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    435|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    435|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    435|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    435|            } \
  |  |  |  |  |  |  |  |  |  |  118|  6.93k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.26k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.26k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.26k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.26k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  9.20k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  9.20k|        } \
  |  |  |  |  |  |  |  |  132|  80.6k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  80.6k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  80.6k|        ct--; \
  |  |  |  |  |  |  |  |  135|  80.6k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 29.6k, False: 50.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  50.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   148k|    } else {  \
  |  |  |  |  |  |  149|   148k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   148k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 47.1k, False: 101k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  47.1k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  47.1k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  47.1k|{ \
  |  |  |  |  |  |  |  |   45|  47.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 6.36k, False: 40.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  6.36k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  6.36k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  40.7k|    } else { \
  |  |  |  |  |  |  |  |   49|  40.7k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  40.7k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  40.7k|    } \
  |  |  |  |  |  |  |  |   52|  47.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  47.1k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  47.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  47.1k|{ \
  |  |  |  |  |  |  |  |  128|  50.3k|    do { \
  |  |  |  |  |  |  |  |  129|  50.3k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 6.28k, False: 44.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  6.28k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  6.28k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  6.28k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  6.28k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  6.28k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  6.28k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  6.28k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  6.28k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.21k, False: 1.07k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.21k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.74k, False: 475]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.74k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.74k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.74k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.74k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    475|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    475|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    475|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    475|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.21k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.07k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.07k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.07k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.07k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  6.28k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  6.28k|        } \
  |  |  |  |  |  |  |  |  132|  50.3k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  50.3k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  50.3k|        ct--; \
  |  |  |  |  |  |  |  |  135|  50.3k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 3.17k, False: 47.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  47.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   101k|        } else { \
  |  |  |  |  |  |  154|   101k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   101k|        } \
  |  |  |  |  |  |  156|   148k|    } \
  |  |  |  |  |  |  157|   199k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   199k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 110k, False: 88.9k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   199k|                    break; \
  |  |  |  | 1128|   199k|            } \
  |  |  |  | 1129|   275k|            { \
  |  |  |  | 1130|   164k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   164k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   164k|                                    ci); \
  |  |  |  | 1133|   164k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   164k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   164k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   164k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   164k|{ \
  |  |  |  |  |  |  140|   164k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   164k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   164k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   164k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   164k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   164k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 44.5k, False: 120k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  44.5k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  44.5k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  44.5k|{ \
  |  |  |  |  |  |  |  |   57|  44.5k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 5.04k, False: 39.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  5.04k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  5.04k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  5.04k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  39.4k|    } else { \
  |  |  |  |  |  |  |  |   62|  39.4k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  39.4k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  39.4k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  39.4k|    } \
  |  |  |  |  |  |  |  |   66|  44.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  44.5k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  44.5k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  44.5k|{ \
  |  |  |  |  |  |  |  |  128|  69.1k|    do { \
  |  |  |  |  |  |  |  |  129|  69.1k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 10.0k, False: 59.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  10.0k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  10.0k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  10.0k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  10.0k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  10.0k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  10.0k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  10.0k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  10.0k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 9.20k, False: 875]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  9.20k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 8.31k, False: 889]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  8.31k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  8.31k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  8.31k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  8.31k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    889|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    889|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    889|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    889|            } \
  |  |  |  |  |  |  |  |  |  |  118|  9.20k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    875|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    875|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    875|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    875|        } \
  |  |  |  |  |  |  |  |  |  |  123|  10.0k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  10.0k|        } \
  |  |  |  |  |  |  |  |  132|  69.1k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  69.1k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  69.1k|        ct--; \
  |  |  |  |  |  |  |  |  135|  69.1k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 24.6k, False: 44.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  44.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   120k|    } else {  \
  |  |  |  |  |  |  149|   120k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   120k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 55.5k, False: 64.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  55.5k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  55.5k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  55.5k|{ \
  |  |  |  |  |  |  |  |   45|  55.5k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 4.00k, False: 51.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.00k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  4.00k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  51.5k|    } else { \
  |  |  |  |  |  |  |  |   49|  51.5k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  51.5k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  51.5k|    } \
  |  |  |  |  |  |  |  |   52|  55.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  55.5k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  55.5k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  55.5k|{ \
  |  |  |  |  |  |  |  |  128|  58.1k|    do { \
  |  |  |  |  |  |  |  |  129|  58.1k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 7.12k, False: 51.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  7.12k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  7.12k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  7.12k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  7.12k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  7.12k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  7.12k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  7.12k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  7.12k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.57k, False: 1.55k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.57k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 5.17k, False: 401]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  5.17k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  5.17k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  5.17k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  5.17k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    401|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    401|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    401|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    401|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.57k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.55k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.55k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.55k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.55k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  7.12k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  7.12k|        } \
  |  |  |  |  |  |  |  |  132|  58.1k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  58.1k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  58.1k|        ct--; \
  |  |  |  |  |  |  |  |  135|  58.1k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.60k, False: 55.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  55.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  64.6k|        } else { \
  |  |  |  |  |  |  154|  64.6k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  64.6k|        } \
  |  |  |  |  |  |  156|   120k|    } \
  |  |  |  |  |  |  157|   164k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   164k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   164k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 80.8k, False: 83.9k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   164k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   164k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   164k|{ \
  |  |  |  |  |  |  323|   164k|    /* east */ \
  |  |  |  |  |  |  324|   164k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   164k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   164k| \
  |  |  |  |  |  |  326|   164k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   164k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   164k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   164k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   164k| \
  |  |  |  |  |  |  329|   164k|    /* west */ \
  |  |  |  |  |  |  330|   164k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   164k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   164k| \
  |  |  |  |  |  |  332|   164k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   164k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   164k| \
  |  |  |  |  |  |  340|   164k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   164k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   164k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   164k|            } \
  |  |  |  | 1139|   164k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   275k|    } \
  |  |  |  | 1141|   275k|}
  |  |  ------------------
  |  | 1296|   275k|                                            flags, flagsp, flags_stride, data, \
  |  | 1297|   275k|                                            l_w, 2, mqc, curctx, \
  |  | 1298|   275k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1299|   275k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   275k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1300|   275k|                        /* FALLTHRU */ \
  |  | 1301|   346k|                    case 3: \
  |  |  ------------------
  |  |  |  Branch (1301:21): [True: 70.7k, False: 275k]
  |  |  ------------------
  |  | 1302|   346k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   346k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   346k|{ \
  |  |  |  | 1120|   346k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   346k|        do { \
  |  |  |  | 1122|   346k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 275k, False: 70.7k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   275k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   275k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   275k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   275k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   275k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   275k|{ \
  |  |  |  |  |  |  140|   275k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   275k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   275k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   275k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   275k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   275k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 46.1k, False: 229k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  46.1k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  46.1k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  46.1k|{ \
  |  |  |  |  |  |  |  |   57|  46.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 8.88k, False: 37.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  8.88k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  8.88k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  8.88k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  37.2k|    } else { \
  |  |  |  |  |  |  |  |   62|  37.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  37.2k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  37.2k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  37.2k|    } \
  |  |  |  |  |  |  |  |   66|  46.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  46.1k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  46.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  46.1k|{ \
  |  |  |  |  |  |  |  |  128|  80.8k|    do { \
  |  |  |  |  |  |  |  |  129|  80.8k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 9.11k, False: 71.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  9.11k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  9.11k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  9.11k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  9.11k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  9.11k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  9.11k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  9.11k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  9.11k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 7.89k, False: 1.21k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  7.89k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 7.30k, False: 582]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  7.30k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  7.30k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  7.30k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  7.30k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    582|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    582|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    582|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    582|            } \
  |  |  |  |  |  |  |  |  |  |  118|  7.89k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.21k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.21k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.21k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.21k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  9.11k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  9.11k|        } \
  |  |  |  |  |  |  |  |  132|  80.8k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  80.8k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  80.8k|        ct--; \
  |  |  |  |  |  |  |  |  135|  80.8k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 34.7k, False: 46.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  46.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   229k|    } else {  \
  |  |  |  |  |  |  149|   229k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   229k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 54.0k, False: 175k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  54.0k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  54.0k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  54.0k|{ \
  |  |  |  |  |  |  |  |   45|  54.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 7.10k, False: 46.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  7.10k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  7.10k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  46.9k|    } else { \
  |  |  |  |  |  |  |  |   49|  46.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  46.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  46.9k|    } \
  |  |  |  |  |  |  |  |   52|  54.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  54.0k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  54.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  54.0k|{ \
  |  |  |  |  |  |  |  |  128|  57.0k|    do { \
  |  |  |  |  |  |  |  |  129|  57.0k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 10.6k, False: 46.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  10.6k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  10.6k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  10.6k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  10.6k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  10.6k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  10.6k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  10.6k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  10.6k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 8.88k, False: 1.78k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  8.88k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 7.94k, False: 937]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  7.94k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  7.94k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  7.94k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  7.94k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    937|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    937|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    937|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    937|            } \
  |  |  |  |  |  |  |  |  |  |  118|  8.88k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.78k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.78k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.78k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.78k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  10.6k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  10.6k|        } \
  |  |  |  |  |  |  |  |  132|  57.0k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  57.0k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  57.0k|        ct--; \
  |  |  |  |  |  |  |  |  135|  57.0k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.92k, False: 54.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  54.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   175k|        } else { \
  |  |  |  |  |  |  154|   175k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   175k|        } \
  |  |  |  |  |  |  156|   229k|    } \
  |  |  |  |  |  |  157|   275k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   275k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 166k, False: 108k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   275k|                    break; \
  |  |  |  | 1128|   275k|            } \
  |  |  |  | 1129|   346k|            { \
  |  |  |  | 1130|   179k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   179k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   179k|                                    ci); \
  |  |  |  | 1133|   179k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   179k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   179k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   179k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   179k|{ \
  |  |  |  |  |  |  140|   179k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   179k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   179k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   179k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   179k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   179k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 53.0k, False: 126k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  53.0k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  53.0k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  53.0k|{ \
  |  |  |  |  |  |  |  |   57|  53.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 9.08k, False: 44.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  9.08k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  9.08k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  9.08k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  44.0k|    } else { \
  |  |  |  |  |  |  |  |   62|  44.0k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  44.0k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  44.0k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  44.0k|    } \
  |  |  |  |  |  |  |  |   66|  53.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  53.0k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  53.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  53.0k|{ \
  |  |  |  |  |  |  |  |  128|  82.1k|    do { \
  |  |  |  |  |  |  |  |  129|  82.1k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 7.79k, False: 74.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  7.79k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  7.79k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  7.79k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  7.79k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  7.79k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  7.79k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  7.79k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  7.79k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 6.79k, False: 1.00k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  6.79k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 6.12k, False: 662]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  6.12k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  6.12k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  6.12k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  6.12k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    662|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    662|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    662|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    662|            } \
  |  |  |  |  |  |  |  |  |  |  118|  6.79k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.00k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.00k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.00k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.00k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  7.79k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  7.79k|        } \
  |  |  |  |  |  |  |  |  132|  82.1k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  82.1k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  82.1k|        ct--; \
  |  |  |  |  |  |  |  |  135|  82.1k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 29.0k, False: 53.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  53.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   126k|    } else {  \
  |  |  |  |  |  |  149|   126k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   126k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 54.4k, False: 71.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  54.4k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  54.4k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  54.4k|{ \
  |  |  |  |  |  |  |  |   45|  54.4k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 5.13k, False: 49.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  5.13k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  5.13k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  49.3k|    } else { \
  |  |  |  |  |  |  |  |   49|  49.3k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  49.3k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  49.3k|    } \
  |  |  |  |  |  |  |  |   52|  54.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  54.4k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  54.4k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  54.4k|{ \
  |  |  |  |  |  |  |  |  128|  57.1k|    do { \
  |  |  |  |  |  |  |  |  129|  57.1k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 9.00k, False: 48.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  9.00k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  9.00k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  9.00k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  9.00k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  9.00k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  9.00k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  9.00k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  9.00k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 6.91k, False: 2.08k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  6.91k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 6.50k, False: 407]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  6.50k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  6.50k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  6.50k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  6.50k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    407|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    407|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    407|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    407|            } \
  |  |  |  |  |  |  |  |  |  |  118|  6.91k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.08k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.08k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.08k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.08k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  9.00k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  9.00k|        } \
  |  |  |  |  |  |  |  |  132|  57.1k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  57.1k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  57.1k|        ct--; \
  |  |  |  |  |  |  |  |  135|  57.1k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.70k, False: 54.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  54.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  71.9k|        } else { \
  |  |  |  |  |  |  154|  71.9k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  71.9k|        } \
  |  |  |  |  |  |  156|   126k|    } \
  |  |  |  |  |  |  157|   179k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   179k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   179k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 85.9k, False: 93.4k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   179k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   179k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   179k|{ \
  |  |  |  |  |  |  323|   179k|    /* east */ \
  |  |  |  |  |  |  324|   179k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   179k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   179k| \
  |  |  |  |  |  |  326|   179k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   179k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   179k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   179k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   179k| \
  |  |  |  |  |  |  329|   179k|    /* west */ \
  |  |  |  |  |  |  330|   179k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   179k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   179k| \
  |  |  |  |  |  |  332|   179k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   179k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   179k| \
  |  |  |  |  |  |  340|   179k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   179k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|   179k|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|   179k|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|   179k|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|   179k|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   179k|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|   179k|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|   179k|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|   179k|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|   179k|    } \
  |  |  |  |  |  |  347|   179k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   179k|            } \
  |  |  |  | 1139|   179k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   346k|    } \
  |  |  |  | 1141|   346k|}
  |  |  ------------------
  |  | 1303|   346k|                                            flags, flagsp, flags_stride, data, \
  |  | 1304|   346k|                                            l_w, 3, mqc, curctx, \
  |  | 1305|   346k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1306|   346k|                        break; \
  |  | 1307|   346k|                } \
  |  | 1308|  13.6M|            } else { \
  |  | 1309|  13.6M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  13.6M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  13.6M|{ \
  |  |  |  | 1120|  13.6M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  13.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  13.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  13.6M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  13.6M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 3.07M, False: 10.6M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  3.07M|        do { \
  |  |  |  | 1122|  3.07M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  3.07M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  3.07M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.07M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  3.07M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.07M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.07M|{ \
  |  |  |  |  |  |  140|  3.07M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.07M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.07M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.07M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.07M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.07M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 714k, False: 2.35M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   714k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   714k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   714k|{ \
  |  |  |  |  |  |  |  |   57|   714k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 158k, False: 555k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   158k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   158k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   158k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   555k|    } else { \
  |  |  |  |  |  |  |  |   62|   555k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   555k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   555k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   555k|    } \
  |  |  |  |  |  |  |  |   66|   714k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   714k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   714k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   714k|{ \
  |  |  |  |  |  |  |  |  128|  1.16M|    do { \
  |  |  |  |  |  |  |  |  129|  1.16M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 144k, False: 1.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   144k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   144k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   144k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   144k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   144k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   144k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   144k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   144k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 130k, False: 13.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   130k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 126k, False: 4.76k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   126k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   126k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   126k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   126k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.76k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.76k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.76k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.76k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   130k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  13.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  13.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  13.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  13.5k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   144k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   144k|        } \
  |  |  |  |  |  |  |  |  132|  1.16M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.16M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.16M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.16M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 453k, False: 714k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   714k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.35M|    } else {  \
  |  |  |  |  |  |  149|  2.35M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.35M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 735k, False: 1.62M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   735k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   735k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   735k|{ \
  |  |  |  |  |  |  |  |   45|   735k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 129k, False: 606k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   129k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   129k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   606k|    } else { \
  |  |  |  |  |  |  |  |   49|   606k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   606k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   606k|    } \
  |  |  |  |  |  |  |  |   52|   735k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   735k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   735k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   735k|{ \
  |  |  |  |  |  |  |  |  128|   791k|    do { \
  |  |  |  |  |  |  |  |  129|   791k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 99.4k, False: 692k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  99.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  99.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  99.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  99.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  99.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  99.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  99.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  99.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 90.8k, False: 8.58k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  90.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 87.9k, False: 2.91k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  87.9k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  87.9k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  87.9k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  87.9k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.91k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.91k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.91k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.91k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  90.8k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.58k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.58k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.58k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.58k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  99.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  99.4k|        } \
  |  |  |  |  |  |  |  |  132|   791k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   791k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   791k|        ct--; \
  |  |  |  |  |  |  |  |  135|   791k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 56.4k, False: 735k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   735k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.62M|        } else { \
  |  |  |  |  |  |  154|  1.62M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.62M|        } \
  |  |  |  |  |  |  156|  2.35M|    } \
  |  |  |  |  |  |  157|  3.07M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.07M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 1.67M, False: 1.39M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.07M|                    break; \
  |  |  |  | 1128|  3.07M|            } \
  |  |  |  | 1129|  3.07M|            { \
  |  |  |  | 1130|  1.39M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  1.39M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  1.39M|                                    ci); \
  |  |  |  | 1133|  1.39M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.39M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  1.39M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.39M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.39M|{ \
  |  |  |  |  |  |  140|  1.39M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.39M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.39M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.39M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.39M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.39M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 378k, False: 1.01M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   378k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   378k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   378k|{ \
  |  |  |  |  |  |  |  |   57|   378k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 88.2k, False: 290k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  88.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  88.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  88.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   290k|    } else { \
  |  |  |  |  |  |  |  |   62|   290k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   290k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   290k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   290k|    } \
  |  |  |  |  |  |  |  |   66|   378k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   378k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   378k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   378k|{ \
  |  |  |  |  |  |  |  |  128|   589k|    do { \
  |  |  |  |  |  |  |  |  129|   589k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 73.6k, False: 516k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  73.6k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  73.6k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  73.6k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  73.6k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  73.6k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  73.6k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  73.6k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  73.6k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 66.9k, False: 6.71k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  66.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 65.4k, False: 1.47k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  65.4k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  65.4k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  65.4k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  65.4k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.47k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.47k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.47k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.47k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  66.9k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  6.71k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  6.71k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  6.71k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  6.71k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  73.6k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  73.6k|        } \
  |  |  |  |  |  |  |  |  132|   589k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   589k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   589k|        ct--; \
  |  |  |  |  |  |  |  |  135|   589k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 211k, False: 378k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   378k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  1.01M|    } else {  \
  |  |  |  |  |  |  149|  1.01M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  1.01M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 402k, False: 614k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   402k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   402k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   402k|{ \
  |  |  |  |  |  |  |  |   45|   402k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 71.3k, False: 331k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  71.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  71.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   331k|    } else { \
  |  |  |  |  |  |  |  |   49|   331k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   331k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   331k|    } \
  |  |  |  |  |  |  |  |   52|   402k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   402k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   402k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   402k|{ \
  |  |  |  |  |  |  |  |  128|   433k|    do { \
  |  |  |  |  |  |  |  |  129|   433k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 53.8k, False: 379k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  53.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  53.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  53.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  53.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  53.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  53.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  53.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  53.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 49.2k, False: 4.61k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  49.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 46.8k, False: 2.41k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  46.8k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  46.8k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  46.8k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  46.8k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.41k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.41k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.41k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.41k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  49.2k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.61k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.61k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.61k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.61k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  53.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  53.8k|        } \
  |  |  |  |  |  |  |  |  132|   433k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   433k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   433k|        ct--; \
  |  |  |  |  |  |  |  |  135|   433k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 31.0k, False: 402k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   402k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   614k|        } else { \
  |  |  |  |  |  |  154|   614k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   614k|        } \
  |  |  |  |  |  |  156|  1.01M|    } \
  |  |  |  |  |  |  157|  1.39M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  1.39M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  1.39M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 677k, False: 718k]
  |  |  |  |  ------------------
  |  |  |  | 1137|  1.39M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.39M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.39M|{ \
  |  |  |  |  |  |  323|  1.39M|    /* east */ \
  |  |  |  |  |  |  324|  1.39M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.39M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.39M| \
  |  |  |  |  |  |  326|  1.39M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.39M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.39M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.39M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.39M| \
  |  |  |  |  |  |  329|  1.39M|    /* west */ \
  |  |  |  |  |  |  330|  1.39M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.39M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.39M| \
  |  |  |  |  |  |  332|  1.39M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.39M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.39M| \
  |  |  |  |  |  |  340|  1.39M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.39M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.39M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  1.39M|            } \
  |  |  |  | 1139|  1.39M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  3.07M|    } \
  |  |  |  | 1141|  13.6M|}
  |  |  ------------------
  |  | 1310|  13.6M|                                    flags, flagsp, flags_stride, data, \
  |  | 1311|  13.6M|                                    l_w, 0, mqc, curctx, \
  |  | 1312|  13.6M|                                    v, a, c, ct, oneplushalf, vsc); \
  |  | 1313|  13.6M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  13.6M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  13.6M|{ \
  |  |  |  | 1120|  13.6M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  13.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  13.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  13.6M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  13.6M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 3.06M, False: 10.6M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  3.06M|        do { \
  |  |  |  | 1122|  3.06M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  3.06M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  3.06M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.06M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  3.06M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.06M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.06M|{ \
  |  |  |  |  |  |  140|  3.06M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.06M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.06M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.06M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.06M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.06M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 695k, False: 2.36M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   695k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   695k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   695k|{ \
  |  |  |  |  |  |  |  |   57|   695k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 156k, False: 539k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   156k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   156k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   156k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   539k|    } else { \
  |  |  |  |  |  |  |  |   62|   539k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   539k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   539k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   539k|    } \
  |  |  |  |  |  |  |  |   66|   695k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   695k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   695k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   695k|{ \
  |  |  |  |  |  |  |  |  128|  1.13M|    do { \
  |  |  |  |  |  |  |  |  129|  1.13M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 142k, False: 991k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   142k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   142k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   142k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   142k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   142k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   142k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   142k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   142k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 129k, False: 12.9k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   129k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 123k, False: 6.45k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   123k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   123k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   123k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   123k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  6.45k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  6.45k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  6.45k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  6.45k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   129k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  12.9k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  12.9k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  12.9k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  12.9k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   142k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   142k|        } \
  |  |  |  |  |  |  |  |  132|  1.13M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.13M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.13M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.13M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 437k, False: 695k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   695k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.36M|    } else {  \
  |  |  |  |  |  |  149|  2.36M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.36M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 745k, False: 1.62M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   745k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   745k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   745k|{ \
  |  |  |  |  |  |  |  |   45|   745k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 124k, False: 621k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   124k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   124k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   621k|    } else { \
  |  |  |  |  |  |  |  |   49|   621k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   621k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   621k|    } \
  |  |  |  |  |  |  |  |   52|   745k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   745k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   745k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   745k|{ \
  |  |  |  |  |  |  |  |  128|   800k|    do { \
  |  |  |  |  |  |  |  |  129|   800k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 96.7k, False: 703k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  96.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  96.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  96.7k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  96.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  96.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  96.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  96.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  96.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 88.1k, False: 8.58k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  88.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 85.3k, False: 2.79k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  85.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  85.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  85.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  85.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.79k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.79k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.79k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.79k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  88.1k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.58k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.58k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.58k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.58k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  96.7k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  96.7k|        } \
  |  |  |  |  |  |  |  |  132|   800k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   800k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   800k|        ct--; \
  |  |  |  |  |  |  |  |  135|   800k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 54.5k, False: 745k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   745k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.62M|        } else { \
  |  |  |  |  |  |  154|  1.62M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.62M|        } \
  |  |  |  |  |  |  156|  2.36M|    } \
  |  |  |  |  |  |  157|  3.06M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.06M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 1.71M, False: 1.34M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.06M|                    break; \
  |  |  |  | 1128|  3.06M|            } \
  |  |  |  | 1129|  3.06M|            { \
  |  |  |  | 1130|  1.34M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  1.34M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  1.34M|                                    ci); \
  |  |  |  | 1133|  1.34M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.34M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  1.34M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.34M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.34M|{ \
  |  |  |  |  |  |  140|  1.34M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.34M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.34M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.34M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.34M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.34M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 388k, False: 961k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   388k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   388k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   388k|{ \
  |  |  |  |  |  |  |  |   57|   388k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 90.2k, False: 298k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  90.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  90.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  90.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   298k|    } else { \
  |  |  |  |  |  |  |  |   62|   298k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   298k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   298k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   298k|    } \
  |  |  |  |  |  |  |  |   66|   388k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   388k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   388k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   388k|{ \
  |  |  |  |  |  |  |  |  128|   603k|    do { \
  |  |  |  |  |  |  |  |  129|   603k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 77.6k, False: 526k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  77.6k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  77.6k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  77.6k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  77.6k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  77.6k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  77.6k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  77.6k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  77.6k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 70.2k, False: 7.34k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  70.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 67.7k, False: 2.52k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  67.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  67.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  67.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  67.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.52k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.52k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.52k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.52k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  70.2k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  7.34k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  7.34k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  7.34k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  7.34k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  77.6k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  77.6k|        } \
  |  |  |  |  |  |  |  |  132|   603k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   603k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   603k|        ct--; \
  |  |  |  |  |  |  |  |  135|   603k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 215k, False: 388k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   388k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   961k|    } else {  \
  |  |  |  |  |  |  149|   961k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   961k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 389k, False: 572k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   389k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   389k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   389k|{ \
  |  |  |  |  |  |  |  |   45|   389k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 68.8k, False: 320k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  68.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  68.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   320k|    } else { \
  |  |  |  |  |  |  |  |   49|   320k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   320k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   320k|    } \
  |  |  |  |  |  |  |  |   52|   389k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   389k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   389k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   389k|{ \
  |  |  |  |  |  |  |  |  128|   420k|    do { \
  |  |  |  |  |  |  |  |  129|   420k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 50.6k, False: 369k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  50.6k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  50.6k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  50.6k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  50.6k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  50.6k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  50.6k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  50.6k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  50.6k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 47.3k, False: 3.30k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  47.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 45.6k, False: 1.71k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  45.6k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  45.6k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  45.6k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  45.6k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.71k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.71k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.71k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.71k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  47.3k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.30k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.30k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.30k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.30k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  50.6k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  50.6k|        } \
  |  |  |  |  |  |  |  |  132|   420k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   420k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   420k|        ct--; \
  |  |  |  |  |  |  |  |  135|   420k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 30.9k, False: 389k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   389k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   572k|        } else { \
  |  |  |  |  |  |  154|   572k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   572k|        } \
  |  |  |  |  |  |  156|   961k|    } \
  |  |  |  |  |  |  157|  1.34M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  1.34M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  1.34M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 673k, False: 676k]
  |  |  |  |  ------------------
  |  |  |  | 1137|  1.34M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.34M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.34M|{ \
  |  |  |  |  |  |  323|  1.34M|    /* east */ \
  |  |  |  |  |  |  324|  1.34M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.34M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.34M| \
  |  |  |  |  |  |  326|  1.34M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.34M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.34M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.34M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.34M| \
  |  |  |  |  |  |  329|  1.34M|    /* west */ \
  |  |  |  |  |  |  330|  1.34M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.34M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.34M| \
  |  |  |  |  |  |  332|  1.34M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.34M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.34M| \
  |  |  |  |  |  |  340|  1.34M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.34M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.34M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  1.34M|            } \
  |  |  |  | 1139|  1.34M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  3.06M|    } \
  |  |  |  | 1141|  13.6M|}
  |  |  ------------------
  |  | 1314|  13.6M|                                    flags, flagsp, flags_stride, data, \
  |  | 1315|  13.6M|                                    l_w, 1, mqc, curctx, \
  |  | 1316|  13.6M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1317|  13.6M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  13.6M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  13.6M|{ \
  |  |  |  | 1120|  13.6M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  13.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  13.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  13.6M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  13.6M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 3.10M, False: 10.5M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  3.10M|        do { \
  |  |  |  | 1122|  3.10M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  3.10M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  3.10M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.10M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  3.10M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.10M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.10M|{ \
  |  |  |  |  |  |  140|  3.10M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.10M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.10M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.10M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.10M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.10M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 697k, False: 2.40M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   697k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   697k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   697k|{ \
  |  |  |  |  |  |  |  |   57|   697k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 152k, False: 545k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   152k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   152k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   152k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   545k|    } else { \
  |  |  |  |  |  |  |  |   62|   545k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   545k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   545k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   545k|    } \
  |  |  |  |  |  |  |  |   66|   697k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   697k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   697k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   697k|{ \
  |  |  |  |  |  |  |  |  128|  1.14M|    do { \
  |  |  |  |  |  |  |  |  129|  1.14M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 143k, False: 1.00M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   143k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   143k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   143k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   143k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   143k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   143k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   143k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   143k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 131k, False: 11.6k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   131k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 127k, False: 3.90k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   127k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   127k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   127k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   127k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.90k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.90k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.90k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.90k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   131k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  11.6k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  11.6k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  11.6k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  11.6k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   143k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   143k|        } \
  |  |  |  |  |  |  |  |  132|  1.14M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.14M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.14M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.14M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 447k, False: 697k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   697k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.40M|    } else {  \
  |  |  |  |  |  |  149|  2.40M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.40M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 739k, False: 1.66M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   739k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   739k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   739k|{ \
  |  |  |  |  |  |  |  |   45|   739k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 118k, False: 620k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   118k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   118k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   620k|    } else { \
  |  |  |  |  |  |  |  |   49|   620k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   620k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   620k|    } \
  |  |  |  |  |  |  |  |   52|   739k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   739k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   739k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   739k|{ \
  |  |  |  |  |  |  |  |  128|   795k|    do { \
  |  |  |  |  |  |  |  |  129|   795k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 98.9k, False: 696k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  98.9k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  98.9k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  98.9k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  98.9k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  98.9k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  98.9k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  98.9k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  98.9k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 90.7k, False: 8.18k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  90.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 87.7k, False: 3.02k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  87.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  87.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  87.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  87.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.02k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.02k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.02k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.02k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  90.7k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  8.18k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  8.18k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  8.18k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  8.18k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  98.9k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  98.9k|        } \
  |  |  |  |  |  |  |  |  132|   795k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   795k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   795k|        ct--; \
  |  |  |  |  |  |  |  |  135|   795k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 55.9k, False: 739k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   739k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.66M|        } else { \
  |  |  |  |  |  |  154|  1.66M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.66M|        } \
  |  |  |  |  |  |  156|  2.40M|    } \
  |  |  |  |  |  |  157|  3.10M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.10M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 1.71M, False: 1.38M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.10M|                    break; \
  |  |  |  | 1128|  3.10M|            } \
  |  |  |  | 1129|  3.10M|            { \
  |  |  |  | 1130|  1.38M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  1.38M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  1.38M|                                    ci); \
  |  |  |  | 1133|  1.38M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.38M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  1.38M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.38M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.38M|{ \
  |  |  |  |  |  |  140|  1.38M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.38M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.38M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.38M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.38M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.38M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 382k, False: 1.00M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   382k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   382k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   382k|{ \
  |  |  |  |  |  |  |  |   57|   382k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 92.9k, False: 289k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  92.9k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  92.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  92.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   289k|    } else { \
  |  |  |  |  |  |  |  |   62|   289k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   289k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   289k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   289k|    } \
  |  |  |  |  |  |  |  |   66|   382k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   382k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   382k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   382k|{ \
  |  |  |  |  |  |  |  |  128|   587k|    do { \
  |  |  |  |  |  |  |  |  129|   587k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 76.9k, False: 510k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  76.9k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  76.9k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  76.9k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  76.9k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  76.9k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  76.9k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  76.9k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  76.9k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 70.8k, False: 6.16k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  70.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 69.2k, False: 1.57k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  69.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  69.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  69.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  69.2k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.57k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.57k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.57k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.57k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  70.8k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  6.16k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  6.16k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  6.16k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  6.16k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  76.9k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  76.9k|        } \
  |  |  |  |  |  |  |  |  132|   587k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   587k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   587k|        ct--; \
  |  |  |  |  |  |  |  |  135|   587k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 204k, False: 382k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   382k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  1.00M|    } else {  \
  |  |  |  |  |  |  149|  1.00M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  1.00M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 398k, False: 609k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   398k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   398k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   398k|{ \
  |  |  |  |  |  |  |  |   45|   398k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 72.0k, False: 326k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  72.0k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  72.0k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   326k|    } else { \
  |  |  |  |  |  |  |  |   49|   326k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   326k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   326k|    } \
  |  |  |  |  |  |  |  |   52|   398k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   398k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   398k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   398k|{ \
  |  |  |  |  |  |  |  |  128|   428k|    do { \
  |  |  |  |  |  |  |  |  129|   428k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 57.4k, False: 371k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  57.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  57.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  57.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  57.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  57.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  57.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  57.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  57.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 52.4k, False: 4.98k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  52.4k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 49.1k, False: 3.23k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  49.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  49.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  49.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  49.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.23k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.23k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.23k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.23k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  52.4k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.98k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.98k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.98k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.98k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  57.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  57.4k|        } \
  |  |  |  |  |  |  |  |  132|   428k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   428k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   428k|        ct--; \
  |  |  |  |  |  |  |  |  135|   428k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 30.5k, False: 398k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   398k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   609k|        } else { \
  |  |  |  |  |  |  154|   609k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   609k|        } \
  |  |  |  |  |  |  156|  1.00M|    } \
  |  |  |  |  |  |  157|  1.38M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  1.38M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  1.38M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 691k, False: 698k]
  |  |  |  |  ------------------
  |  |  |  | 1137|  1.38M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.38M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.38M|{ \
  |  |  |  |  |  |  323|  1.38M|    /* east */ \
  |  |  |  |  |  |  324|  1.38M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.38M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.38M| \
  |  |  |  |  |  |  326|  1.38M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.38M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.38M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.38M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.38M| \
  |  |  |  |  |  |  329|  1.38M|    /* west */ \
  |  |  |  |  |  |  330|  1.38M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.38M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.38M| \
  |  |  |  |  |  |  332|  1.38M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.38M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.38M| \
  |  |  |  |  |  |  340|  1.38M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.38M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.38M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  1.38M|            } \
  |  |  |  | 1139|  1.38M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  3.10M|    } \
  |  |  |  | 1141|  13.6M|}
  |  |  ------------------
  |  | 1318|  13.6M|                                    flags, flagsp, flags_stride, data, \
  |  | 1319|  13.6M|                                    l_w, 2, mqc, curctx, \
  |  | 1320|  13.6M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1321|  13.6M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  13.6M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  13.6M|{ \
  |  |  |  | 1120|  13.6M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  13.6M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  13.6M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  13.6M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  13.6M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 3.20M, False: 10.4M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  3.20M|        do { \
  |  |  |  | 1122|  3.20M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  3.20M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  3.20M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.20M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  3.20M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.20M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.20M|{ \
  |  |  |  |  |  |  140|  3.20M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.20M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.20M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.20M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.20M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.20M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 655k, False: 2.55M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   655k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   655k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   655k|{ \
  |  |  |  |  |  |  |  |   57|   655k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 130k, False: 525k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   130k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   130k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   130k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   525k|    } else { \
  |  |  |  |  |  |  |  |   62|   525k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   525k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   525k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   525k|    } \
  |  |  |  |  |  |  |  |   66|   655k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   655k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   655k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   655k|{ \
  |  |  |  |  |  |  |  |  128|  1.12M|    do { \
  |  |  |  |  |  |  |  |  129|  1.12M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 136k, False: 984k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   136k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   136k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   136k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   136k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   136k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   136k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   136k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   136k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 125k, False: 10.3k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   125k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 122k, False: 3.84k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   122k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   122k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   122k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   122k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.84k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.84k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.84k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.84k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   125k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  10.3k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  10.3k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  10.3k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  10.3k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   136k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   136k|        } \
  |  |  |  |  |  |  |  |  132|  1.12M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.12M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.12M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.12M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 464k, False: 655k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   655k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.55M|    } else {  \
  |  |  |  |  |  |  149|  2.55M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.55M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 701k, False: 1.85M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   701k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   701k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   701k|{ \
  |  |  |  |  |  |  |  |   45|   701k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 102k, False: 599k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   102k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   102k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   599k|    } else { \
  |  |  |  |  |  |  |  |   49|   599k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   599k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   599k|    } \
  |  |  |  |  |  |  |  |   52|   701k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   701k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   701k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   701k|{ \
  |  |  |  |  |  |  |  |  128|   750k|    do { \
  |  |  |  |  |  |  |  |  129|   750k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 94.0k, False: 656k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  94.0k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  94.0k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  94.0k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  94.0k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  94.0k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  94.0k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  94.0k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  94.0k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 86.1k, False: 7.82k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  86.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 82.2k, False: 3.89k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  82.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  82.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  82.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  82.2k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.89k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.89k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.89k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.89k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  86.1k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  7.82k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  7.82k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  7.82k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  7.82k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  94.0k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  94.0k|        } \
  |  |  |  |  |  |  |  |  132|   750k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   750k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   750k|        ct--; \
  |  |  |  |  |  |  |  |  135|   750k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 48.9k, False: 701k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   701k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.85M|        } else { \
  |  |  |  |  |  |  154|  1.85M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.85M|        } \
  |  |  |  |  |  |  156|  2.55M|    } \
  |  |  |  |  |  |  157|  3.20M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.20M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 1.89M, False: 1.31M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.20M|                    break; \
  |  |  |  | 1128|  3.20M|            } \
  |  |  |  | 1129|  3.20M|            { \
  |  |  |  | 1130|  1.31M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  1.31M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  1.31M|                                    ci); \
  |  |  |  | 1133|  1.31M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.31M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  1.31M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.31M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.31M|{ \
  |  |  |  |  |  |  140|  1.31M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.31M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.31M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.31M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.31M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.31M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 370k, False: 946k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   370k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   370k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   370k|{ \
  |  |  |  |  |  |  |  |   57|   370k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 85.9k, False: 284k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  85.9k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  85.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  85.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   284k|    } else { \
  |  |  |  |  |  |  |  |   62|   284k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   284k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   284k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   284k|    } \
  |  |  |  |  |  |  |  |   66|   370k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   370k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   370k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   370k|{ \
  |  |  |  |  |  |  |  |  128|   577k|    do { \
  |  |  |  |  |  |  |  |  129|   577k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 70.9k, False: 506k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  70.9k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  70.9k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  70.9k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  70.9k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  70.9k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  70.9k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  70.9k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  70.9k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 65.7k, False: 5.20k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  65.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 62.4k, False: 3.28k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  62.4k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  62.4k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  62.4k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  62.4k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.28k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.28k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.28k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.28k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  65.7k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.20k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.20k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.20k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.20k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  70.9k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  70.9k|        } \
  |  |  |  |  |  |  |  |  132|   577k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   577k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   577k|        ct--; \
  |  |  |  |  |  |  |  |  135|   577k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 207k, False: 370k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   370k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   946k|    } else {  \
  |  |  |  |  |  |  149|   946k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   946k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 383k, False: 562k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   383k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   383k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   383k|{ \
  |  |  |  |  |  |  |  |   45|   383k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 71.5k, False: 311k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  71.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  71.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   311k|    } else { \
  |  |  |  |  |  |  |  |   49|   311k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   311k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   311k|    } \
  |  |  |  |  |  |  |  |   52|   383k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   383k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   383k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   383k|{ \
  |  |  |  |  |  |  |  |  128|   413k|    do { \
  |  |  |  |  |  |  |  |  129|   413k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 57.4k, False: 355k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  57.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  57.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  57.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  57.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  57.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  57.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  57.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  57.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 53.1k, False: 4.24k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  53.1k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 49.6k, False: 3.55k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  49.6k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  49.6k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  49.6k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  49.6k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.55k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.55k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.55k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.55k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  53.1k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  4.24k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  4.24k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  4.24k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  4.24k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  57.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  57.4k|        } \
  |  |  |  |  |  |  |  |  132|   413k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   413k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   413k|        ct--; \
  |  |  |  |  |  |  |  |  135|   413k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 29.8k, False: 383k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   383k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   562k|        } else { \
  |  |  |  |  |  |  154|   562k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   562k|        } \
  |  |  |  |  |  |  156|   946k|    } \
  |  |  |  |  |  |  157|  1.31M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  1.31M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  1.31M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 642k, False: 674k]
  |  |  |  |  ------------------
  |  |  |  | 1137|  1.31M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.31M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.31M|{ \
  |  |  |  |  |  |  323|  1.31M|    /* east */ \
  |  |  |  |  |  |  324|  1.31M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.31M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.31M| \
  |  |  |  |  |  |  326|  1.31M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.31M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.31M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.31M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.31M| \
  |  |  |  |  |  |  329|  1.31M|    /* west */ \
  |  |  |  |  |  |  330|  1.31M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.31M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.31M| \
  |  |  |  |  |  |  332|  1.31M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.31M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.31M| \
  |  |  |  |  |  |  340|  1.31M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.31M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  1.31M|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|  1.31M|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  1.31M|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  1.31M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  1.31M|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  1.31M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  1.31M|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  1.31M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|  1.31M|    } \
  |  |  |  |  |  |  347|  1.31M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  1.31M|            } \
  |  |  |  | 1139|  1.31M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  3.20M|    } \
  |  |  |  | 1141|  13.6M|}
  |  |  ------------------
  |  | 1322|  13.6M|                                    flags, flagsp, flags_stride, data, \
  |  | 1323|  13.6M|                                    l_w, 3, mqc, curctx, \
  |  | 1324|  13.6M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1325|  13.6M|            } \
  |  | 1326|  21.8M|            *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  115|  14.0M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  119|  14.0M|#define T1_PI_1     (1U << 24)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  122|  14.0M|#define T1_PI_2     (1U << 27)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  125|  14.0M|#define T1_PI_3     (1U << 30)
  |  |  ------------------
  |  | 1327|  14.0M|        } \
  |  | 1328|  1.75M|    } \
  |  | 1329|   180k|    UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|   180k|        mqc->curctx = curctx; \
  |  |  |  |  167|   180k|        mqc->c = c; \
  |  |  |  |  168|   180k|        mqc->a = a; \
  |  |  |  |  169|   180k|        mqc->ct = ct;
  |  |  ------------------
  |  | 1330|   180k|    if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (1330:9): [True: 81.3k, False: 99.2k]
  |  |  ------------------
  |  | 1331|  1.32M|        for (i = 0; i < l_w; ++i, ++flagsp, ++data) { \
  |  |  ------------------
  |  |  |  Branch (1331:21): [True: 1.24M, False: 81.3k]
  |  |  ------------------
  |  | 1332|  3.68M|            for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (1332:25): [True: 2.43M, False: 1.24M]
  |  |  ------------------
  |  | 1333|  2.43M|                opj_t1_dec_clnpass_step(t1, flagsp, data + j * l_w, oneplushalf, j, vsc); \
  |  | 1334|  2.43M|            } \
  |  | 1335|  1.24M|            *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  115|  1.24M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  119|  1.24M|#define T1_PI_1     (1U << 24)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  122|  1.24M|#define T1_PI_2     (1U << 27)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  125|  1.24M|#define T1_PI_3     (1U << 30)
  |  |  ------------------
  |  | 1336|  1.24M|        } \
  |  | 1337|  81.3k|    } \
  |  | 1338|   180k|}
  ------------------
 1388|   180k|                                t1->w + 2U);
 1389|   180k|}
t1.c:opj_t1_dec_clnpass_generic_novsc:
 1378|   182k|{
 1379|   182k|    opj_t1_dec_clnpass_internal(t1, bpno, OPJ_FALSE, t1->w, t1->h,
  ------------------
  |  | 1251|   182k|#define opj_t1_dec_clnpass_internal(t1, bpno, vsc, w, h, flags_stride) \
  |  | 1252|   182k|{ \
  |  | 1253|   182k|    OPJ_INT32 one, half, oneplushalf; \
  |  | 1254|   182k|    OPJ_UINT32 runlen; \
  |  | 1255|   182k|    OPJ_UINT32 i, j, k; \
  |  | 1256|   182k|    const OPJ_UINT32 l_w = w; \
  |  | 1257|   182k|    opj_mqc_t* mqc = &(t1->mqc); \
  |  | 1258|   182k|    register OPJ_INT32 *data = t1->data; \
  |  | 1259|   182k|    register opj_flag_t *flagsp = &t1->flags[flags_stride + 1]; \
  |  | 1260|   182k|    DOWNLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  160|   182k|        register const opj_mqc_state_t **curctx = mqc->curctx; \
  |  |  |  |  161|   182k|        register OPJ_UINT32 c = mqc->c; \
  |  |  |  |  162|   182k|        register OPJ_UINT32 a = mqc->a; \
  |  |  |  |  163|   182k|        register OPJ_UINT32 ct = mqc->ct
  |  |  ------------------
  |  | 1261|   182k|    register OPJ_UINT32 v; \
  |  | 1262|   182k|    one = 1 << bpno; \
  |  | 1263|   182k|    half = one >> 1; \
  |  | 1264|   182k|    oneplushalf = one | half; \
  |  | 1265|  2.06M|    for (k = 0; k < (h & ~3u); k += 4, data += 3*l_w, flagsp += 2) { \
  |  |  ------------------
  |  |  |  Branch (1265:17): [True: 1.88M, False: 182k]
  |  |  ------------------
  |  | 1266|  27.1M|        for (i = 0; i < l_w; ++i, ++data, ++flagsp) { \
  |  |  ------------------
  |  |  |  Branch (1266:21): [True: 25.2M, False: 1.88M]
  |  |  ------------------
  |  | 1267|  25.2M|            opj_flag_t flags = *flagsp; \
  |  | 1268|  25.2M|            if (flags == 0) { \
  |  |  ------------------
  |  |  |  Branch (1268:17): [True: 10.3M, False: 14.9M]
  |  |  ------------------
  |  | 1269|  10.3M|                OPJ_UINT32 partial = OPJ_TRUE; \
  |  |  ------------------
  |  |  |  |  117|  10.3M|#define OPJ_TRUE 1
  |  |  ------------------
  |  | 1270|  10.3M|                opj_t1_setcurctx(curctx, T1_CTXNO_AGG); \
  |  |  ------------------
  |  |  |  |   62|  10.3M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1271|  10.3M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|  10.3M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|  10.3M|{ \
  |  |  |  |  140|  10.3M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|  10.3M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|  10.3M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|  10.3M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|  10.3M|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|  10.3M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 307k, False: 10.0M]
  |  |  |  |  ------------------
  |  |  |  |  146|   307k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   307k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   307k|{ \
  |  |  |  |  |  |   57|   307k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 28.5k, False: 278k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  28.5k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  28.5k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  28.5k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   278k|    } else { \
  |  |  |  |  |  |   62|   278k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   278k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   278k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   278k|    } \
  |  |  |  |  |  |   66|   307k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   307k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   307k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   307k|{ \
  |  |  |  |  |  |  128|   794k|    do { \
  |  |  |  |  |  |  129|   794k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 102k, False: 692k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|   102k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|   102k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|   102k|{ \
  |  |  |  |  |  |  |  |  104|   102k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|   102k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|   102k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|   102k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|   102k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 68.3k, False: 34.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  68.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 59.0k, False: 9.30k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  59.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  59.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  59.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  59.0k|            } else { \
  |  |  |  |  |  |  |  |  114|  9.30k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  9.30k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  9.30k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  9.30k|            } \
  |  |  |  |  |  |  |  |  118|  68.3k|        } else { \
  |  |  |  |  |  |  |  |  119|  34.5k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  34.5k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  34.5k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  34.5k|        } \
  |  |  |  |  |  |  |  |  123|   102k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|   102k|        } \
  |  |  |  |  |  |  132|   794k|        a <<= 1; \
  |  |  |  |  |  |  133|   794k|        c <<= 1; \
  |  |  |  |  |  |  134|   794k|        ct--; \
  |  |  |  |  |  |  135|   794k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 487k, False: 307k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   307k|}
  |  |  |  |  ------------------
  |  |  |  |  148|  10.0M|    } else {  \
  |  |  |  |  149|  10.0M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|  10.0M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 447k, False: 9.57M]
  |  |  |  |  ------------------
  |  |  |  |  151|   447k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   447k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   447k|{ \
  |  |  |  |  |  |   45|   447k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 22.2k, False: 425k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  22.2k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  22.2k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   425k|    } else { \
  |  |  |  |  |  |   49|   425k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   425k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   425k|    } \
  |  |  |  |  |  |   52|   447k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   447k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   447k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   447k|{ \
  |  |  |  |  |  |  128|   457k|    do { \
  |  |  |  |  |  |  129|   457k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 75.4k, False: 381k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  75.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  75.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  75.4k|{ \
  |  |  |  |  |  |  |  |  104|  75.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  75.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  75.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  75.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  75.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 48.9k, False: 26.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  48.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 46.3k, False: 2.59k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  46.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  46.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  46.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  46.3k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.59k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.59k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.59k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.59k|            } \
  |  |  |  |  |  |  |  |  118|  48.9k|        } else { \
  |  |  |  |  |  |  |  |  119|  26.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  26.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  26.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  26.4k|        } \
  |  |  |  |  |  |  |  |  123|  75.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  75.4k|        } \
  |  |  |  |  |  |  132|   457k|        a <<= 1; \
  |  |  |  |  |  |  133|   457k|        c <<= 1; \
  |  |  |  |  |  |  134|   457k|        ct--; \
  |  |  |  |  |  |  135|   457k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 9.57k, False: 447k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   447k|}
  |  |  |  |  ------------------
  |  |  |  |  153|  9.57M|        } else { \
  |  |  |  |  154|  9.57M|            d = (*curctx)->mps; \
  |  |  |  |  155|  9.57M|        } \
  |  |  |  |  156|  10.0M|    } \
  |  |  |  |  157|  10.3M|}
  |  |  ------------------
  |  | 1272|  10.3M|                if (!v) { \
  |  |  ------------------
  |  |  |  Branch (1272:21): [True: 10.0M, False: 320k]
  |  |  ------------------
  |  | 1273|  10.0M|                    continue; \
  |  | 1274|  10.0M|                } \
  |  | 1275|  10.3M|                opj_t1_setcurctx(curctx, T1_CTXNO_UNI); \
  |  |  ------------------
  |  |  |  |   62|   320k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  ------------------
  |  | 1276|   320k|                opj_mqc_decode_macro(runlen, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   320k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   320k|{ \
  |  |  |  |  140|   320k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   320k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   320k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   320k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   320k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   320k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 166k, False: 153k]
  |  |  |  |  ------------------
  |  |  |  |  146|   166k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   166k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   166k|{ \
  |  |  |  |  |  |   57|   166k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 100k, False: 66.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|   100k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|   100k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|   100k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   100k|    } else { \
  |  |  |  |  |  |   62|  66.6k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|  66.6k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|  66.6k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|  66.6k|    } \
  |  |  |  |  |  |   66|   166k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   166k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   166k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   166k|{ \
  |  |  |  |  |  |  128|   166k|    do { \
  |  |  |  |  |  |  129|   166k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 20.2k, False: 146k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  20.2k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  20.2k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  20.2k|{ \
  |  |  |  |  |  |  |  |  104|  20.2k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  20.2k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  20.2k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  20.2k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  20.2k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 15.4k, False: 4.79k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  15.4k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 14.0k, False: 1.37k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  14.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  14.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  14.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  14.0k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.37k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.37k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.37k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.37k|            } \
  |  |  |  |  |  |  |  |  118|  15.4k|        } else { \
  |  |  |  |  |  |  |  |  119|  4.79k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  4.79k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  4.79k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  4.79k|        } \
  |  |  |  |  |  |  |  |  123|  20.2k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  20.2k|        } \
  |  |  |  |  |  |  132|   166k|        a <<= 1; \
  |  |  |  |  |  |  133|   166k|        c <<= 1; \
  |  |  |  |  |  |  134|   166k|        ct--; \
  |  |  |  |  |  |  135|   166k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 166k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   166k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   166k|    } else {  \
  |  |  |  |  149|   153k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   153k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 129k, False: 24.0k]
  |  |  |  |  ------------------
  |  |  |  |  151|   129k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   129k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   129k|{ \
  |  |  |  |  |  |   45|   129k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 66.8k, False: 63.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  66.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  66.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|  66.8k|    } else { \
  |  |  |  |  |  |   49|  63.0k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|  63.0k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|  63.0k|    } \
  |  |  |  |  |  |   52|   129k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   129k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   129k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   129k|{ \
  |  |  |  |  |  |  128|   161k|    do { \
  |  |  |  |  |  |  129|   161k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 19.4k, False: 142k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  19.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  19.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  19.4k|{ \
  |  |  |  |  |  |  |  |  104|  19.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  19.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  19.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  19.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  19.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 14.8k, False: 4.59k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  14.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 13.9k, False: 889]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  13.9k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  13.9k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  13.9k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  13.9k|            } else { \
  |  |  |  |  |  |  |  |  114|    889|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|    889|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|    889|                ct = 7; \
  |  |  |  |  |  |  |  |  117|    889|            } \
  |  |  |  |  |  |  |  |  118|  14.8k|        } else { \
  |  |  |  |  |  |  |  |  119|  4.59k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  4.59k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  4.59k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  4.59k|        } \
  |  |  |  |  |  |  |  |  123|  19.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  19.4k|        } \
  |  |  |  |  |  |  132|   161k|        a <<= 1; \
  |  |  |  |  |  |  133|   161k|        c <<= 1; \
  |  |  |  |  |  |  134|   161k|        ct--; \
  |  |  |  |  |  |  135|   161k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 32.1k, False: 129k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   129k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   129k|        } else { \
  |  |  |  |  154|  24.0k|            d = (*curctx)->mps; \
  |  |  |  |  155|  24.0k|        } \
  |  |  |  |  156|   153k|    } \
  |  |  |  |  157|   320k|}
  |  |  ------------------
  |  | 1277|   320k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  138|   320k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   320k|{ \
  |  |  |  |  140|   320k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   320k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   320k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   320k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   320k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   320k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 150k, False: 170k]
  |  |  |  |  ------------------
  |  |  |  |  146|   150k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   150k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   150k|{ \
  |  |  |  |  |  |   57|   150k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 32.4k, False: 117k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  32.4k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  32.4k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  32.4k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   117k|    } else { \
  |  |  |  |  |  |   62|   117k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   117k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   117k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   117k|    } \
  |  |  |  |  |  |   66|   150k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   150k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   150k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   150k|{ \
  |  |  |  |  |  |  128|   150k|    do { \
  |  |  |  |  |  |  129|   150k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 18.1k, False: 131k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  18.1k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  18.1k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  18.1k|{ \
  |  |  |  |  |  |  |  |  104|  18.1k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  18.1k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  18.1k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  18.1k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  18.1k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 13.3k, False: 4.86k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  13.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 12.3k, False: 1.02k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  12.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  12.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  12.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  12.3k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.02k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.02k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.02k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.02k|            } \
  |  |  |  |  |  |  |  |  118|  13.3k|        } else { \
  |  |  |  |  |  |  |  |  119|  4.86k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  4.86k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  4.86k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  4.86k|        } \
  |  |  |  |  |  |  |  |  123|  18.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  18.1k|        } \
  |  |  |  |  |  |  132|   150k|        a <<= 1; \
  |  |  |  |  |  |  133|   150k|        c <<= 1; \
  |  |  |  |  |  |  134|   150k|        ct--; \
  |  |  |  |  |  |  135|   150k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 150k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   150k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   170k|    } else {  \
  |  |  |  |  149|   170k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   170k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 145k, False: 24.9k]
  |  |  |  |  ------------------
  |  |  |  |  151|   145k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   145k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   145k|{ \
  |  |  |  |  |  |   45|   145k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 26.5k, False: 119k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  26.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  26.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   119k|    } else { \
  |  |  |  |  |  |   49|   119k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   119k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   119k|    } \
  |  |  |  |  |  |   52|   145k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   145k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   145k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   145k|{ \
  |  |  |  |  |  |  128|   162k|    do { \
  |  |  |  |  |  |  129|   162k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 21.0k, False: 141k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  21.0k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  21.0k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  21.0k|{ \
  |  |  |  |  |  |  |  |  104|  21.0k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  21.0k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  21.0k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  21.0k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  21.0k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 15.6k, False: 5.45k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  15.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 14.4k, False: 1.17k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  14.4k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  14.4k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  14.4k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  14.4k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.17k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.17k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.17k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.17k|            } \
  |  |  |  |  |  |  |  |  118|  15.6k|        } else { \
  |  |  |  |  |  |  |  |  119|  5.45k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  5.45k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  5.45k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  5.45k|        } \
  |  |  |  |  |  |  |  |  123|  21.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  21.0k|        } \
  |  |  |  |  |  |  132|   162k|        a <<= 1; \
  |  |  |  |  |  |  133|   162k|        c <<= 1; \
  |  |  |  |  |  |  134|   162k|        ct--; \
  |  |  |  |  |  |  135|   162k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 17.1k, False: 145k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   145k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   145k|        } else { \
  |  |  |  |  154|  24.9k|            d = (*curctx)->mps; \
  |  |  |  |  155|  24.9k|        } \
  |  |  |  |  156|   170k|    } \
  |  |  |  |  157|   320k|}
  |  |  ------------------
  |  | 1278|   320k|                runlen = (runlen << 1) | v; \
  |  | 1279|   320k|                switch(runlen) { \
  |  |  ------------------
  |  |  |  Branch (1279:24): [True: 0, False: 320k]
  |  |  ------------------
  |  | 1280|   105k|                    case 0: \
  |  |  ------------------
  |  |  |  Branch (1280:21): [True: 105k, False: 215k]
  |  |  ------------------
  |  | 1281|   105k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, OPJ_TRUE,\
  |  |  ------------------
  |  |  |  | 1118|   105k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   105k|{ \
  |  |  |  | 1120|   105k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   105k|        do { \
  |  |  |  | 1122|   105k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|      0|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|      0|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|      0|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|      0|{ \
  |  |  |  |  |  |  140|      0|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|      0|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|      0|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|      0|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|      0|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|      0|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|      0|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|      0|{ \
  |  |  |  |  |  |  |  |   57|      0|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|      0|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|      0|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|      0|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|      0|    } else { \
  |  |  |  |  |  |  |  |   62|      0|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|      0|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|      0|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|      0|    } \
  |  |  |  |  |  |  |  |   66|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|      0|{ \
  |  |  |  |  |  |  |  |  128|      0|    do { \
  |  |  |  |  |  |  |  |  129|      0|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|      0|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|      0|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|      0|{ \
  |  |  |  |  |  |  |  |  |  |  104|      0|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|      0|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|      0|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|      0|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|      0|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|      0|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|      0|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|      0|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|      0|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|      0|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|      0|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|      0|            } \
  |  |  |  |  |  |  |  |  |  |  118|      0|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|      0|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|      0|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|      0|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|      0|        } \
  |  |  |  |  |  |  |  |  |  |  123|      0|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|        } \
  |  |  |  |  |  |  |  |  132|      0|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|      0|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|      0|        ct--; \
  |  |  |  |  |  |  |  |  135|      0|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|    } else {  \
  |  |  |  |  |  |  149|      0|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|      0|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|      0|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|      0|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|      0|{ \
  |  |  |  |  |  |  |  |   45|      0|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|      0|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|      0|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|      0|    } else { \
  |  |  |  |  |  |  |  |   49|      0|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|      0|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|      0|    } \
  |  |  |  |  |  |  |  |   52|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|      0|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|      0|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|      0|{ \
  |  |  |  |  |  |  |  |  128|      0|    do { \
  |  |  |  |  |  |  |  |  129|      0|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|      0|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|      0|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|      0|{ \
  |  |  |  |  |  |  |  |  |  |  104|      0|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|      0|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|      0|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|      0|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|      0|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      0|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|      0|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|      0|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|      0|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|      0|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|      0|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|      0|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|      0|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|      0|            } \
  |  |  |  |  |  |  |  |  |  |  118|      0|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|      0|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|      0|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|      0|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|      0|        } \
  |  |  |  |  |  |  |  |  |  |  123|      0|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|      0|        } \
  |  |  |  |  |  |  |  |  132|      0|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|      0|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|      0|        ct--; \
  |  |  |  |  |  |  |  |  135|      0|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|      0|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|        } else { \
  |  |  |  |  |  |  154|      0|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|      0|        } \
  |  |  |  |  |  |  156|      0|    } \
  |  |  |  |  |  |  157|      0|}
  |  |  |  |  ------------------
  |  |  |  | 1126|      0|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1127|      0|                    break; \
  |  |  |  | 1128|      0|            } \
  |  |  |  | 1129|   105k|            { \
  |  |  |  | 1130|   105k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   105k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   105k|                                    ci); \
  |  |  |  | 1133|   105k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   105k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   105k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   105k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   105k|{ \
  |  |  |  |  |  |  140|   105k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   105k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   105k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   105k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   105k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   105k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 29.3k, False: 75.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  29.3k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  29.3k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  29.3k|{ \
  |  |  |  |  |  |  |  |   57|  29.3k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 1.52k, False: 27.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  1.52k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  1.52k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  1.52k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  27.7k|    } else { \
  |  |  |  |  |  |  |  |   62|  27.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  27.7k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  27.7k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  27.7k|    } \
  |  |  |  |  |  |  |  |   66|  29.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  29.3k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  29.3k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  29.3k|{ \
  |  |  |  |  |  |  |  |  128|  47.5k|    do { \
  |  |  |  |  |  |  |  |  129|  47.5k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 5.06k, False: 42.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  5.06k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  5.06k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  5.06k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  5.06k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  5.06k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  5.06k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  5.06k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  5.06k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 3.94k, False: 1.12k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  3.94k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.45k, False: 494]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.45k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.45k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.45k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.45k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    494|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    494|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    494|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    494|            } \
  |  |  |  |  |  |  |  |  |  |  118|  3.94k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.12k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.12k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.12k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.12k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  5.06k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  5.06k|        } \
  |  |  |  |  |  |  |  |  132|  47.5k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  47.5k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  47.5k|        ct--; \
  |  |  |  |  |  |  |  |  135|  47.5k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 18.2k, False: 29.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  29.3k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  75.7k|    } else {  \
  |  |  |  |  |  |  149|  75.7k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  75.7k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 37.9k, False: 37.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  37.9k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  37.9k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  37.9k|{ \
  |  |  |  |  |  |  |  |   45|  37.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 1.29k, False: 36.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  1.29k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  1.29k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  36.6k|    } else { \
  |  |  |  |  |  |  |  |   49|  36.6k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  36.6k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  36.6k|    } \
  |  |  |  |  |  |  |  |   52|  37.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  37.9k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  37.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  37.9k|{ \
  |  |  |  |  |  |  |  |  128|  38.2k|    do { \
  |  |  |  |  |  |  |  |  129|  38.2k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 4.74k, False: 33.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  4.74k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  4.74k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  4.74k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  4.74k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  4.74k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  4.74k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  4.74k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  4.74k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 3.76k, False: 983]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  3.76k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.12k, False: 638]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.12k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.12k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.12k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.12k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    638|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    638|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    638|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    638|            } \
  |  |  |  |  |  |  |  |  |  |  118|  3.76k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    983|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    983|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    983|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    983|        } \
  |  |  |  |  |  |  |  |  |  |  123|  4.74k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  4.74k|        } \
  |  |  |  |  |  |  |  |  132|  38.2k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  38.2k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  38.2k|        ct--; \
  |  |  |  |  |  |  |  |  135|  38.2k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 277, False: 37.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  37.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  37.9k|        } else { \
  |  |  |  |  |  |  154|  37.8k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  37.8k|        } \
  |  |  |  |  |  |  156|  75.7k|    } \
  |  |  |  |  |  |  157|   105k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   105k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   105k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 48.9k, False: 56.1k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   105k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   105k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   105k|{ \
  |  |  |  |  |  |  323|   105k|    /* east */ \
  |  |  |  |  |  |  324|   105k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   105k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   105k| \
  |  |  |  |  |  |  326|   105k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   105k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   105k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   105k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   105k| \
  |  |  |  |  |  |  329|   105k|    /* west */ \
  |  |  |  |  |  |  330|   105k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   105k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   105k| \
  |  |  |  |  |  |  332|   105k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   105k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|   105k|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|   105k|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|   105k|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|   105k|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|   105k|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|   105k|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|   105k|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|   105k|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|   105k|    } \
  |  |  |  |  |  |  339|   105k| \
  |  |  |  |  |  |  340|   105k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   105k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   105k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   105k|            } \
  |  |  |  | 1139|   105k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   105k|    } \
  |  |  |  | 1141|   105k|}
  |  |  ------------------
  |  | 1282|   105k|                                            flags, flagsp, flags_stride, data, \
  |  | 1283|   105k|                                            l_w, 0, mqc, curctx, \
  |  | 1284|   105k|                                            v, a, c, ct, oneplushalf, vsc); \
  |  | 1285|   105k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   105k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1286|   105k|                        /* FALLTHRU */ \
  |  | 1287|   187k|                    case 1: \
  |  |  ------------------
  |  |  |  Branch (1287:21): [True: 82.3k, False: 238k]
  |  |  ------------------
  |  | 1288|   187k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   187k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   187k|{ \
  |  |  |  | 1120|   187k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   187k|        do { \
  |  |  |  | 1122|   187k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 105k, False: 82.3k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   105k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   105k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   105k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   105k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   105k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   105k|{ \
  |  |  |  |  |  |  140|   105k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   105k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   105k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   105k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   105k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   105k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 28.5k, False: 76.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  28.5k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  28.5k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  28.5k|{ \
  |  |  |  |  |  |  |  |   57|  28.5k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 6.85k, False: 21.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  6.85k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  6.85k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  6.85k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  21.7k|    } else { \
  |  |  |  |  |  |  |  |   62|  21.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  21.7k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  21.7k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  21.7k|    } \
  |  |  |  |  |  |  |  |   66|  28.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  28.5k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  28.5k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  28.5k|{ \
  |  |  |  |  |  |  |  |  128|  43.9k|    do { \
  |  |  |  |  |  |  |  |  129|  43.9k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 5.42k, False: 38.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  5.42k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  5.42k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  5.42k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  5.42k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  5.42k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  5.42k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  5.42k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  5.42k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 3.83k, False: 1.59k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  3.83k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.41k, False: 419]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.41k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.41k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.41k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.41k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    419|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    419|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    419|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    419|            } \
  |  |  |  |  |  |  |  |  |  |  118|  3.83k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.59k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.59k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.59k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.59k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  5.42k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  5.42k|        } \
  |  |  |  |  |  |  |  |  132|  43.9k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  43.9k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  43.9k|        ct--; \
  |  |  |  |  |  |  |  |  135|  43.9k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 15.3k, False: 28.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  28.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  76.4k|    } else {  \
  |  |  |  |  |  |  149|  76.4k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  76.4k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 31.4k, False: 44.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  31.4k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  31.4k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  31.4k|{ \
  |  |  |  |  |  |  |  |   45|  31.4k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 4.46k, False: 26.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.46k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  4.46k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  26.9k|    } else { \
  |  |  |  |  |  |  |  |   49|  26.9k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  26.9k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  26.9k|    } \
  |  |  |  |  |  |  |  |   52|  31.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  31.4k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  31.4k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  31.4k|{ \
  |  |  |  |  |  |  |  |  128|  34.2k|    do { \
  |  |  |  |  |  |  |  |  129|  34.2k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 4.55k, False: 29.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  4.55k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  4.55k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  4.55k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  4.55k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  4.55k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  4.55k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  4.55k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  4.55k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 3.57k, False: 981]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  3.57k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.10k, False: 463]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.10k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.10k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.10k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.10k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    463|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    463|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    463|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    463|            } \
  |  |  |  |  |  |  |  |  |  |  118|  3.57k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|    981|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|    981|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|    981|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|    981|        } \
  |  |  |  |  |  |  |  |  |  |  123|  4.55k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  4.55k|        } \
  |  |  |  |  |  |  |  |  132|  34.2k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  34.2k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  34.2k|        ct--; \
  |  |  |  |  |  |  |  |  135|  34.2k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.78k, False: 31.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  31.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  44.9k|        } else { \
  |  |  |  |  |  |  154|  44.9k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  44.9k|        } \
  |  |  |  |  |  |  156|  76.4k|    } \
  |  |  |  |  |  |  157|   105k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   105k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 61.1k, False: 43.8k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   105k|                    break; \
  |  |  |  | 1128|   105k|            } \
  |  |  |  | 1129|   187k|            { \
  |  |  |  | 1130|   126k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   126k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   126k|                                    ci); \
  |  |  |  | 1133|   126k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   126k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   126k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   126k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   126k|{ \
  |  |  |  |  |  |  140|   126k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   126k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   126k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   126k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   126k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   126k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 40.8k, False: 85.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  40.8k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  40.8k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  40.8k|{ \
  |  |  |  |  |  |  |  |   57|  40.8k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 2.61k, False: 38.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  2.61k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  2.61k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  2.61k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  38.2k|    } else { \
  |  |  |  |  |  |  |  |   62|  38.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  38.2k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  38.2k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  38.2k|    } \
  |  |  |  |  |  |  |  |   66|  40.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  40.8k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  40.8k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  40.8k|{ \
  |  |  |  |  |  |  |  |  128|  62.9k|    do { \
  |  |  |  |  |  |  |  |  129|  62.9k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 8.60k, False: 54.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  8.60k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  8.60k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  8.60k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  8.60k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  8.60k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  8.60k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  8.60k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  8.60k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 6.60k, False: 1.99k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  6.60k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 5.95k, False: 654]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  5.95k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  5.95k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  5.95k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  5.95k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    654|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    654|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    654|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    654|            } \
  |  |  |  |  |  |  |  |  |  |  118|  6.60k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.99k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.99k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.99k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.99k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  8.60k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  8.60k|        } \
  |  |  |  |  |  |  |  |  132|  62.9k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  62.9k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  62.9k|        ct--; \
  |  |  |  |  |  |  |  |  135|  62.9k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 22.1k, False: 40.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  40.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  85.3k|    } else {  \
  |  |  |  |  |  |  149|  85.3k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  85.3k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 41.0k, False: 44.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  41.0k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  41.0k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  41.0k|{ \
  |  |  |  |  |  |  |  |   45|  41.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 2.52k, False: 38.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  2.52k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  2.52k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  38.5k|    } else { \
  |  |  |  |  |  |  |  |   49|  38.5k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  38.5k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  38.5k|    } \
  |  |  |  |  |  |  |  |   52|  41.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  41.0k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  41.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  41.0k|{ \
  |  |  |  |  |  |  |  |  128|  42.3k|    do { \
  |  |  |  |  |  |  |  |  129|  42.3k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 5.47k, False: 36.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  5.47k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  5.47k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  5.47k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  5.47k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  5.47k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  5.47k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  5.47k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  5.47k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 4.30k, False: 1.16k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  4.30k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.84k, False: 465]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.84k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.84k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.84k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.84k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    465|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    465|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    465|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    465|            } \
  |  |  |  |  |  |  |  |  |  |  118|  4.30k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.16k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.16k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.16k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.16k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  5.47k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  5.47k|        } \
  |  |  |  |  |  |  |  |  132|  42.3k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  42.3k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  42.3k|        ct--; \
  |  |  |  |  |  |  |  |  135|  42.3k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 1.23k, False: 41.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  41.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  44.3k|        } else { \
  |  |  |  |  |  |  154|  44.3k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  44.3k|        } \
  |  |  |  |  |  |  156|  85.3k|    } \
  |  |  |  |  |  |  157|   126k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   126k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   126k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 60.5k, False: 65.7k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   126k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   126k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   126k|{ \
  |  |  |  |  |  |  323|   126k|    /* east */ \
  |  |  |  |  |  |  324|   126k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   126k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   126k| \
  |  |  |  |  |  |  326|   126k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   126k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   126k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   126k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   126k| \
  |  |  |  |  |  |  329|   126k|    /* west */ \
  |  |  |  |  |  |  330|   126k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   126k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   126k| \
  |  |  |  |  |  |  332|   126k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   126k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   126k| \
  |  |  |  |  |  |  340|   126k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   126k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   126k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   126k|            } \
  |  |  |  | 1139|   126k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   187k|    } \
  |  |  |  | 1141|   187k|}
  |  |  ------------------
  |  | 1289|   187k|                                            flags, flagsp, flags_stride, data, \
  |  | 1290|   187k|                                            l_w, 1, mqc, curctx, \
  |  | 1291|   187k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1292|   187k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   187k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1293|   187k|                        /* FALLTHRU */ \
  |  | 1294|   259k|                    case 2: \
  |  |  ------------------
  |  |  |  Branch (1294:21): [True: 71.6k, False: 249k]
  |  |  ------------------
  |  | 1295|   259k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   259k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   259k|{ \
  |  |  |  | 1120|   259k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   259k|        do { \
  |  |  |  | 1122|   259k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 187k, False: 71.6k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   187k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   187k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   187k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   187k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   187k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   187k|{ \
  |  |  |  |  |  |  140|   187k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   187k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   187k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   187k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   187k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   187k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 37.1k, False: 150k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  37.1k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  37.1k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  37.1k|{ \
  |  |  |  |  |  |  |  |   57|  37.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 7.11k, False: 30.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  7.11k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  7.11k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  7.11k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  30.0k|    } else { \
  |  |  |  |  |  |  |  |   62|  30.0k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  30.0k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  30.0k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  30.0k|    } \
  |  |  |  |  |  |  |  |   66|  37.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  37.1k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  37.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  37.1k|{ \
  |  |  |  |  |  |  |  |  128|  61.2k|    do { \
  |  |  |  |  |  |  |  |  129|  61.2k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 7.71k, False: 53.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  7.71k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  7.71k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  7.71k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  7.71k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  7.71k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  7.71k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  7.71k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  7.71k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.04k, False: 2.66k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.04k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.40k, False: 642]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.40k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.40k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.40k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.40k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    642|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    642|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    642|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    642|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.04k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.66k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.66k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.66k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.66k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  7.71k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  7.71k|        } \
  |  |  |  |  |  |  |  |  132|  61.2k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  61.2k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  61.2k|        ct--; \
  |  |  |  |  |  |  |  |  135|  61.2k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 24.1k, False: 37.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  37.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   150k|    } else {  \
  |  |  |  |  |  |  149|   150k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   150k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 41.1k, False: 109k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  41.1k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  41.1k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  41.1k|{ \
  |  |  |  |  |  |  |  |   45|  41.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 7.36k, False: 33.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  7.36k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  7.36k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  33.8k|    } else { \
  |  |  |  |  |  |  |  |   49|  33.8k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  33.8k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  33.8k|    } \
  |  |  |  |  |  |  |  |   52|  41.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  41.1k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  41.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  41.1k|{ \
  |  |  |  |  |  |  |  |  128|  44.4k|    do { \
  |  |  |  |  |  |  |  |  129|  44.4k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 6.37k, False: 38.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  6.37k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  6.37k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  6.37k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  6.37k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  6.37k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  6.37k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  6.37k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  6.37k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 4.74k, False: 1.63k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  4.74k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.07k, False: 675]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.07k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.07k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.07k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.07k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    675|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    675|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    675|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    675|            } \
  |  |  |  |  |  |  |  |  |  |  118|  4.74k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.63k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.63k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.63k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.63k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  6.37k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  6.37k|        } \
  |  |  |  |  |  |  |  |  132|  44.4k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  44.4k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  44.4k|        ct--; \
  |  |  |  |  |  |  |  |  135|  44.4k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 3.32k, False: 41.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  41.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   109k|        } else { \
  |  |  |  |  |  |  154|   109k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   109k|        } \
  |  |  |  |  |  |  156|   150k|    } \
  |  |  |  |  |  |  157|   187k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   187k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 122k, False: 65.3k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   187k|                    break; \
  |  |  |  | 1128|   187k|            } \
  |  |  |  | 1129|   259k|            { \
  |  |  |  | 1130|   137k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   137k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   137k|                                    ci); \
  |  |  |  | 1133|   137k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   137k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   137k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   137k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   137k|{ \
  |  |  |  |  |  |  140|   137k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   137k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   137k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   137k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   137k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   137k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 37.5k, False: 99.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  37.5k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  37.5k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  37.5k|{ \
  |  |  |  |  |  |  |  |   57|  37.5k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 5.31k, False: 32.2k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  5.31k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  5.31k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  5.31k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  32.2k|    } else { \
  |  |  |  |  |  |  |  |   62|  32.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  32.2k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  32.2k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  32.2k|    } \
  |  |  |  |  |  |  |  |   66|  37.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  37.5k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  37.5k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  37.5k|{ \
  |  |  |  |  |  |  |  |  128|  57.3k|    do { \
  |  |  |  |  |  |  |  |  129|  57.3k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 6.68k, False: 50.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  6.68k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  6.68k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  6.68k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  6.68k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  6.68k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  6.68k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  6.68k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  6.68k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.24k, False: 1.43k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.24k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.87k, False: 371]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.87k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.87k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.87k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.87k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    371|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    371|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    371|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    371|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.24k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.43k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.43k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.43k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.43k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  6.68k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  6.68k|        } \
  |  |  |  |  |  |  |  |  132|  57.3k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  57.3k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  57.3k|        ct--; \
  |  |  |  |  |  |  |  |  135|  57.3k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 19.8k, False: 37.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  37.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  99.4k|    } else {  \
  |  |  |  |  |  |  149|  99.4k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  99.4k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 42.9k, False: 56.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  42.9k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  42.9k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  42.9k|{ \
  |  |  |  |  |  |  |  |   45|  42.9k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 4.03k, False: 38.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.03k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  4.03k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  38.8k|    } else { \
  |  |  |  |  |  |  |  |   49|  38.8k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  38.8k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  38.8k|    } \
  |  |  |  |  |  |  |  |   52|  42.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  42.9k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  42.9k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  42.9k|{ \
  |  |  |  |  |  |  |  |  128|  45.2k|    do { \
  |  |  |  |  |  |  |  |  129|  45.2k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 6.18k, False: 39.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  6.18k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  6.18k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  6.18k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  6.18k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  6.18k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  6.18k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  6.18k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  6.18k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 4.17k, False: 2.01k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  4.17k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 3.67k, False: 501]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  3.67k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  3.67k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  3.67k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  3.67k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    501|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    501|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    501|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    501|            } \
  |  |  |  |  |  |  |  |  |  |  118|  4.17k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.01k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.01k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.01k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.01k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  6.18k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  6.18k|        } \
  |  |  |  |  |  |  |  |  132|  45.2k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  45.2k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  45.2k|        ct--; \
  |  |  |  |  |  |  |  |  135|  45.2k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.37k, False: 42.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  42.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  56.5k|        } else { \
  |  |  |  |  |  |  154|  56.5k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  56.5k|        } \
  |  |  |  |  |  |  156|  99.4k|    } \
  |  |  |  |  |  |  157|   137k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   137k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   137k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 65.3k, False: 71.6k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   137k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   137k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   137k|{ \
  |  |  |  |  |  |  323|   137k|    /* east */ \
  |  |  |  |  |  |  324|   137k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   137k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   137k| \
  |  |  |  |  |  |  326|   137k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   137k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   137k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   137k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   137k| \
  |  |  |  |  |  |  329|   137k|    /* west */ \
  |  |  |  |  |  |  330|   137k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   137k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   137k| \
  |  |  |  |  |  |  332|   137k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   137k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   137k| \
  |  |  |  |  |  |  340|   137k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   137k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|   137k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   137k|            } \
  |  |  |  | 1139|   137k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   259k|    } \
  |  |  |  | 1141|   259k|}
  |  |  ------------------
  |  | 1296|   259k|                                            flags, flagsp, flags_stride, data, \
  |  | 1297|   259k|                                            l_w, 2, mqc, curctx, \
  |  | 1298|   259k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1299|   259k|                        partial = OPJ_FALSE; \
  |  |  ------------------
  |  |  |  |  118|   259k|#define OPJ_FALSE 0
  |  |  ------------------
  |  | 1300|   259k|                        /* FALLTHRU */ \
  |  | 1301|   320k|                    case 3: \
  |  |  ------------------
  |  |  |  Branch (1301:21): [True: 61.8k, False: 259k]
  |  |  ------------------
  |  | 1302|   320k|                        opj_t1_dec_clnpass_step_macro(OPJ_FALSE, partial,\
  |  |  ------------------
  |  |  |  | 1118|   320k|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|   320k|{ \
  |  |  |  | 1120|   320k|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|      0|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|      0|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      0|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1121|   320k|        do { \
  |  |  |  | 1122|   320k|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [True: 259k, False: 61.8k]
  |  |  |  |  ------------------
  |  |  |  | 1123|   259k|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|   259k|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   259k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|   259k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   259k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   259k|{ \
  |  |  |  |  |  |  140|   259k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   259k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   259k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   259k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   259k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   259k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 45.0k, False: 214k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  45.0k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  45.0k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  45.0k|{ \
  |  |  |  |  |  |  |  |   57|  45.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 9.35k, False: 35.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  9.35k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  9.35k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  9.35k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  35.6k|    } else { \
  |  |  |  |  |  |  |  |   62|  35.6k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  35.6k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  35.6k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  35.6k|    } \
  |  |  |  |  |  |  |  |   66|  45.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  45.0k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  45.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  45.0k|{ \
  |  |  |  |  |  |  |  |  128|  84.4k|    do { \
  |  |  |  |  |  |  |  |  129|  84.4k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 10.8k, False: 73.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  10.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  10.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  10.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  10.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  10.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  10.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  10.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  10.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 8.66k, False: 2.16k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  8.66k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 8.19k, False: 471]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  8.19k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  8.19k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  8.19k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  8.19k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    471|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    471|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    471|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    471|            } \
  |  |  |  |  |  |  |  |  |  |  118|  8.66k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.16k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.16k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.16k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.16k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  10.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  10.8k|        } \
  |  |  |  |  |  |  |  |  132|  84.4k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  84.4k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  84.4k|        ct--; \
  |  |  |  |  |  |  |  |  135|  84.4k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 39.4k, False: 45.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  45.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   214k|    } else {  \
  |  |  |  |  |  |  149|   214k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   214k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 48.0k, False: 166k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  48.0k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  48.0k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  48.0k|{ \
  |  |  |  |  |  |  |  |   45|  48.0k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 5.92k, False: 42.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  5.92k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  5.92k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  42.1k|    } else { \
  |  |  |  |  |  |  |  |   49|  42.1k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  42.1k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  42.1k|    } \
  |  |  |  |  |  |  |  |   52|  48.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  48.0k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  48.0k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  48.0k|{ \
  |  |  |  |  |  |  |  |  128|  50.6k|    do { \
  |  |  |  |  |  |  |  |  129|  50.6k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 8.20k, False: 42.4k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  8.20k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  8.20k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  8.20k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  8.20k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  8.20k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  8.20k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  8.20k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  8.20k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.20k, False: 2.99k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.20k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.55k, False: 657]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.55k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.55k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.55k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.55k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    657|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    657|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    657|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    657|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.20k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.99k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.99k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.99k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.99k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  8.20k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  8.20k|        } \
  |  |  |  |  |  |  |  |  132|  50.6k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  50.6k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  50.6k|        ct--; \
  |  |  |  |  |  |  |  |  135|  50.6k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.59k, False: 48.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  48.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   166k|        } else { \
  |  |  |  |  |  |  154|   166k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   166k|        } \
  |  |  |  |  |  |  156|   214k|    } \
  |  |  |  |  |  |  157|   259k|}
  |  |  |  |  ------------------
  |  |  |  | 1126|   259k|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 177k, False: 81.4k]
  |  |  |  |  ------------------
  |  |  |  | 1127|   259k|                    break; \
  |  |  |  | 1128|   259k|            } \
  |  |  |  | 1129|   320k|            { \
  |  |  |  | 1130|   143k|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|   143k|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|   143k|                                    ci); \
  |  |  |  | 1133|   143k|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|   143k|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|   143k|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|   143k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|   143k|{ \
  |  |  |  |  |  |  140|   143k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|   143k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|   143k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|   143k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|   143k|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|   143k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 45.1k, False: 98.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|  45.1k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|  45.1k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|  45.1k|{ \
  |  |  |  |  |  |  |  |   57|  45.1k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 8.61k, False: 36.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  8.61k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  8.61k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  8.61k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|  36.5k|    } else { \
  |  |  |  |  |  |  |  |   62|  36.5k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|  36.5k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|  36.5k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|  36.5k|    } \
  |  |  |  |  |  |  |  |   66|  45.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|  45.1k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  45.1k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  45.1k|{ \
  |  |  |  |  |  |  |  |  128|  69.3k|    do { \
  |  |  |  |  |  |  |  |  129|  69.3k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 8.47k, False: 60.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  8.47k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  8.47k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  8.47k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  8.47k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  8.47k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  8.47k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  8.47k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  8.47k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 5.91k, False: 2.56k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  5.91k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 5.59k, False: 321]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  5.59k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  5.59k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  5.59k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  5.59k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    321|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    321|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    321|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    321|            } \
  |  |  |  |  |  |  |  |  |  |  118|  5.91k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  2.56k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  2.56k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  2.56k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  2.56k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  8.47k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  8.47k|        } \
  |  |  |  |  |  |  |  |  132|  69.3k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  69.3k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  69.3k|        ct--; \
  |  |  |  |  |  |  |  |  135|  69.3k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 24.1k, False: 45.1k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  45.1k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  98.0k|    } else {  \
  |  |  |  |  |  |  149|  98.0k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  98.0k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 42.8k, False: 55.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|  42.8k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|  42.8k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|  42.8k|{ \
  |  |  |  |  |  |  |  |   45|  42.8k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 4.18k, False: 38.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  4.18k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  4.18k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|  38.6k|    } else { \
  |  |  |  |  |  |  |  |   49|  38.6k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|  38.6k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|  38.6k|    } \
  |  |  |  |  |  |  |  |   52|  42.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|  42.8k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|  42.8k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|  42.8k|{ \
  |  |  |  |  |  |  |  |  128|  45.0k|    do { \
  |  |  |  |  |  |  |  |  129|  45.0k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 6.27k, False: 38.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  6.27k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  6.27k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  6.27k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  6.27k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  6.27k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  6.27k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  6.27k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  6.27k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 4.85k, False: 1.42k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  4.85k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 4.05k, False: 797]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  4.05k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  4.05k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  4.05k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  4.05k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|    797|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|    797|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|    797|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|    797|            } \
  |  |  |  |  |  |  |  |  |  |  118|  4.85k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  1.42k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  1.42k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  1.42k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  1.42k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  6.27k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  6.27k|        } \
  |  |  |  |  |  |  |  |  132|  45.0k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  45.0k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  45.0k|        ct--; \
  |  |  |  |  |  |  |  |  135|  45.0k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 2.22k, False: 42.8k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  42.8k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  55.2k|        } else { \
  |  |  |  |  |  |  154|  55.2k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  55.2k|        } \
  |  |  |  |  |  |  156|  98.0k|    } \
  |  |  |  |  |  |  157|   143k|}
  |  |  |  |  ------------------
  |  |  |  | 1135|   143k|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|   143k|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 66.5k, False: 76.7k]
  |  |  |  |  ------------------
  |  |  |  | 1137|   143k|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|   143k|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|   143k|{ \
  |  |  |  |  |  |  323|   143k|    /* east */ \
  |  |  |  |  |  |  324|   143k|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|   143k|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|   143k| \
  |  |  |  |  |  |  326|   143k|    /* mark target as significant */ \
  |  |  |  |  |  |  327|   143k|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|   143k|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|   143k|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|   143k| \
  |  |  |  |  |  |  329|   143k|    /* west */ \
  |  |  |  |  |  |  330|   143k|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|   143k|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|   143k| \
  |  |  |  |  |  |  332|   143k|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|   143k|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|   143k| \
  |  |  |  |  |  |  340|   143k|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|   143k|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|   143k|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|   143k|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|   143k|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|   143k|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|   143k|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|   143k|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|   143k|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|   143k|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|   143k|    } \
  |  |  |  |  |  |  347|   143k|}
  |  |  |  |  ------------------
  |  |  |  | 1138|   143k|            } \
  |  |  |  | 1139|   143k|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|   320k|    } \
  |  |  |  | 1141|   320k|}
  |  |  ------------------
  |  | 1303|   320k|                                            flags, flagsp, flags_stride, data, \
  |  | 1304|   320k|                                            l_w, 3, mqc, curctx, \
  |  | 1305|   320k|                                            v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1306|   320k|                        break; \
  |  | 1307|   320k|                } \
  |  | 1308|  14.9M|            } else { \
  |  | 1309|  14.9M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  14.9M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  14.9M|{ \
  |  |  |  | 1120|  14.9M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  14.9M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  14.9M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  14.9M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  14.9M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 3.19M, False: 11.7M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  3.19M|        do { \
  |  |  |  | 1122|  3.19M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  3.19M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  3.19M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.19M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  3.19M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.19M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.19M|{ \
  |  |  |  |  |  |  140|  3.19M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.19M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.19M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.19M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.19M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.19M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 696k, False: 2.49M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   696k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   696k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   696k|{ \
  |  |  |  |  |  |  |  |   57|   696k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 156k, False: 540k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   156k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   156k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   156k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   540k|    } else { \
  |  |  |  |  |  |  |  |   62|   540k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   540k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   540k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   540k|    } \
  |  |  |  |  |  |  |  |   66|   696k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   696k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   696k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   696k|{ \
  |  |  |  |  |  |  |  |  128|  1.15M|    do { \
  |  |  |  |  |  |  |  |  129|  1.15M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 142k, False: 1.01M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   142k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   142k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   142k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   142k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   142k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   142k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   142k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   142k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 124k, False: 17.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   124k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 120k, False: 4.37k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   120k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   120k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   120k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   120k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.37k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.37k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.37k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.37k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   124k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  17.7k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  17.7k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  17.7k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  17.7k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   142k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   142k|        } \
  |  |  |  |  |  |  |  |  132|  1.15M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.15M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.15M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.15M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 457k, False: 696k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   696k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.49M|    } else {  \
  |  |  |  |  |  |  149|  2.49M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.49M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 732k, False: 1.76M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   732k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   732k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   732k|{ \
  |  |  |  |  |  |  |  |   45|   732k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 115k, False: 616k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   115k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   115k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   616k|    } else { \
  |  |  |  |  |  |  |  |   49|   616k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   616k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   616k|    } \
  |  |  |  |  |  |  |  |   52|   732k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   732k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   732k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   732k|{ \
  |  |  |  |  |  |  |  |  128|   780k|    do { \
  |  |  |  |  |  |  |  |  129|   780k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 94.3k, False: 686k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  94.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  94.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  94.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  94.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  94.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  94.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  94.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  94.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 84.0k, False: 10.2k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  84.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 81.3k, False: 2.73k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  81.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  81.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  81.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  81.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.73k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.73k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.73k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.73k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  84.0k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  10.2k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  10.2k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  10.2k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  10.2k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  94.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  94.3k|        } \
  |  |  |  |  |  |  |  |  132|   780k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   780k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   780k|        ct--; \
  |  |  |  |  |  |  |  |  135|   780k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 47.9k, False: 732k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   732k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.76M|        } else { \
  |  |  |  |  |  |  154|  1.76M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.76M|        } \
  |  |  |  |  |  |  156|  2.49M|    } \
  |  |  |  |  |  |  157|  3.19M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.19M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 1.88M, False: 1.30M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.19M|                    break; \
  |  |  |  | 1128|  3.19M|            } \
  |  |  |  | 1129|  3.19M|            { \
  |  |  |  | 1130|  1.30M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  1.30M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  1.30M|                                    ci); \
  |  |  |  | 1133|  1.30M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.30M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  1.30M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.30M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.30M|{ \
  |  |  |  |  |  |  140|  1.30M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.30M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.30M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.30M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.30M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.30M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 356k, False: 945k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   356k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   356k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   356k|{ \
  |  |  |  |  |  |  |  |   57|   356k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 76.6k, False: 280k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  76.6k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  76.6k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  76.6k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   280k|    } else { \
  |  |  |  |  |  |  |  |   62|   280k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   280k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   280k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   280k|    } \
  |  |  |  |  |  |  |  |   66|   356k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   356k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   356k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   356k|{ \
  |  |  |  |  |  |  |  |  128|   569k|    do { \
  |  |  |  |  |  |  |  |  129|   569k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 75.4k, False: 493k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  75.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  75.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  75.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  75.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  75.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  75.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  75.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  75.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 68.4k, False: 6.96k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  68.4k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 65.8k, False: 2.58k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  65.8k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  65.8k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  65.8k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  65.8k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.58k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.58k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.58k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.58k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  68.4k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  6.96k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  6.96k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  6.96k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  6.96k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  75.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  75.4k|        } \
  |  |  |  |  |  |  |  |  132|   569k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   569k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   569k|        ct--; \
  |  |  |  |  |  |  |  |  135|   569k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 212k, False: 356k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   356k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   945k|    } else {  \
  |  |  |  |  |  |  149|   945k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   945k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 365k, False: 580k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   365k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   365k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   365k|{ \
  |  |  |  |  |  |  |  |   45|   365k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 61.3k, False: 304k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  61.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  61.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   304k|    } else { \
  |  |  |  |  |  |  |  |   49|   304k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   304k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   304k|    } \
  |  |  |  |  |  |  |  |   52|   365k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   365k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   365k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   365k|{ \
  |  |  |  |  |  |  |  |  128|   391k|    do { \
  |  |  |  |  |  |  |  |  129|   391k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 47.4k, False: 343k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  47.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  47.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  47.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  47.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  47.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  47.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  47.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  47.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 41.9k, False: 5.47k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  41.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 40.3k, False: 1.60k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  40.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  40.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  40.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  40.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.60k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.60k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.60k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.60k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  41.9k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.47k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.47k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.47k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.47k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  47.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  47.4k|        } \
  |  |  |  |  |  |  |  |  132|   391k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   391k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   391k|        ct--; \
  |  |  |  |  |  |  |  |  135|   391k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 25.7k, False: 365k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   365k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   580k|        } else { \
  |  |  |  |  |  |  154|   580k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   580k|        } \
  |  |  |  |  |  |  156|   945k|    } \
  |  |  |  |  |  |  157|  1.30M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  1.30M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  1.30M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 640k, False: 661k]
  |  |  |  |  ------------------
  |  |  |  | 1137|  1.30M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.30M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.30M|{ \
  |  |  |  |  |  |  323|  1.30M|    /* east */ \
  |  |  |  |  |  |  324|  1.30M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.30M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.30M| \
  |  |  |  |  |  |  326|  1.30M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.30M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.30M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.30M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.30M| \
  |  |  |  |  |  |  329|  1.30M|    /* west */ \
  |  |  |  |  |  |  330|  1.30M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.30M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.30M| \
  |  |  |  |  |  |  332|  1.30M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.30M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|  1.30M|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|  1.30M|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  1.30M|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|  1.30M|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|  1.30M|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|  1.30M|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|  1.30M|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|  1.30M|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|  1.30M|    } \
  |  |  |  |  |  |  339|  1.30M| \
  |  |  |  |  |  |  340|  1.30M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.30M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.30M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  1.30M|            } \
  |  |  |  | 1139|  1.30M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  3.19M|    } \
  |  |  |  | 1141|  14.9M|}
  |  |  ------------------
  |  | 1310|  14.9M|                                    flags, flagsp, flags_stride, data, \
  |  | 1311|  14.9M|                                    l_w, 0, mqc, curctx, \
  |  | 1312|  14.9M|                                    v, a, c, ct, oneplushalf, vsc); \
  |  | 1313|  14.9M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  14.9M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  14.9M|{ \
  |  |  |  | 1120|  14.9M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  14.9M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  14.9M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  14.9M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  14.9M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 3.17M, False: 11.7M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  3.17M|        do { \
  |  |  |  | 1122|  3.17M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  3.17M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  3.17M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.17M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  3.17M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.17M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.17M|{ \
  |  |  |  |  |  |  140|  3.17M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.17M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.17M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.17M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.17M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.17M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 694k, False: 2.48M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   694k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   694k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   694k|{ \
  |  |  |  |  |  |  |  |   57|   694k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 156k, False: 537k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   156k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   156k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   156k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   537k|    } else { \
  |  |  |  |  |  |  |  |   62|   537k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   537k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   537k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   537k|    } \
  |  |  |  |  |  |  |  |   66|   694k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   694k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   694k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   694k|{ \
  |  |  |  |  |  |  |  |  128|  1.15M|    do { \
  |  |  |  |  |  |  |  |  129|  1.15M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 142k, False: 1.01M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   142k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   142k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   142k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   142k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   142k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   142k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   142k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   142k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 126k, False: 16.3k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   126k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 121k, False: 4.60k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   121k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   121k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   121k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   121k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  4.60k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  4.60k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  4.60k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  4.60k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   126k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  16.3k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  16.3k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  16.3k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  16.3k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   142k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   142k|        } \
  |  |  |  |  |  |  |  |  132|  1.15M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.15M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.15M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.15M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 462k, False: 694k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   694k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.48M|    } else {  \
  |  |  |  |  |  |  149|  2.48M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.48M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 732k, False: 1.75M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   732k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   732k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   732k|{ \
  |  |  |  |  |  |  |  |   45|   732k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 114k, False: 617k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   114k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   114k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   617k|    } else { \
  |  |  |  |  |  |  |  |   49|   617k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   617k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   617k|    } \
  |  |  |  |  |  |  |  |   52|   732k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   732k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   732k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   732k|{ \
  |  |  |  |  |  |  |  |  128|   782k|    do { \
  |  |  |  |  |  |  |  |  129|   782k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 92.8k, False: 689k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  92.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  92.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  92.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  92.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  92.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  92.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  92.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  92.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 81.3k, False: 11.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  81.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 79.1k, False: 2.22k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  79.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  79.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  79.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  79.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.22k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.22k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.22k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.22k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  81.3k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  11.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  11.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  11.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  11.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  92.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  92.8k|        } \
  |  |  |  |  |  |  |  |  132|   782k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   782k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   782k|        ct--; \
  |  |  |  |  |  |  |  |  135|   782k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 49.9k, False: 732k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   732k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.75M|        } else { \
  |  |  |  |  |  |  154|  1.75M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.75M|        } \
  |  |  |  |  |  |  156|  2.48M|    } \
  |  |  |  |  |  |  157|  3.17M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.17M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 1.91M, False: 1.26M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.17M|                    break; \
  |  |  |  | 1128|  3.17M|            } \
  |  |  |  | 1129|  3.17M|            { \
  |  |  |  | 1130|  1.26M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  1.26M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  1.26M|                                    ci); \
  |  |  |  | 1133|  1.26M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.26M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  1.26M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.26M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.26M|{ \
  |  |  |  |  |  |  140|  1.26M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.26M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.26M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.26M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.26M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.26M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 353k, False: 912k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   353k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   353k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   353k|{ \
  |  |  |  |  |  |  |  |   57|   353k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 81.1k, False: 272k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  81.1k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  81.1k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  81.1k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   272k|    } else { \
  |  |  |  |  |  |  |  |   62|   272k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   272k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   272k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   272k|    } \
  |  |  |  |  |  |  |  |   66|   353k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   353k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   353k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   353k|{ \
  |  |  |  |  |  |  |  |  128|   553k|    do { \
  |  |  |  |  |  |  |  |  129|   553k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 67.8k, False: 485k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  67.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  67.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  67.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  67.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  67.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  67.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  67.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  67.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 62.6k, False: 5.21k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  62.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 60.1k, False: 2.47k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  60.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  60.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  60.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  60.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.47k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.47k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.47k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.47k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  62.6k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.21k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.21k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.21k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.21k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  67.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  67.8k|        } \
  |  |  |  |  |  |  |  |  132|   553k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   553k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   553k|        ct--; \
  |  |  |  |  |  |  |  |  135|   553k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 200k, False: 353k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   353k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   912k|    } else {  \
  |  |  |  |  |  |  149|   912k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   912k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 354k, False: 558k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   354k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   354k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   354k|{ \
  |  |  |  |  |  |  |  |   45|   354k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 62.8k, False: 291k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  62.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  62.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   291k|    } else { \
  |  |  |  |  |  |  |  |   49|   291k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   291k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   291k|    } \
  |  |  |  |  |  |  |  |   52|   354k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   354k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   354k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   354k|{ \
  |  |  |  |  |  |  |  |  128|   383k|    do { \
  |  |  |  |  |  |  |  |  129|   383k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 47.1k, False: 336k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  47.1k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  47.1k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  47.1k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  47.1k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  47.1k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  47.1k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  47.1k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  47.1k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 43.3k, False: 3.78k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  43.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 42.0k, False: 1.35k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  42.0k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  42.0k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  42.0k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  42.0k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.35k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.35k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.35k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.35k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  43.3k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  3.78k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  3.78k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  3.78k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  3.78k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  47.1k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  47.1k|        } \
  |  |  |  |  |  |  |  |  132|   383k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   383k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   383k|        ct--; \
  |  |  |  |  |  |  |  |  135|   383k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 29.6k, False: 354k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   354k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   558k|        } else { \
  |  |  |  |  |  |  154|   558k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   558k|        } \
  |  |  |  |  |  |  156|   912k|    } \
  |  |  |  |  |  |  157|  1.26M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  1.26M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  1.26M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 630k, False: 635k]
  |  |  |  |  ------------------
  |  |  |  | 1137|  1.26M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.26M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.26M|{ \
  |  |  |  |  |  |  323|  1.26M|    /* east */ \
  |  |  |  |  |  |  324|  1.26M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.26M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.26M| \
  |  |  |  |  |  |  326|  1.26M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.26M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.26M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.26M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.26M| \
  |  |  |  |  |  |  329|  1.26M|    /* west */ \
  |  |  |  |  |  |  330|  1.26M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.26M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.26M| \
  |  |  |  |  |  |  332|  1.26M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.26M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.26M| \
  |  |  |  |  |  |  340|  1.26M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.26M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.26M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  1.26M|            } \
  |  |  |  | 1139|  1.26M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  3.17M|    } \
  |  |  |  | 1141|  14.9M|}
  |  |  ------------------
  |  | 1314|  14.9M|                                    flags, flagsp, flags_stride, data, \
  |  | 1315|  14.9M|                                    l_w, 1, mqc, curctx, \
  |  | 1316|  14.9M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1317|  14.9M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  14.9M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  14.9M|{ \
  |  |  |  | 1120|  14.9M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  14.9M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  14.9M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  14.9M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  14.9M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 3.17M, False: 11.7M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  3.17M|        do { \
  |  |  |  | 1122|  3.17M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  3.17M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  3.17M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.17M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  3.17M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.17M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.17M|{ \
  |  |  |  |  |  |  140|  3.17M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.17M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.17M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.17M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.17M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.17M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 663k, False: 2.51M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   663k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   663k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   663k|{ \
  |  |  |  |  |  |  |  |   57|   663k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 143k, False: 520k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   143k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   143k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   143k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   520k|    } else { \
  |  |  |  |  |  |  |  |   62|   520k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   520k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   520k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   520k|    } \
  |  |  |  |  |  |  |  |   66|   663k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   663k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   663k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   663k|{ \
  |  |  |  |  |  |  |  |  128|  1.11M|    do { \
  |  |  |  |  |  |  |  |  129|  1.11M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 141k, False: 976k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   141k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   141k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   141k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   141k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   141k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   141k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   141k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   141k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 126k, False: 15.4k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   126k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 122k, False: 3.48k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   122k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   122k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   122k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   122k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.48k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.48k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.48k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.48k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   126k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  15.4k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  15.4k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  15.4k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  15.4k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   141k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   141k|        } \
  |  |  |  |  |  |  |  |  132|  1.11M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.11M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.11M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.11M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 454k, False: 663k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   663k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.51M|    } else {  \
  |  |  |  |  |  |  149|  2.51M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.51M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 719k, False: 1.79M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   719k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   719k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   719k|{ \
  |  |  |  |  |  |  |  |   45|   719k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 114k, False: 604k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   114k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   114k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   604k|    } else { \
  |  |  |  |  |  |  |  |   49|   604k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   604k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   604k|    } \
  |  |  |  |  |  |  |  |   52|   719k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   719k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   719k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   719k|{ \
  |  |  |  |  |  |  |  |  128|   765k|    do { \
  |  |  |  |  |  |  |  |  129|   765k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 96.9k, False: 668k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  96.9k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  96.9k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  96.9k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  96.9k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  96.9k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  96.9k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  96.9k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  96.9k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 87.7k, False: 9.20k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  87.7k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 85.3k, False: 2.35k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  85.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  85.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  85.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  85.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.35k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.35k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.35k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.35k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  87.7k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  9.20k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  9.20k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  9.20k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  9.20k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  96.9k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  96.9k|        } \
  |  |  |  |  |  |  |  |  132|   765k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   765k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   765k|        ct--; \
  |  |  |  |  |  |  |  |  135|   765k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 46.3k, False: 719k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   719k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.79M|        } else { \
  |  |  |  |  |  |  154|  1.79M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.79M|        } \
  |  |  |  |  |  |  156|  2.51M|    } \
  |  |  |  |  |  |  157|  3.17M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.17M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 1.90M, False: 1.26M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.17M|                    break; \
  |  |  |  | 1128|  3.17M|            } \
  |  |  |  | 1129|  3.17M|            { \
  |  |  |  | 1130|  1.26M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  1.26M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  1.26M|                                    ci); \
  |  |  |  | 1133|  1.26M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.26M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  1.26M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.26M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.26M|{ \
  |  |  |  |  |  |  140|  1.26M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.26M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.26M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.26M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.26M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.26M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 338k, False: 926k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   338k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   338k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   338k|{ \
  |  |  |  |  |  |  |  |   57|   338k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 85.1k, False: 253k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  85.1k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  85.1k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  85.1k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   253k|    } else { \
  |  |  |  |  |  |  |  |   62|   253k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   253k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   253k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   253k|    } \
  |  |  |  |  |  |  |  |   66|   338k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   338k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   338k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   338k|{ \
  |  |  |  |  |  |  |  |  128|   524k|    do { \
  |  |  |  |  |  |  |  |  129|   524k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 67.8k, False: 456k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  67.8k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  67.8k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  67.8k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  67.8k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  67.8k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  67.8k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  67.8k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  67.8k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 61.8k, False: 5.93k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  61.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 60.1k, False: 1.70k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  60.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  60.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  60.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  60.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.70k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.70k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.70k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.70k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  61.8k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.93k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.93k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.93k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.93k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  67.8k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  67.8k|        } \
  |  |  |  |  |  |  |  |  132|   524k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   524k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   524k|        ct--; \
  |  |  |  |  |  |  |  |  135|   524k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 185k, False: 338k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   338k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   926k|    } else {  \
  |  |  |  |  |  |  149|   926k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   926k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 363k, False: 563k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   363k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   363k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   363k|{ \
  |  |  |  |  |  |  |  |   45|   363k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 65.1k, False: 297k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  65.1k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  65.1k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   297k|    } else { \
  |  |  |  |  |  |  |  |   49|   297k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   297k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   297k|    } \
  |  |  |  |  |  |  |  |   52|   363k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   363k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   363k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   363k|{ \
  |  |  |  |  |  |  |  |  128|   390k|    do { \
  |  |  |  |  |  |  |  |  129|   390k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 52.2k, False: 338k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  52.2k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  52.2k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  52.2k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  52.2k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  52.2k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  52.2k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  52.2k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  52.2k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 46.8k, False: 5.39k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  46.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 44.1k, False: 2.70k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  44.1k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  44.1k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  44.1k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  44.1k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.70k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.70k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.70k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.70k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  46.8k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.39k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.39k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.39k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.39k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  52.2k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  52.2k|        } \
  |  |  |  |  |  |  |  |  132|   390k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   390k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   390k|        ct--; \
  |  |  |  |  |  |  |  |  135|   390k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 27.4k, False: 363k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   363k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   563k|        } else { \
  |  |  |  |  |  |  154|   563k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   563k|        } \
  |  |  |  |  |  |  156|   926k|    } \
  |  |  |  |  |  |  157|  1.26M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  1.26M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  1.26M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 635k, False: 630k]
  |  |  |  |  ------------------
  |  |  |  | 1137|  1.26M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.26M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.26M|{ \
  |  |  |  |  |  |  323|  1.26M|    /* east */ \
  |  |  |  |  |  |  324|  1.26M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.26M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.26M| \
  |  |  |  |  |  |  326|  1.26M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.26M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.26M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.26M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.26M| \
  |  |  |  |  |  |  329|  1.26M|    /* west */ \
  |  |  |  |  |  |  330|  1.26M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.26M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.26M| \
  |  |  |  |  |  |  332|  1.26M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.26M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.26M| \
  |  |  |  |  |  |  340|  1.26M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.26M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|      0|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|      0|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      0|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|      0|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|      0|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|      0|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|      0|    } \
  |  |  |  |  |  |  347|  1.26M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  1.26M|            } \
  |  |  |  | 1139|  1.26M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  3.17M|    } \
  |  |  |  | 1141|  14.9M|}
  |  |  ------------------
  |  | 1318|  14.9M|                                    flags, flagsp, flags_stride, data, \
  |  | 1319|  14.9M|                                    l_w, 2, mqc, curctx, \
  |  | 1320|  14.9M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1321|  14.9M|                opj_t1_dec_clnpass_step_macro(OPJ_TRUE, OPJ_FALSE, \
  |  |  ------------------
  |  |  |  | 1118|  14.9M|                                      v, a, c, ct, oneplushalf, vsc) \
  |  |  |  | 1119|  14.9M|{ \
  |  |  |  | 1120|  14.9M|    if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  14.9M|#define T1_SIGMA_THIS T1_SIGMA_4
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  14.9M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   if ( !check_flags || !(flags & ((T1_SIGMA_THIS | T1_PI_THIS) << (ci * 3U)))) {\
  |  |  |  |  ------------------
  |  |  |  |  |  |  163|  14.9M|#define T1_PI_THIS    T1_PI_0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|  14.9M|#define T1_PI_0     (1U << 21)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:10): [Folded - Ignored]
  |  |  |  |  |  Branch (1120:26): [True: 3.18M, False: 11.7M]
  |  |  |  |  ------------------
  |  |  |  | 1121|  3.18M|        do { \
  |  |  |  | 1122|  3.18M|            if( !partial ) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1123|  3.18M|                OPJ_UINT32 ctxt1 = opj_t1_getctxno_zc(mqc, flags >> (ci * 3U)); \
  |  |  |  | 1124|  3.18M|                opj_t1_setcurctx(curctx, ctxt1); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  3.18M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1125|  3.18M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  3.18M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  3.18M|{ \
  |  |  |  |  |  |  140|  3.18M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  3.18M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  3.18M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  3.18M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  3.18M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  3.18M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 637k, False: 2.54M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   637k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   637k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   637k|{ \
  |  |  |  |  |  |  |  |   57|   637k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 133k, False: 503k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|   133k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|   133k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|   133k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   503k|    } else { \
  |  |  |  |  |  |  |  |   62|   503k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   503k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   503k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   503k|    } \
  |  |  |  |  |  |  |  |   66|   637k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   637k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   637k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   637k|{ \
  |  |  |  |  |  |  |  |  128|  1.08M|    do { \
  |  |  |  |  |  |  |  |  129|  1.08M|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 136k, False: 952k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|   136k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|   136k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|   136k|{ \
  |  |  |  |  |  |  |  |  |  |  104|   136k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|   136k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|   136k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|   136k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|   136k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 121k, False: 14.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|   121k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 117k, False: 3.74k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|   117k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|   117k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|   117k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|   117k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  3.74k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  3.74k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  3.74k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  3.74k|            } \
  |  |  |  |  |  |  |  |  |  |  118|   121k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  14.7k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  14.7k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  14.7k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  14.7k|        } \
  |  |  |  |  |  |  |  |  |  |  123|   136k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|   136k|        } \
  |  |  |  |  |  |  |  |  132|  1.08M|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|  1.08M|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|  1.08M|        ct--; \
  |  |  |  |  |  |  |  |  135|  1.08M|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 451k, False: 637k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   637k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|  2.54M|    } else {  \
  |  |  |  |  |  |  149|  2.54M|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|  2.54M|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 681k, False: 1.86M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   681k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   681k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   681k|{ \
  |  |  |  |  |  |  |  |   45|   681k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 106k, False: 574k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|   106k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|   106k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   574k|    } else { \
  |  |  |  |  |  |  |  |   49|   574k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   574k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   574k|    } \
  |  |  |  |  |  |  |  |   52|   681k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   681k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   681k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   681k|{ \
  |  |  |  |  |  |  |  |  128|   728k|    do { \
  |  |  |  |  |  |  |  |  129|   728k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 88.3k, False: 639k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  88.3k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  88.3k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  88.3k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  88.3k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  88.3k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  88.3k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  88.3k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  88.3k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 77.0k, False: 11.3k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  77.0k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 74.7k, False: 2.33k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  74.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  74.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  74.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  74.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.33k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.33k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.33k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.33k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  77.0k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  11.3k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  11.3k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  11.3k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  11.3k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  88.3k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  88.3k|        } \
  |  |  |  |  |  |  |  |  132|   728k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   728k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   728k|        ct--; \
  |  |  |  |  |  |  |  |  135|   728k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 46.9k, False: 681k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   681k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.86M|        } else { \
  |  |  |  |  |  |  154|  1.86M|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|  1.86M|        } \
  |  |  |  |  |  |  156|  2.54M|    } \
  |  |  |  |  |  |  157|  3.18M|}
  |  |  |  |  ------------------
  |  |  |  | 1126|  3.18M|                if( !v ) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1126:21): [True: 1.95M, False: 1.22M]
  |  |  |  |  ------------------
  |  |  |  | 1127|  3.18M|                    break; \
  |  |  |  | 1128|  3.18M|            } \
  |  |  |  | 1129|  3.18M|            { \
  |  |  |  | 1130|  1.22M|                OPJ_UINT32 lu = opj_t1_getctxtno_sc_or_spb_index( \
  |  |  |  | 1131|  1.22M|                                    flags, flagsp[-1], flagsp[1], \
  |  |  |  | 1132|  1.22M|                                    ci); \
  |  |  |  | 1133|  1.22M|                opj_t1_setcurctx(curctx, opj_t1_getctxno_sc(lu)); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   62|  1.22M|#define opj_t1_setcurctx(curctx, ctxno)  curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  |  |  |  |  ------------------
  |  |  |  | 1134|  1.22M|                opj_mqc_decode_macro(v, mqc, curctx, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.22M|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  |  |  139|  1.22M|{ \
  |  |  |  |  |  |  140|  1.22M|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  |  |  141|  1.22M|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  |  |  142|  1.22M|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  |  |  143|  1.22M|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  |  |  144|  1.22M|    a -= (*curctx)->qeval;  \
  |  |  |  |  |  |  145|  1.22M|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (145:9): [True: 334k, False: 893k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  146|   334k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   55|   334k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   56|   334k|{ \
  |  |  |  |  |  |  |  |   57|   334k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (57:9): [True: 80.7k, False: 253k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   58|  80.7k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   59|  80.7k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   60|  80.7k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   61|   253k|    } else { \
  |  |  |  |  |  |  |  |   62|   253k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |  |  |   63|   253k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   64|   253k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   65|   253k|    } \
  |  |  |  |  |  |  |  |   66|   334k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  147|   334k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   334k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   334k|{ \
  |  |  |  |  |  |  |  |  128|   519k|    do { \
  |  |  |  |  |  |  |  |  129|   519k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 68.2k, False: 451k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  68.2k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  68.2k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  68.2k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  68.2k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  68.2k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  68.2k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  68.2k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  68.2k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 62.2k, False: 6.01k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  62.2k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 59.7k, False: 2.45k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  59.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  59.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  59.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  59.7k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  2.45k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  2.45k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  2.45k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  2.45k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  62.2k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  6.01k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  6.01k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  6.01k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  6.01k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  68.2k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  68.2k|        } \
  |  |  |  |  |  |  |  |  132|   519k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   519k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   519k|        ct--; \
  |  |  |  |  |  |  |  |  135|   519k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 185k, False: 334k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   334k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  148|   893k|    } else {  \
  |  |  |  |  |  |  149|   893k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  |  |  150|   893k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (150:13): [True: 358k, False: 535k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  151|   358k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   43|   358k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |  |  |   44|   358k|{ \
  |  |  |  |  |  |  |  |   45|   358k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (45:9): [True: 62.8k, False: 295k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   46|  62.8k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |  |  |   47|  62.8k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |  |  |   48|   295k|    } else { \
  |  |  |  |  |  |  |  |   49|   295k|        d = (*curctx)->mps; \
  |  |  |  |  |  |  |  |   50|   295k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |  |  |   51|   295k|    } \
  |  |  |  |  |  |  |  |   52|   358k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  152|   358k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  126|   358k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  |  |  127|   358k|{ \
  |  |  |  |  |  |  |  |  128|   387k|    do { \
  |  |  |  |  |  |  |  |  129|   387k|        if (ct == 0) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (129:13): [True: 49.4k, False: 337k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  130|  49.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|  49.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  |  |  103|  49.4k|{ \
  |  |  |  |  |  |  |  |  |  |  104|  49.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  |  |  105|  49.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  |  |  106|  49.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  |  |  107|  49.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  |  |  108|  49.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 44.3k, False: 5.09k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|  44.3k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 42.3k, False: 1.99k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  110|  42.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  |  |  111|  42.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  |  |  112|  42.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  |  |  113|  42.3k|            } else { \
  |  |  |  |  |  |  |  |  |  |  114|  1.99k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  115|  1.99k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  |  |  116|  1.99k|                ct = 7; \
  |  |  |  |  |  |  |  |  |  |  117|  1.99k|            } \
  |  |  |  |  |  |  |  |  |  |  118|  44.3k|        } else { \
  |  |  |  |  |  |  |  |  |  |  119|  5.09k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  |  |  120|  5.09k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  |  |  121|  5.09k|            ct = 8; \
  |  |  |  |  |  |  |  |  |  |  122|  5.09k|        } \
  |  |  |  |  |  |  |  |  |  |  123|  49.4k|}
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  131|  49.4k|        } \
  |  |  |  |  |  |  |  |  132|   387k|        a <<= 1; \
  |  |  |  |  |  |  |  |  133|   387k|        c <<= 1; \
  |  |  |  |  |  |  |  |  134|   387k|        ct--; \
  |  |  |  |  |  |  |  |  135|   387k|    } while (a < 0x8000); \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (135:14): [True: 28.9k, False: 358k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|   358k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  153|   535k|        } else { \
  |  |  |  |  |  |  154|   535k|            d = (*curctx)->mps; \
  |  |  |  |  |  |  155|   535k|        } \
  |  |  |  |  |  |  156|   893k|    } \
  |  |  |  |  |  |  157|  1.22M|}
  |  |  |  |  ------------------
  |  |  |  | 1135|  1.22M|                v = v ^ opj_t1_getspb(lu); \
  |  |  |  | 1136|  1.22M|                data[ci*data_stride] = v ? -oneplushalf : oneplushalf; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1136:40): [True: 617k, False: 611k]
  |  |  |  |  ------------------
  |  |  |  | 1137|  1.22M|                opj_t1_update_flags_macro(flags, flagsp, ci, v, flags_stride, vsc); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  321|  1.22M|#define opj_t1_update_flags_macro(flags, flagsp, ci, s, stride, vsc) \
  |  |  |  |  |  |  322|  1.22M|{ \
  |  |  |  |  |  |  323|  1.22M|    /* east */ \
  |  |  |  |  |  |  324|  1.22M|    flagsp[-1] |= T1_SIGMA_5 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.22M|#define T1_SIGMA_5  (1U << 5)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  325|  1.22M| \
  |  |  |  |  |  |  326|  1.22M|    /* mark target as significant */ \
  |  |  |  |  |  |  327|  1.22M|    flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  113|  1.22M|#define T1_CHI_1_I  19
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                   flags |= ((s << T1_CHI_1_I) | T1_SIGMA_4) << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|  1.22M|#define T1_SIGMA_4  (1U << 4)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  328|  1.22M| \
  |  |  |  |  |  |  329|  1.22M|    /* west */ \
  |  |  |  |  |  |  330|  1.22M|    flagsp[1] |= T1_SIGMA_3 << (3U * ci); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|  1.22M|#define T1_SIGMA_3  (1U << 3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  331|  1.22M| \
  |  |  |  |  |  |  332|  1.22M|    /* north-west, north, north-east */ \
  |  |  |  |  |  |  333|  1.22M|    if (ci == 0U && !(vsc)) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (333:9): [Folded - Ignored]
  |  |  |  |  |  |  |  Branch (333:21): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  334|      0|        opj_flag_t* north = flagsp - (stride); \
  |  |  |  |  |  |  335|      0|        *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|      0|#define T1_CHI_5_I  31
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *north |= (s << T1_CHI_5_I) | T1_SIGMA_16; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define T1_SIGMA_16 (1U << 16)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  336|      0|        north[-1] |= T1_SIGMA_17; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  108|      0|#define T1_SIGMA_17 (1U << 17)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  337|      0|        north[1] |= T1_SIGMA_15; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define T1_SIGMA_15 (1U << 15)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  338|      0|    } \
  |  |  |  |  |  |  339|  1.22M| \
  |  |  |  |  |  |  340|  1.22M|    /* south-west, south, south-east */ \
  |  |  |  |  |  |  341|  1.22M|    if (ci == 3U) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (341:9): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  342|  1.22M|        opj_flag_t* south = flagsp + (stride); \
  |  |  |  |  |  |  343|  1.22M|        *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|  1.22M|#define T1_CHI_0_I  18
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |                       *south |= (s << T1_CHI_0_I) | T1_SIGMA_1; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|  1.22M|#define T1_SIGMA_1  (1U << 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  344|  1.22M|        south[-1] |= T1_SIGMA_2; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|  1.22M|#define T1_SIGMA_2  (1U << 2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  345|  1.22M|        south[1] |= T1_SIGMA_0; \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   91|  1.22M|#define T1_SIGMA_0  (1U << 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  346|  1.22M|    } \
  |  |  |  |  |  |  347|  1.22M|}
  |  |  |  |  ------------------
  |  |  |  | 1138|  1.22M|            } \
  |  |  |  | 1139|  1.22M|        } while(0); \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1139:17): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  |  | 1140|  3.18M|    } \
  |  |  |  | 1141|  14.9M|}
  |  |  ------------------
  |  | 1322|  14.9M|                                    flags, flagsp, flags_stride, data, \
  |  | 1323|  14.9M|                                    l_w, 3, mqc, curctx, \
  |  | 1324|  14.9M|                                    v, a, c, ct, oneplushalf, OPJ_FALSE); \
  |  | 1325|  14.9M|            } \
  |  | 1326|  25.2M|            *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  115|  15.2M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  119|  15.2M|#define T1_PI_1     (1U << 24)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  122|  15.2M|#define T1_PI_2     (1U << 27)
  |  |  ------------------
  |  |                           *flagsp = flags & ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  125|  15.2M|#define T1_PI_3     (1U << 30)
  |  |  ------------------
  |  | 1327|  15.2M|        } \
  |  | 1328|  1.88M|    } \
  |  | 1329|   182k|    UPLOAD_MQC_VARIABLES(mqc, curctx, a, c, ct); \
  |  |  ------------------
  |  |  |  |  166|   182k|        mqc->curctx = curctx; \
  |  |  |  |  167|   182k|        mqc->c = c; \
  |  |  |  |  168|   182k|        mqc->a = a; \
  |  |  |  |  169|   182k|        mqc->ct = ct;
  |  |  ------------------
  |  | 1330|   182k|    if( k < h ) { \
  |  |  ------------------
  |  |  |  Branch (1330:9): [True: 56.6k, False: 125k]
  |  |  ------------------
  |  | 1331|  1.83M|        for (i = 0; i < l_w; ++i, ++flagsp, ++data) { \
  |  |  ------------------
  |  |  |  Branch (1331:21): [True: 1.77M, False: 56.6k]
  |  |  ------------------
  |  | 1332|  5.21M|            for (j = 0; j < h - k; ++j) { \
  |  |  ------------------
  |  |  |  Branch (1332:25): [True: 3.43M, False: 1.77M]
  |  |  ------------------
  |  | 1333|  3.43M|                opj_t1_dec_clnpass_step(t1, flagsp, data + j * l_w, oneplushalf, j, vsc); \
  |  | 1334|  3.43M|            } \
  |  | 1335|  1.77M|            *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  115|  1.77M|#define T1_PI_0     (1U << 21)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  119|  1.77M|#define T1_PI_1     (1U << 24)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  122|  1.77M|#define T1_PI_2     (1U << 27)
  |  |  ------------------
  |  |                           *flagsp &= ~(T1_PI_0 | T1_PI_1 | T1_PI_2 | T1_PI_3); \
  |  |  ------------------
  |  |  |  |  125|  1.77M|#define T1_PI_3     (1U << 30)
  |  |  ------------------
  |  | 1336|  1.77M|        } \
  |  | 1337|  56.6k|    } \
  |  | 1338|   182k|}
  ------------------
 1380|   182k|                                t1->w + 2U);
 1381|   182k|}
t1.c:opj_t1_dec_clnpass_check_segsym:
 1341|   557k|{
 1342|   557k|    if (cblksty & J2K_CCP_CBLKSTY_SEGSYM) {
  ------------------
  |  |   63|   557k|#define J2K_CCP_CBLKSTY_SEGSYM 0x20   /**< Segmentation symbols are used */
  ------------------
  |  Branch (1342:9): [True: 367k, False: 189k]
  ------------------
 1343|   367k|        opj_mqc_t* mqc = &(t1->mqc);
 1344|   367k|        OPJ_UINT32 v, v2;
 1345|   367k|        opj_mqc_setcurctx(mqc, T1_CTXNO_UNI);
  ------------------
  |  |  139|   367k|#define opj_mqc_setcurctx(mqc, ctxno)   (mqc)->curctx = &(mqc)->ctxs[(OPJ_UINT32)(ctxno)]
  ------------------
 1346|   367k|        opj_mqc_decode(v, mqc);
  ------------------
  |  |  194|   367k|    opj_mqc_decode_macro(d, mqc, mqc->curctx, mqc->a, mqc->c, mqc->ct)
  |  |  ------------------
  |  |  |  |  138|   367k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   367k|{ \
  |  |  |  |  140|   367k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   367k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   367k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   367k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   367k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   367k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 125k, False: 241k]
  |  |  |  |  ------------------
  |  |  |  |  146|   125k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   125k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   125k|{ \
  |  |  |  |  |  |   57|   125k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 59.2k, False: 66.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  59.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  59.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  59.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|  66.3k|    } else { \
  |  |  |  |  |  |   62|  66.3k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|  66.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|  66.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|  66.3k|    } \
  |  |  |  |  |  |   66|   125k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   125k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   125k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   125k|{ \
  |  |  |  |  |  |  128|   125k|    do { \
  |  |  |  |  |  |  129|   125k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 16.9k, False: 108k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  16.9k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  16.9k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  16.9k|{ \
  |  |  |  |  |  |  |  |  104|  16.9k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  16.9k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  16.9k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  16.9k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  16.9k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 12.8k, False: 4.15k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  12.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 8.87k, False: 3.94k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  8.87k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  8.87k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  8.87k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  8.87k|            } else { \
  |  |  |  |  |  |  |  |  114|  3.94k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  3.94k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  3.94k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  3.94k|            } \
  |  |  |  |  |  |  |  |  118|  12.8k|        } else { \
  |  |  |  |  |  |  |  |  119|  4.15k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  4.15k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  4.15k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  4.15k|        } \
  |  |  |  |  |  |  |  |  123|  16.9k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  16.9k|        } \
  |  |  |  |  |  |  132|   125k|        a <<= 1; \
  |  |  |  |  |  |  133|   125k|        c <<= 1; \
  |  |  |  |  |  |  134|   125k|        ct--; \
  |  |  |  |  |  |  135|   125k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 125k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   125k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   241k|    } else {  \
  |  |  |  |  149|   241k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   241k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 153k, False: 88.3k]
  |  |  |  |  ------------------
  |  |  |  |  151|   153k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   153k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   153k|{ \
  |  |  |  |  |  |   45|   153k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 76.3k, False: 77.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  76.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  76.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|  77.2k|    } else { \
  |  |  |  |  |  |   49|  77.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|  77.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|  77.2k|    } \
  |  |  |  |  |  |   52|   153k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   153k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   153k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   153k|{ \
  |  |  |  |  |  |  128|   186k|    do { \
  |  |  |  |  |  |  129|   186k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 29.5k, False: 157k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  29.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  29.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  29.5k|{ \
  |  |  |  |  |  |  |  |  104|  29.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  29.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  29.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  29.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  29.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 20.4k, False: 9.12k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  20.4k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 18.2k, False: 2.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  18.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  18.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  18.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  18.2k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.18k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.18k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.18k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.18k|            } \
  |  |  |  |  |  |  |  |  118|  20.4k|        } else { \
  |  |  |  |  |  |  |  |  119|  9.12k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  9.12k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  9.12k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  9.12k|        } \
  |  |  |  |  |  |  |  |  123|  29.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  29.5k|        } \
  |  |  |  |  |  |  132|   186k|        a <<= 1; \
  |  |  |  |  |  |  133|   186k|        c <<= 1; \
  |  |  |  |  |  |  134|   186k|        ct--; \
  |  |  |  |  |  |  135|   186k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 33.0k, False: 153k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   153k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   153k|        } else { \
  |  |  |  |  154|  88.3k|            d = (*curctx)->mps; \
  |  |  |  |  155|  88.3k|        } \
  |  |  |  |  156|   241k|    } \
  |  |  |  |  157|   367k|}
  |  |  ------------------
  ------------------
 1347|   367k|        opj_mqc_decode(v2, mqc);
  ------------------
  |  |  194|   367k|    opj_mqc_decode_macro(d, mqc, mqc->curctx, mqc->a, mqc->c, mqc->ct)
  |  |  ------------------
  |  |  |  |  138|   367k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   367k|{ \
  |  |  |  |  140|   367k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   367k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   367k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   367k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   367k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   367k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 138k, False: 229k]
  |  |  |  |  ------------------
  |  |  |  |  146|   138k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   138k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   138k|{ \
  |  |  |  |  |  |   57|   138k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 41.8k, False: 96.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  41.8k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  41.8k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  41.8k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|  96.2k|    } else { \
  |  |  |  |  |  |   62|  96.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|  96.2k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|  96.2k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|  96.2k|    } \
  |  |  |  |  |  |   66|   138k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   138k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   138k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   138k|{ \
  |  |  |  |  |  |  128|   138k|    do { \
  |  |  |  |  |  |  129|   138k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 18.0k, False: 120k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  18.0k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  18.0k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  18.0k|{ \
  |  |  |  |  |  |  |  |  104|  18.0k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  18.0k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  18.0k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  18.0k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  18.0k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 12.8k, False: 5.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  12.8k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 10.2k, False: 2.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  10.2k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  10.2k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  10.2k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  10.2k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.58k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.58k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.58k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.58k|            } \
  |  |  |  |  |  |  |  |  118|  12.8k|        } else { \
  |  |  |  |  |  |  |  |  119|  5.18k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  5.18k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  5.18k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  5.18k|        } \
  |  |  |  |  |  |  |  |  123|  18.0k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  18.0k|        } \
  |  |  |  |  |  |  132|   138k|        a <<= 1; \
  |  |  |  |  |  |  133|   138k|        c <<= 1; \
  |  |  |  |  |  |  134|   138k|        ct--; \
  |  |  |  |  |  |  135|   138k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 138k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   138k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   229k|    } else {  \
  |  |  |  |  149|   229k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   229k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 193k, False: 36.3k]
  |  |  |  |  ------------------
  |  |  |  |  151|   193k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   193k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   193k|{ \
  |  |  |  |  |  |   45|   193k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 95.9k, False: 97.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  95.9k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  95.9k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|  97.1k|    } else { \
  |  |  |  |  |  |   49|  97.1k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|  97.1k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|  97.1k|    } \
  |  |  |  |  |  |   52|   193k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   193k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   193k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   193k|{ \
  |  |  |  |  |  |  128|   235k|    do { \
  |  |  |  |  |  |  129|   235k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 24.4k, False: 210k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  24.4k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  24.4k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  24.4k|{ \
  |  |  |  |  |  |  |  |  104|  24.4k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  24.4k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  24.4k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  24.4k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  24.4k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 20.5k, False: 3.89k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  20.5k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 18.7k, False: 1.76k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  18.7k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  18.7k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  18.7k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  18.7k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.76k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.76k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.76k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.76k|            } \
  |  |  |  |  |  |  |  |  118|  20.5k|        } else { \
  |  |  |  |  |  |  |  |  119|  3.89k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  3.89k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  3.89k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  3.89k|        } \
  |  |  |  |  |  |  |  |  123|  24.4k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  24.4k|        } \
  |  |  |  |  |  |  132|   235k|        a <<= 1; \
  |  |  |  |  |  |  133|   235k|        c <<= 1; \
  |  |  |  |  |  |  134|   235k|        ct--; \
  |  |  |  |  |  |  135|   235k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 42.1k, False: 193k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   193k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   193k|        } else { \
  |  |  |  |  154|  36.3k|            d = (*curctx)->mps; \
  |  |  |  |  155|  36.3k|        } \
  |  |  |  |  156|   229k|    } \
  |  |  |  |  157|   367k|}
  |  |  ------------------
  ------------------
 1348|   367k|        v = (v << 1) | v2;
 1349|   367k|        opj_mqc_decode(v2, mqc);
  ------------------
  |  |  194|   367k|    opj_mqc_decode_macro(d, mqc, mqc->curctx, mqc->a, mqc->c, mqc->ct)
  |  |  ------------------
  |  |  |  |  138|   367k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   367k|{ \
  |  |  |  |  140|   367k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   367k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   367k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   367k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   367k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   367k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 141k, False: 225k]
  |  |  |  |  ------------------
  |  |  |  |  146|   141k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   141k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   141k|{ \
  |  |  |  |  |  |   57|   141k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 29.1k, False: 112k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  29.1k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  29.1k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  29.1k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   112k|    } else { \
  |  |  |  |  |  |   62|   112k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   112k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   112k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   112k|    } \
  |  |  |  |  |  |   66|   141k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   141k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   141k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   141k|{ \
  |  |  |  |  |  |  128|   141k|    do { \
  |  |  |  |  |  |  129|   141k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 20.7k, False: 120k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  20.7k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  20.7k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  20.7k|{ \
  |  |  |  |  |  |  |  |  104|  20.7k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  20.7k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  20.7k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  20.7k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  20.7k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 14.6k, False: 6.11k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  14.6k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 10.3k, False: 4.30k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  10.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  10.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  10.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  10.3k|            } else { \
  |  |  |  |  |  |  |  |  114|  4.30k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  4.30k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  4.30k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  4.30k|            } \
  |  |  |  |  |  |  |  |  118|  14.6k|        } else { \
  |  |  |  |  |  |  |  |  119|  6.11k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  6.11k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  6.11k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  6.11k|        } \
  |  |  |  |  |  |  |  |  123|  20.7k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  20.7k|        } \
  |  |  |  |  |  |  132|   141k|        a <<= 1; \
  |  |  |  |  |  |  133|   141k|        c <<= 1; \
  |  |  |  |  |  |  134|   141k|        ct--; \
  |  |  |  |  |  |  135|   141k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 141k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   141k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   225k|    } else {  \
  |  |  |  |  149|   225k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   225k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 184k, False: 41.0k]
  |  |  |  |  ------------------
  |  |  |  |  151|   184k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   184k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   184k|{ \
  |  |  |  |  |  |   45|   184k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 61.3k, False: 123k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  61.3k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  61.3k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   123k|    } else { \
  |  |  |  |  |  |   49|   123k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   123k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   123k|    } \
  |  |  |  |  |  |   52|   184k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   184k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   184k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   184k|{ \
  |  |  |  |  |  |  128|   216k|    do { \
  |  |  |  |  |  |  129|   216k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 26.2k, False: 190k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  26.2k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  26.2k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  26.2k|{ \
  |  |  |  |  |  |  |  |  104|  26.2k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  26.2k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  26.2k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  26.2k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  26.2k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 19.9k, False: 6.33k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  19.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 18.3k, False: 1.57k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  18.3k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  18.3k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  18.3k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  18.3k|            } else { \
  |  |  |  |  |  |  |  |  114|  1.57k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  1.57k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  1.57k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  1.57k|            } \
  |  |  |  |  |  |  |  |  118|  19.9k|        } else { \
  |  |  |  |  |  |  |  |  119|  6.33k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  6.33k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  6.33k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  6.33k|        } \
  |  |  |  |  |  |  |  |  123|  26.2k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  26.2k|        } \
  |  |  |  |  |  |  132|   216k|        a <<= 1; \
  |  |  |  |  |  |  133|   216k|        c <<= 1; \
  |  |  |  |  |  |  134|   216k|        ct--; \
  |  |  |  |  |  |  135|   216k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 31.7k, False: 184k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   184k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   184k|        } else { \
  |  |  |  |  154|  41.0k|            d = (*curctx)->mps; \
  |  |  |  |  155|  41.0k|        } \
  |  |  |  |  156|   225k|    } \
  |  |  |  |  157|   367k|}
  |  |  ------------------
  ------------------
 1350|   367k|        v = (v << 1) | v2;
 1351|   367k|        opj_mqc_decode(v2, mqc);
  ------------------
  |  |  194|   367k|    opj_mqc_decode_macro(d, mqc, mqc->curctx, mqc->a, mqc->c, mqc->ct)
  |  |  ------------------
  |  |  |  |  138|   367k|#define opj_mqc_decode_macro(d, mqc, curctx, a, c, ct) \
  |  |  |  |  139|   367k|{ \
  |  |  |  |  140|   367k|    /* Implements ISO 15444-1 C.3.2 Decoding a decision (DECODE) */ \
  |  |  |  |  141|   367k|    /* Note: alternate "J.2 - Decoding an MPS or an LPS in the */ \
  |  |  |  |  142|   367k|    /* software-conventions decoder" has been tried, but does not bring any */ \
  |  |  |  |  143|   367k|    /* improvement. See https://github.com/uclouvain/openjpeg/issues/921 */ \
  |  |  |  |  144|   367k|    a -= (*curctx)->qeval;  \
  |  |  |  |  145|   367k|    if ((c >> 16) < (*curctx)->qeval) {  \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (145:9): [True: 145k, False: 222k]
  |  |  |  |  ------------------
  |  |  |  |  146|   145k|        opj_mqc_lpsexchange_macro(d, curctx, a);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |   55|   145k|#define opj_mqc_lpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   56|   145k|{ \
  |  |  |  |  |  |   57|   145k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (57:9): [True: 15.2k, False: 130k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   58|  15.2k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   59|  15.2k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   60|  15.2k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   61|   130k|    } else { \
  |  |  |  |  |  |   62|   130k|        a = (*curctx)->qeval; \
  |  |  |  |  |  |   63|   130k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   64|   130k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   65|   130k|    } \
  |  |  |  |  |  |   66|   145k|}
  |  |  |  |  ------------------
  |  |  |  |  147|   145k|        opj_mqc_renormd_macro(mqc, a, c, ct);  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   145k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   145k|{ \
  |  |  |  |  |  |  128|   145k|    do { \
  |  |  |  |  |  |  129|   145k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 18.6k, False: 126k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  18.6k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  18.6k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  18.6k|{ \
  |  |  |  |  |  |  |  |  104|  18.6k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  18.6k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  18.6k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  18.6k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  18.6k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 14.5k, False: 4.15k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  14.5k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 11.6k, False: 2.91k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  11.6k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  11.6k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  11.6k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  11.6k|            } else { \
  |  |  |  |  |  |  |  |  114|  2.91k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  2.91k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  2.91k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  2.91k|            } \
  |  |  |  |  |  |  |  |  118|  14.5k|        } else { \
  |  |  |  |  |  |  |  |  119|  4.15k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  4.15k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  4.15k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  4.15k|        } \
  |  |  |  |  |  |  |  |  123|  18.6k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  18.6k|        } \
  |  |  |  |  |  |  132|   145k|        a <<= 1; \
  |  |  |  |  |  |  133|   145k|        c <<= 1; \
  |  |  |  |  |  |  134|   145k|        ct--; \
  |  |  |  |  |  |  135|   145k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 0, False: 145k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   145k|}
  |  |  |  |  ------------------
  |  |  |  |  148|   222k|    } else {  \
  |  |  |  |  149|   222k|        c -= (*curctx)->qeval << 16;  \
  |  |  |  |  150|   222k|        if ((a & 0x8000) == 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (150:13): [True: 204k, False: 17.8k]
  |  |  |  |  ------------------
  |  |  |  |  151|   204k|            opj_mqc_mpsexchange_macro(d, curctx, a); \
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   204k|#define opj_mqc_mpsexchange_macro(d, curctx, a) \
  |  |  |  |  |  |   44|   204k|{ \
  |  |  |  |  |  |   45|   204k|    if (a < (*curctx)->qeval) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (45:9): [True: 56.2k, False: 148k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  56.2k|        d = !((*curctx)->mps); \
  |  |  |  |  |  |   47|  56.2k|        *curctx = (*curctx)->nlps; \
  |  |  |  |  |  |   48|   148k|    } else { \
  |  |  |  |  |  |   49|   148k|        d = (*curctx)->mps; \
  |  |  |  |  |  |   50|   148k|        *curctx = (*curctx)->nmps; \
  |  |  |  |  |  |   51|   148k|    } \
  |  |  |  |  |  |   52|   204k|}
  |  |  |  |  ------------------
  |  |  |  |  152|   204k|            opj_mqc_renormd_macro(mqc, a, c, ct); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  126|   204k|#define opj_mqc_renormd_macro(mqc, a, c, ct) \
  |  |  |  |  |  |  127|   204k|{ \
  |  |  |  |  |  |  128|   239k|    do { \
  |  |  |  |  |  |  129|   239k|        if (ct == 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (129:13): [True: 29.5k, False: 209k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  130|  29.5k|            opj_mqc_bytein_macro(mqc, c, ct); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|  29.5k|#define opj_mqc_bytein_macro(mqc, c, ct) \
  |  |  |  |  |  |  |  |  103|  29.5k|{ \
  |  |  |  |  |  |  |  |  104|  29.5k|        OPJ_UINT32 l_c;  \
  |  |  |  |  |  |  |  |  105|  29.5k|        /* Given opj_mqc_init_dec() we know that at some point we will */ \
  |  |  |  |  |  |  |  |  106|  29.5k|        /* have a 0xFF 0xFF artificial marker */ \
  |  |  |  |  |  |  |  |  107|  29.5k|        l_c = *(mqc->bp + 1); \
  |  |  |  |  |  |  |  |  108|  29.5k|        if (*mqc->bp == 0xff) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (108:13): [True: 24.9k, False: 4.64k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  109|  24.9k|            if (l_c > 0x8f) { \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (109:17): [True: 20.5k, False: 4.40k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|  20.5k|                c += 0xff00; \
  |  |  |  |  |  |  |  |  111|  20.5k|                ct = 8; \
  |  |  |  |  |  |  |  |  112|  20.5k|                mqc->end_of_byte_stream_counter ++; \
  |  |  |  |  |  |  |  |  113|  20.5k|            } else { \
  |  |  |  |  |  |  |  |  114|  4.40k|                mqc->bp++; \
  |  |  |  |  |  |  |  |  115|  4.40k|                c += l_c << 9; \
  |  |  |  |  |  |  |  |  116|  4.40k|                ct = 7; \
  |  |  |  |  |  |  |  |  117|  4.40k|            } \
  |  |  |  |  |  |  |  |  118|  24.9k|        } else { \
  |  |  |  |  |  |  |  |  119|  4.64k|            mqc->bp++; \
  |  |  |  |  |  |  |  |  120|  4.64k|            c += l_c << 8; \
  |  |  |  |  |  |  |  |  121|  4.64k|            ct = 8; \
  |  |  |  |  |  |  |  |  122|  4.64k|        } \
  |  |  |  |  |  |  |  |  123|  29.5k|}
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  29.5k|        } \
  |  |  |  |  |  |  132|   239k|        a <<= 1; \
  |  |  |  |  |  |  133|   239k|        c <<= 1; \
  |  |  |  |  |  |  134|   239k|        ct--; \
  |  |  |  |  |  |  135|   239k|    } while (a < 0x8000); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (135:14): [True: 35.0k, False: 204k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   204k|}
  |  |  |  |  ------------------
  |  |  |  |  153|   204k|        } else { \
  |  |  |  |  154|  17.8k|            d = (*curctx)->mps; \
  |  |  |  |  155|  17.8k|        } \
  |  |  |  |  156|   222k|    } \
  |  |  |  |  157|   367k|}
  |  |  ------------------
  ------------------
 1352|   367k|        v = (v << 1) | v2;
 1353|       |        /*
 1354|       |        if (v!=0xa) {
 1355|       |            opj_event_msg(t1->cinfo, EVT_WARNING, "Bad segmentation symbol %x\n", v);
 1356|       |        }
 1357|       |        */
 1358|   367k|    }
 1359|   557k|}

opj_t2_decode_packets:
  402|  8.79k|{
  403|  8.79k|    OPJ_BYTE *l_current_data = p_src;
  404|  8.79k|    opj_pi_iterator_t *l_pi = 00;
  405|  8.79k|    OPJ_UINT32 pino;
  406|  8.79k|    opj_image_t *l_image = p_t2->image;
  407|  8.79k|    opj_cp_t *l_cp = p_t2->cp;
  408|  8.79k|    opj_tcp_t *l_tcp = &(p_t2->cp->tcps[p_tile_no]);
  409|  8.79k|    OPJ_UINT32 l_nb_bytes_read;
  410|  8.79k|    OPJ_UINT32 l_nb_pocs = l_tcp->numpocs + 1;
  411|  8.79k|    opj_pi_iterator_t *l_current_pi = 00;
  412|       |#ifdef TODO_MSD
  413|       |    OPJ_UINT32 curtp = 0;
  414|       |    OPJ_UINT32 tp_start_packno;
  415|       |#endif
  416|  8.79k|    opj_packet_info_t *l_pack_info = 00;
  417|  8.79k|    opj_image_comp_t* l_img_comp = 00;
  418|       |
  419|  8.79k|    OPJ_ARG_NOT_USED(p_cstr_index);
  ------------------
  |  |  142|  8.79k|#define OPJ_ARG_NOT_USED(x) (void)(x)
  ------------------
  420|       |
  421|       |#ifdef TODO_MSD
  422|       |    if (p_cstr_index) {
  423|       |        l_pack_info = p_cstr_index->tile_index[p_tile_no].packet;
  424|       |    }
  425|       |#endif
  426|       |
  427|       |    /* create a packet iterator */
  428|  8.79k|    l_pi = opj_pi_create_decode(l_image, l_cp, p_tile_no, p_manager);
  429|  8.79k|    if (!l_pi) {
  ------------------
  |  Branch (429:9): [True: 15, False: 8.77k]
  ------------------
  430|     15|        return OPJ_FALSE;
  ------------------
  |  |  118|     15|#define OPJ_FALSE 0
  ------------------
  431|     15|    }
  432|       |
  433|       |
  434|  8.77k|    l_current_pi = l_pi;
  435|       |
  436|  30.8k|    for (pino = 0; pino <= l_tcp->numpocs; ++pino) {
  ------------------
  |  Branch (436:20): [True: 22.4k, False: 8.35k]
  ------------------
  437|       |
  438|       |        /* if the resolution needed is too low, one dim of the tilec could be equal to zero
  439|       |         * and no packets are used to decode this resolution and
  440|       |         * l_current_pi->resno is always >= p_tile->comps[l_current_pi->compno].minimum_num_resolutions
  441|       |         * and no l_img_comp->resno_decoded are computed
  442|       |         */
  443|  22.4k|        OPJ_BOOL* first_pass_failed = NULL;
  444|       |
  445|  22.4k|        if (l_current_pi->poc.prg == OPJ_PROG_UNKNOWN) {
  ------------------
  |  Branch (445:13): [True: 5, False: 22.4k]
  ------------------
  446|       |            /* TODO ADE : add an error */
  447|      5|            opj_pi_destroy(l_pi, l_nb_pocs);
  448|      5|            return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
  449|      5|        }
  450|       |
  451|  22.4k|        first_pass_failed = (OPJ_BOOL*)opj_malloc(l_image->numcomps * sizeof(OPJ_BOOL));
  452|  22.4k|        if (!first_pass_failed) {
  ------------------
  |  Branch (452:13): [True: 0, False: 22.4k]
  ------------------
  453|      0|            opj_pi_destroy(l_pi, l_nb_pocs);
  454|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  455|      0|        }
  456|  22.4k|        memset(first_pass_failed, OPJ_TRUE, l_image->numcomps * sizeof(OPJ_BOOL));
  ------------------
  |  |  117|  22.4k|#define OPJ_TRUE 1
  ------------------
  457|       |
  458|   695M|        while (opj_pi_next(l_current_pi)) {
  ------------------
  |  Branch (458:16): [True: 695M, False: 22.0k]
  ------------------
  459|   695M|            OPJ_BOOL skip_packet = OPJ_FALSE;
  ------------------
  |  |  118|   695M|#define OPJ_FALSE 0
  ------------------
  460|   695M|            JAS_FPRINTF(stderr,
  ------------------
  |  |  390|   695M|#define JAS_FPRINTF opj_null_jas_fprintf
  ------------------
  461|   695M|                        "packet offset=00000166 prg=%d cmptno=%02d rlvlno=%02d prcno=%03d lyrno=%02d\n\n",
  462|   695M|                        l_current_pi->poc.prg1, l_current_pi->compno, l_current_pi->resno,
  463|   695M|                        l_current_pi->precno, l_current_pi->layno);
  464|       |
  465|       |            /* If the packet layer is greater or equal than the maximum */
  466|       |            /* number of layers, skip the packet */
  467|   695M|            if (l_current_pi->layno >= l_tcp->num_layers_to_decode) {
  ------------------
  |  Branch (467:17): [True: 0, False: 695M]
  ------------------
  468|      0|                skip_packet = OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
  469|      0|            }
  470|       |            /* If the packet resolution number is greater than the minimum */
  471|       |            /* number of resolution allowed, skip the packet */
  472|   695M|            else if (l_current_pi->resno >=
  ------------------
  |  Branch (472:22): [True: 0, False: 695M]
  ------------------
  473|   695M|                     p_tile->comps[l_current_pi->compno].minimum_num_resolutions) {
  474|      0|                skip_packet = OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
  475|   695M|            } else {
  476|       |                /* If no precincts of any band intersects the area of interest, */
  477|       |                /* skip the packet */
  478|   695M|                OPJ_UINT32 bandno;
  479|   695M|                opj_tcd_tilecomp_t *tilec = &p_tile->comps[l_current_pi->compno];
  480|   695M|                opj_tcd_resolution_t *res = &tilec->resolutions[l_current_pi->resno];
  481|       |
  482|   695M|                skip_packet = OPJ_TRUE;
  ------------------
  |  |  117|   695M|#define OPJ_TRUE 1
  ------------------
  483|  1.32G|                for (bandno = 0; bandno < res->numbands; ++bandno) {
  ------------------
  |  Branch (483:34): [True: 732M, False: 588M]
  ------------------
  484|   732M|                    opj_tcd_band_t* band = &res->bands[bandno];
  485|   732M|                    opj_tcd_precinct_t* prec = &band->precincts[l_current_pi->precno];
  486|       |
  487|   732M|                    if (opj_tcd_is_subband_area_of_interest(tcd,
  ------------------
  |  Branch (487:25): [True: 106M, False: 626M]
  ------------------
  488|   732M|                                                            l_current_pi->compno,
  489|   732M|                                                            l_current_pi->resno,
  490|   732M|                                                            band->bandno,
  491|   732M|                                                            (OPJ_UINT32)prec->x0,
  492|   732M|                                                            (OPJ_UINT32)prec->y0,
  493|   732M|                                                            (OPJ_UINT32)prec->x1,
  494|   732M|                                                            (OPJ_UINT32)prec->y1)) {
  495|   106M|                        skip_packet = OPJ_FALSE;
  ------------------
  |  |  118|   106M|#define OPJ_FALSE 0
  ------------------
  496|   106M|                        break;
  497|   106M|                    }
  498|   732M|                }
  499|       |                /*
  500|       |                                printf("packet cmptno=%02d rlvlno=%02d prcno=%03d lyrno=%02d -> %s\n",
  501|       |                                    l_current_pi->compno, l_current_pi->resno,
  502|       |                                    l_current_pi->precno, l_current_pi->layno, skip_packet ? "skipped" : "kept");
  503|       |                */
  504|   695M|            }
  505|   695M|            if (!skip_packet) {
  ------------------
  |  Branch (505:17): [True: 106M, False: 588M]
  ------------------
  506|   106M|                l_nb_bytes_read = 0;
  507|       |
  508|   106M|                first_pass_failed[l_current_pi->compno] = OPJ_FALSE;
  ------------------
  |  |  118|   106M|#define OPJ_FALSE 0
  ------------------
  509|       |
  510|   106M|                if (! opj_t2_decode_packet(p_t2, p_tile, l_tcp, l_current_pi, l_current_data,
  ------------------
  |  Branch (510:21): [True: 296, False: 106M]
  ------------------
  511|   106M|                                           &l_nb_bytes_read, p_max_len, l_pack_info, p_manager)) {
  512|    296|                    opj_pi_destroy(l_pi, l_nb_pocs);
  513|    296|                    opj_free(first_pass_failed);
  514|    296|                    return OPJ_FALSE;
  ------------------
  |  |  118|    296|#define OPJ_FALSE 0
  ------------------
  515|    296|                }
  516|       |
  517|   106M|                l_img_comp = &(l_image->comps[l_current_pi->compno]);
  518|   106M|                l_img_comp->resno_decoded = opj_uint_max(l_current_pi->resno,
  519|   106M|                                            l_img_comp->resno_decoded);
  520|   588M|            } else {
  521|   588M|                l_nb_bytes_read = 0;
  522|   588M|                if (! opj_t2_skip_packet(p_t2, p_tile, l_tcp, l_current_pi, l_current_data,
  ------------------
  |  Branch (522:21): [True: 118, False: 588M]
  ------------------
  523|   588M|                                         &l_nb_bytes_read, p_max_len, l_pack_info, p_manager)) {
  524|    118|                    opj_pi_destroy(l_pi, l_nb_pocs);
  525|    118|                    opj_free(first_pass_failed);
  526|    118|                    return OPJ_FALSE;
  ------------------
  |  |  118|    118|#define OPJ_FALSE 0
  ------------------
  527|    118|                }
  528|   588M|            }
  529|       |
  530|   695M|            if (first_pass_failed[l_current_pi->compno]) {
  ------------------
  |  Branch (530:17): [True: 4.01M, False: 691M]
  ------------------
  531|  4.01M|                l_img_comp = &(l_image->comps[l_current_pi->compno]);
  532|  4.01M|                if (l_img_comp->resno_decoded == 0) {
  ------------------
  |  Branch (532:21): [True: 4.01M, False: 859]
  ------------------
  533|  4.01M|                    l_img_comp->resno_decoded =
  534|  4.01M|                        p_tile->comps[l_current_pi->compno].minimum_num_resolutions - 1;
  535|  4.01M|                }
  536|  4.01M|            }
  537|       |
  538|   695M|            l_current_data += l_nb_bytes_read;
  539|   695M|            p_max_len -= l_nb_bytes_read;
  540|       |
  541|       |            /* INDEX >> */
  542|       |#ifdef TODO_MSD
  543|       |            if (p_cstr_info) {
  544|       |                opj_tile_info_v2_t *info_TL = &p_cstr_info->tile[p_tile_no];
  545|       |                opj_packet_info_t *info_PK = &info_TL->packet[p_cstr_info->packno];
  546|       |                tp_start_packno = 0;
  547|       |                if (!p_cstr_info->packno) {
  548|       |                    info_PK->start_pos = info_TL->end_header + 1;
  549|       |                } else if (info_TL->packet[p_cstr_info->packno - 1].end_pos >=
  550|       |                           (OPJ_INT32)
  551|       |                           p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_pos) { /* New tile part */
  552|       |                    info_TL->tp[curtp].tp_numpacks = p_cstr_info->packno -
  553|       |                                                     tp_start_packno; /* Number of packets in previous tile-part */
  554|       |                    tp_start_packno = p_cstr_info->packno;
  555|       |                    curtp++;
  556|       |                    info_PK->start_pos = p_cstr_info->tile[p_tile_no].tp[curtp].tp_end_header + 1;
  557|       |                } else {
  558|       |                    info_PK->start_pos = (l_cp->m_specific_param.m_enc.m_tp_on &&
  559|       |                                          info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[p_cstr_info->packno -
  560|       |                                                                      1].end_pos + 1;
  561|       |                }
  562|       |                info_PK->end_pos = info_PK->start_pos + l_nb_bytes_read - 1;
  563|       |                info_PK->end_ph_pos += info_PK->start_pos -
  564|       |                                       1;  /* End of packet header which now only represents the distance */
  565|       |                ++p_cstr_info->packno;
  566|       |            }
  567|       |#endif
  568|       |            /* << INDEX */
  569|   695M|        }
  570|  22.0k|        ++l_current_pi;
  571|       |
  572|  22.0k|        opj_free(first_pass_failed);
  573|  22.0k|    }
  574|       |    /* INDEX >> */
  575|       |#ifdef TODO_MSD
  576|       |    if
  577|       |    (p_cstr_info) {
  578|       |        p_cstr_info->tile[p_tile_no].tp[curtp].tp_numpacks = p_cstr_info->packno -
  579|       |                tp_start_packno; /* Number of packets in last tile-part */
  580|       |    }
  581|       |#endif
  582|       |    /* << INDEX */
  583|       |
  584|       |    /* don't forget to release pi */
  585|  8.35k|    opj_pi_destroy(l_pi, l_nb_pocs);
  586|  8.35k|    *p_data_read = (OPJ_UINT32)(l_current_data - p_src);
  587|  8.35k|    return OPJ_TRUE;
  ------------------
  |  |  117|  8.35k|#define OPJ_TRUE 1
  ------------------
  588|  8.77k|}
opj_t2_create:
  600|  8.79k|{
  601|       |    /* create the t2 structure */
  602|  8.79k|    opj_t2_t *l_t2 = (opj_t2_t*)opj_calloc(1, sizeof(opj_t2_t));
  603|  8.79k|    if (!l_t2) {
  ------------------
  |  Branch (603:9): [True: 0, False: 8.79k]
  ------------------
  604|      0|        return NULL;
  605|      0|    }
  606|       |
  607|  8.79k|    l_t2->image = p_image;
  608|  8.79k|    l_t2->cp = p_cp;
  609|       |
  610|  8.79k|    return l_t2;
  611|  8.79k|}
opj_t2_destroy:
  614|  8.79k|{
  615|  8.79k|    if (t2) {
  ------------------
  |  Branch (615:9): [True: 8.79k, False: 0]
  ------------------
  616|  8.79k|        opj_free(t2);
  617|  8.79k|    }
  618|  8.79k|}
t2.c:opj_null_jas_fprintf:
  386|  1.40G|{
  387|  1.40G|    (void)file;
  388|  1.40G|    (void)format;
  389|  1.40G|}
t2.c:opj_t2_decode_packet:
  629|   106M|{
  630|   106M|    OPJ_BOOL l_read_data;
  631|   106M|    OPJ_UINT32 l_nb_bytes_read = 0;
  632|   106M|    OPJ_UINT32 l_nb_total_bytes_read = 0;
  633|       |
  634|   106M|    *p_data_read = 0;
  635|       |
  636|   106M|    if (! opj_t2_read_packet_header(p_t2, p_tile, p_tcp, p_pi, &l_read_data, p_src,
  ------------------
  |  Branch (636:9): [True: 9, False: 106M]
  ------------------
  637|   106M|                                    &l_nb_bytes_read, p_max_length, p_pack_info, p_manager)) {
  638|      9|        return OPJ_FALSE;
  ------------------
  |  |  118|      9|#define OPJ_FALSE 0
  ------------------
  639|      9|    }
  640|       |
  641|   106M|    p_src += l_nb_bytes_read;
  642|   106M|    l_nb_total_bytes_read += l_nb_bytes_read;
  643|   106M|    p_max_length -= l_nb_bytes_read;
  644|       |
  645|       |    /* we should read data for the packet */
  646|   106M|    if (l_read_data) {
  ------------------
  |  Branch (646:9): [True: 717k, False: 106M]
  ------------------
  647|   717k|        l_nb_bytes_read = 0;
  648|       |
  649|   717k|        if (! opj_t2_read_packet_data(p_t2, p_tile, p_pi, p_src, &l_nb_bytes_read,
  ------------------
  |  Branch (649:13): [True: 287, False: 717k]
  ------------------
  650|   717k|                                      p_max_length, p_pack_info, p_manager)) {
  651|    287|            return OPJ_FALSE;
  ------------------
  |  |  118|    287|#define OPJ_FALSE 0
  ------------------
  652|    287|        }
  653|       |
  654|   717k|        l_nb_total_bytes_read += l_nb_bytes_read;
  655|   717k|    }
  656|       |
  657|   106M|    *p_data_read = l_nb_total_bytes_read;
  658|       |
  659|   106M|    return OPJ_TRUE;
  ------------------
  |  |  117|   106M|#define OPJ_TRUE 1
  ------------------
  660|   106M|}
t2.c:opj_t2_read_packet_header:
 1061|   695M|{
 1062|       |    /* loop */
 1063|   695M|    OPJ_UINT32 bandno, cblkno;
 1064|   695M|    OPJ_UINT32 l_nb_code_blocks;
 1065|   695M|    OPJ_UINT32 l_remaining_length;
 1066|   695M|    OPJ_UINT32 l_header_length;
 1067|   695M|    OPJ_UINT32 * l_modified_length_ptr = 00;
 1068|   695M|    OPJ_BYTE *l_current_data = p_src_data;
 1069|   695M|    opj_cp_t *l_cp = p_t2->cp;
 1070|   695M|    opj_bio_t *l_bio = 00;  /* BIO component */
 1071|   695M|    opj_tcd_band_t *l_band = 00;
 1072|   695M|    opj_tcd_cblk_dec_t* l_cblk = 00;
 1073|   695M|    opj_tcd_resolution_t* l_res =
 1074|   695M|        &p_tile->comps[p_pi->compno].resolutions[p_pi->resno];
 1075|       |
 1076|   695M|    OPJ_BYTE *l_header_data = 00;
 1077|   695M|    OPJ_BYTE **l_header_data_start = 00;
 1078|       |
 1079|   695M|    OPJ_UINT32 l_present;
 1080|       |
 1081|   695M|    if (p_pi->layno == 0) {
  ------------------
  |  Branch (1081:9): [True: 21.1M, False: 674M]
  ------------------
 1082|  21.1M|        l_band = l_res->bands;
 1083|       |
 1084|       |        /* reset tagtrees */
 1085|  44.6M|        for (bandno = 0; bandno < l_res->numbands; ++bandno) {
  ------------------
  |  Branch (1085:26): [True: 23.5M, False: 21.1M]
  ------------------
 1086|  23.5M|            if (!opj_tcd_is_band_empty(l_band)) {
  ------------------
  |  Branch (1086:17): [True: 23.2M, False: 310k]
  ------------------
 1087|  23.2M|                opj_tcd_precinct_t *l_prc = &l_band->precincts[p_pi->precno];
 1088|  23.2M|                if (!(p_pi->precno < (l_band->precincts_data_size / sizeof(
  ------------------
  |  Branch (1088:21): [True: 0, False: 23.2M]
  ------------------
 1089|  23.2M|                                          opj_tcd_precinct_t)))) {
 1090|      0|                    opj_event_msg(p_manager, EVT_ERROR, "Invalid precinct\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1091|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1092|      0|                }
 1093|       |
 1094|       |
 1095|  23.2M|                opj_tgt_reset(l_prc->incltree);
 1096|  23.2M|                opj_tgt_reset(l_prc->imsbtree);
 1097|  23.2M|                l_cblk = l_prc->cblks.dec;
 1098|       |
 1099|  23.2M|                l_nb_code_blocks = l_prc->cw * l_prc->ch;
 1100|   200M|                for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {
  ------------------
  |  Branch (1100:34): [True: 177M, False: 23.2M]
  ------------------
 1101|   177M|                    l_cblk->numsegs = 0;
 1102|   177M|                    l_cblk->real_num_segs = 0;
 1103|   177M|                    ++l_cblk;
 1104|   177M|                }
 1105|  23.2M|            }
 1106|       |
 1107|  23.5M|            ++l_band;
 1108|  23.5M|        }
 1109|  21.1M|    }
 1110|       |
 1111|       |    /* SOP markers */
 1112|       |
 1113|   695M|    if (p_tcp->csty & J2K_CP_CSTY_SOP) {
  ------------------
  |  |   55|   695M|#define J2K_CP_CSTY_SOP 0x02
  ------------------
  |  Branch (1113:9): [True: 13.8M, False: 681M]
  ------------------
 1114|  13.8M|        if (p_max_length < 6) {
  ------------------
  |  Branch (1114:13): [True: 12.8M, False: 1.05M]
  ------------------
 1115|  12.8M|            opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  12.8M|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1116|  12.8M|                          "Not enough space for expected SOP marker\n");
 1117|  12.8M|        } else if ((*l_current_data) != 0xff || (*(l_current_data + 1) != 0x91)) {
  ------------------
  |  Branch (1117:20): [True: 1.02M, False: 28.8k]
  |  Branch (1117:49): [True: 23.0k, False: 5.83k]
  ------------------
 1118|  1.04M|            opj_event_msg(p_manager, EVT_WARNING, "Expected SOP marker\n");
  ------------------
  |  |   67|  1.04M|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1119|  1.04M|        } else {
 1120|  5.83k|            l_current_data += 6;
 1121|  5.83k|        }
 1122|       |
 1123|       |        /** TODO : check the Nsop value */
 1124|  13.8M|    }
 1125|       |
 1126|       |    /*
 1127|       |    When the marker PPT/PPM is used the packet header are store in PPT/PPM marker
 1128|       |    This part deal with this characteristic
 1129|       |    step 1: Read packet header in the saved structure
 1130|       |    step 2: Return to codestream for decoding
 1131|       |    */
 1132|       |
 1133|   695M|    l_bio = opj_bio_create();
 1134|   695M|    if (! l_bio) {
  ------------------
  |  Branch (1134:9): [True: 0, False: 695M]
  ------------------
 1135|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1136|      0|    }
 1137|       |
 1138|   695M|    if (l_cp->ppm == 1) { /* PPM */
  ------------------
  |  Branch (1138:9): [True: 458k, False: 695M]
  ------------------
 1139|   458k|        l_header_data_start = &l_cp->ppm_data;
 1140|   458k|        l_header_data = *l_header_data_start;
 1141|   458k|        l_modified_length_ptr = &(l_cp->ppm_len);
 1142|       |
 1143|   695M|    } else if (p_tcp->ppt == 1) { /* PPT */
  ------------------
  |  Branch (1143:16): [True: 597k, False: 694M]
  ------------------
 1144|   597k|        l_header_data_start = &(p_tcp->ppt_data);
 1145|   597k|        l_header_data = *l_header_data_start;
 1146|   597k|        l_modified_length_ptr = &(p_tcp->ppt_len);
 1147|   694M|    } else { /* Normal Case */
 1148|   694M|        l_header_data_start = &(l_current_data);
 1149|   694M|        l_header_data = *l_header_data_start;
 1150|   694M|        l_remaining_length = (OPJ_UINT32)(p_src_data + p_max_length - l_header_data);
 1151|   694M|        l_modified_length_ptr = &(l_remaining_length);
 1152|   694M|    }
 1153|       |
 1154|   695M|    opj_bio_init_dec(l_bio, l_header_data, *l_modified_length_ptr);
 1155|       |
 1156|   695M|    l_present = opj_bio_read(l_bio, 1);
 1157|   695M|    JAS_FPRINTF(stderr, "present=%d \n", l_present);
  ------------------
  |  |  390|   695M|#define JAS_FPRINTF opj_null_jas_fprintf
  ------------------
 1158|   695M|    if (!l_present) {
  ------------------
  |  Branch (1158:9): [True: 694M, False: 732k]
  ------------------
 1159|       |        /* TODO MSD: no test to control the output of this function*/
 1160|   694M|        opj_bio_inalign(l_bio);
 1161|   694M|        l_header_data += opj_bio_numbytes(l_bio);
 1162|   694M|        opj_bio_destroy(l_bio);
 1163|       |
 1164|       |        /* EPH markers */
 1165|   694M|        if (p_tcp->csty & J2K_CP_CSTY_EPH) {
  ------------------
  |  |   56|   694M|#define J2K_CP_CSTY_EPH 0x04
  ------------------
  |  Branch (1165:13): [True: 649M, False: 45.5M]
  ------------------
 1166|   649M|            if ((*l_modified_length_ptr - (OPJ_UINT32)(l_header_data -
  ------------------
  |  Branch (1166:17): [True: 648M, False: 1.23M]
  ------------------
 1167|   649M|                    *l_header_data_start)) < 2U) {
 1168|   648M|                opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|   648M|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1169|   648M|                              "Not enough space for expected EPH marker\n");
 1170|   648M|            } else if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) {
  ------------------
  |  Branch (1170:24): [True: 758k, False: 479k]
  |  Branch (1170:52): [True: 478k, False: 420]
  ------------------
 1171|  1.23M|                opj_event_msg(p_manager, EVT_WARNING, "Expected EPH marker\n");
  ------------------
  |  |   67|  1.23M|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1172|  1.23M|            } else {
 1173|    420|                l_header_data += 2;
 1174|    420|            }
 1175|   649M|        }
 1176|       |
 1177|   694M|        l_header_length = (OPJ_UINT32)(l_header_data - *l_header_data_start);
 1178|   694M|        *l_modified_length_ptr -= l_header_length;
 1179|   694M|        *l_header_data_start += l_header_length;
 1180|       |
 1181|       |        /* << INDEX */
 1182|       |        /* End of packet header position. Currently only represents the distance to start of packet
 1183|       |           Will be updated later by incrementing with packet start value */
 1184|   694M|        if (p_pack_info) {
  ------------------
  |  Branch (1184:13): [True: 0, False: 694M]
  ------------------
 1185|      0|            p_pack_info->end_ph_pos = (OPJ_INT32)(l_current_data - p_src_data);
 1186|      0|        }
 1187|       |        /* INDEX >> */
 1188|       |
 1189|   694M|        * p_is_data_present = OPJ_FALSE;
  ------------------
  |  |  118|   694M|#define OPJ_FALSE 0
  ------------------
 1190|   694M|        *p_data_read = (OPJ_UINT32)(l_current_data - p_src_data);
 1191|   694M|        return OPJ_TRUE;
  ------------------
  |  |  117|   694M|#define OPJ_TRUE 1
  ------------------
 1192|   694M|    }
 1193|       |
 1194|   732k|    l_band = l_res->bands;
 1195|  1.90M|    for (bandno = 0; bandno < l_res->numbands; ++bandno, ++l_band) {
  ------------------
  |  Branch (1195:22): [True: 1.17M, False: 732k]
  ------------------
 1196|  1.17M|        opj_tcd_precinct_t *l_prc = &(l_band->precincts[p_pi->precno]);
 1197|       |
 1198|  1.17M|        if (opj_tcd_is_band_empty(l_band)) {
  ------------------
  |  Branch (1198:13): [True: 29.6k, False: 1.14M]
  ------------------
 1199|  29.6k|            continue;
 1200|  29.6k|        }
 1201|       |
 1202|  1.14M|        l_nb_code_blocks = l_prc->cw * l_prc->ch;
 1203|  1.14M|        l_cblk = l_prc->cblks.dec;
 1204|  8.45M|        for (cblkno = 0; cblkno < l_nb_code_blocks; cblkno++) {
  ------------------
  |  Branch (1204:26): [True: 7.30M, False: 1.14M]
  ------------------
 1205|  7.30M|            OPJ_UINT32 l_included, l_increment, l_segno;
 1206|  7.30M|            OPJ_INT32 n;
 1207|       |
 1208|       |            /* if cblk not yet included before --> inclusion tagtree */
 1209|  7.30M|            if (!l_cblk->numsegs) {
  ------------------
  |  Branch (1209:17): [True: 6.25M, False: 1.05M]
  ------------------
 1210|  6.25M|                l_included = opj_tgt_decode(l_bio, l_prc->incltree, cblkno,
 1211|  6.25M|                                            (OPJ_INT32)(p_pi->layno + 1));
 1212|       |                /* else one bit */
 1213|  6.25M|            } else {
 1214|  1.05M|                l_included = opj_bio_read(l_bio, 1);
 1215|  1.05M|            }
 1216|       |
 1217|       |            /* if cblk not included */
 1218|  7.30M|            if (!l_included) {
  ------------------
  |  Branch (1218:17): [True: 6.47M, False: 837k]
  ------------------
 1219|  6.47M|                l_cblk->numnewpasses = 0;
 1220|  6.47M|                ++l_cblk;
 1221|  6.47M|                JAS_FPRINTF(stderr, "included=%d \n", l_included);
  ------------------
  |  |  390|  6.47M|#define JAS_FPRINTF opj_null_jas_fprintf
  ------------------
 1222|  6.47M|                continue;
 1223|  6.47M|            }
 1224|       |
 1225|       |            /* if cblk not yet included --> zero-bitplane tagtree */
 1226|   837k|            if (!l_cblk->numsegs) {
  ------------------
  |  Branch (1226:17): [True: 137k, False: 699k]
  ------------------
 1227|   137k|                OPJ_UINT32 i = 0;
 1228|       |
 1229|   908k|                while (!opj_tgt_decode(l_bio, l_prc->imsbtree, cblkno, (OPJ_INT32)i)) {
  ------------------
  |  Branch (1229:24): [True: 770k, False: 137k]
  ------------------
 1230|   770k|                    ++i;
 1231|   770k|                }
 1232|       |
 1233|   137k|                l_cblk->Mb = (OPJ_UINT32)l_band->numbps;
 1234|   137k|                l_cblk->numbps = (OPJ_UINT32)l_band->numbps + 1 - i;
 1235|   137k|                l_cblk->numlenbits = 3;
 1236|   137k|            }
 1237|       |
 1238|       |            /* number of coding passes */
 1239|   837k|            l_cblk->numnewpasses = opj_t2_getnumpasses(l_bio);
 1240|   837k|            l_increment = opj_t2_getcommacode(l_bio);
 1241|       |
 1242|       |            /* length indicator increment */
 1243|   837k|            l_cblk->numlenbits += l_increment;
 1244|   837k|            l_segno = 0;
 1245|       |
 1246|   837k|            if (!l_cblk->numsegs) {
  ------------------
  |  Branch (1246:17): [True: 137k, False: 699k]
  ------------------
 1247|   137k|                if (! opj_t2_init_seg(l_cblk, l_segno, p_tcp->tccps[p_pi->compno].cblksty, 1)) {
  ------------------
  |  Branch (1247:21): [True: 0, False: 137k]
  ------------------
 1248|      0|                    opj_bio_destroy(l_bio);
 1249|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1250|      0|                }
 1251|   699k|            } else {
 1252|   699k|                l_segno = l_cblk->numsegs - 1;
 1253|   699k|                if (l_cblk->segs[l_segno].numpasses == l_cblk->segs[l_segno].maxpasses) {
  ------------------
  |  Branch (1253:21): [True: 17.3k, False: 682k]
  ------------------
 1254|  17.3k|                    ++l_segno;
 1255|  17.3k|                    if (! opj_t2_init_seg(l_cblk, l_segno, p_tcp->tccps[p_pi->compno].cblksty, 0)) {
  ------------------
  |  Branch (1255:25): [True: 0, False: 17.3k]
  ------------------
 1256|      0|                        opj_bio_destroy(l_bio);
 1257|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1258|      0|                    }
 1259|  17.3k|                }
 1260|   699k|            }
 1261|   837k|            n = (OPJ_INT32)l_cblk->numnewpasses;
 1262|       |
 1263|   837k|            if ((p_tcp->tccps[p_pi->compno].cblksty & J2K_CCP_CBLKSTY_HT) != 0)
  ------------------
  |  |   64|   837k|#define J2K_CCP_CBLKSTY_HT 0x40       /**< (high throughput) HT codeblocks */
  ------------------
  |  Branch (1263:17): [True: 602k, False: 235k]
  ------------------
 1264|   613k|                do {
 1265|   613k|                    OPJ_UINT32 bit_number;
 1266|   613k|                    l_cblk->segs[l_segno].numnewpasses = l_segno == 0 ? 1 : (OPJ_UINT32)n;
  ------------------
  |  Branch (1266:58): [True: 17.8k, False: 595k]
  ------------------
 1267|   613k|                    bit_number = l_cblk->numlenbits + opj_uint_floorlog2(
 1268|   613k|                                     l_cblk->segs[l_segno].numnewpasses);
 1269|   613k|                    if (bit_number > 32) {
  ------------------
  |  Branch (1269:25): [True: 1, False: 613k]
  ------------------
 1270|      1|                        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1271|      1|                                      "Invalid bit number %d in opj_t2_read_packet_header()\n",
 1272|      1|                                      bit_number);
 1273|      1|                        opj_bio_destroy(l_bio);
 1274|      1|                        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 1275|      1|                    }
 1276|   613k|                    l_cblk->segs[l_segno].newlen = opj_bio_read(l_bio, bit_number);
 1277|   613k|                    JAS_FPRINTF(stderr, "included=%d numnewpasses=%d increment=%d len=%d \n",
  ------------------
  |  |  390|   613k|#define JAS_FPRINTF opj_null_jas_fprintf
  ------------------
 1278|   613k|                                l_included, l_cblk->segs[l_segno].numnewpasses, l_increment,
 1279|   613k|                                l_cblk->segs[l_segno].newlen);
 1280|       |
 1281|   613k|                    n -= (OPJ_INT32)l_cblk->segs[l_segno].numnewpasses;
 1282|   613k|                    if (n > 0) {
  ------------------
  |  Branch (1282:25): [True: 11.6k, False: 602k]
  ------------------
 1283|  11.6k|                        ++l_segno;
 1284|       |
 1285|  11.6k|                        if (! opj_t2_init_seg(l_cblk, l_segno, p_tcp->tccps[p_pi->compno].cblksty, 0)) {
  ------------------
  |  Branch (1285:29): [True: 0, False: 11.6k]
  ------------------
 1286|      0|                            opj_bio_destroy(l_bio);
 1287|      0|                            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1288|      0|                        }
 1289|  11.6k|                    }
 1290|   613k|                } while (n > 0);
  ------------------
  |  Branch (1290:26): [True: 11.6k, False: 602k]
  ------------------
 1291|   235k|            else
 1292|   394k|                do {
 1293|   394k|                    OPJ_UINT32 bit_number;
 1294|   394k|                    l_cblk->segs[l_segno].numnewpasses = (OPJ_UINT32)opj_int_min((OPJ_INT32)(
 1295|   394k|                            l_cblk->segs[l_segno].maxpasses - l_cblk->segs[l_segno].numpasses), n);
 1296|   394k|                    bit_number = l_cblk->numlenbits + opj_uint_floorlog2(
 1297|   394k|                                     l_cblk->segs[l_segno].numnewpasses);
 1298|   394k|                    if (bit_number > 32) {
  ------------------
  |  Branch (1298:25): [True: 9, False: 394k]
  ------------------
 1299|      9|                        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      9|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1300|      9|                                      "Invalid bit number %d in opj_t2_read_packet_header()\n",
 1301|      9|                                      bit_number);
 1302|      9|                        opj_bio_destroy(l_bio);
 1303|      9|                        return OPJ_FALSE;
  ------------------
  |  |  118|      9|#define OPJ_FALSE 0
  ------------------
 1304|      9|                    }
 1305|   394k|                    l_cblk->segs[l_segno].newlen = opj_bio_read(l_bio, bit_number);
 1306|   394k|                    JAS_FPRINTF(stderr, "included=%d numnewpasses=%d increment=%d len=%d \n",
  ------------------
  |  |  390|   394k|#define JAS_FPRINTF opj_null_jas_fprintf
  ------------------
 1307|   394k|                                l_included, l_cblk->segs[l_segno].numnewpasses, l_increment,
 1308|   394k|                                l_cblk->segs[l_segno].newlen);
 1309|       |
 1310|   394k|                    n -= (OPJ_INT32)l_cblk->segs[l_segno].numnewpasses;
 1311|   394k|                    if (n > 0) {
  ------------------
  |  Branch (1311:25): [True: 159k, False: 235k]
  ------------------
 1312|   159k|                        ++l_segno;
 1313|       |
 1314|   159k|                        if (! opj_t2_init_seg(l_cblk, l_segno, p_tcp->tccps[p_pi->compno].cblksty, 0)) {
  ------------------
  |  Branch (1314:29): [True: 0, False: 159k]
  ------------------
 1315|      0|                            opj_bio_destroy(l_bio);
 1316|      0|                            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1317|      0|                        }
 1318|   159k|                    }
 1319|   394k|                } while (n > 0);
  ------------------
  |  Branch (1319:26): [True: 159k, False: 235k]
  ------------------
 1320|       |
 1321|   837k|            ++l_cblk;
 1322|   837k|        }
 1323|  1.14M|    }
 1324|       |
 1325|   732k|    if (!opj_bio_inalign(l_bio)) {
  ------------------
  |  Branch (1325:9): [True: 5, False: 732k]
  ------------------
 1326|      5|        opj_bio_destroy(l_bio);
 1327|      5|        return OPJ_FALSE;
  ------------------
  |  |  118|      5|#define OPJ_FALSE 0
  ------------------
 1328|      5|    }
 1329|       |
 1330|   732k|    l_header_data += opj_bio_numbytes(l_bio);
 1331|   732k|    opj_bio_destroy(l_bio);
 1332|       |
 1333|       |    /* EPH markers */
 1334|   732k|    if (p_tcp->csty & J2K_CP_CSTY_EPH) {
  ------------------
  |  |   56|   732k|#define J2K_CP_CSTY_EPH 0x04
  ------------------
  |  Branch (1334:9): [True: 706k, False: 26.1k]
  ------------------
 1335|   706k|        if ((*l_modified_length_ptr - (OPJ_UINT32)(l_header_data -
  ------------------
  |  Branch (1335:13): [True: 3.19k, False: 703k]
  ------------------
 1336|   706k|                *l_header_data_start)) < 2U) {
 1337|  3.19k|            opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|  3.19k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1338|  3.19k|                          "Not enough space for expected EPH marker\n");
 1339|   703k|        } else if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) {
  ------------------
  |  Branch (1339:20): [True: 642k, False: 61.0k]
  |  Branch (1339:48): [True: 53.5k, False: 7.50k]
  ------------------
 1340|   695k|            opj_event_msg(p_manager, EVT_WARNING, "Expected EPH marker\n");
  ------------------
  |  |   67|   695k|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1341|   695k|        } else {
 1342|  7.50k|            l_header_data += 2;
 1343|  7.50k|        }
 1344|   706k|    }
 1345|       |
 1346|   732k|    l_header_length = (OPJ_UINT32)(l_header_data - *l_header_data_start);
 1347|   732k|    JAS_FPRINTF(stderr, "hdrlen=%d \n", l_header_length);
  ------------------
  |  |  390|   732k|#define JAS_FPRINTF opj_null_jas_fprintf
  ------------------
 1348|   732k|    JAS_FPRINTF(stderr, "packet body\n");
  ------------------
  |  |  390|   732k|#define JAS_FPRINTF opj_null_jas_fprintf
  ------------------
 1349|   732k|    *l_modified_length_ptr -= l_header_length;
 1350|   732k|    *l_header_data_start += l_header_length;
 1351|       |
 1352|       |    /* << INDEX */
 1353|       |    /* End of packet header position. Currently only represents the distance to start of packet
 1354|       |     Will be updated later by incrementing with packet start value */
 1355|   732k|    if (p_pack_info) {
  ------------------
  |  Branch (1355:9): [True: 0, False: 732k]
  ------------------
 1356|      0|        p_pack_info->end_ph_pos = (OPJ_INT32)(l_current_data - p_src_data);
 1357|      0|    }
 1358|       |    /* INDEX >> */
 1359|       |
 1360|   732k|    *p_is_data_present = OPJ_TRUE;
  ------------------
  |  |  117|   732k|#define OPJ_TRUE 1
  ------------------
 1361|   732k|    *p_data_read = (OPJ_UINT32)(l_current_data - p_src_data);
 1362|       |
 1363|   732k|    return OPJ_TRUE;
  ------------------
  |  |  117|   732k|#define OPJ_TRUE 1
  ------------------
 1364|   732k|}
t2.c:opj_t2_getnumpasses:
  200|   837k|{
  201|   837k|    OPJ_UINT32 n;
  202|   837k|    if (!opj_bio_read(bio, 1)) {
  ------------------
  |  Branch (202:9): [True: 184k, False: 653k]
  ------------------
  203|   184k|        return 1;
  204|   184k|    }
  205|   653k|    if (!opj_bio_read(bio, 1)) {
  ------------------
  |  Branch (205:9): [True: 65.9k, False: 587k]
  ------------------
  206|  65.9k|        return 2;
  207|  65.9k|    }
  208|   587k|    if ((n = opj_bio_read(bio, 2)) != 3) {
  ------------------
  |  Branch (208:9): [True: 32.5k, False: 554k]
  ------------------
  209|  32.5k|        return (3 + n);
  210|  32.5k|    }
  211|   554k|    if ((n = opj_bio_read(bio, 5)) != 31) {
  ------------------
  |  Branch (211:9): [True: 89.6k, False: 464k]
  ------------------
  212|  89.6k|        return (6 + n);
  213|  89.6k|    }
  214|   464k|    return (37 + opj_bio_read(bio, 7));
  215|   554k|}
t2.c:opj_t2_getcommacode:
  176|   837k|{
  177|   837k|    OPJ_UINT32 n = 0;
  178|   898k|    while (opj_bio_read(bio, 1)) {
  ------------------
  |  Branch (178:12): [True: 61.4k, False: 837k]
  ------------------
  179|  61.4k|        ++n;
  180|  61.4k|    }
  181|   837k|    return n;
  182|   837k|}
t2.c:opj_t2_init_seg:
 1645|   326k|{
 1646|   326k|    opj_tcd_seg_t* seg = 00;
 1647|   326k|    OPJ_UINT32 l_nb_segs = index + 1;
 1648|       |
 1649|   326k|    if (l_nb_segs > cblk->m_current_max_segs) {
  ------------------
  |  Branch (1649:9): [True: 14.1k, False: 312k]
  ------------------
 1650|  14.1k|        opj_tcd_seg_t* new_segs;
 1651|  14.1k|        OPJ_UINT32 l_m_current_max_segs = cblk->m_current_max_segs +
 1652|  14.1k|                                          OPJ_J2K_DEFAULT_NB_SEGS;
  ------------------
  |  |  155|  14.1k|#define OPJ_J2K_DEFAULT_NB_SEGS             10
  ------------------
 1653|       |
 1654|  14.1k|        new_segs = (opj_tcd_seg_t*) opj_realloc(cblk->segs,
 1655|  14.1k|                                                l_m_current_max_segs * sizeof(opj_tcd_seg_t));
 1656|  14.1k|        if (! new_segs) {
  ------------------
  |  Branch (1656:13): [True: 0, False: 14.1k]
  ------------------
 1657|       |            /* opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to initialize segment %d\n", l_nb_segs); */
 1658|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1659|      0|        }
 1660|  14.1k|        cblk->segs = new_segs;
 1661|  14.1k|        memset(new_segs + cblk->m_current_max_segs,
 1662|  14.1k|               0, OPJ_J2K_DEFAULT_NB_SEGS * sizeof(opj_tcd_seg_t));
  ------------------
  |  |  155|  14.1k|#define OPJ_J2K_DEFAULT_NB_SEGS             10
  ------------------
 1663|  14.1k|        cblk->m_current_max_segs = l_m_current_max_segs;
 1664|  14.1k|    }
 1665|       |
 1666|   326k|    seg = &cblk->segs[index];
 1667|   326k|    opj_tcd_reinit_segment(seg);
 1668|       |
 1669|   326k|    if (cblksty & J2K_CCP_CBLKSTY_TERMALL) {
  ------------------
  |  |   60|   326k|#define J2K_CCP_CBLKSTY_TERMALL 0x04  /**< Termination on each coding pass */
  ------------------
  |  Branch (1669:9): [True: 69.8k, False: 256k]
  ------------------
 1670|  69.8k|        seg->maxpasses = 1;
 1671|   256k|    } else if (cblksty & J2K_CCP_CBLKSTY_LAZY) {
  ------------------
  |  |   58|   256k|#define J2K_CCP_CBLKSTY_LAZY 0x01     /**< Selective arithmetic coding bypass */
  ------------------
  |  Branch (1671:16): [True: 125k, False: 131k]
  ------------------
 1672|   125k|        if (first) {
  ------------------
  |  Branch (1672:13): [True: 8.42k, False: 116k]
  ------------------
 1673|  8.42k|            seg->maxpasses = 10;
 1674|   116k|        } else {
 1675|   116k|            seg->maxpasses = (((seg - 1)->maxpasses == 1) ||
  ------------------
  |  Branch (1675:31): [True: 55.6k, False: 61.0k]
  ------------------
 1676|   116k|                              ((seg - 1)->maxpasses == 10)) ? 2 : 1;
  ------------------
  |  Branch (1676:31): [True: 3.36k, False: 57.7k]
  ------------------
 1677|   116k|        }
 1678|   131k|    } else {
 1679|       |        /* See paragraph "B.10.6 Number of coding passes" of the standard.
 1680|       |         * Probably that 109 must be interpreted a (Mb-1)*3 + 1 with Mb=37,
 1681|       |         * Mb being the maximum number of bit-planes available for the
 1682|       |         * representation of coefficients in the sub-band */
 1683|   131k|        seg->maxpasses = 109;
 1684|   131k|    }
 1685|       |
 1686|   326k|    return OPJ_TRUE;
  ------------------
  |  |  117|   326k|#define OPJ_TRUE 1
  ------------------
 1687|   326k|}
t2.c:opj_t2_read_packet_data:
 1374|   717k|{
 1375|   717k|    OPJ_UINT32 bandno, cblkno;
 1376|   717k|    OPJ_UINT32 l_nb_code_blocks;
 1377|   717k|    OPJ_BYTE *l_current_data = p_src_data;
 1378|   717k|    opj_tcd_band_t *l_band = 00;
 1379|   717k|    opj_tcd_cblk_dec_t* l_cblk = 00;
 1380|   717k|    opj_tcd_resolution_t* l_res =
 1381|   717k|        &p_tile->comps[p_pi->compno].resolutions[p_pi->resno];
 1382|   717k|    OPJ_BOOL partial_buffer = OPJ_FALSE;
  ------------------
  |  |  118|   717k|#define OPJ_FALSE 0
  ------------------
 1383|       |
 1384|   717k|    OPJ_ARG_NOT_USED(p_t2);
  ------------------
  |  |  142|   717k|#define OPJ_ARG_NOT_USED(x) (void)(x)
  ------------------
 1385|   717k|    OPJ_ARG_NOT_USED(pack_info);
  ------------------
  |  |  142|   717k|#define OPJ_ARG_NOT_USED(x) (void)(x)
  ------------------
 1386|       |
 1387|   717k|    l_band = l_res->bands;
 1388|  1.86M|    for (bandno = 0; bandno < l_res->numbands; ++bandno) {
  ------------------
  |  Branch (1388:22): [True: 1.15M, False: 717k]
  ------------------
 1389|  1.15M|        opj_tcd_precinct_t *l_prc = &l_band->precincts[p_pi->precno];
 1390|       |
 1391|  1.15M|        if ((l_band->x1 - l_band->x0 == 0) || (l_band->y1 - l_band->y0 == 0)) {
  ------------------
  |  Branch (1391:13): [True: 11.2k, False: 1.13M]
  |  Branch (1391:47): [True: 12.6k, False: 1.12M]
  ------------------
 1392|  23.9k|            ++l_band;
 1393|  23.9k|            continue;
 1394|  23.9k|        }
 1395|       |
 1396|  1.12M|        l_nb_code_blocks = l_prc->cw * l_prc->ch;
 1397|  1.12M|        l_cblk = l_prc->cblks.dec;
 1398|       |
 1399|  4.65M|        for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {
  ------------------
  |  Branch (1399:26): [True: 3.52M, False: 1.12M]
  ------------------
 1400|  3.52M|            opj_tcd_seg_t *l_seg = 00;
 1401|       |
 1402|       |            // if we have a partial data stream, set numchunks to zero
 1403|       |            // since we have no data to actually decode.
 1404|  3.52M|            if (partial_buffer) {
  ------------------
  |  Branch (1404:17): [True: 0, False: 3.52M]
  ------------------
 1405|      0|                l_cblk->numchunks = 0;
 1406|      0|            }
 1407|       |
 1408|  3.52M|            if (!l_cblk->numnewpasses) {
  ------------------
  |  Branch (1408:17): [True: 2.70M, False: 818k]
  ------------------
 1409|       |                /* nothing to do */
 1410|  2.70M|                ++l_cblk;
 1411|  2.70M|                continue;
 1412|  2.70M|            }
 1413|       |
 1414|   818k|            if (!l_cblk->numsegs) {
  ------------------
  |  Branch (1414:17): [True: 123k, False: 694k]
  ------------------
 1415|   123k|                l_seg = l_cblk->segs;
 1416|   123k|                ++l_cblk->numsegs;
 1417|   694k|            } else {
 1418|   694k|                l_seg = &l_cblk->segs[l_cblk->numsegs - 1];
 1419|       |
 1420|   694k|                if (l_seg->numpasses == l_seg->maxpasses) {
  ------------------
  |  Branch (1420:21): [True: 15.6k, False: 679k]
  ------------------
 1421|  15.6k|                    ++l_seg;
 1422|  15.6k|                    ++l_cblk->numsegs;
 1423|  15.6k|                }
 1424|   694k|            }
 1425|       |
 1426|   958k|            do {
 1427|       |                /* Check possible overflow (on l_current_data only, assumes input args already checked) then size */
 1428|   958k|                if ((((OPJ_SIZE_T)l_current_data + (OPJ_SIZE_T)l_seg->newlen) <
  ------------------
  |  Branch (1428:21): [True: 0, False: 958k]
  ------------------
 1429|   958k|                        (OPJ_SIZE_T)l_current_data) ||
 1430|   958k|                        (l_current_data + l_seg->newlen > p_src_data + p_max_length) ||
  ------------------
  |  Branch (1430:25): [True: 287, False: 958k]
  ------------------
 1431|   958k|                        (partial_buffer)) {
  ------------------
  |  Branch (1431:25): [True: 0, False: 958k]
  ------------------
 1432|    287|                    if (p_t2->cp->strict) {
  ------------------
  |  Branch (1432:25): [True: 287, False: 0]
  ------------------
 1433|    287|                        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    287|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1434|    287|                                      "read: segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
 1435|    287|                                      l_seg->newlen, p_max_length, cblkno, p_pi->precno, bandno, p_pi->resno,
 1436|    287|                                      p_pi->compno);
 1437|    287|                        return OPJ_FALSE;
  ------------------
  |  |  118|    287|#define OPJ_FALSE 0
  ------------------
 1438|    287|                    } else {
 1439|      0|                        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1440|      0|                                      "read: segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
 1441|      0|                                      l_seg->newlen, p_max_length, cblkno, p_pi->precno, bandno, p_pi->resno,
 1442|      0|                                      p_pi->compno);
 1443|       |                        // skip this codeblock since it is a partial read
 1444|      0|                        partial_buffer = OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
 1445|      0|                        l_cblk->numchunks = 0;
 1446|       |
 1447|      0|                        l_seg->numpasses += l_seg->numnewpasses;
 1448|      0|                        l_cblk->numnewpasses -= l_seg->numnewpasses;
 1449|      0|                        if (l_cblk->numnewpasses > 0) {
  ------------------
  |  Branch (1449:29): [True: 0, False: 0]
  ------------------
 1450|      0|                            ++l_seg;
 1451|      0|                            ++l_cblk->numsegs;
 1452|      0|                            break;
 1453|      0|                        }
 1454|      0|                        continue;
 1455|      0|                    }
 1456|    287|                }
 1457|       |
 1458|       |#ifdef USE_JPWL
 1459|       |                /* we need here a j2k handle to verify if making a check to
 1460|       |                the validity of cblocks parameters is selected from user (-W) */
 1461|       |
 1462|       |                /* let's check that we are not exceeding */
 1463|       |                if ((l_cblk->len + l_seg->newlen) > 8192) {
 1464|       |                    opj_event_msg(p_manager, EVT_WARNING,
 1465|       |                                  "JPWL: segment too long (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
 1466|       |                                  l_seg->newlen, cblkno, p_pi->precno, bandno, p_pi->resno, p_pi->compno);
 1467|       |                    if (!JPWL_ASSUME) {
 1468|       |                        opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 1469|       |                        return OPJ_FALSE;
 1470|       |                    }
 1471|       |                    l_seg->newlen = 8192 - l_cblk->len;
 1472|       |                    opj_event_msg(p_manager, EVT_WARNING, "      - truncating segment to %d\n",
 1473|       |                                  l_seg->newlen);
 1474|       |                    break;
 1475|       |                };
 1476|       |
 1477|       |#endif /* USE_JPWL */
 1478|       |
 1479|   958k|                if (l_cblk->numchunks == l_cblk->numchunksalloc) {
  ------------------
  |  Branch (1479:21): [True: 170k, False: 787k]
  ------------------
 1480|   170k|                    OPJ_UINT32 l_numchunksalloc = l_cblk->numchunksalloc * 2 + 1;
 1481|   170k|                    opj_tcd_seg_data_chunk_t* l_chunks =
 1482|   170k|                        (opj_tcd_seg_data_chunk_t*)opj_realloc(l_cblk->chunks,
 1483|   170k|                                l_numchunksalloc * sizeof(opj_tcd_seg_data_chunk_t));
 1484|   170k|                    if (l_chunks == NULL) {
  ------------------
  |  Branch (1484:25): [True: 0, False: 170k]
  ------------------
 1485|      0|                        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1486|      0|                                      "cannot allocate opj_tcd_seg_data_chunk_t* array");
 1487|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1488|      0|                    }
 1489|   170k|                    l_cblk->chunks = l_chunks;
 1490|   170k|                    l_cblk->numchunksalloc = l_numchunksalloc;
 1491|   170k|                }
 1492|       |
 1493|   958k|                l_cblk->chunks[l_cblk->numchunks].data = l_current_data;
 1494|   958k|                l_cblk->chunks[l_cblk->numchunks].len = l_seg->newlen;
 1495|   958k|                l_cblk->numchunks ++;
 1496|       |
 1497|   958k|                l_current_data += l_seg->newlen;
 1498|   958k|                l_seg->len += l_seg->newlen;
 1499|   958k|                l_seg->numpasses += l_seg->numnewpasses;
 1500|   958k|                l_cblk->numnewpasses -= l_seg->numnewpasses;
 1501|       |
 1502|   958k|                l_seg->real_num_passes = l_seg->numpasses;
 1503|       |
 1504|   958k|                if (l_cblk->numnewpasses > 0) {
  ------------------
  |  Branch (1504:21): [True: 139k, False: 818k]
  ------------------
 1505|   139k|                    ++l_seg;
 1506|   139k|                    ++l_cblk->numsegs;
 1507|   139k|                }
 1508|   958k|            } while (l_cblk->numnewpasses > 0);
  ------------------
  |  Branch (1508:22): [True: 139k, False: 818k]
  ------------------
 1509|       |
 1510|   818k|            l_cblk->real_num_segs = l_cblk->numsegs;
 1511|   818k|            ++l_cblk;
 1512|   818k|        } /* next code_block */
 1513|       |
 1514|  1.12M|        ++l_band;
 1515|  1.12M|    }
 1516|       |
 1517|       |    // return the number of bytes read
 1518|   717k|    if (partial_buffer) {
  ------------------
  |  Branch (1518:9): [True: 0, False: 717k]
  ------------------
 1519|      0|        *(p_data_read) = p_max_length;
 1520|   717k|    } else {
 1521|   717k|        *(p_data_read) = (OPJ_UINT32)(l_current_data - p_src_data);
 1522|   717k|    }
 1523|       |
 1524|   717k|    return OPJ_TRUE;
  ------------------
  |  |  117|   717k|#define OPJ_TRUE 1
  ------------------
 1525|   717k|}
t2.c:opj_t2_skip_packet:
 1017|   588M|{
 1018|   588M|    OPJ_BOOL l_read_data;
 1019|   588M|    OPJ_UINT32 l_nb_bytes_read = 0;
 1020|   588M|    OPJ_UINT32 l_nb_total_bytes_read = 0;
 1021|       |
 1022|   588M|    *p_data_read = 0;
 1023|       |
 1024|   588M|    if (! opj_t2_read_packet_header(p_t2, p_tile, p_tcp, p_pi, &l_read_data, p_src,
  ------------------
  |  Branch (1024:9): [True: 6, False: 588M]
  ------------------
 1025|   588M|                                    &l_nb_bytes_read, p_max_length, p_pack_info, p_manager)) {
 1026|      6|        return OPJ_FALSE;
  ------------------
  |  |  118|      6|#define OPJ_FALSE 0
  ------------------
 1027|      6|    }
 1028|       |
 1029|   588M|    p_src += l_nb_bytes_read;
 1030|   588M|    l_nb_total_bytes_read += l_nb_bytes_read;
 1031|   588M|    p_max_length -= l_nb_bytes_read;
 1032|       |
 1033|       |    /* we should read data for the packet */
 1034|   588M|    if (l_read_data) {
  ------------------
  |  Branch (1034:9): [True: 15.1k, False: 588M]
  ------------------
 1035|  15.1k|        l_nb_bytes_read = 0;
 1036|       |
 1037|  15.1k|        if (! opj_t2_skip_packet_data(p_t2, p_tile, p_pi, &l_nb_bytes_read,
  ------------------
  |  Branch (1037:13): [True: 112, False: 15.0k]
  ------------------
 1038|  15.1k|                                      p_max_length, p_pack_info, p_manager)) {
 1039|    112|            return OPJ_FALSE;
  ------------------
  |  |  118|    112|#define OPJ_FALSE 0
  ------------------
 1040|    112|        }
 1041|       |
 1042|  15.0k|        l_nb_total_bytes_read += l_nb_bytes_read;
 1043|  15.0k|    }
 1044|   588M|    *p_data_read = l_nb_total_bytes_read;
 1045|       |
 1046|   588M|    return OPJ_TRUE;
  ------------------
  |  |  117|   588M|#define OPJ_TRUE 1
  ------------------
 1047|   588M|}
t2.c:opj_t2_skip_packet_data:
 1534|  15.1k|{
 1535|  15.1k|    OPJ_UINT32 bandno, cblkno;
 1536|  15.1k|    OPJ_UINT32 l_nb_code_blocks;
 1537|  15.1k|    opj_tcd_band_t *l_band = 00;
 1538|  15.1k|    opj_tcd_cblk_dec_t* l_cblk = 00;
 1539|  15.1k|    opj_tcd_resolution_t* l_res =
 1540|  15.1k|        &p_tile->comps[p_pi->compno].resolutions[p_pi->resno];
 1541|       |
 1542|  15.1k|    OPJ_ARG_NOT_USED(p_t2);
  ------------------
  |  |  142|  15.1k|#define OPJ_ARG_NOT_USED(x) (void)(x)
  ------------------
 1543|  15.1k|    OPJ_ARG_NOT_USED(pack_info);
  ------------------
  |  |  142|  15.1k|#define OPJ_ARG_NOT_USED(x) (void)(x)
  ------------------
 1544|       |
 1545|  15.1k|    *p_data_read = 0;
 1546|  15.1k|    l_band = l_res->bands;
 1547|       |
 1548|  38.1k|    for (bandno = 0; bandno < l_res->numbands; ++bandno) {
  ------------------
  |  Branch (1548:22): [True: 23.1k, False: 15.0k]
  ------------------
 1549|  23.1k|        opj_tcd_precinct_t *l_prc = &l_band->precincts[p_pi->precno];
 1550|       |
 1551|  23.1k|        if ((l_band->x1 - l_band->x0 == 0) || (l_band->y1 - l_band->y0 == 0)) {
  ------------------
  |  Branch (1551:13): [True: 2.13k, False: 21.0k]
  |  Branch (1551:47): [True: 3.48k, False: 17.5k]
  ------------------
 1552|  5.61k|            ++l_band;
 1553|  5.61k|            continue;
 1554|  5.61k|        }
 1555|       |
 1556|  17.5k|        l_nb_code_blocks = l_prc->cw * l_prc->ch;
 1557|  17.5k|        l_cblk = l_prc->cblks.dec;
 1558|       |
 1559|  2.98M|        for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {
  ------------------
  |  Branch (1559:26): [True: 2.96M, False: 17.4k]
  ------------------
 1560|  2.96M|            opj_tcd_seg_t *l_seg = 00;
 1561|       |
 1562|  2.96M|            if (!l_cblk->numnewpasses) {
  ------------------
  |  Branch (1562:17): [True: 2.94M, False: 16.4k]
  ------------------
 1563|       |                /* nothing to do */
 1564|  2.94M|                ++l_cblk;
 1565|  2.94M|                continue;
 1566|  2.94M|            }
 1567|       |
 1568|  16.4k|            if (!l_cblk->numsegs) {
  ------------------
  |  Branch (1568:17): [True: 11.7k, False: 4.77k]
  ------------------
 1569|  11.7k|                l_seg = l_cblk->segs;
 1570|  11.7k|                ++l_cblk->numsegs;
 1571|  11.7k|            } else {
 1572|  4.77k|                l_seg = &l_cblk->segs[l_cblk->numsegs - 1];
 1573|       |
 1574|  4.77k|                if (l_seg->numpasses == l_seg->maxpasses) {
  ------------------
  |  Branch (1574:21): [True: 1.71k, False: 3.05k]
  ------------------
 1575|  1.71k|                    ++l_seg;
 1576|  1.71k|                    ++l_cblk->numsegs;
 1577|  1.71k|                }
 1578|  4.77k|            }
 1579|       |
 1580|  40.5k|            do {
 1581|       |                /* Check possible overflow then size */
 1582|  40.5k|                if (((*p_data_read + l_seg->newlen) < (*p_data_read)) ||
  ------------------
  |  Branch (1582:21): [True: 0, False: 40.5k]
  ------------------
 1583|  40.5k|                        ((*p_data_read + l_seg->newlen) > p_max_length)) {
  ------------------
  |  Branch (1583:25): [True: 112, False: 40.3k]
  ------------------
 1584|    112|                    if (p_t2->cp->strict) {
  ------------------
  |  Branch (1584:25): [True: 112, False: 0]
  ------------------
 1585|    112|                        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    112|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1586|    112|                                      "skip: segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
 1587|    112|                                      l_seg->newlen, p_max_length, cblkno, p_pi->precno, bandno, p_pi->resno,
 1588|    112|                                      p_pi->compno);
 1589|    112|                        return OPJ_FALSE;
  ------------------
  |  |  118|    112|#define OPJ_FALSE 0
  ------------------
 1590|    112|                    } else {
 1591|      0|                        opj_event_msg(p_manager, EVT_WARNING,
  ------------------
  |  |   67|      0|#define EVT_WARNING 2   /**< Warning event type */
  ------------------
 1592|      0|                                      "skip: segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
 1593|      0|                                      l_seg->newlen, p_max_length, cblkno, p_pi->precno, bandno, p_pi->resno,
 1594|      0|                                      p_pi->compno);
 1595|      0|                        return OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
 1596|      0|                    }
 1597|    112|                }
 1598|       |
 1599|       |#ifdef USE_JPWL
 1600|       |                /* we need here a j2k handle to verify if making a check to
 1601|       |                the validity of cblocks parameters is selected from user (-W) */
 1602|       |
 1603|       |                /* let's check that we are not exceeding */
 1604|       |                if ((l_cblk->len + l_seg->newlen) > 8192) {
 1605|       |                    opj_event_msg(p_manager, EVT_WARNING,
 1606|       |                                  "JPWL: segment too long (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
 1607|       |                                  l_seg->newlen, cblkno, p_pi->precno, bandno, p_pi->resno, p_pi->compno);
 1608|       |                    if (!JPWL_ASSUME) {
 1609|       |                        opj_event_msg(p_manager, EVT_ERROR, "JPWL: giving up\n");
 1610|       |                        return -999;
 1611|       |                    }
 1612|       |                    l_seg->newlen = 8192 - l_cblk->len;
 1613|       |                    opj_event_msg(p_manager, EVT_WARNING, "      - truncating segment to %d\n",
 1614|       |                                  l_seg->newlen);
 1615|       |                    break;
 1616|       |                };
 1617|       |
 1618|       |#endif /* USE_JPWL */
 1619|  40.3k|                JAS_FPRINTF(stderr, "p_data_read (%d) newlen (%d) \n", *p_data_read,
  ------------------
  |  |  390|  40.3k|#define JAS_FPRINTF opj_null_jas_fprintf
  ------------------
 1620|  40.3k|                            l_seg->newlen);
 1621|  40.3k|                *(p_data_read) += l_seg->newlen;
 1622|       |
 1623|  40.3k|                l_seg->numpasses += l_seg->numnewpasses;
 1624|  40.3k|                l_cblk->numnewpasses -= l_seg->numnewpasses;
 1625|  40.3k|                if (l_cblk->numnewpasses > 0) {
  ------------------
  |  Branch (1625:21): [True: 24.0k, False: 16.3k]
  ------------------
 1626|  24.0k|                    ++l_seg;
 1627|  24.0k|                    ++l_cblk->numsegs;
 1628|  24.0k|                }
 1629|  40.3k|            } while (l_cblk->numnewpasses > 0);
  ------------------
  |  Branch (1629:22): [True: 24.0k, False: 16.3k]
  ------------------
 1630|       |
 1631|  16.3k|            ++l_cblk;
 1632|  16.3k|        }
 1633|       |
 1634|  17.4k|        ++l_band;
 1635|  17.4k|    }
 1636|       |
 1637|  15.0k|    return OPJ_TRUE;
  ------------------
  |  |  117|  15.0k|#define OPJ_TRUE 1
  ------------------
 1638|  15.1k|}

opj_tcd_create:
  209|  7.85k|{
  210|  7.85k|    opj_tcd_t *l_tcd = 00;
  211|       |
  212|       |    /* create the tcd structure */
  213|  7.85k|    l_tcd = (opj_tcd_t*) opj_calloc(1, sizeof(opj_tcd_t));
  214|  7.85k|    if (!l_tcd) {
  ------------------
  |  Branch (214:9): [True: 0, False: 7.85k]
  ------------------
  215|      0|        return 00;
  216|      0|    }
  217|       |
  218|  7.85k|    l_tcd->m_is_decoder = p_is_decoder ? 1 : 0;
  ------------------
  |  Branch (218:27): [True: 7.85k, False: 0]
  ------------------
  219|       |
  220|  7.85k|    l_tcd->tcd_image = (opj_tcd_image_t*)opj_calloc(1, sizeof(opj_tcd_image_t));
  221|  7.85k|    if (!l_tcd->tcd_image) {
  ------------------
  |  Branch (221:9): [True: 0, False: 7.85k]
  ------------------
  222|      0|        opj_free(l_tcd);
  223|      0|        return 00;
  224|      0|    }
  225|       |
  226|  7.85k|    return l_tcd;
  227|  7.85k|}
opj_tcd_init:
  718|  7.85k|{
  719|  7.85k|    p_tcd->image = p_image;
  720|  7.85k|    p_tcd->cp = p_cp;
  721|       |
  722|  7.85k|    p_tcd->tcd_image->tiles = (opj_tcd_tile_t *) opj_calloc(1,
  723|  7.85k|                              sizeof(opj_tcd_tile_t));
  724|  7.85k|    if (! p_tcd->tcd_image->tiles) {
  ------------------
  |  Branch (724:9): [True: 0, False: 7.85k]
  ------------------
  725|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  726|      0|    }
  727|       |
  728|  7.85k|    p_tcd->tcd_image->tiles->comps = (opj_tcd_tilecomp_t *) opj_calloc(
  729|  7.85k|                                         p_image->numcomps, sizeof(opj_tcd_tilecomp_t));
  730|  7.85k|    if (! p_tcd->tcd_image->tiles->comps) {
  ------------------
  |  Branch (730:9): [True: 0, False: 7.85k]
  ------------------
  731|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  732|      0|    }
  733|       |
  734|  7.85k|    p_tcd->tcd_image->tiles->numcomps = p_image->numcomps;
  735|  7.85k|    p_tcd->tp_pos = p_cp->m_specific_param.m_enc.m_tp_pos;
  736|  7.85k|    p_tcd->thread_pool = p_tp;
  737|       |
  738|  7.85k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.85k|#define OPJ_TRUE 1
  ------------------
  739|  7.85k|}
opj_tcd_destroy:
  745|  9.21k|{
  746|  9.21k|    if (tcd) {
  ------------------
  |  Branch (746:9): [True: 7.85k, False: 1.36k]
  ------------------
  747|  7.85k|        opj_tcd_free_tile(tcd);
  748|       |
  749|  7.85k|        if (tcd->tcd_image) {
  ------------------
  |  Branch (749:13): [True: 7.85k, False: 0]
  ------------------
  750|  7.85k|            opj_free(tcd->tcd_image);
  751|  7.85k|            tcd->tcd_image = 00;
  752|  7.85k|        }
  753|       |
  754|  7.85k|        opj_free(tcd->used_component);
  755|       |
  756|  7.85k|        opj_free(tcd);
  757|  7.85k|    }
  758|  9.21k|}
opj_alloc_tile_component_data:
  761|  18.1k|{
  762|  18.1k|    if ((l_tilec->data == 00) ||
  ------------------
  |  Branch (762:9): [True: 13.6k, False: 4.55k]
  ------------------
  763|  18.1k|            ((l_tilec->data_size_needed > l_tilec->data_size) &&
  ------------------
  |  Branch (763:14): [True: 923, False: 3.63k]
  ------------------
  764|  13.6k|             (l_tilec->ownsData == OPJ_FALSE))) {
  ------------------
  |  |  118|    923|#define OPJ_FALSE 0
  ------------------
  |  Branch (764:14): [True: 0, False: 923]
  ------------------
  765|  13.6k|        l_tilec->data = (OPJ_INT32 *) opj_image_data_alloc(l_tilec->data_size_needed);
  766|  13.6k|        if (!l_tilec->data && l_tilec->data_size_needed != 0) {
  ------------------
  |  Branch (766:13): [True: 3.54k, False: 10.0k]
  |  Branch (766:31): [True: 0, False: 3.54k]
  ------------------
  767|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  768|      0|        }
  769|       |        /*fprintf(stderr, "tAllocate data of tilec (int): %d x OPJ_UINT32n",l_data_size);*/
  770|  13.6k|        l_tilec->data_size = l_tilec->data_size_needed;
  771|  13.6k|        l_tilec->ownsData = OPJ_TRUE;
  ------------------
  |  |  117|  13.6k|#define OPJ_TRUE 1
  ------------------
  772|  13.6k|    } else if (l_tilec->data_size_needed > l_tilec->data_size) {
  ------------------
  |  Branch (772:16): [True: 923, False: 3.63k]
  ------------------
  773|       |        /* We don't need to keep old data */
  774|    923|        opj_image_data_free(l_tilec->data);
  775|    923|        l_tilec->data = (OPJ_INT32 *) opj_image_data_alloc(l_tilec->data_size_needed);
  776|    923|        if (! l_tilec->data) {
  ------------------
  |  Branch (776:13): [True: 0, False: 923]
  ------------------
  777|      0|            l_tilec->data_size = 0;
  778|      0|            l_tilec->data_size_needed = 0;
  779|      0|            l_tilec->ownsData = OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  780|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  781|      0|        }
  782|       |        /*fprintf(stderr, "tReallocate data of tilec (int): from %d to %d x OPJ_UINT32n", l_tilec->data_size, l_data_size);*/
  783|    923|        l_tilec->data_size = l_tilec->data_size_needed;
  784|    923|        l_tilec->ownsData = OPJ_TRUE;
  ------------------
  |  |  117|    923|#define OPJ_TRUE 1
  ------------------
  785|    923|    }
  786|  18.1k|    return OPJ_TRUE;
  ------------------
  |  |  117|  18.1k|#define OPJ_TRUE 1
  ------------------
  787|  18.1k|}
opj_tcd_init_decode_tile:
 1275|  8.89k|{
 1276|  8.89k|    return opj_tcd_init_tile(p_tcd, p_tile_no, OPJ_FALSE,
  ------------------
  |  |  118|  8.89k|#define OPJ_FALSE 0
  ------------------
 1277|  8.89k|                             sizeof(opj_tcd_cblk_dec_t), p_manager);
 1278|  8.89k|}
opj_tcd_reinit_segment:
 1349|   415M|{
 1350|   415M|    memset(seg, 0, sizeof(opj_tcd_seg_t));
 1351|   415M|}
opj_tcd_decode_tile:
 1558|  8.83k|{
 1559|  8.83k|    OPJ_UINT32 l_data_read;
 1560|  8.83k|    OPJ_UINT32 compno;
 1561|       |
 1562|  8.83k|    p_tcd->tcd_tileno = p_tile_no;
 1563|  8.83k|    p_tcd->tcp = &(p_tcd->cp->tcps[p_tile_no]);
 1564|  8.83k|    p_tcd->win_x0 = win_x0;
 1565|  8.83k|    p_tcd->win_y0 = win_y0;
 1566|  8.83k|    p_tcd->win_x1 = win_x1;
 1567|  8.83k|    p_tcd->win_y1 = win_y1;
 1568|  8.83k|    p_tcd->whole_tile_decoding = OPJ_TRUE;
  ------------------
  |  |  117|  8.83k|#define OPJ_TRUE 1
  ------------------
 1569|       |
 1570|  8.83k|    opj_free(p_tcd->used_component);
 1571|  8.83k|    p_tcd->used_component = NULL;
 1572|       |
 1573|  8.83k|    if (numcomps_to_decode) {
  ------------------
  |  Branch (1573:9): [True: 0, False: 8.83k]
  ------------------
 1574|      0|        OPJ_BOOL* used_component = (OPJ_BOOL*) opj_calloc(sizeof(OPJ_BOOL),
 1575|      0|                                   p_tcd->image->numcomps);
 1576|      0|        if (used_component == NULL) {
  ------------------
  |  Branch (1576:13): [True: 0, False: 0]
  ------------------
 1577|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1578|      0|        }
 1579|      0|        for (compno = 0; compno < numcomps_to_decode; compno++) {
  ------------------
  |  Branch (1579:26): [True: 0, False: 0]
  ------------------
 1580|      0|            used_component[ comps_indices[compno] ] = OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
 1581|      0|        }
 1582|       |
 1583|      0|        p_tcd->used_component = used_component;
 1584|      0|    }
 1585|       |
 1586|  27.0k|    for (compno = 0; compno < p_tcd->image->numcomps; compno++) {
  ------------------
  |  Branch (1586:22): [True: 21.9k, False: 5.05k]
  ------------------
 1587|  21.9k|        if (p_tcd->used_component != NULL && !p_tcd->used_component[compno]) {
  ------------------
  |  Branch (1587:13): [True: 0, False: 21.9k]
  |  Branch (1587:46): [True: 0, False: 0]
  ------------------
 1588|      0|            continue;
 1589|      0|        }
 1590|       |
 1591|  21.9k|        if (!opj_tcd_is_whole_tilecomp_decoding(p_tcd, compno)) {
  ------------------
  |  Branch (1591:13): [True: 3.78k, False: 18.1k]
  ------------------
 1592|  3.78k|            p_tcd->whole_tile_decoding = OPJ_FALSE;
  ------------------
  |  |  118|  3.78k|#define OPJ_FALSE 0
  ------------------
 1593|  3.78k|            break;
 1594|  3.78k|        }
 1595|  21.9k|    }
 1596|       |
 1597|  8.83k|    if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (1597:9): [True: 5.05k, False: 3.78k]
  ------------------
 1598|  23.2k|        for (compno = 0; compno < p_tcd->image->numcomps; compno++) {
  ------------------
  |  Branch (1598:26): [True: 18.1k, False: 5.05k]
  ------------------
 1599|  18.1k|            opj_tcd_tilecomp_t* tilec = &(p_tcd->tcd_image->tiles->comps[compno]);
 1600|  18.1k|            opj_tcd_resolution_t *l_res = &
 1601|  18.1k|                                          (tilec->resolutions[tilec->minimum_num_resolutions - 1]);
 1602|  18.1k|            OPJ_SIZE_T l_data_size;
 1603|       |
 1604|       |            /* compute l_data_size with overflow check */
 1605|  18.1k|            OPJ_SIZE_T res_w = (OPJ_SIZE_T)(l_res->x1 - l_res->x0);
 1606|  18.1k|            OPJ_SIZE_T res_h = (OPJ_SIZE_T)(l_res->y1 - l_res->y0);
 1607|       |
 1608|  18.1k|            if (p_tcd->used_component != NULL && !p_tcd->used_component[compno]) {
  ------------------
  |  Branch (1608:17): [True: 0, False: 18.1k]
  |  Branch (1608:50): [True: 0, False: 0]
  ------------------
 1609|      0|                continue;
 1610|      0|            }
 1611|       |
 1612|       |            /* issue 733, l_data_size == 0U, probably something wrong should be checked before getting here */
 1613|  18.1k|            if (res_h > 0 && res_w > SIZE_MAX / res_h) {
  ------------------
  |  Branch (1613:17): [True: 16.1k, False: 2.05k]
  |  Branch (1613:30): [True: 0, False: 16.1k]
  ------------------
 1614|      0|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1615|      0|                              "Size of tile data exceeds system limits\n");
 1616|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1617|      0|            }
 1618|  18.1k|            l_data_size = res_w * res_h;
 1619|       |
 1620|  18.1k|            if (SIZE_MAX / sizeof(OPJ_UINT32) < l_data_size) {
  ------------------
  |  Branch (1620:17): [True: 0, False: 18.1k]
  ------------------
 1621|      0|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1622|      0|                              "Size of tile data exceeds system limits\n");
 1623|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1624|      0|            }
 1625|  18.1k|            l_data_size *= sizeof(OPJ_UINT32);
 1626|       |
 1627|  18.1k|            tilec->data_size_needed = l_data_size;
 1628|       |
 1629|  18.1k|            if (!opj_alloc_tile_component_data(tilec)) {
  ------------------
  |  Branch (1629:17): [True: 0, False: 18.1k]
  ------------------
 1630|      0|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1631|      0|                              "Size of tile data exceeds system limits\n");
 1632|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1633|      0|            }
 1634|  18.1k|        }
 1635|  5.05k|    } else {
 1636|       |        /* Compute restricted tile-component and tile-resolution coordinates */
 1637|       |        /* of the window of interest, but defer the memory allocation until */
 1638|       |        /* we know the resno_decoded */
 1639|  14.0k|        for (compno = 0; compno < p_tcd->image->numcomps; compno++) {
  ------------------
  |  Branch (1639:26): [True: 10.2k, False: 3.73k]
  ------------------
 1640|  10.2k|            OPJ_UINT32 resno;
 1641|  10.2k|            opj_tcd_tilecomp_t* tilec = &(p_tcd->tcd_image->tiles->comps[compno]);
 1642|  10.2k|            opj_image_comp_t* image_comp = &(p_tcd->image->comps[compno]);
 1643|       |
 1644|  10.2k|            if (p_tcd->used_component != NULL && !p_tcd->used_component[compno]) {
  ------------------
  |  Branch (1644:17): [True: 0, False: 10.2k]
  |  Branch (1644:50): [True: 0, False: 0]
  ------------------
 1645|      0|                continue;
 1646|      0|            }
 1647|       |
 1648|       |            /* Compute the intersection of the area of interest, expressed in tile coordinates */
 1649|       |            /* with the tile coordinates */
 1650|  10.2k|            tilec->win_x0 = opj_uint_max(
 1651|  10.2k|                                (OPJ_UINT32)tilec->x0,
 1652|  10.2k|                                opj_uint_ceildiv(p_tcd->win_x0, image_comp->dx));
 1653|  10.2k|            tilec->win_y0 = opj_uint_max(
 1654|  10.2k|                                (OPJ_UINT32)tilec->y0,
 1655|  10.2k|                                opj_uint_ceildiv(p_tcd->win_y0, image_comp->dy));
 1656|  10.2k|            tilec->win_x1 = opj_uint_min(
 1657|  10.2k|                                (OPJ_UINT32)tilec->x1,
 1658|  10.2k|                                opj_uint_ceildiv(p_tcd->win_x1, image_comp->dx));
 1659|  10.2k|            tilec->win_y1 = opj_uint_min(
 1660|  10.2k|                                (OPJ_UINT32)tilec->y1,
 1661|  10.2k|                                opj_uint_ceildiv(p_tcd->win_y1, image_comp->dy));
 1662|  10.2k|            if (tilec->win_x1 < tilec->win_x0 ||
  ------------------
  |  Branch (1662:17): [True: 27, False: 10.2k]
  ------------------
 1663|  10.2k|                    tilec->win_y1 < tilec->win_y0) {
  ------------------
  |  Branch (1663:21): [True: 20, False: 10.2k]
  ------------------
 1664|       |                /* We should not normally go there. The circumstance is when */
 1665|       |                /* the tile coordinates do not intersect the area of interest */
 1666|       |                /* Upper level logic should not even try to decode that tile */
 1667|     47|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     47|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1668|     47|                              "Invalid tilec->win_xxx values\n");
 1669|     47|                return OPJ_FALSE;
  ------------------
  |  |  118|     47|#define OPJ_FALSE 0
  ------------------
 1670|     47|            }
 1671|       |
 1672|  79.3k|            for (resno = 0; resno < tilec->numresolutions; ++resno) {
  ------------------
  |  Branch (1672:29): [True: 69.0k, False: 10.2k]
  ------------------
 1673|  69.0k|                opj_tcd_resolution_t *res = tilec->resolutions + resno;
 1674|  69.0k|                res->win_x0 = opj_uint_ceildivpow2(tilec->win_x0,
 1675|  69.0k|                                                   tilec->numresolutions - 1 - resno);
 1676|  69.0k|                res->win_y0 = opj_uint_ceildivpow2(tilec->win_y0,
 1677|  69.0k|                                                   tilec->numresolutions - 1 - resno);
 1678|  69.0k|                res->win_x1 = opj_uint_ceildivpow2(tilec->win_x1,
 1679|  69.0k|                                                   tilec->numresolutions - 1 - resno);
 1680|  69.0k|                res->win_y1 = opj_uint_ceildivpow2(tilec->win_y1,
 1681|  69.0k|                                                   tilec->numresolutions - 1 - resno);
 1682|  69.0k|            }
 1683|  10.2k|        }
 1684|  3.78k|    }
 1685|       |
 1686|       |#ifdef TODO_MSD /* FIXME */
 1687|       |    /* INDEX >>  */
 1688|       |    if (p_cstr_info) {
 1689|       |        OPJ_UINT32 resno, compno, numprec = 0;
 1690|       |        for (compno = 0; compno < (OPJ_UINT32) p_cstr_info->numcomps; compno++) {
 1691|       |            opj_tcp_t *tcp = &p_tcd->cp->tcps[0];
 1692|       |            opj_tccp_t *tccp = &tcp->tccps[compno];
 1693|       |            opj_tcd_tilecomp_t *tilec_idx = &p_tcd->tcd_image->tiles->comps[compno];
 1694|       |            for (resno = 0; resno < tilec_idx->numresolutions; resno++) {
 1695|       |                opj_tcd_resolution_t *res_idx = &tilec_idx->resolutions[resno];
 1696|       |                p_cstr_info->tile[p_tile_no].pw[resno] = res_idx->pw;
 1697|       |                p_cstr_info->tile[p_tile_no].ph[resno] = res_idx->ph;
 1698|       |                numprec += res_idx->pw * res_idx->ph;
 1699|       |                p_cstr_info->tile[p_tile_no].pdx[resno] = tccp->prcw[resno];
 1700|       |                p_cstr_info->tile[p_tile_no].pdy[resno] = tccp->prch[resno];
 1701|       |            }
 1702|       |        }
 1703|       |        p_cstr_info->tile[p_tile_no].packet = (opj_packet_info_t *) opj_malloc(
 1704|       |                p_cstr_info->numlayers * numprec * sizeof(opj_packet_info_t));
 1705|       |        p_cstr_info->packno = 0;
 1706|       |    }
 1707|       |    /* << INDEX */
 1708|       |#endif
 1709|       |
 1710|       |    /*--------------TIER2------------------*/
 1711|       |    /* FIXME _ProfStart(PGROUP_T2); */
 1712|  8.79k|    l_data_read = 0;
 1713|  8.79k|    if (! opj_tcd_t2_decode(p_tcd, p_src, &l_data_read, p_max_length, p_cstr_index,
  ------------------
  |  Branch (1713:9): [True: 434, False: 8.35k]
  ------------------
 1714|  8.79k|                            p_manager)) {
 1715|    434|        return OPJ_FALSE;
  ------------------
  |  |  118|    434|#define OPJ_FALSE 0
  ------------------
 1716|    434|    }
 1717|       |    /* FIXME _ProfStop(PGROUP_T2); */
 1718|       |
 1719|       |    /*------------------TIER1-----------------*/
 1720|       |
 1721|       |    /* FIXME _ProfStart(PGROUP_T1); */
 1722|  8.35k|    if (! opj_tcd_t1_decode(p_tcd, p_manager)) {
  ------------------
  |  Branch (1722:9): [True: 529, False: 7.82k]
  ------------------
 1723|    529|        return OPJ_FALSE;
  ------------------
  |  |  118|    529|#define OPJ_FALSE 0
  ------------------
 1724|    529|    }
 1725|       |    /* FIXME _ProfStop(PGROUP_T1); */
 1726|       |
 1727|       |
 1728|       |    /* For subtile decoding, now we know the resno_decoded, we can allocate */
 1729|       |    /* the tile data buffer */
 1730|  7.82k|    if (!p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (1730:9): [True: 3.16k, False: 4.66k]
  ------------------
 1731|  11.7k|        for (compno = 0; compno < p_tcd->image->numcomps; compno++) {
  ------------------
  |  Branch (1731:26): [True: 8.60k, False: 3.16k]
  ------------------
 1732|  8.60k|            opj_tcd_tilecomp_t* tilec = &(p_tcd->tcd_image->tiles->comps[compno]);
 1733|  8.60k|            opj_image_comp_t* image_comp = &(p_tcd->image->comps[compno]);
 1734|  8.60k|            opj_tcd_resolution_t *res = tilec->resolutions + image_comp->resno_decoded;
 1735|  8.60k|            OPJ_SIZE_T w = res->win_x1 - res->win_x0;
 1736|  8.60k|            OPJ_SIZE_T h = res->win_y1 - res->win_y0;
 1737|  8.60k|            OPJ_SIZE_T l_data_size;
 1738|       |
 1739|  8.60k|            opj_image_data_free(tilec->data_win);
 1740|  8.60k|            tilec->data_win = NULL;
 1741|       |
 1742|  8.60k|            if (p_tcd->used_component != NULL && !p_tcd->used_component[compno]) {
  ------------------
  |  Branch (1742:17): [True: 0, False: 8.60k]
  |  Branch (1742:50): [True: 0, False: 0]
  ------------------
 1743|      0|                continue;
 1744|      0|            }
 1745|       |
 1746|  8.60k|            if (w > 0 && h > 0) {
  ------------------
  |  Branch (1746:17): [True: 7.95k, False: 648]
  |  Branch (1746:26): [True: 7.24k, False: 708]
  ------------------
 1747|  7.24k|                if (w > SIZE_MAX / h) {
  ------------------
  |  Branch (1747:21): [True: 0, False: 7.24k]
  ------------------
 1748|      0|                    opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1749|      0|                                  "Size of tile data exceeds system limits\n");
 1750|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1751|      0|                }
 1752|  7.24k|                l_data_size = w * h;
 1753|  7.24k|                if (l_data_size > SIZE_MAX / sizeof(OPJ_INT32)) {
  ------------------
  |  Branch (1753:21): [True: 0, False: 7.24k]
  ------------------
 1754|      0|                    opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1755|      0|                                  "Size of tile data exceeds system limits\n");
 1756|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1757|      0|                }
 1758|  7.24k|                l_data_size *= sizeof(OPJ_INT32);
 1759|       |
 1760|  7.24k|                tilec->data_win = (OPJ_INT32*) opj_image_data_alloc(l_data_size);
 1761|  7.24k|                if (tilec->data_win == NULL) {
  ------------------
  |  Branch (1761:21): [True: 0, False: 7.24k]
  ------------------
 1762|      0|                    opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1763|      0|                                  "Size of tile data exceeds system limits\n");
 1764|      0|                    return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1765|      0|                }
 1766|  7.24k|            }
 1767|  8.60k|        }
 1768|  3.16k|    }
 1769|       |
 1770|       |    /*----------------DWT---------------------*/
 1771|       |
 1772|       |    /* FIXME _ProfStart(PGROUP_DWT); */
 1773|  7.82k|    if
 1774|  7.82k|    (! opj_tcd_dwt_decode(p_tcd)) {
  ------------------
  |  Branch (1774:6): [True: 0, False: 7.82k]
  ------------------
 1775|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1776|      0|    }
 1777|       |    /* FIXME _ProfStop(PGROUP_DWT); */
 1778|       |
 1779|       |    /*----------------MCT-------------------*/
 1780|       |    /* FIXME _ProfStart(PGROUP_MCT); */
 1781|  7.82k|    if
 1782|  7.82k|    (! opj_tcd_mct_decode(p_tcd, p_manager)) {
  ------------------
  |  Branch (1782:6): [True: 110, False: 7.71k]
  ------------------
 1783|    110|        return OPJ_FALSE;
  ------------------
  |  |  118|    110|#define OPJ_FALSE 0
  ------------------
 1784|    110|    }
 1785|       |    /* FIXME _ProfStop(PGROUP_MCT); */
 1786|       |
 1787|       |    /* FIXME _ProfStart(PGROUP_DC_SHIFT); */
 1788|  7.71k|    if
 1789|  7.71k|    (! opj_tcd_dc_level_shift_decode(p_tcd)) {
  ------------------
  |  Branch (1789:6): [True: 0, False: 7.71k]
  ------------------
 1790|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1791|      0|    }
 1792|       |    /* FIXME _ProfStop(PGROUP_DC_SHIFT); */
 1793|       |
 1794|       |
 1795|       |    /*---------------TILE-------------------*/
 1796|  7.71k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.71k|#define OPJ_TRUE 1
  ------------------
 1797|  7.71k|}
opj_tcd_is_band_empty:
 2776|  24.7M|{
 2777|  24.7M|    return (band->x1 - band->x0 == 0) || (band->y1 - band->y0 == 0);
  ------------------
  |  Branch (2777:12): [True: 289k, False: 24.4M]
  |  Branch (2777:42): [True: 50.2k, False: 24.4M]
  ------------------
 2778|  24.7M|}
opj_tcd_is_subband_area_of_interest:
 2788|   774M|{
 2789|       |    /* Note: those values for filter_margin are in part the result of */
 2790|       |    /* experimentation. The value 2 for QMFBID=1 (5x3 filter) can be linked */
 2791|       |    /* to the maximum left/right extension given in tables F.2 and F.3 of the */
 2792|       |    /* standard. The value 3 for QMFBID=0 (9x7 filter) is more suspicious, */
 2793|       |    /* since F.2 and F.3 would lead to 4 instead, so the current 3 might be */
 2794|       |    /* needed to be bumped to 4, in case inconsistencies are found while */
 2795|       |    /* decoding parts of irreversible coded images. */
 2796|       |    /* See opj_dwt_decode_partial_53 and opj_dwt_decode_partial_97 as well */
 2797|   774M|    OPJ_UINT32 filter_margin = (tcd->tcp->tccps[compno].qmfbid == 1) ? 2 : 3;
  ------------------
  |  Branch (2797:32): [True: 699M, False: 74.5M]
  ------------------
 2798|   774M|    opj_tcd_tilecomp_t *tilec = &(tcd->tcd_image->tiles->comps[compno]);
 2799|   774M|    opj_image_comp_t* image_comp = &(tcd->image->comps[compno]);
 2800|       |    /* Compute the intersection of the area of interest, expressed in tile coordinates */
 2801|       |    /* with the tile coordinates */
 2802|   774M|    OPJ_UINT32 tcx0 = opj_uint_max(
 2803|   774M|                          (OPJ_UINT32)tilec->x0,
 2804|   774M|                          opj_uint_ceildiv(tcd->win_x0, image_comp->dx));
 2805|   774M|    OPJ_UINT32 tcy0 = opj_uint_max(
 2806|   774M|                          (OPJ_UINT32)tilec->y0,
 2807|   774M|                          opj_uint_ceildiv(tcd->win_y0, image_comp->dy));
 2808|   774M|    OPJ_UINT32 tcx1 = opj_uint_min(
 2809|   774M|                          (OPJ_UINT32)tilec->x1,
 2810|   774M|                          opj_uint_ceildiv(tcd->win_x1, image_comp->dx));
 2811|   774M|    OPJ_UINT32 tcy1 = opj_uint_min(
 2812|   774M|                          (OPJ_UINT32)tilec->y1,
 2813|   774M|                          opj_uint_ceildiv(tcd->win_y1, image_comp->dy));
 2814|       |    /* Compute number of decomposition for this band. See table F-1 */
 2815|   774M|    OPJ_UINT32 nb = (resno == 0) ?
  ------------------
  |  Branch (2815:21): [True: 676M, False: 98.1M]
  ------------------
 2816|   676M|                    tilec->numresolutions - 1 :
 2817|   774M|                    tilec->numresolutions - resno;
 2818|       |    /* Map above tile-based coordinates to sub-band-based coordinates per */
 2819|       |    /* equation B-15 of the standard */
 2820|   774M|    OPJ_UINT32 x0b = bandno & 1;
 2821|   774M|    OPJ_UINT32 y0b = bandno >> 1;
 2822|   774M|    OPJ_UINT32 tbx0 = (nb == 0) ? tcx0 :
  ------------------
  |  Branch (2822:23): [True: 667M, False: 106M]
  ------------------
 2823|   774M|                      (tcx0 <= (1U << (nb - 1)) * x0b) ? 0 :
  ------------------
  |  Branch (2823:23): [True: 54.2M, False: 52.0M]
  ------------------
 2824|   106M|                      opj_uint_ceildivpow2(tcx0 - (1U << (nb - 1)) * x0b, nb);
 2825|   774M|    OPJ_UINT32 tby0 = (nb == 0) ? tcy0 :
  ------------------
  |  Branch (2825:23): [True: 667M, False: 106M]
  ------------------
 2826|   774M|                      (tcy0 <= (1U << (nb - 1)) * y0b) ? 0 :
  ------------------
  |  Branch (2826:23): [True: 30.4M, False: 75.8M]
  ------------------
 2827|   106M|                      opj_uint_ceildivpow2(tcy0 - (1U << (nb - 1)) * y0b, nb);
 2828|   774M|    OPJ_UINT32 tbx1 = (nb == 0) ? tcx1 :
  ------------------
  |  Branch (2828:23): [True: 667M, False: 106M]
  ------------------
 2829|   774M|                      (tcx1 <= (1U << (nb - 1)) * x0b) ? 0 :
  ------------------
  |  Branch (2829:23): [True: 3.71M, False: 102M]
  ------------------
 2830|   106M|                      opj_uint_ceildivpow2(tcx1 - (1U << (nb - 1)) * x0b, nb);
 2831|   774M|    OPJ_UINT32 tby1 = (nb == 0) ? tcy1 :
  ------------------
  |  Branch (2831:23): [True: 667M, False: 106M]
  ------------------
 2832|   774M|                      (tcy1 <= (1U << (nb - 1)) * y0b) ? 0 :
  ------------------
  |  Branch (2832:23): [True: 1.79M, False: 104M]
  ------------------
 2833|   106M|                      opj_uint_ceildivpow2(tcy1 - (1U << (nb - 1)) * y0b, nb);
 2834|   774M|    OPJ_BOOL intersects;
 2835|       |
 2836|   774M|    if (tbx0 < filter_margin) {
  ------------------
  |  Branch (2836:9): [True: 154M, False: 619M]
  ------------------
 2837|   154M|        tbx0 = 0;
 2838|   619M|    } else {
 2839|   619M|        tbx0 -= filter_margin;
 2840|   619M|    }
 2841|   774M|    if (tby0 < filter_margin) {
  ------------------
  |  Branch (2841:9): [True: 157M, False: 617M]
  ------------------
 2842|   157M|        tby0 = 0;
 2843|   617M|    } else {
 2844|   617M|        tby0 -= filter_margin;
 2845|   617M|    }
 2846|   774M|    tbx1 = opj_uint_adds(tbx1, filter_margin);
 2847|   774M|    tby1 = opj_uint_adds(tby1, filter_margin);
 2848|       |
 2849|   774M|    intersects = band_x0 < tbx1 && band_y0 < tby1 && band_x1 > tbx0 &&
  ------------------
  |  Branch (2849:18): [True: 212M, False: 561M]
  |  Branch (2849:36): [True: 113M, False: 99.0M]
  |  Branch (2849:54): [True: 111M, False: 1.35M]
  ------------------
 2850|   774M|                 band_y1 > tby0;
  ------------------
  |  Branch (2850:18): [True: 111M, False: 102k]
  ------------------
 2851|       |
 2852|       |#ifdef DEBUG_VERBOSE
 2853|       |    printf("compno=%u resno=%u nb=%u bandno=%u x0b=%u y0b=%u band=%u,%u,%u,%u tb=%u,%u,%u,%u -> %u\n",
 2854|       |           compno, resno, nb, bandno, x0b, y0b,
 2855|       |           band_x0, band_y0, band_x1, band_y1,
 2856|       |           tbx0, tby0, tbx1, tby1, intersects);
 2857|       |#endif
 2858|   774M|    return intersects;
 2859|   774M|}
tcd.c:opj_tcd_init_tile:
  794|  8.89k|{
  795|  8.89k|    OPJ_UINT32 compno, resno, bandno, precno, cblkno;
  796|  8.89k|    opj_tcp_t * l_tcp = 00;
  797|  8.89k|    opj_cp_t * l_cp = 00;
  798|  8.89k|    opj_tcd_tile_t * l_tile = 00;
  799|  8.89k|    opj_tccp_t *l_tccp = 00;
  800|  8.89k|    opj_tcd_tilecomp_t *l_tilec = 00;
  801|  8.89k|    opj_image_comp_t * l_image_comp = 00;
  802|  8.89k|    opj_tcd_resolution_t *l_res = 00;
  803|  8.89k|    opj_tcd_band_t *l_band = 00;
  804|  8.89k|    opj_stepsize_t * l_step_size = 00;
  805|  8.89k|    opj_tcd_precinct_t *l_current_precinct = 00;
  806|  8.89k|    opj_image_t *l_image = 00;
  807|  8.89k|    OPJ_UINT32 p, q;
  808|  8.89k|    OPJ_UINT32 l_level_no;
  809|  8.89k|    OPJ_UINT32 l_pdx, l_pdy;
  810|  8.89k|    OPJ_INT32 l_x0b, l_y0b;
  811|  8.89k|    OPJ_UINT32 l_tx0, l_ty0;
  812|       |    /* extent of precincts , top left, bottom right**/
  813|  8.89k|    OPJ_INT32 l_tl_prc_x_start, l_tl_prc_y_start, l_br_prc_x_end, l_br_prc_y_end;
  814|       |    /* number of precinct for a resolution */
  815|  8.89k|    OPJ_UINT32 l_nb_precincts;
  816|       |    /* room needed to store l_nb_precinct precinct for a resolution */
  817|  8.89k|    OPJ_UINT32 l_nb_precinct_size;
  818|       |    /* number of code blocks for a precinct*/
  819|  8.89k|    OPJ_UINT32 l_nb_code_blocks;
  820|       |    /* room needed to store l_nb_code_blocks code blocks for a precinct*/
  821|  8.89k|    OPJ_UINT32 l_nb_code_blocks_size;
  822|       |    /* size of data for a tile */
  823|  8.89k|    OPJ_UINT32 l_data_size;
  824|       |
  825|  8.89k|    l_cp = p_tcd->cp;
  826|  8.89k|    l_tcp = &(l_cp->tcps[p_tile_no]);
  827|  8.89k|    l_tile = p_tcd->tcd_image->tiles;
  828|  8.89k|    l_tccp = l_tcp->tccps;
  829|  8.89k|    l_tilec = l_tile->comps;
  830|  8.89k|    l_image = p_tcd->image;
  831|  8.89k|    l_image_comp = p_tcd->image->comps;
  832|       |
  833|  8.89k|    p = p_tile_no % l_cp->tw;       /* tile coordinates */
  834|  8.89k|    q = p_tile_no / l_cp->tw;
  835|       |    /*fprintf(stderr, "Tile coordinate = %d,%d\n", p, q);*/
  836|       |
  837|       |    /* 4 borders of the tile rescale on the image if necessary */
  838|  8.89k|    l_tx0 = l_cp->tx0 + p *
  839|  8.89k|            l_cp->tdx; /* can't be greater than l_image->x1 so won't overflow */
  840|  8.89k|    l_tile->x0 = (OPJ_INT32)opj_uint_max(l_tx0, l_image->x0);
  841|  8.89k|    l_tile->x1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_tx0, l_cp->tdx),
  842|  8.89k|                                         l_image->x1);
  843|       |    /* all those OPJ_UINT32 are casted to OPJ_INT32, let's do some sanity check */
  844|  8.89k|    if ((l_tile->x0 < 0) || (l_tile->x1 <= l_tile->x0)) {
  ------------------
  |  Branch (844:9): [True: 1, False: 8.89k]
  |  Branch (844:29): [True: 22, False: 8.87k]
  ------------------
  845|     23|        opj_event_msg(manager, EVT_ERROR, "Tile X coordinates are not supported\n");
  ------------------
  |  |   66|     23|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  846|     23|        return OPJ_FALSE;
  ------------------
  |  |  118|     23|#define OPJ_FALSE 0
  ------------------
  847|     23|    }
  848|  8.87k|    l_ty0 = l_cp->ty0 + q *
  849|  8.87k|            l_cp->tdy; /* can't be greater than l_image->y1 so won't overflow */
  850|  8.87k|    l_tile->y0 = (OPJ_INT32)opj_uint_max(l_ty0, l_image->y0);
  851|  8.87k|    l_tile->y1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_ty0, l_cp->tdy),
  852|  8.87k|                                         l_image->y1);
  853|       |    /* all those OPJ_UINT32 are casted to OPJ_INT32, let's do some sanity check */
  854|  8.87k|    if ((l_tile->y0 < 0) || (l_tile->y1 <= l_tile->y0)) {
  ------------------
  |  Branch (854:9): [True: 4, False: 8.86k]
  |  Branch (854:29): [True: 12, False: 8.85k]
  ------------------
  855|     16|        opj_event_msg(manager, EVT_ERROR, "Tile Y coordinates are not supported\n");
  ------------------
  |  |   66|     16|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  856|     16|        return OPJ_FALSE;
  ------------------
  |  |  118|     16|#define OPJ_FALSE 0
  ------------------
  857|     16|    }
  858|       |
  859|       |
  860|       |    /* testcase 1888.pdf.asan.35.988 */
  861|  8.85k|    if (l_tccp->numresolutions == 0) {
  ------------------
  |  Branch (861:9): [True: 0, False: 8.85k]
  ------------------
  862|      0|        opj_event_msg(manager, EVT_ERROR, "tiles require at least one resolution\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  863|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  864|      0|    }
  865|       |    /*fprintf(stderr, "Tile border = %d,%d,%d,%d\n", l_tile->x0, l_tile->y0,l_tile->x1,l_tile->y1);*/
  866|       |
  867|       |    /*tile->numcomps = image->numcomps; */
  868|  37.3k|    for (compno = 0; compno < l_tile->numcomps; ++compno) {
  ------------------
  |  Branch (868:22): [True: 28.4k, False: 8.84k]
  ------------------
  869|       |        /*fprintf(stderr, "compno = %d/%d\n", compno, l_tile->numcomps);*/
  870|  28.4k|        l_image_comp->resno_decoded = 0;
  871|       |        /* border of each l_tile component (global) */
  872|  28.4k|        l_tilec->x0 = opj_int_ceildiv(l_tile->x0, (OPJ_INT32)l_image_comp->dx);
  873|  28.4k|        l_tilec->y0 = opj_int_ceildiv(l_tile->y0, (OPJ_INT32)l_image_comp->dy);
  874|  28.4k|        l_tilec->x1 = opj_int_ceildiv(l_tile->x1, (OPJ_INT32)l_image_comp->dx);
  875|  28.4k|        l_tilec->y1 = opj_int_ceildiv(l_tile->y1, (OPJ_INT32)l_image_comp->dy);
  876|  28.4k|        l_tilec->compno = compno;
  877|       |        /*fprintf(stderr, "\tTile compo border = %d,%d,%d,%d\n", l_tilec->x0, l_tilec->y0,l_tilec->x1,l_tilec->y1);*/
  878|       |
  879|  28.4k|        l_tilec->numresolutions = l_tccp->numresolutions;
  880|  28.4k|        if (l_tccp->numresolutions < l_cp->m_specific_param.m_dec.m_reduce) {
  ------------------
  |  Branch (880:13): [True: 0, False: 28.4k]
  ------------------
  881|      0|            l_tilec->minimum_num_resolutions = 1;
  882|  28.4k|        } else {
  883|  28.4k|            l_tilec->minimum_num_resolutions = l_tccp->numresolutions -
  884|  28.4k|                                               l_cp->m_specific_param.m_dec.m_reduce;
  885|  28.4k|        }
  886|       |
  887|  28.4k|        if (isEncoder) {
  ------------------
  |  Branch (887:13): [True: 0, False: 28.4k]
  ------------------
  888|      0|            OPJ_SIZE_T l_tile_data_size;
  889|       |
  890|       |            /* compute l_data_size with overflow check */
  891|      0|            OPJ_SIZE_T w = (OPJ_SIZE_T)(l_tilec->x1 - l_tilec->x0);
  892|      0|            OPJ_SIZE_T h = (OPJ_SIZE_T)(l_tilec->y1 - l_tilec->y0);
  893|       |
  894|       |            /* issue 733, l_data_size == 0U, probably something wrong should be checked before getting here */
  895|      0|            if (h > 0 && w > SIZE_MAX / h) {
  ------------------
  |  Branch (895:17): [True: 0, False: 0]
  |  Branch (895:26): [True: 0, False: 0]
  ------------------
  896|      0|                opj_event_msg(manager, EVT_ERROR, "Size of tile data exceeds system limits\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  897|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  898|      0|            }
  899|      0|            l_tile_data_size = w * h;
  900|       |
  901|      0|            if (SIZE_MAX / sizeof(OPJ_UINT32) < l_tile_data_size) {
  ------------------
  |  Branch (901:17): [True: 0, False: 0]
  ------------------
  902|      0|                opj_event_msg(manager, EVT_ERROR, "Size of tile data exceeds system limits\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  903|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  904|      0|            }
  905|      0|            l_tile_data_size = l_tile_data_size * sizeof(OPJ_UINT32);
  906|       |
  907|      0|            l_tilec->data_size_needed = l_tile_data_size;
  908|      0|        }
  909|       |
  910|  28.4k|        l_data_size = l_tilec->numresolutions * (OPJ_UINT32)sizeof(
  911|  28.4k|                          opj_tcd_resolution_t);
  912|       |
  913|  28.4k|        opj_image_data_free(l_tilec->data_win);
  914|  28.4k|        l_tilec->data_win = NULL;
  915|  28.4k|        l_tilec->win_x0 = 0;
  916|  28.4k|        l_tilec->win_y0 = 0;
  917|  28.4k|        l_tilec->win_x1 = 0;
  918|  28.4k|        l_tilec->win_y1 = 0;
  919|       |
  920|  28.4k|        if (l_tilec->resolutions == 00) {
  ------------------
  |  Branch (920:13): [True: 21.1k, False: 7.33k]
  ------------------
  921|  21.1k|            l_tilec->resolutions = (opj_tcd_resolution_t *) opj_malloc(l_data_size);
  922|  21.1k|            if (! l_tilec->resolutions) {
  ------------------
  |  Branch (922:17): [True: 0, False: 21.1k]
  ------------------
  923|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  924|      0|            }
  925|       |            /*fprintf(stderr, "\tAllocate resolutions of tilec (opj_tcd_resolution_t): %d\n",l_data_size);*/
  926|  21.1k|            l_tilec->resolutions_size = l_data_size;
  927|  21.1k|            memset(l_tilec->resolutions, 0, l_data_size);
  928|  21.1k|        } else if (l_data_size > l_tilec->resolutions_size) {
  ------------------
  |  Branch (928:20): [True: 10, False: 7.32k]
  ------------------
  929|     10|            opj_tcd_resolution_t* new_resolutions = (opj_tcd_resolution_t *) opj_realloc(
  930|     10|                    l_tilec->resolutions, l_data_size);
  931|     10|            if (! new_resolutions) {
  ------------------
  |  Branch (931:17): [True: 0, False: 10]
  ------------------
  932|      0|                opj_event_msg(manager, EVT_ERROR, "Not enough memory for tile resolutions\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  933|      0|                opj_free(l_tilec->resolutions);
  934|      0|                l_tilec->resolutions = NULL;
  935|      0|                l_tilec->resolutions_size = 0;
  936|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  937|      0|            }
  938|     10|            l_tilec->resolutions = new_resolutions;
  939|       |            /*fprintf(stderr, "\tReallocate data of tilec (int): from %d to %d x OPJ_UINT32\n", l_tilec->resolutions_size, l_data_size);*/
  940|     10|            memset(((OPJ_BYTE*) l_tilec->resolutions) + l_tilec->resolutions_size, 0,
  941|     10|                   l_data_size - l_tilec->resolutions_size);
  942|     10|            l_tilec->resolutions_size = l_data_size;
  943|     10|        }
  944|       |
  945|  28.4k|        l_level_no = l_tilec->numresolutions;
  946|  28.4k|        l_res = l_tilec->resolutions;
  947|  28.4k|        l_step_size = l_tccp->stepsizes;
  948|       |        /*fprintf(stderr, "\tlevel_no=%d\n",l_level_no);*/
  949|       |
  950|   266k|        for (resno = 0; resno < l_tilec->numresolutions; ++resno) {
  ------------------
  |  Branch (950:25): [True: 237k, False: 28.4k]
  ------------------
  951|       |            /*fprintf(stderr, "\t\tresno = %d/%d\n", resno, l_tilec->numresolutions);*/
  952|   237k|            OPJ_INT32 tlcbgxstart, tlcbgystart /*, brcbgxend, brcbgyend*/;
  953|   237k|            OPJ_UINT32 cbgwidthexpn, cbgheightexpn;
  954|   237k|            OPJ_UINT32 cblkwidthexpn, cblkheightexpn;
  955|       |
  956|   237k|            --l_level_no;
  957|       |
  958|       |            /* border for each resolution level (global) */
  959|   237k|            l_res->x0 = opj_int_ceildivpow2(l_tilec->x0, (OPJ_INT32)l_level_no);
  960|   237k|            l_res->y0 = opj_int_ceildivpow2(l_tilec->y0, (OPJ_INT32)l_level_no);
  961|   237k|            l_res->x1 = opj_int_ceildivpow2(l_tilec->x1, (OPJ_INT32)l_level_no);
  962|   237k|            l_res->y1 = opj_int_ceildivpow2(l_tilec->y1, (OPJ_INT32)l_level_no);
  963|       |
  964|       |            /*fprintf(stderr, "\t\t\tres_x0= %d, res_y0 =%d, res_x1=%d, res_y1=%d\n", l_res->x0, l_res->y0, l_res->x1, l_res->y1);*/
  965|       |            /* p. 35, table A-23, ISO/IEC FDIS154444-1 : 2000 (18 august 2000) */
  966|   237k|            l_pdx = l_tccp->prcw[resno];
  967|   237k|            l_pdy = l_tccp->prch[resno];
  968|       |            /*fprintf(stderr, "\t\t\tpdx=%d, pdy=%d\n", l_pdx, l_pdy);*/
  969|       |            /* p. 64, B.6, ISO/IEC FDIS15444-1 : 2000 (18 august 2000)  */
  970|   237k|            l_tl_prc_x_start = opj_int_floordivpow2(l_res->x0, (OPJ_INT32)l_pdx) << l_pdx;
  971|   237k|            l_tl_prc_y_start = opj_int_floordivpow2(l_res->y0, (OPJ_INT32)l_pdy) << l_pdy;
  972|   237k|            {
  973|   237k|                OPJ_UINT32 tmp = ((OPJ_UINT32)opj_int_ceildivpow2(l_res->x1,
  974|   237k|                                  (OPJ_INT32)l_pdx)) << l_pdx;
  975|   237k|                if (tmp > (OPJ_UINT32)INT_MAX) {
  ------------------
  |  Branch (975:21): [True: 1, False: 237k]
  ------------------
  976|      1|                    opj_event_msg(manager, EVT_ERROR, "Integer overflow\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  977|      1|                    return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
  978|      1|                }
  979|   237k|                l_br_prc_x_end = (OPJ_INT32)tmp;
  980|   237k|            }
  981|      0|            {
  982|   237k|                OPJ_UINT32 tmp = ((OPJ_UINT32)opj_int_ceildivpow2(l_res->y1,
  983|   237k|                                  (OPJ_INT32)l_pdy)) << l_pdy;
  984|   237k|                if (tmp > (OPJ_UINT32)INT_MAX) {
  ------------------
  |  Branch (984:21): [True: 1, False: 237k]
  ------------------
  985|      1|                    opj_event_msg(manager, EVT_ERROR, "Integer overflow\n");
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  986|      1|                    return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
  987|      1|                }
  988|   237k|                l_br_prc_y_end = (OPJ_INT32)tmp;
  989|   237k|            }
  990|       |            /*fprintf(stderr, "\t\t\tprc_x_start=%d, prc_y_start=%d, br_prc_x_end=%d, br_prc_y_end=%d \n", l_tl_prc_x_start, l_tl_prc_y_start, l_br_prc_x_end ,l_br_prc_y_end );*/
  991|       |
  992|   237k|            l_res->pw = (l_res->x0 == l_res->x1) ? 0U : (OPJ_UINT32)((
  ------------------
  |  Branch (992:25): [True: 126k, False: 111k]
  ------------------
  993|   111k|                            l_br_prc_x_end - l_tl_prc_x_start) >> l_pdx);
  994|   237k|            l_res->ph = (l_res->y0 == l_res->y1) ? 0U : (OPJ_UINT32)((
  ------------------
  |  Branch (994:25): [True: 124k, False: 113k]
  ------------------
  995|   113k|                            l_br_prc_y_end - l_tl_prc_y_start) >> l_pdy);
  996|       |            /*fprintf(stderr, "\t\t\tres_pw=%d, res_ph=%d\n", l_res->pw, l_res->ph );*/
  997|       |
  998|   237k|            if ((l_res->pw != 0U) && ((((OPJ_UINT32) - 1) / l_res->pw) < l_res->ph)) {
  ------------------
  |  Branch (998:17): [True: 111k, False: 126k]
  |  Branch (998:38): [True: 2, False: 111k]
  ------------------
  999|      2|                opj_event_msg(manager, EVT_ERROR, "Size of tile data exceeds system limits\n");
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1000|      2|                return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 1001|      2|            }
 1002|   237k|            l_nb_precincts = l_res->pw * l_res->ph;
 1003|       |
 1004|   237k|            if ((((OPJ_UINT32) - 1) / (OPJ_UINT32)sizeof(opj_tcd_precinct_t)) <
  ------------------
  |  Branch (1004:17): [True: 6, False: 237k]
  ------------------
 1005|   237k|                    l_nb_precincts) {
 1006|      6|                opj_event_msg(manager, EVT_ERROR, "Size of tile data exceeds system limits\n");
  ------------------
  |  |   66|      6|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1007|      6|                return OPJ_FALSE;
  ------------------
  |  |  118|      6|#define OPJ_FALSE 0
  ------------------
 1008|      6|            }
 1009|   237k|            l_nb_precinct_size = l_nb_precincts * (OPJ_UINT32)sizeof(opj_tcd_precinct_t);
 1010|       |
 1011|   237k|            if (resno == 0) {
  ------------------
  |  Branch (1011:17): [True: 28.4k, False: 209k]
  ------------------
 1012|  28.4k|                tlcbgxstart = l_tl_prc_x_start;
 1013|  28.4k|                tlcbgystart = l_tl_prc_y_start;
 1014|       |                /*brcbgxend = l_br_prc_x_end;*/
 1015|       |                /* brcbgyend = l_br_prc_y_end;*/
 1016|  28.4k|                cbgwidthexpn = l_pdx;
 1017|  28.4k|                cbgheightexpn = l_pdy;
 1018|  28.4k|                l_res->numbands = 1;
 1019|   209k|            } else {
 1020|   209k|                tlcbgxstart = opj_int_ceildivpow2(l_tl_prc_x_start, 1);
 1021|   209k|                tlcbgystart = opj_int_ceildivpow2(l_tl_prc_y_start, 1);
 1022|       |                /*brcbgxend = opj_int_ceildivpow2(l_br_prc_x_end, 1);*/
 1023|       |                /*brcbgyend = opj_int_ceildivpow2(l_br_prc_y_end, 1);*/
 1024|   209k|                cbgwidthexpn = l_pdx - 1;
 1025|   209k|                cbgheightexpn = l_pdy - 1;
 1026|   209k|                l_res->numbands = 3;
 1027|   209k|            }
 1028|       |
 1029|   237k|            cblkwidthexpn = opj_uint_min(l_tccp->cblkw, cbgwidthexpn);
 1030|   237k|            cblkheightexpn = opj_uint_min(l_tccp->cblkh, cbgheightexpn);
 1031|   237k|            l_band = l_res->bands;
 1032|       |
 1033|   893k|            for (bandno = 0; bandno < l_res->numbands; ++bandno, ++l_band, ++l_step_size) {
  ------------------
  |  Branch (1033:30): [True: 656k, False: 237k]
  ------------------
 1034|       |                /*fprintf(stderr, "\t\t\tband_no=%d/%d\n", bandno, l_res->numbands );*/
 1035|       |
 1036|   656k|                if (resno == 0) {
  ------------------
  |  Branch (1036:21): [True: 28.4k, False: 627k]
  ------------------
 1037|  28.4k|                    l_band->bandno = 0 ;
 1038|  28.4k|                    l_band->x0 = opj_int_ceildivpow2(l_tilec->x0, (OPJ_INT32)l_level_no);
 1039|  28.4k|                    l_band->y0 = opj_int_ceildivpow2(l_tilec->y0, (OPJ_INT32)l_level_no);
 1040|  28.4k|                    l_band->x1 = opj_int_ceildivpow2(l_tilec->x1, (OPJ_INT32)l_level_no);
 1041|  28.4k|                    l_band->y1 = opj_int_ceildivpow2(l_tilec->y1, (OPJ_INT32)l_level_no);
 1042|   627k|                } else {
 1043|   627k|                    l_band->bandno = bandno + 1;
 1044|       |                    /* x0b = 1 if bandno = 1 or 3 */
 1045|   627k|                    l_x0b = l_band->bandno & 1;
 1046|       |                    /* y0b = 1 if bandno = 2 or 3 */
 1047|   627k|                    l_y0b = (OPJ_INT32)((l_band->bandno) >> 1);
 1048|       |                    /* l_band border (global) */
 1049|   627k|                    l_band->x0 = opj_int64_ceildivpow2(l_tilec->x0 - ((OPJ_INT64)l_x0b <<
 1050|   627k|                                                       l_level_no), (OPJ_INT32)(l_level_no + 1));
 1051|   627k|                    l_band->y0 = opj_int64_ceildivpow2(l_tilec->y0 - ((OPJ_INT64)l_y0b <<
 1052|   627k|                                                       l_level_no), (OPJ_INT32)(l_level_no + 1));
 1053|   627k|                    l_band->x1 = opj_int64_ceildivpow2(l_tilec->x1 - ((OPJ_INT64)l_x0b <<
 1054|   627k|                                                       l_level_no), (OPJ_INT32)(l_level_no + 1));
 1055|   627k|                    l_band->y1 = opj_int64_ceildivpow2(l_tilec->y1 - ((OPJ_INT64)l_y0b <<
 1056|   627k|                                                       l_level_no), (OPJ_INT32)(l_level_no + 1));
 1057|   627k|                }
 1058|       |
 1059|   656k|                if (isEncoder) {
  ------------------
  |  Branch (1059:21): [True: 0, False: 656k]
  ------------------
 1060|       |                    /* Skip empty bands */
 1061|      0|                    if (opj_tcd_is_band_empty(l_band)) {
  ------------------
  |  Branch (1061:25): [True: 0, False: 0]
  ------------------
 1062|       |                        /* Do not zero l_band->precints to avoid leaks */
 1063|       |                        /* but make sure we don't use it later, since */
 1064|       |                        /* it will point to precincts of previous bands... */
 1065|      0|                        continue;
 1066|      0|                    }
 1067|      0|                }
 1068|       |
 1069|   656k|                {
 1070|       |                    /* Table E-1 - Sub-band gains */
 1071|       |                    /* BUG_WEIRD_TWO_INVK (look for this identifier in dwt.c): */
 1072|       |                    /* the test (!isEncoder && l_tccp->qmfbid == 0) is strongly */
 1073|       |                    /* linked to the use of two_invK instead of invK */
 1074|   656k|                    const OPJ_INT32 log2_gain = (!isEncoder &&
  ------------------
  |  Branch (1074:50): [True: 656k, False: 0]
  ------------------
 1075|   656k|                                                 l_tccp->qmfbid == 0) ? 0 : (l_band->bandno == 0) ? 0 :
  ------------------
  |  Branch (1075:50): [True: 224k, False: 431k]
  |  Branch (1075:77): [True: 17.8k, False: 413k]
  ------------------
 1076|   431k|                                                (l_band->bandno == 3) ? 2 : 1;
  ------------------
  |  Branch (1076:49): [True: 137k, False: 275k]
  ------------------
 1077|       |
 1078|       |                    /* Nominal dynamic range. Equation E-4 */
 1079|   656k|                    const OPJ_INT32 Rb = (OPJ_INT32)l_image_comp->prec + log2_gain;
 1080|       |
 1081|       |                    /* Delta_b value of Equation E-3 in "E.1 Inverse quantization
 1082|       |                    * procedure" of the standard */
 1083|   656k|                    l_band->stepsize = (OPJ_FLOAT32)(((1.0 + l_step_size->mant / 2048.0) * pow(2.0,
 1084|   656k|                                                      (OPJ_INT32)(Rb - l_step_size->expn))));
 1085|   656k|                }
 1086|       |
 1087|       |                /* Mb value of Equation E-2 in "E.1 Inverse quantization
 1088|       |                 * procedure" of the standard */
 1089|   656k|                l_band->numbps = l_step_size->expn + (OPJ_INT32)l_tccp->numgbits -
 1090|   656k|                                 1;
 1091|       |
 1092|   656k|                if (!l_band->precincts && (l_nb_precincts > 0U)) {
  ------------------
  |  Branch (1092:21): [True: 589k, False: 66.9k]
  |  Branch (1092:43): [True: 156k, False: 432k]
  ------------------
 1093|   156k|                    l_band->precincts = (opj_tcd_precinct_t *) opj_malloc(/*3 * */
 1094|   156k|                                            l_nb_precinct_size);
 1095|   156k|                    if (! l_band->precincts) {
  ------------------
  |  Branch (1095:25): [True: 0, False: 156k]
  ------------------
 1096|      0|                        opj_event_msg(manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1097|      0|                                      "Not enough memory to handle band precints\n");
 1098|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1099|      0|                    }
 1100|       |                    /*fprintf(stderr, "\t\t\t\tAllocate precincts of a band (opj_tcd_precinct_t): %d\n",l_nb_precinct_size);     */
 1101|   156k|                    memset(l_band->precincts, 0, l_nb_precinct_size);
 1102|   156k|                    l_band->precincts_data_size = l_nb_precinct_size;
 1103|   499k|                } else if (l_band->precincts_data_size < l_nb_precinct_size) {
  ------------------
  |  Branch (1103:28): [True: 375, False: 499k]
  ------------------
 1104|       |
 1105|    375|                    opj_tcd_precinct_t * new_precincts = (opj_tcd_precinct_t *) opj_realloc(
 1106|    375|                            l_band->precincts,/*3 * */ l_nb_precinct_size);
 1107|    375|                    if (! new_precincts) {
  ------------------
  |  Branch (1107:25): [True: 0, False: 375]
  ------------------
 1108|      0|                        opj_event_msg(manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1109|      0|                                      "Not enough memory to handle band precints\n");
 1110|      0|                        opj_free(l_band->precincts);
 1111|      0|                        l_band->precincts = NULL;
 1112|      0|                        l_band->precincts_data_size = 0;
 1113|      0|                        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1114|      0|                    }
 1115|    375|                    l_band->precincts = new_precincts;
 1116|       |                    /*fprintf(stderr, "\t\t\t\tReallocate precincts of a band (opj_tcd_precinct_t): from %d to %d\n",l_band->precincts_data_size, l_nb_precinct_size);*/
 1117|    375|                    memset(((OPJ_BYTE *) l_band->precincts) + l_band->precincts_data_size, 0,
 1118|    375|                           l_nb_precinct_size - l_band->precincts_data_size);
 1119|    375|                    l_band->precincts_data_size = l_nb_precinct_size;
 1120|    375|                }
 1121|       |
 1122|   656k|                l_current_precinct = l_band->precincts;
 1123|  36.1M|                for (precno = 0; precno < l_nb_precincts; ++precno) {
  ------------------
  |  Branch (1123:34): [True: 35.4M, False: 656k]
  ------------------
 1124|  35.4M|                    OPJ_INT32 tlcblkxstart, tlcblkystart, brcblkxend, brcblkyend;
 1125|  35.4M|                    OPJ_INT32 cbgxstart = tlcbgxstart + (OPJ_INT32)(precno % l_res->pw) *
 1126|  35.4M|                                          (1 << cbgwidthexpn);
 1127|  35.4M|                    OPJ_INT32 cbgystart = tlcbgystart + (OPJ_INT32)(precno / l_res->pw) *
 1128|  35.4M|                                          (1 << cbgheightexpn);
 1129|  35.4M|                    OPJ_INT32 cbgxend = cbgxstart + (1 << cbgwidthexpn);
 1130|  35.4M|                    OPJ_INT32 cbgyend = cbgystart + (1 << cbgheightexpn);
 1131|       |                    /*fprintf(stderr, "\t precno=%d; bandno=%d, resno=%d; compno=%d\n", precno, bandno , resno, compno);*/
 1132|       |                    /*fprintf(stderr, "\t tlcbgxstart(=%d) + (precno(=%d) percent res->pw(=%d)) * (1 << cbgwidthexpn(=%d)) \n",tlcbgxstart,precno,l_res->pw,cbgwidthexpn);*/
 1133|       |
 1134|       |                    /* precinct size (global) */
 1135|       |                    /*fprintf(stderr, "\t cbgxstart=%d, l_band->x0 = %d \n",cbgxstart, l_band->x0);*/
 1136|       |
 1137|  35.4M|                    l_current_precinct->x0 = opj_int_max(cbgxstart, l_band->x0);
 1138|  35.4M|                    l_current_precinct->y0 = opj_int_max(cbgystart, l_band->y0);
 1139|  35.4M|                    l_current_precinct->x1 = opj_int_min(cbgxend, l_band->x1);
 1140|  35.4M|                    l_current_precinct->y1 = opj_int_min(cbgyend, l_band->y1);
 1141|       |                    /*fprintf(stderr, "\t prc_x0=%d; prc_y0=%d, prc_x1=%d; prc_y1=%d\n",l_current_precinct->x0, l_current_precinct->y0 ,l_current_precinct->x1, l_current_precinct->y1);*/
 1142|       |
 1143|  35.4M|                    tlcblkxstart = opj_int_floordivpow2(l_current_precinct->x0,
 1144|  35.4M|                                                        (OPJ_INT32)cblkwidthexpn) << cblkwidthexpn;
 1145|       |                    /*fprintf(stderr, "\t tlcblkxstart =%d\n",tlcblkxstart );*/
 1146|  35.4M|                    tlcblkystart = opj_int_floordivpow2(l_current_precinct->y0,
 1147|  35.4M|                                                        (OPJ_INT32)cblkheightexpn) << cblkheightexpn;
 1148|       |                    /*fprintf(stderr, "\t tlcblkystart =%d\n",tlcblkystart );*/
 1149|  35.4M|                    brcblkxend = opj_int_ceildivpow2(l_current_precinct->x1,
 1150|  35.4M|                                                     (OPJ_INT32)cblkwidthexpn) << cblkwidthexpn;
 1151|       |                    /*fprintf(stderr, "\t brcblkxend =%d\n",brcblkxend );*/
 1152|  35.4M|                    brcblkyend = opj_int_ceildivpow2(l_current_precinct->y1,
 1153|  35.4M|                                                     (OPJ_INT32)cblkheightexpn) << cblkheightexpn;
 1154|       |                    /*fprintf(stderr, "\t brcblkyend =%d\n",brcblkyend );*/
 1155|  35.4M|                    l_current_precinct->cw = (OPJ_UINT32)((brcblkxend - tlcblkxstart) >>
 1156|  35.4M|                                                          cblkwidthexpn);
 1157|  35.4M|                    l_current_precinct->ch = (OPJ_UINT32)((brcblkyend - tlcblkystart) >>
 1158|  35.4M|                                                          cblkheightexpn);
 1159|       |
 1160|  35.4M|                    l_nb_code_blocks = l_current_precinct->cw * l_current_precinct->ch;
 1161|       |                    /*fprintf(stderr, "\t\t\t\t precinct_cw = %d x recinct_ch = %d\n",l_current_precinct->cw, l_current_precinct->ch);      */
 1162|  35.4M|                    if ((((OPJ_UINT32) - 1) / (OPJ_UINT32)sizeof_block) <
  ------------------
  |  Branch (1162:25): [True: 1, False: 35.4M]
  ------------------
 1163|  35.4M|                            l_nb_code_blocks) {
 1164|      1|                        opj_event_msg(manager, EVT_ERROR,
  ------------------
  |  |   66|      1|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1165|      1|                                      "Size of code block data exceeds system limits\n");
 1166|      1|                        return OPJ_FALSE;
  ------------------
  |  |  118|      1|#define OPJ_FALSE 0
  ------------------
 1167|      1|                    }
 1168|  35.4M|                    l_nb_code_blocks_size = l_nb_code_blocks * (OPJ_UINT32)sizeof_block;
 1169|       |
 1170|  35.4M|                    if (!l_current_precinct->cblks.blocks && (l_nb_code_blocks > 0U)) {
  ------------------
  |  Branch (1170:25): [True: 34.8M, False: 624k]
  |  Branch (1170:62): [True: 34.5M, False: 271k]
  ------------------
 1171|  34.5M|                        l_current_precinct->cblks.blocks = opj_malloc(l_nb_code_blocks_size);
 1172|  34.5M|                        if (! l_current_precinct->cblks.blocks) {
  ------------------
  |  Branch (1172:29): [True: 0, False: 34.5M]
  ------------------
 1173|      0|                            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1174|      0|                        }
 1175|       |                        /*fprintf(stderr, "\t\t\t\tAllocate cblks of a precinct (opj_tcd_cblk_dec_t): %d\n",l_nb_code_blocks_size);*/
 1176|       |
 1177|  34.5M|                        memset(l_current_precinct->cblks.blocks, 0, l_nb_code_blocks_size);
 1178|       |
 1179|  34.5M|                        l_current_precinct->block_size = l_nb_code_blocks_size;
 1180|  34.5M|                    } else if (l_nb_code_blocks_size > l_current_precinct->block_size) {
  ------------------
  |  Branch (1180:32): [True: 13.8k, False: 882k]
  ------------------
 1181|  13.8k|                        void *new_blocks = opj_realloc(l_current_precinct->cblks.blocks,
 1182|  13.8k|                                                       l_nb_code_blocks_size);
 1183|  13.8k|                        if (! new_blocks) {
  ------------------
  |  Branch (1183:29): [True: 0, False: 13.8k]
  ------------------
 1184|      0|                            opj_free(l_current_precinct->cblks.blocks);
 1185|      0|                            l_current_precinct->cblks.blocks = NULL;
 1186|      0|                            l_current_precinct->block_size = 0;
 1187|      0|                            opj_event_msg(manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 1188|      0|                                          "Not enough memory for current precinct codeblock element\n");
 1189|      0|                            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1190|      0|                        }
 1191|  13.8k|                        l_current_precinct->cblks.blocks = new_blocks;
 1192|       |                        /*fprintf(stderr, "\t\t\t\tReallocate cblks of a precinct (opj_tcd_cblk_dec_t): from %d to %d\n",l_current_precinct->block_size, l_nb_code_blocks_size);     */
 1193|       |
 1194|  13.8k|                        memset(((OPJ_BYTE *) l_current_precinct->cblks.blocks) +
 1195|  13.8k|                               l_current_precinct->block_size
 1196|  13.8k|                               , 0
 1197|  13.8k|                               , l_nb_code_blocks_size - l_current_precinct->block_size);
 1198|       |
 1199|  13.8k|                        l_current_precinct->block_size = l_nb_code_blocks_size;
 1200|  13.8k|                    }
 1201|       |
 1202|  35.4M|                    if (! l_current_precinct->incltree) {
  ------------------
  |  Branch (1202:25): [True: 34.8M, False: 569k]
  ------------------
 1203|  34.8M|                        l_current_precinct->incltree = opj_tgt_create(l_current_precinct->cw,
 1204|  34.8M|                                                       l_current_precinct->ch, manager);
 1205|  34.8M|                    } else {
 1206|   569k|                        l_current_precinct->incltree = opj_tgt_init(l_current_precinct->incltree,
 1207|   569k|                                                       l_current_precinct->cw, l_current_precinct->ch, manager);
 1208|   569k|                    }
 1209|       |
 1210|  35.4M|                    if (! l_current_precinct->imsbtree) {
  ------------------
  |  Branch (1210:25): [True: 34.8M, False: 569k]
  ------------------
 1211|  34.8M|                        l_current_precinct->imsbtree = opj_tgt_create(l_current_precinct->cw,
 1212|  34.8M|                                                       l_current_precinct->ch, manager);
 1213|  34.8M|                    } else {
 1214|   569k|                        l_current_precinct->imsbtree = opj_tgt_init(l_current_precinct->imsbtree,
 1215|   569k|                                                       l_current_precinct->cw, l_current_precinct->ch, manager);
 1216|   569k|                    }
 1217|       |
 1218|   339M|                    for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {
  ------------------
  |  Branch (1218:38): [True: 304M, False: 35.4M]
  ------------------
 1219|   304M|                        OPJ_INT32 cblkxstart = tlcblkxstart + (OPJ_INT32)(cblkno %
 1220|   304M|                                               l_current_precinct->cw) * (1 << cblkwidthexpn);
 1221|   304M|                        OPJ_INT32 cblkystart = tlcblkystart + (OPJ_INT32)(cblkno /
 1222|   304M|                                               l_current_precinct->cw) * (1 << cblkheightexpn);
 1223|   304M|                        OPJ_INT32 cblkxend = cblkxstart + (1 << cblkwidthexpn);
 1224|   304M|                        OPJ_INT32 cblkyend = cblkystart + (1 << cblkheightexpn);
 1225|       |
 1226|   304M|                        if (isEncoder) {
  ------------------
  |  Branch (1226:29): [True: 0, False: 304M]
  ------------------
 1227|      0|                            opj_tcd_cblk_enc_t* l_code_block = l_current_precinct->cblks.enc + cblkno;
 1228|       |
 1229|      0|                            if (! opj_tcd_code_block_enc_allocate(l_code_block)) {
  ------------------
  |  Branch (1229:33): [True: 0, False: 0]
  ------------------
 1230|      0|                                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1231|      0|                            }
 1232|       |                            /* code-block size (global) */
 1233|      0|                            l_code_block->x0 = opj_int_max(cblkxstart, l_current_precinct->x0);
 1234|      0|                            l_code_block->y0 = opj_int_max(cblkystart, l_current_precinct->y0);
 1235|      0|                            l_code_block->x1 = opj_int_min(cblkxend, l_current_precinct->x1);
 1236|      0|                            l_code_block->y1 = opj_int_min(cblkyend, l_current_precinct->y1);
 1237|       |
 1238|      0|                            if (! opj_tcd_code_block_enc_allocate_data(l_code_block)) {
  ------------------
  |  Branch (1238:33): [True: 0, False: 0]
  ------------------
 1239|      0|                                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1240|      0|                            }
 1241|   304M|                        } else {
 1242|   304M|                            opj_tcd_cblk_dec_t* l_code_block = l_current_precinct->cblks.dec + cblkno;
 1243|       |
 1244|   304M|                            if (! opj_tcd_code_block_dec_allocate(l_code_block)) {
  ------------------
  |  Branch (1244:33): [True: 0, False: 304M]
  ------------------
 1245|      0|                                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1246|      0|                            }
 1247|       |                            /* code-block size (global) */
 1248|   304M|                            l_code_block->x0 = opj_int_max(cblkxstart, l_current_precinct->x0);
 1249|   304M|                            l_code_block->y0 = opj_int_max(cblkystart, l_current_precinct->y0);
 1250|   304M|                            l_code_block->x1 = opj_int_min(cblkxend, l_current_precinct->x1);
 1251|   304M|                            l_code_block->y1 = opj_int_min(cblkyend, l_current_precinct->y1);
 1252|   304M|                        }
 1253|   304M|                    }
 1254|  35.4M|                    ++l_current_precinct;
 1255|  35.4M|                } /* precno */
 1256|   656k|            } /* bandno */
 1257|   237k|            ++l_res;
 1258|   237k|        } /* resno */
 1259|  28.4k|        ++l_tccp;
 1260|  28.4k|        ++l_tilec;
 1261|  28.4k|        ++l_image_comp;
 1262|  28.4k|    } /* compno */
 1263|  8.84k|    return OPJ_TRUE;
  ------------------
  |  |  117|  8.84k|#define OPJ_TRUE 1
  ------------------
 1264|  8.85k|}
tcd.c:opj_tcd_code_block_dec_allocate:
 1358|   304M|{
 1359|   304M|    if (! p_code_block->segs) {
  ------------------
  |  Branch (1359:9): [True: 263M, False: 41.5M]
  ------------------
 1360|       |
 1361|   263M|        p_code_block->segs = (opj_tcd_seg_t *) opj_calloc(OPJ_J2K_DEFAULT_NB_SEGS,
  ------------------
  |  |  155|   263M|#define OPJ_J2K_DEFAULT_NB_SEGS             10
  ------------------
 1362|   263M|                             sizeof(opj_tcd_seg_t));
 1363|   263M|        if (! p_code_block->segs) {
  ------------------
  |  Branch (1363:13): [True: 0, False: 263M]
  ------------------
 1364|      0|            return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 1365|      0|        }
 1366|       |        /*fprintf(stderr, "Allocate %d elements of code_block->data\n", OPJ_J2K_DEFAULT_NB_SEGS * sizeof(opj_tcd_seg_t));*/
 1367|       |
 1368|   263M|        p_code_block->m_current_max_segs = OPJ_J2K_DEFAULT_NB_SEGS;
  ------------------
  |  |  155|   263M|#define OPJ_J2K_DEFAULT_NB_SEGS             10
  ------------------
 1369|       |        /*fprintf(stderr, "m_current_max_segs of code_block->data = %d\n", p_code_block->m_current_max_segs);*/
 1370|   263M|    } else {
 1371|       |        /* sanitize */
 1372|  41.5M|        opj_tcd_seg_t * l_segs = p_code_block->segs;
 1373|  41.5M|        OPJ_UINT32 l_current_max_segs = p_code_block->m_current_max_segs;
 1374|  41.5M|        opj_tcd_seg_data_chunk_t* l_chunks = p_code_block->chunks;
 1375|  41.5M|        OPJ_UINT32 l_numchunksalloc = p_code_block->numchunksalloc;
 1376|  41.5M|        OPJ_UINT32 i;
 1377|       |
 1378|  41.5M|        opj_aligned_free(p_code_block->decoded_data);
 1379|  41.5M|        p_code_block->decoded_data = 00;
 1380|       |
 1381|  41.5M|        memset(p_code_block, 0, sizeof(opj_tcd_cblk_dec_t));
 1382|  41.5M|        p_code_block->segs = l_segs;
 1383|  41.5M|        p_code_block->m_current_max_segs = l_current_max_segs;
 1384|   456M|        for (i = 0; i < l_current_max_segs; ++i) {
  ------------------
  |  Branch (1384:21): [True: 415M, False: 41.5M]
  ------------------
 1385|   415M|            opj_tcd_reinit_segment(&l_segs[i]);
 1386|   415M|        }
 1387|  41.5M|        p_code_block->chunks = l_chunks;
 1388|  41.5M|        p_code_block->numchunksalloc = l_numchunksalloc;
 1389|  41.5M|    }
 1390|       |
 1391|   304M|    return OPJ_TRUE;
  ------------------
  |  |  117|   304M|#define OPJ_TRUE 1
  ------------------
 1392|   304M|}
tcd.c:opj_tcd_free_tile:
 1923|  7.85k|{
 1924|  7.85k|    OPJ_UINT32 compno, resno, bandno, precno;
 1925|  7.85k|    opj_tcd_tile_t *l_tile = 00;
 1926|  7.85k|    opj_tcd_tilecomp_t *l_tile_comp = 00;
 1927|  7.85k|    opj_tcd_resolution_t *l_res = 00;
 1928|  7.85k|    opj_tcd_band_t *l_band = 00;
 1929|  7.85k|    opj_tcd_precinct_t *l_precinct = 00;
 1930|  7.85k|    OPJ_UINT32 l_nb_resolutions, l_nb_precincts;
 1931|  7.85k|    void (* l_tcd_code_block_deallocate)(opj_tcd_precinct_t *) = 00;
 1932|       |
 1933|  7.85k|    if (! p_tcd) {
  ------------------
  |  Branch (1933:9): [True: 0, False: 7.85k]
  ------------------
 1934|      0|        return;
 1935|      0|    }
 1936|       |
 1937|  7.85k|    if (! p_tcd->tcd_image) {
  ------------------
  |  Branch (1937:9): [True: 0, False: 7.85k]
  ------------------
 1938|      0|        return;
 1939|      0|    }
 1940|       |
 1941|  7.85k|    if (p_tcd->m_is_decoder) {
  ------------------
  |  Branch (1941:9): [True: 7.85k, False: 0]
  ------------------
 1942|  7.85k|        l_tcd_code_block_deallocate = opj_tcd_code_block_dec_deallocate;
 1943|  7.85k|    } else {
 1944|      0|        l_tcd_code_block_deallocate = opj_tcd_code_block_enc_deallocate;
 1945|      0|    }
 1946|       |
 1947|  7.85k|    l_tile = p_tcd->tcd_image->tiles;
 1948|  7.85k|    if (! l_tile) {
  ------------------
  |  Branch (1948:9): [True: 0, False: 7.85k]
  ------------------
 1949|      0|        return;
 1950|      0|    }
 1951|       |
 1952|  7.85k|    l_tile_comp = l_tile->comps;
 1953|       |
 1954|  30.5k|    for (compno = 0; compno < l_tile->numcomps; ++compno) {
  ------------------
  |  Branch (1954:22): [True: 22.6k, False: 7.85k]
  ------------------
 1955|  22.6k|        l_res = l_tile_comp->resolutions;
 1956|  22.6k|        if (l_res) {
  ------------------
  |  Branch (1956:13): [True: 21.1k, False: 1.52k]
  ------------------
 1957|       |
 1958|  21.1k|            l_nb_resolutions = l_tile_comp->resolutions_size / (OPJ_UINT32)sizeof(
 1959|  21.1k|                                   opj_tcd_resolution_t);
 1960|   191k|            for (resno = 0; resno < l_nb_resolutions; ++resno) {
  ------------------
  |  Branch (1960:29): [True: 169k, False: 21.1k]
  ------------------
 1961|   169k|                l_band = l_res->bands;
 1962|   679k|                for (bandno = 0; bandno < 3; ++bandno) {
  ------------------
  |  Branch (1962:34): [True: 509k, False: 169k]
  ------------------
 1963|   509k|                    l_precinct = l_band->precincts;
 1964|   509k|                    if (l_precinct) {
  ------------------
  |  Branch (1964:25): [True: 156k, False: 353k]
  ------------------
 1965|       |
 1966|   156k|                        l_nb_precincts = l_band->precincts_data_size / (OPJ_UINT32)sizeof(
 1967|   156k|                                             opj_tcd_precinct_t);
 1968|  34.9M|                        for (precno = 0; precno < l_nb_precincts; ++precno) {
  ------------------
  |  Branch (1968:42): [True: 34.8M, False: 156k]
  ------------------
 1969|  34.8M|                            opj_tgt_destroy(l_precinct->incltree);
 1970|  34.8M|                            l_precinct->incltree = 00;
 1971|  34.8M|                            opj_tgt_destroy(l_precinct->imsbtree);
 1972|  34.8M|                            l_precinct->imsbtree = 00;
 1973|  34.8M|                            (*l_tcd_code_block_deallocate)(l_precinct);
 1974|  34.8M|                            ++l_precinct;
 1975|  34.8M|                        }
 1976|       |
 1977|   156k|                        opj_free(l_band->precincts);
 1978|   156k|                        l_band->precincts = 00;
 1979|   156k|                    }
 1980|   509k|                    ++l_band;
 1981|   509k|                } /* for (resno */
 1982|   169k|                ++l_res;
 1983|   169k|            }
 1984|       |
 1985|  21.1k|            opj_free(l_tile_comp->resolutions);
 1986|  21.1k|            l_tile_comp->resolutions = 00;
 1987|  21.1k|        }
 1988|       |
 1989|  22.6k|        if (l_tile_comp->ownsData && l_tile_comp->data) {
  ------------------
  |  Branch (1989:13): [True: 13.0k, False: 9.62k]
  |  Branch (1989:38): [True: 6.92k, False: 6.14k]
  ------------------
 1990|  6.92k|            opj_image_data_free(l_tile_comp->data);
 1991|  6.92k|            l_tile_comp->data = 00;
 1992|  6.92k|            l_tile_comp->ownsData = 0;
 1993|  6.92k|            l_tile_comp->data_size = 0;
 1994|  6.92k|            l_tile_comp->data_size_needed = 0;
 1995|  6.92k|        }
 1996|       |
 1997|  22.6k|        opj_image_data_free(l_tile_comp->data_win);
 1998|       |
 1999|  22.6k|        ++l_tile_comp;
 2000|  22.6k|    }
 2001|       |
 2002|  7.85k|    opj_free(l_tile->comps);
 2003|  7.85k|    l_tile->comps = 00;
 2004|  7.85k|    opj_free(p_tcd->tcd_image->tiles);
 2005|  7.85k|    p_tcd->tcd_image->tiles = 00;
 2006|  7.85k|}
tcd.c:opj_tcd_code_block_dec_deallocate:
 2359|  34.8M|{
 2360|  34.8M|    OPJ_UINT32 cblkno, l_nb_code_blocks;
 2361|       |
 2362|  34.8M|    opj_tcd_cblk_dec_t * l_code_block = p_precinct->cblks.dec;
 2363|  34.8M|    if (l_code_block) {
  ------------------
  |  Branch (2363:9): [True: 34.5M, False: 273k]
  ------------------
 2364|       |        /*fprintf(stderr,"deallocate codeblock:{\n");*/
 2365|       |        /*fprintf(stderr,"\t x0=%d, y0=%d, x1=%d, y1=%d\n",l_code_block->x0, l_code_block->y0, l_code_block->x1, l_code_block->y1);*/
 2366|       |        /*fprintf(stderr,"\t numbps=%d, numlenbits=%d, len=%d, numnewpasses=%d, real_num_segs=%d, m_current_max_segs=%d\n ",
 2367|       |                        l_code_block->numbps, l_code_block->numlenbits, l_code_block->len, l_code_block->numnewpasses, l_code_block->real_num_segs, l_code_block->m_current_max_segs );*/
 2368|       |
 2369|       |
 2370|  34.5M|        l_nb_code_blocks = p_precinct->block_size / (OPJ_UINT32)sizeof(
 2371|  34.5M|                               opj_tcd_cblk_dec_t);
 2372|       |        /*fprintf(stderr,"nb_code_blocks =%d\t}\n", l_nb_code_blocks);*/
 2373|       |
 2374|   297M|        for (cblkno = 0; cblkno < l_nb_code_blocks; ++cblkno) {
  ------------------
  |  Branch (2374:26): [True: 263M, False: 34.5M]
  ------------------
 2375|       |
 2376|   263M|            if (l_code_block->segs) {
  ------------------
  |  Branch (2376:17): [True: 263M, False: 0]
  ------------------
 2377|   263M|                opj_free(l_code_block->segs);
 2378|   263M|                l_code_block->segs = 00;
 2379|   263M|            }
 2380|       |
 2381|   263M|            if (l_code_block->chunks) {
  ------------------
  |  Branch (2381:17): [True: 120k, False: 262M]
  ------------------
 2382|   120k|                opj_free(l_code_block->chunks);
 2383|   120k|                l_code_block->chunks = 00;
 2384|   120k|            }
 2385|       |
 2386|   263M|            opj_aligned_free(l_code_block->decoded_data);
 2387|   263M|            l_code_block->decoded_data = NULL;
 2388|       |
 2389|   263M|            ++l_code_block;
 2390|   263M|        }
 2391|       |
 2392|  34.5M|        opj_free(p_precinct->cblks.dec);
 2393|  34.5M|        p_precinct->cblks.dec = 00;
 2394|  34.5M|    }
 2395|  34.8M|}
tcd.c:opj_tcd_t2_decode:
 2016|  8.79k|{
 2017|  8.79k|    opj_t2_t * l_t2;
 2018|       |
 2019|  8.79k|    l_t2 = opj_t2_create(p_tcd->image, p_tcd->cp);
 2020|  8.79k|    if (l_t2 == 00) {
  ------------------
  |  Branch (2020:9): [True: 0, False: 8.79k]
  ------------------
 2021|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2022|      0|    }
 2023|       |
 2024|  8.79k|    if (! opj_t2_decode_packets(
  ------------------
  |  Branch (2024:9): [True: 434, False: 8.35k]
  ------------------
 2025|  8.79k|                p_tcd,
 2026|  8.79k|                l_t2,
 2027|  8.79k|                p_tcd->tcd_tileno,
 2028|  8.79k|                p_tcd->tcd_image->tiles,
 2029|  8.79k|                p_src_data,
 2030|  8.79k|                p_data_read,
 2031|  8.79k|                p_max_src_size,
 2032|  8.79k|                p_cstr_index,
 2033|  8.79k|                p_manager)) {
 2034|    434|        opj_t2_destroy(l_t2);
 2035|    434|        return OPJ_FALSE;
  ------------------
  |  |  118|    434|#define OPJ_FALSE 0
  ------------------
 2036|    434|    }
 2037|       |
 2038|  8.35k|    opj_t2_destroy(l_t2);
 2039|       |
 2040|       |    /*---------------CLEAN-------------------*/
 2041|  8.35k|    return OPJ_TRUE;
  ------------------
  |  |  117|  8.35k|#define OPJ_TRUE 1
  ------------------
 2042|  8.79k|}
tcd.c:opj_tcd_t1_decode:
 2045|  8.35k|{
 2046|  8.35k|    OPJ_UINT32 compno;
 2047|  8.35k|    opj_tcd_tile_t * l_tile = p_tcd->tcd_image->tiles;
 2048|  8.35k|    opj_tcd_tilecomp_t* l_tile_comp = l_tile->comps;
 2049|  8.35k|    opj_tccp_t * l_tccp = p_tcd->tcp->tccps;
 2050|  8.35k|    volatile OPJ_BOOL ret = OPJ_TRUE;
  ------------------
  |  |  117|  8.35k|#define OPJ_TRUE 1
  ------------------
 2051|  8.35k|    OPJ_BOOL check_pterm = OPJ_FALSE;
  ------------------
  |  |  118|  8.35k|#define OPJ_FALSE 0
  ------------------
 2052|  8.35k|    opj_mutex_t* p_manager_mutex = NULL;
 2053|       |
 2054|  8.35k|    p_manager_mutex = opj_mutex_create();
 2055|       |
 2056|       |    /* Only enable PTERM check if we decode all layers */
 2057|  8.35k|    if (p_tcd->tcp->num_layers_to_decode == p_tcd->tcp->numlayers &&
  ------------------
  |  Branch (2057:9): [True: 8.35k, False: 0]
  ------------------
 2058|  8.35k|            (l_tccp->cblksty & J2K_CCP_CBLKSTY_PTERM) != 0) {
  ------------------
  |  |   62|  8.35k|#define J2K_CCP_CBLKSTY_PTERM 0x10    /**< Predictable termination */
  ------------------
  |  Branch (2058:13): [True: 4.36k, False: 3.99k]
  ------------------
 2059|  4.36k|        check_pterm = OPJ_TRUE;
  ------------------
  |  |  117|  4.36k|#define OPJ_TRUE 1
  ------------------
 2060|  4.36k|    }
 2061|       |
 2062|  34.4k|    for (compno = 0; compno < l_tile->numcomps;
  ------------------
  |  Branch (2062:22): [True: 26.6k, False: 7.82k]
  ------------------
 2063|  26.6k|            ++compno, ++l_tile_comp, ++l_tccp) {
 2064|  26.6k|        if (p_tcd->used_component != NULL && !p_tcd->used_component[compno]) {
  ------------------
  |  Branch (2064:13): [True: 0, False: 26.6k]
  |  Branch (2064:46): [True: 0, False: 0]
  ------------------
 2065|      0|            continue;
 2066|      0|        }
 2067|       |
 2068|  26.6k|        opj_t1_decode_cblks(p_tcd, &ret, l_tile_comp, l_tccp,
 2069|  26.6k|                            p_manager, p_manager_mutex, check_pterm);
 2070|  26.6k|        if (!ret) {
  ------------------
  |  Branch (2070:13): [True: 529, False: 26.1k]
  ------------------
 2071|    529|            break;
 2072|    529|        }
 2073|  26.6k|    }
 2074|       |
 2075|  8.35k|    opj_thread_pool_wait_completion(p_tcd->thread_pool, 0);
 2076|  8.35k|    if (p_manager_mutex) {
  ------------------
  |  Branch (2076:9): [True: 8.35k, False: 0]
  ------------------
 2077|  8.35k|        opj_mutex_destroy(p_manager_mutex);
 2078|  8.35k|    }
 2079|  8.35k|    return ret;
 2080|  8.35k|}
tcd.c:opj_tcd_dwt_decode:
 2084|  7.82k|{
 2085|  7.82k|    OPJ_UINT32 compno;
 2086|  7.82k|    opj_tcd_tile_t * l_tile = p_tcd->tcd_image->tiles;
 2087|  7.82k|    opj_tcd_tilecomp_t * l_tile_comp = l_tile->comps;
 2088|  7.82k|    opj_tccp_t * l_tccp = p_tcd->tcp->tccps;
 2089|  7.82k|    opj_image_comp_t * l_img_comp = p_tcd->image->comps;
 2090|       |
 2091|  33.6k|    for (compno = 0; compno < l_tile->numcomps;
  ------------------
  |  Branch (2091:22): [True: 25.8k, False: 7.82k]
  ------------------
 2092|  25.8k|            compno++, ++l_tile_comp, ++l_img_comp, ++l_tccp) {
 2093|  25.8k|        if (p_tcd->used_component != NULL && !p_tcd->used_component[compno]) {
  ------------------
  |  Branch (2093:13): [True: 0, False: 25.8k]
  |  Branch (2093:46): [True: 0, False: 0]
  ------------------
 2094|      0|            continue;
 2095|      0|        }
 2096|       |
 2097|  25.8k|        if (l_tccp->qmfbid == 1) {
  ------------------
  |  Branch (2097:13): [True: 16.4k, False: 9.37k]
  ------------------
 2098|  16.4k|            if (! opj_dwt_decode(p_tcd, l_tile_comp,
  ------------------
  |  Branch (2098:17): [True: 0, False: 16.4k]
  ------------------
 2099|  16.4k|                                 l_img_comp->resno_decoded + 1)) {
 2100|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2101|      0|            }
 2102|  16.4k|        } else {
 2103|  9.37k|            if (! opj_dwt_decode_real(p_tcd, l_tile_comp,
  ------------------
  |  Branch (2103:17): [True: 0, False: 9.37k]
  ------------------
 2104|  9.37k|                                      l_img_comp->resno_decoded + 1)) {
 2105|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2106|      0|            }
 2107|  9.37k|        }
 2108|       |
 2109|  25.8k|    }
 2110|       |
 2111|  7.82k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.82k|#define OPJ_TRUE 1
  ------------------
 2112|  7.82k|}
tcd.c:opj_tcd_mct_decode:
 2115|  7.82k|{
 2116|  7.82k|    opj_tcd_tile_t * l_tile = p_tcd->tcd_image->tiles;
 2117|  7.82k|    opj_tcp_t * l_tcp = p_tcd->tcp;
 2118|  7.82k|    opj_tcd_tilecomp_t * l_tile_comp = l_tile->comps;
 2119|  7.82k|    OPJ_SIZE_T l_samples;
 2120|  7.82k|    OPJ_UINT32 i;
 2121|       |
 2122|  7.82k|    if (l_tcp->mct == 0 || p_tcd->used_component != NULL) {
  ------------------
  |  Branch (2122:9): [True: 6.00k, False: 1.82k]
  |  Branch (2122:28): [True: 0, False: 1.82k]
  ------------------
 2123|  6.00k|        return OPJ_TRUE;
  ------------------
  |  |  117|  6.00k|#define OPJ_TRUE 1
  ------------------
 2124|  6.00k|    }
 2125|       |
 2126|  1.82k|    if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (2126:9): [True: 1.01k, False: 805]
  ------------------
 2127|  1.01k|        opj_tcd_resolution_t* res_comp0 = l_tile->comps[0].resolutions +
 2128|  1.01k|                                          l_tile_comp->minimum_num_resolutions - 1;
 2129|       |
 2130|       |        /* A bit inefficient: we process more data than needed if */
 2131|       |        /* resno_decoded < l_tile_comp->minimum_num_resolutions-1, */
 2132|       |        /* but we would need to take into account a stride then */
 2133|  1.01k|        l_samples = (OPJ_SIZE_T)(res_comp0->x1 - res_comp0->x0) *
 2134|  1.01k|                    (OPJ_SIZE_T)(res_comp0->y1 - res_comp0->y0);
 2135|  1.01k|        if (l_tile->numcomps >= 3) {
  ------------------
  |  Branch (2135:13): [True: 918, False: 101]
  ------------------
 2136|    918|            if (l_tile_comp->minimum_num_resolutions !=
  ------------------
  |  Branch (2136:17): [True: 1, False: 917]
  ------------------
 2137|    918|                    l_tile->comps[1].minimum_num_resolutions ||
 2138|    918|                    l_tile_comp->minimum_num_resolutions !=
  ------------------
  |  Branch (2138:21): [True: 1, False: 916]
  ------------------
 2139|    917|                    l_tile->comps[2].minimum_num_resolutions) {
 2140|      2|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      2|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2141|      2|                              "Tiles don't all have the same dimension. Skip the MCT step.\n");
 2142|      2|                return OPJ_FALSE;
  ------------------
  |  |  118|      2|#define OPJ_FALSE 0
  ------------------
 2143|      2|            }
 2144|    918|        }
 2145|  1.01k|        if (l_tile->numcomps >= 3) {
  ------------------
  |  Branch (2145:13): [True: 916, False: 101]
  ------------------
 2146|    916|            opj_tcd_resolution_t* res_comp1 = l_tile->comps[1].resolutions +
 2147|    916|                                              l_tile_comp->minimum_num_resolutions - 1;
 2148|    916|            opj_tcd_resolution_t* res_comp2 = l_tile->comps[2].resolutions +
 2149|    916|                                              l_tile_comp->minimum_num_resolutions - 1;
 2150|       |            /* testcase 1336.pdf.asan.47.376 */
 2151|    916|            if (p_tcd->image->comps[0].resno_decoded !=
  ------------------
  |  Branch (2151:17): [True: 14, False: 902]
  ------------------
 2152|    916|                    p_tcd->image->comps[1].resno_decoded ||
 2153|    916|                    p_tcd->image->comps[0].resno_decoded !=
  ------------------
  |  Branch (2153:21): [True: 5, False: 897]
  ------------------
 2154|    902|                    p_tcd->image->comps[2].resno_decoded ||
 2155|    916|                    (OPJ_SIZE_T)(res_comp1->x1 - res_comp1->x0) *
  ------------------
  |  Branch (2155:21): [True: 24, False: 873]
  ------------------
 2156|    897|                    (OPJ_SIZE_T)(res_comp1->y1 - res_comp1->y0) != l_samples ||
 2157|    916|                    (OPJ_SIZE_T)(res_comp2->x1 - res_comp2->x0) *
  ------------------
  |  Branch (2157:21): [True: 7, False: 866]
  ------------------
 2158|    873|                    (OPJ_SIZE_T)(res_comp2->y1 - res_comp2->y0) != l_samples) {
 2159|     50|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     50|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2160|     50|                              "Tiles don't all have the same dimension. Skip the MCT step.\n");
 2161|     50|                return OPJ_FALSE;
  ------------------
  |  |  118|     50|#define OPJ_FALSE 0
  ------------------
 2162|     50|            }
 2163|    916|        }
 2164|  1.01k|    } else {
 2165|    805|        opj_tcd_resolution_t* res_comp0 = l_tile->comps[0].resolutions +
 2166|    805|                                          p_tcd->image->comps[0].resno_decoded;
 2167|       |
 2168|    805|        l_samples = (OPJ_SIZE_T)(res_comp0->win_x1 - res_comp0->win_x0) *
 2169|    805|                    (OPJ_SIZE_T)(res_comp0->win_y1 - res_comp0->win_y0);
 2170|    805|        if (l_tile->numcomps >= 3) {
  ------------------
  |  Branch (2170:13): [True: 491, False: 314]
  ------------------
 2171|    491|            opj_tcd_resolution_t* res_comp1 = l_tile->comps[1].resolutions +
 2172|    491|                                              p_tcd->image->comps[1].resno_decoded;
 2173|    491|            opj_tcd_resolution_t* res_comp2 = l_tile->comps[2].resolutions +
 2174|    491|                                              p_tcd->image->comps[2].resno_decoded;
 2175|       |            /* testcase 1336.pdf.asan.47.376 */
 2176|    491|            if (p_tcd->image->comps[0].resno_decoded !=
  ------------------
  |  Branch (2176:17): [True: 11, False: 480]
  ------------------
 2177|    491|                    p_tcd->image->comps[1].resno_decoded ||
 2178|    491|                    p_tcd->image->comps[0].resno_decoded !=
  ------------------
  |  Branch (2178:21): [True: 7, False: 473]
  ------------------
 2179|    480|                    p_tcd->image->comps[2].resno_decoded ||
 2180|    491|                    (OPJ_SIZE_T)(res_comp1->win_x1 - res_comp1->win_x0) *
  ------------------
  |  Branch (2180:21): [True: 32, False: 441]
  ------------------
 2181|    473|                    (OPJ_SIZE_T)(res_comp1->win_y1 - res_comp1->win_y0) != l_samples ||
 2182|    491|                    (OPJ_SIZE_T)(res_comp2->win_x1 - res_comp2->win_x0) *
  ------------------
  |  Branch (2182:21): [True: 8, False: 433]
  ------------------
 2183|    441|                    (OPJ_SIZE_T)(res_comp2->win_y1 - res_comp2->win_y0) != l_samples) {
 2184|     58|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|     58|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2185|     58|                              "Tiles don't all have the same dimension. Skip the MCT step.\n");
 2186|     58|                return OPJ_FALSE;
  ------------------
  |  |  118|     58|#define OPJ_FALSE 0
  ------------------
 2187|     58|            }
 2188|    491|        }
 2189|    805|    }
 2190|       |
 2191|  1.71k|    if (l_tile->numcomps >= 3) {
  ------------------
  |  Branch (2191:9): [True: 1.29k, False: 415]
  ------------------
 2192|  1.29k|        if (l_tcp->mct == 2) {
  ------------------
  |  Branch (2192:13): [True: 0, False: 1.29k]
  ------------------
 2193|      0|            OPJ_BYTE ** l_data;
 2194|       |
 2195|      0|            if (! l_tcp->m_mct_decoding_matrix) {
  ------------------
  |  Branch (2195:17): [True: 0, False: 0]
  ------------------
 2196|      0|                return OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
 2197|      0|            }
 2198|       |
 2199|      0|            l_data = (OPJ_BYTE **) opj_malloc(l_tile->numcomps * sizeof(OPJ_BYTE*));
 2200|      0|            if (! l_data) {
  ------------------
  |  Branch (2200:17): [True: 0, False: 0]
  ------------------
 2201|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2202|      0|            }
 2203|       |
 2204|      0|            for (i = 0; i < l_tile->numcomps; ++i) {
  ------------------
  |  Branch (2204:25): [True: 0, False: 0]
  ------------------
 2205|      0|                if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (2205:21): [True: 0, False: 0]
  ------------------
 2206|      0|                    l_data[i] = (OPJ_BYTE*) l_tile_comp->data;
 2207|      0|                } else {
 2208|      0|                    l_data[i] = (OPJ_BYTE*) l_tile_comp->data_win;
 2209|      0|                }
 2210|      0|                ++l_tile_comp;
 2211|      0|            }
 2212|       |
 2213|      0|            if (! opj_mct_decode_custom(/* MCT data */
  ------------------
  |  Branch (2213:17): [True: 0, False: 0]
  ------------------
 2214|      0|                        (OPJ_BYTE*) l_tcp->m_mct_decoding_matrix,
 2215|       |                        /* size of components */
 2216|      0|                        l_samples,
 2217|       |                        /* components */
 2218|      0|                        l_data,
 2219|       |                        /* nb of components (i.e. size of pData) */
 2220|      0|                        l_tile->numcomps,
 2221|       |                        /* tells if the data is signed */
 2222|      0|                        p_tcd->image->comps->sgnd)) {
 2223|      0|                opj_free(l_data);
 2224|      0|                return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
 2225|      0|            }
 2226|       |
 2227|      0|            opj_free(l_data);
 2228|  1.29k|        } else {
 2229|  1.29k|            if (l_tcp->tccps->qmfbid == 1) {
  ------------------
  |  Branch (2229:17): [True: 359, False: 940]
  ------------------
 2230|    359|                if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (2230:21): [True: 222, False: 137]
  ------------------
 2231|    222|                    opj_mct_decode(l_tile->comps[0].data,
 2232|    222|                                   l_tile->comps[1].data,
 2233|    222|                                   l_tile->comps[2].data,
 2234|    222|                                   l_samples);
 2235|    222|                } else {
 2236|    137|                    opj_mct_decode(l_tile->comps[0].data_win,
 2237|    137|                                   l_tile->comps[1].data_win,
 2238|    137|                                   l_tile->comps[2].data_win,
 2239|    137|                                   l_samples);
 2240|    137|                }
 2241|    940|            } else {
 2242|    940|                if (p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (2242:21): [True: 644, False: 296]
  ------------------
 2243|    644|                    opj_mct_decode_real((OPJ_FLOAT32*)l_tile->comps[0].data,
 2244|    644|                                        (OPJ_FLOAT32*)l_tile->comps[1].data,
 2245|    644|                                        (OPJ_FLOAT32*)l_tile->comps[2].data,
 2246|    644|                                        l_samples);
 2247|    644|                } else {
 2248|    296|                    opj_mct_decode_real((OPJ_FLOAT32*)l_tile->comps[0].data_win,
 2249|    296|                                        (OPJ_FLOAT32*)l_tile->comps[1].data_win,
 2250|    296|                                        (OPJ_FLOAT32*)l_tile->comps[2].data_win,
 2251|    296|                                        l_samples);
 2252|    296|                }
 2253|    940|            }
 2254|  1.29k|        }
 2255|  1.29k|    } else {
 2256|    415|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|    415|#define EVT_ERROR   1   /**< Error event type */
  ------------------
 2257|    415|                      "Number of components (%d) is inconsistent with a MCT. Skip the MCT step.\n",
 2258|    415|                      l_tile->numcomps);
 2259|    415|    }
 2260|       |
 2261|  1.71k|    return OPJ_TRUE;
  ------------------
  |  |  117|  1.71k|#define OPJ_TRUE 1
  ------------------
 2262|  1.71k|}
tcd.c:opj_tcd_dc_level_shift_decode:
 2266|  7.71k|{
 2267|  7.71k|    OPJ_UINT32 compno;
 2268|  7.71k|    opj_tcd_tilecomp_t * l_tile_comp = 00;
 2269|  7.71k|    opj_tccp_t * l_tccp = 00;
 2270|  7.71k|    opj_image_comp_t * l_img_comp = 00;
 2271|  7.71k|    opj_tcd_resolution_t* l_res = 00;
 2272|  7.71k|    opj_tcd_tile_t * l_tile;
 2273|  7.71k|    OPJ_UINT32 l_width, l_height, i, j;
 2274|  7.71k|    OPJ_INT32 * l_current_ptr;
 2275|  7.71k|    OPJ_INT32 l_min, l_max;
 2276|  7.71k|    OPJ_UINT32 l_stride;
 2277|       |
 2278|  7.71k|    l_tile = p_tcd->tcd_image->tiles;
 2279|  7.71k|    l_tile_comp = l_tile->comps;
 2280|  7.71k|    l_tccp = p_tcd->tcp->tccps;
 2281|  7.71k|    l_img_comp = p_tcd->image->comps;
 2282|       |
 2283|  32.6k|    for (compno = 0; compno < l_tile->numcomps;
  ------------------
  |  Branch (2283:22): [True: 24.9k, False: 7.71k]
  ------------------
 2284|  24.9k|            compno++, ++l_img_comp, ++l_tccp, ++l_tile_comp) {
 2285|       |
 2286|  24.9k|        if (p_tcd->used_component != NULL && !p_tcd->used_component[compno]) {
  ------------------
  |  Branch (2286:13): [True: 0, False: 24.9k]
  |  Branch (2286:46): [True: 0, False: 0]
  ------------------
 2287|      0|            continue;
 2288|      0|        }
 2289|       |
 2290|  24.9k|        l_res = l_tile_comp->resolutions + l_img_comp->resno_decoded;
 2291|       |
 2292|  24.9k|        if (!p_tcd->whole_tile_decoding) {
  ------------------
  |  Branch (2292:13): [True: 8.15k, False: 16.8k]
  ------------------
 2293|  8.15k|            l_width = l_res->win_x1 - l_res->win_x0;
 2294|  8.15k|            l_height = l_res->win_y1 - l_res->win_y0;
 2295|  8.15k|            l_stride = 0;
 2296|  8.15k|            l_current_ptr = l_tile_comp->data_win;
 2297|  16.8k|        } else {
 2298|  16.8k|            l_width = (OPJ_UINT32)(l_res->x1 - l_res->x0);
 2299|  16.8k|            l_height = (OPJ_UINT32)(l_res->y1 - l_res->y0);
 2300|  16.8k|            l_stride = (OPJ_UINT32)(
 2301|  16.8k|                           l_tile_comp->resolutions[l_tile_comp->minimum_num_resolutions - 1].x1 -
 2302|  16.8k|                           l_tile_comp->resolutions[l_tile_comp->minimum_num_resolutions - 1].x0)
 2303|  16.8k|                       - l_width;
 2304|  16.8k|            l_current_ptr = l_tile_comp->data;
 2305|       |
 2306|  16.8k|            assert(l_height == 0 ||
 2307|  16.8k|                   l_width + l_stride <= l_tile_comp->data_size / l_height); /*MUPDF*/
 2308|  16.8k|        }
 2309|       |
 2310|  24.9k|        if (l_img_comp->sgnd) {
  ------------------
  |  Branch (2310:13): [True: 5.48k, False: 19.4k]
  ------------------
 2311|  5.48k|            l_min = -(1 << (l_img_comp->prec - 1));
 2312|  5.48k|            l_max = (1 << (l_img_comp->prec - 1)) - 1;
 2313|  19.4k|        } else {
 2314|  19.4k|            l_min = 0;
 2315|  19.4k|            l_max = (OPJ_INT32)((1U << l_img_comp->prec) - 1);
 2316|  19.4k|        }
 2317|       |
 2318|       |
 2319|  24.9k|        if (l_tccp->qmfbid == 1) {
  ------------------
  |  Branch (2319:13): [True: 16.1k, False: 8.76k]
  ------------------
 2320|  2.63M|            for (j = 0; j < l_height; ++j) {
  ------------------
  |  Branch (2320:25): [True: 2.62M, False: 16.1k]
  ------------------
 2321|  1.03G|                for (i = 0; i < l_width; ++i) {
  ------------------
  |  Branch (2321:29): [True: 1.03G, False: 2.62M]
  ------------------
 2322|       |                    /* TODO: do addition on int64 ? */
 2323|  1.03G|                    *l_current_ptr = opj_int_clamp(*l_current_ptr + l_tccp->m_dc_level_shift, l_min,
 2324|  1.03G|                                                   l_max);
 2325|  1.03G|                    ++l_current_ptr;
 2326|  1.03G|                }
 2327|  2.62M|                l_current_ptr += l_stride;
 2328|  2.62M|            }
 2329|  16.1k|        } else {
 2330|  1.22M|            for (j = 0; j < l_height; ++j) {
  ------------------
  |  Branch (2330:25): [True: 1.21M, False: 8.76k]
  ------------------
 2331|  68.5M|                for (i = 0; i < l_width; ++i) {
  ------------------
  |  Branch (2331:29): [True: 67.3M, False: 1.21M]
  ------------------
 2332|  67.3M|                    OPJ_FLOAT32 l_value = *((OPJ_FLOAT32 *) l_current_ptr);
 2333|  67.3M|                    if (l_value > INT_MAX) {
  ------------------
  |  Branch (2333:25): [True: 607, False: 67.3M]
  ------------------
 2334|    607|                        *l_current_ptr = l_max;
 2335|  67.3M|                    } else if (l_value < INT_MIN) {
  ------------------
  |  Branch (2335:32): [True: 597, False: 67.3M]
  ------------------
 2336|    597|                        *l_current_ptr = l_min;
 2337|  67.3M|                    } else {
 2338|       |                        /* Do addition on int64 to avoid overflows */
 2339|  67.3M|                        OPJ_INT64 l_value_int = (OPJ_INT64)opj_lrintf(l_value);
 2340|  67.3M|                        *l_current_ptr = (OPJ_INT32)opj_int64_clamp(
 2341|  67.3M|                                             l_value_int + l_tccp->m_dc_level_shift, l_min, l_max);
 2342|  67.3M|                    }
 2343|  67.3M|                    ++l_current_ptr;
 2344|  67.3M|                }
 2345|  1.21M|                l_current_ptr += l_stride;
 2346|  1.21M|            }
 2347|  8.76k|        }
 2348|  24.9k|    }
 2349|       |
 2350|  7.71k|    return OPJ_TRUE;
  ------------------
  |  |  117|  7.71k|#define OPJ_TRUE 1
  ------------------
 2351|  7.71k|}
tcd.c:opj_tcd_is_whole_tilecomp_decoding:
 2870|  21.9k|{
 2871|  21.9k|    opj_tcd_tilecomp_t* tilec = &(p_tcd->tcd_image->tiles->comps[compno]);
 2872|  21.9k|    opj_image_comp_t* image_comp = &(p_tcd->image->comps[compno]);
 2873|       |    /* Compute the intersection of the area of interest, expressed in tile coordinates */
 2874|       |    /* with the tile coordinates */
 2875|  21.9k|    OPJ_UINT32 tcx0 = opj_uint_max(
 2876|  21.9k|                          (OPJ_UINT32)tilec->x0,
 2877|  21.9k|                          opj_uint_ceildiv(p_tcd->win_x0, image_comp->dx));
 2878|  21.9k|    OPJ_UINT32 tcy0 = opj_uint_max(
 2879|  21.9k|                          (OPJ_UINT32)tilec->y0,
 2880|  21.9k|                          opj_uint_ceildiv(p_tcd->win_y0, image_comp->dy));
 2881|  21.9k|    OPJ_UINT32 tcx1 = opj_uint_min(
 2882|  21.9k|                          (OPJ_UINT32)tilec->x1,
 2883|  21.9k|                          opj_uint_ceildiv(p_tcd->win_x1, image_comp->dx));
 2884|  21.9k|    OPJ_UINT32 tcy1 = opj_uint_min(
 2885|  21.9k|                          (OPJ_UINT32)tilec->y1,
 2886|  21.9k|                          opj_uint_ceildiv(p_tcd->win_y1, image_comp->dy));
 2887|       |
 2888|  21.9k|    OPJ_UINT32 shift = tilec->numresolutions - tilec->minimum_num_resolutions;
 2889|       |    /* Tolerate small margin within the reduced resolution factor to consider if */
 2890|       |    /* the whole tile path must be taken */
 2891|  21.9k|    return (tcx0 >= (OPJ_UINT32)tilec->x0 &&
  ------------------
  |  Branch (2891:13): [True: 21.9k, False: 0]
  ------------------
 2892|  21.9k|            tcy0 >= (OPJ_UINT32)tilec->y0 &&
  ------------------
  |  Branch (2892:13): [True: 21.9k, False: 0]
  ------------------
 2893|  21.9k|            tcx1 <= (OPJ_UINT32)tilec->x1 &&
  ------------------
  |  Branch (2893:13): [True: 21.9k, False: 0]
  ------------------
 2894|  21.9k|            tcy1 <= (OPJ_UINT32)tilec->y1 &&
  ------------------
  |  Branch (2894:13): [True: 21.9k, False: 0]
  ------------------
 2895|  21.9k|            (shift >= 32 ||
  ------------------
  |  Branch (2895:14): [True: 0, False: 21.9k]
  ------------------
 2896|  21.9k|             (((tcx0 - (OPJ_UINT32)tilec->x0) >> shift) == 0 &&
  ------------------
  |  Branch (2896:15): [True: 21.9k, False: 0]
  ------------------
 2897|  21.9k|              ((tcy0 - (OPJ_UINT32)tilec->y0) >> shift) == 0 &&
  ------------------
  |  Branch (2897:15): [True: 21.9k, False: 0]
  ------------------
 2898|  21.9k|              (((OPJ_UINT32)tilec->x1 - tcx1) >> shift) == 0 &&
  ------------------
  |  Branch (2898:15): [True: 19.6k, False: 2.36k]
  ------------------
 2899|  21.9k|              (((OPJ_UINT32)tilec->y1 - tcy1) >> shift) == 0)));
  ------------------
  |  Branch (2899:15): [True: 18.1k, False: 1.41k]
  ------------------
 2900|  21.9k|}

opj_tgt_create:
   50|  69.7M|{
   51|  69.7M|    OPJ_INT32 nplh[32];
   52|  69.7M|    OPJ_INT32 nplv[32];
   53|  69.7M|    opj_tgt_node_t *node = 00;
   54|  69.7M|    opj_tgt_node_t *l_parent_node = 00;
   55|  69.7M|    opj_tgt_node_t *l_parent_node0 = 00;
   56|  69.7M|    opj_tgt_tree_t *tree = 00;
   57|  69.7M|    OPJ_UINT32 i;
   58|  69.7M|    OPJ_INT32  j, k;
   59|  69.7M|    OPJ_UINT32 numlvls;
   60|  69.7M|    OPJ_UINT32 n;
   61|       |
   62|  69.7M|    tree = (opj_tgt_tree_t *) opj_calloc(1, sizeof(opj_tgt_tree_t));
   63|  69.7M|    if (!tree) {
  ------------------
  |  Branch (63:9): [True: 0, False: 69.7M]
  ------------------
   64|      0|        opj_event_msg(p_manager, EVT_ERROR, "Not enough memory to create Tag-tree\n");
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
   65|      0|        return 00;
   66|      0|    }
   67|       |
   68|  69.7M|    tree->numleafsh = numleafsh;
   69|  69.7M|    tree->numleafsv = numleafsv;
   70|       |
   71|  69.7M|    numlvls = 0;
   72|  69.7M|    nplh[0] = (OPJ_INT32)numleafsh;
   73|  69.7M|    nplv[0] = (OPJ_INT32)numleafsv;
   74|  69.7M|    tree->numnodes = 0;
   75|   107M|    do {
   76|   107M|        n = (OPJ_UINT32)(nplh[numlvls] * nplv[numlvls]);
   77|   107M|        nplh[numlvls + 1] = (nplh[numlvls] + 1) / 2;
   78|   107M|        nplv[numlvls + 1] = (nplv[numlvls] + 1) / 2;
   79|   107M|        tree->numnodes += n;
   80|   107M|        ++numlvls;
   81|   107M|    } while (n > 1);
  ------------------
  |  Branch (81:14): [True: 37.3M, False: 69.7M]
  ------------------
   82|       |
   83|       |    /* ADD */
   84|  69.7M|    if (tree->numnodes == 0) {
  ------------------
  |  Branch (84:9): [True: 543k, False: 69.2M]
  ------------------
   85|   543k|        opj_free(tree);
   86|   543k|        return 00;
   87|   543k|    }
   88|       |
   89|  69.2M|    tree->nodes = (opj_tgt_node_t*) opj_calloc(tree->numnodes,
   90|  69.2M|                  sizeof(opj_tgt_node_t));
   91|  69.2M|    if (!tree->nodes) {
  ------------------
  |  Branch (91:9): [True: 0, False: 69.2M]
  ------------------
   92|      0|        opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
   93|      0|                      "Not enough memory to create Tag-tree nodes\n");
   94|      0|        opj_free(tree);
   95|      0|        return 00;
   96|      0|    }
   97|  69.2M|    tree->nodes_size = tree->numnodes * (OPJ_UINT32)sizeof(opj_tgt_node_t);
   98|       |
   99|  69.2M|    node = tree->nodes;
  100|  69.2M|    l_parent_node = &tree->nodes[tree->numleafsh * tree->numleafsv];
  101|  69.2M|    l_parent_node0 = l_parent_node;
  102|       |
  103|   106M|    for (i = 0; i < numlvls - 1; ++i) {
  ------------------
  |  Branch (103:17): [True: 37.3M, False: 69.2M]
  ------------------
  104|   433M|        for (j = 0; j < nplv[i]; ++j) {
  ------------------
  |  Branch (104:21): [True: 396M, False: 37.3M]
  ------------------
  105|   396M|            k = nplh[i];
  106|   996M|            while (--k >= 0) {
  ------------------
  |  Branch (106:20): [True: 599M, False: 396M]
  ------------------
  107|   599M|                node->parent = l_parent_node;
  108|   599M|                ++node;
  109|   599M|                if (--k >= 0) {
  ------------------
  |  Branch (109:21): [True: 220M, False: 379M]
  ------------------
  110|   220M|                    node->parent = l_parent_node;
  111|   220M|                    ++node;
  112|   220M|                }
  113|   599M|                ++l_parent_node;
  114|   599M|            }
  115|   396M|            if ((j & 1) || j == nplv[i] - 1) {
  ------------------
  |  Branch (115:17): [True: 193M, False: 202M]
  |  Branch (115:28): [True: 9.26M, False: 193M]
  ------------------
  116|   202M|                l_parent_node0 = l_parent_node;
  117|   202M|            } else {
  118|   193M|                l_parent_node = l_parent_node0;
  119|   193M|                l_parent_node0 += nplh[i];
  120|   193M|            }
  121|   396M|        }
  122|  37.3M|    }
  123|  69.2M|    node->parent = 0;
  124|  69.2M|    opj_tgt_reset(tree);
  125|  69.2M|    return tree;
  126|  69.2M|}
opj_tgt_init:
  138|  1.13M|{
  139|  1.13M|    OPJ_INT32 l_nplh[32];
  140|  1.13M|    OPJ_INT32 l_nplv[32];
  141|  1.13M|    opj_tgt_node_t *l_node = 00;
  142|  1.13M|    opj_tgt_node_t *l_parent_node = 00;
  143|  1.13M|    opj_tgt_node_t *l_parent_node0 = 00;
  144|  1.13M|    OPJ_UINT32 i;
  145|  1.13M|    OPJ_INT32 j, k;
  146|  1.13M|    OPJ_UINT32 l_num_levels;
  147|  1.13M|    OPJ_UINT32 n;
  148|  1.13M|    OPJ_UINT32 l_node_size;
  149|       |
  150|  1.13M|    if (! p_tree) {
  ------------------
  |  Branch (150:9): [True: 0, False: 1.13M]
  ------------------
  151|      0|        return 00;
  152|      0|    }
  153|       |
  154|  1.13M|    if ((p_tree->numleafsh != p_num_leafs_h) ||
  ------------------
  |  Branch (154:9): [True: 113k, False: 1.02M]
  ------------------
  155|  1.13M|            (p_tree->numleafsv != p_num_leafs_v)) {
  ------------------
  |  Branch (155:13): [True: 39.1k, False: 987k]
  ------------------
  156|   152k|        p_tree->numleafsh = p_num_leafs_h;
  157|   152k|        p_tree->numleafsv = p_num_leafs_v;
  158|       |
  159|   152k|        l_num_levels = 0;
  160|   152k|        l_nplh[0] = (OPJ_INT32)p_num_leafs_h;
  161|   152k|        l_nplv[0] = (OPJ_INT32)p_num_leafs_v;
  162|   152k|        p_tree->numnodes = 0;
  163|   376k|        do {
  164|   376k|            n = (OPJ_UINT32)(l_nplh[l_num_levels] * l_nplv[l_num_levels]);
  165|   376k|            l_nplh[l_num_levels + 1] = (l_nplh[l_num_levels] + 1) / 2;
  166|   376k|            l_nplv[l_num_levels + 1] = (l_nplv[l_num_levels] + 1) / 2;
  167|   376k|            p_tree->numnodes += n;
  168|   376k|            ++l_num_levels;
  169|   376k|        } while (n > 1);
  ------------------
  |  Branch (169:18): [True: 224k, False: 152k]
  ------------------
  170|       |
  171|       |        /* ADD */
  172|   152k|        if (p_tree->numnodes == 0) {
  ------------------
  |  Branch (172:13): [True: 111k, False: 40.9k]
  ------------------
  173|   111k|            opj_tgt_destroy(p_tree);
  174|   111k|            return 00;
  175|   111k|        }
  176|  40.9k|        l_node_size = p_tree->numnodes * (OPJ_UINT32)sizeof(opj_tgt_node_t);
  177|       |
  178|  40.9k|        if (l_node_size > p_tree->nodes_size) {
  ------------------
  |  Branch (178:13): [True: 27.6k, False: 13.3k]
  ------------------
  179|  27.6k|            opj_tgt_node_t* new_nodes = (opj_tgt_node_t*) opj_realloc(p_tree->nodes,
  180|  27.6k|                                        l_node_size);
  181|  27.6k|            if (! new_nodes) {
  ------------------
  |  Branch (181:17): [True: 0, False: 27.6k]
  ------------------
  182|      0|                opj_event_msg(p_manager, EVT_ERROR,
  ------------------
  |  |   66|      0|#define EVT_ERROR   1   /**< Error event type */
  ------------------
  183|      0|                              "Not enough memory to reinitialize the tag tree\n");
  184|      0|                opj_tgt_destroy(p_tree);
  185|      0|                return 00;
  186|      0|            }
  187|  27.6k|            p_tree->nodes = new_nodes;
  188|  27.6k|            memset(((char *) p_tree->nodes) + p_tree->nodes_size, 0,
  189|  27.6k|                   l_node_size - p_tree->nodes_size);
  190|  27.6k|            p_tree->nodes_size = l_node_size;
  191|  27.6k|        }
  192|  40.9k|        l_node = p_tree->nodes;
  193|  40.9k|        l_parent_node = &p_tree->nodes[p_tree->numleafsh * p_tree->numleafsv];
  194|  40.9k|        l_parent_node0 = l_parent_node;
  195|       |
  196|   265k|        for (i = 0; i < l_num_levels - 1; ++i) {
  ------------------
  |  Branch (196:21): [True: 224k, False: 40.9k]
  ------------------
  197|   911k|            for (j = 0; j < l_nplv[i]; ++j) {
  ------------------
  |  Branch (197:25): [True: 687k, False: 224k]
  ------------------
  198|   687k|                k = l_nplh[i];
  199|  9.81M|                while (--k >= 0) {
  ------------------
  |  Branch (199:24): [True: 9.12M, False: 687k]
  ------------------
  200|  9.12M|                    l_node->parent = l_parent_node;
  201|  9.12M|                    ++l_node;
  202|  9.12M|                    if (--k >= 0) {
  ------------------
  |  Branch (202:25): [True: 8.86M, False: 264k]
  ------------------
  203|  8.86M|                        l_node->parent = l_parent_node;
  204|  8.86M|                        ++l_node;
  205|  8.86M|                    }
  206|  9.12M|                    ++l_parent_node;
  207|  9.12M|                }
  208|   687k|                if ((j & 1) || j == l_nplv[i] - 1) {
  ------------------
  |  Branch (208:21): [True: 249k, False: 437k]
  |  Branch (208:32): [True: 188k, False: 249k]
  ------------------
  209|   437k|                    l_parent_node0 = l_parent_node;
  210|   437k|                } else {
  211|   249k|                    l_parent_node = l_parent_node0;
  212|   249k|                    l_parent_node0 += l_nplh[i];
  213|   249k|                }
  214|   687k|            }
  215|   224k|        }
  216|  40.9k|        l_node->parent = 0;
  217|  40.9k|    }
  218|  1.02M|    opj_tgt_reset(p_tree);
  219|       |
  220|  1.02M|    return p_tree;
  221|  1.13M|}
opj_tgt_destroy:
  224|  69.7M|{
  225|  69.7M|    if (! p_tree) {
  ------------------
  |  Branch (225:9): [True: 547k, False: 69.2M]
  ------------------
  226|   547k|        return;
  227|   547k|    }
  228|       |
  229|  69.2M|    if (p_tree->nodes) {
  ------------------
  |  Branch (229:9): [True: 69.2M, False: 0]
  ------------------
  230|  69.2M|        opj_free(p_tree->nodes);
  231|  69.2M|        p_tree->nodes = 00;
  232|  69.2M|    }
  233|  69.2M|    opj_free(p_tree);
  234|  69.2M|}
opj_tgt_reset:
  237|   116M|{
  238|   116M|    OPJ_UINT32 i;
  239|   116M|    opj_tgt_node_t * l_current_node = 00;;
  240|       |
  241|   116M|    if (! p_tree) {
  ------------------
  |  Branch (241:9): [True: 184k, False: 116M]
  ------------------
  242|   184k|        return;
  243|   184k|    }
  244|       |
  245|   116M|    l_current_node = p_tree->nodes;
  246|  1.77G|    for (i = 0; i < p_tree->numnodes; ++i) {
  ------------------
  |  Branch (246:17): [True: 1.65G, False: 116M]
  ------------------
  247|  1.65G|        l_current_node->value = 999;
  248|  1.65G|        l_current_node->low = 0;
  249|  1.65G|        l_current_node->known = 0;
  250|  1.65G|        ++l_current_node;
  251|  1.65G|    }
  252|   116M|}
opj_tgt_decode:
  309|  7.16M|{
  310|  7.16M|    opj_tgt_node_t *stk[31];
  311|  7.16M|    opj_tgt_node_t **stkptr;
  312|  7.16M|    opj_tgt_node_t *node;
  313|  7.16M|    OPJ_INT32 low;
  314|       |
  315|  7.16M|    stkptr = stk;
  316|  7.16M|    node = &tree->nodes[leafno];
  317|  80.7M|    while (node->parent) {
  ------------------
  |  Branch (317:12): [True: 73.6M, False: 7.16M]
  ------------------
  318|  73.6M|        *stkptr++ = node;
  319|  73.6M|        node = node->parent;
  320|  73.6M|    }
  321|       |
  322|  7.16M|    low = 0;
  323|  80.7M|    for (;;) {
  324|  80.7M|        if (low > node->low) {
  ------------------
  |  Branch (324:13): [True: 11.1M, False: 69.6M]
  ------------------
  325|  11.1M|            node->low = low;
  326|  69.6M|        } else {
  327|  69.6M|            low = node->low;
  328|  69.6M|        }
  329|  81.7M|        while (low < threshold && low < node->value) {
  ------------------
  |  Branch (329:16): [True: 15.5M, False: 66.2M]
  |  Branch (329:35): [True: 1.00M, False: 14.5M]
  ------------------
  330|  1.00M|            if (opj_bio_read(bio, 1)) {
  ------------------
  |  Branch (330:17): [True: 389k, False: 612k]
  ------------------
  331|   389k|                node->value = low;
  332|   612k|            } else {
  333|   612k|                ++low;
  334|   612k|            }
  335|  1.00M|        }
  336|  80.7M|        node->low = low;
  337|  80.7M|        if (stkptr == stk) {
  ------------------
  |  Branch (337:13): [True: 7.16M, False: 73.6M]
  ------------------
  338|  7.16M|            break;
  339|  7.16M|        }
  340|  73.6M|        node = *--stkptr;
  341|  73.6M|    }
  342|       |
  343|  7.16M|    return (node->value < threshold) ? 1 : 0;
  ------------------
  |  Branch (343:12): [True: 275k, False: 6.88M]
  ------------------
  344|  7.16M|}

opj_mutex_create:
  314|  8.35k|{
  315|  8.35k|    opj_mutex_t* mutex = (opj_mutex_t*) opj_calloc(1U, sizeof(opj_mutex_t));
  316|  8.35k|    if (mutex != NULL) {
  ------------------
  |  Branch (316:9): [True: 8.35k, False: 0]
  ------------------
  317|  8.35k|        if (pthread_mutex_init(&mutex->mutex, NULL) != 0) {
  ------------------
  |  Branch (317:13): [True: 0, False: 8.35k]
  ------------------
  318|      0|            opj_free(mutex);
  319|      0|            mutex = NULL;
  320|      0|        }
  321|  8.35k|    }
  322|  8.35k|    return mutex;
  323|  8.35k|}
opj_mutex_lock:
  326|  53.7k|{
  327|  53.7k|    pthread_mutex_lock(&(mutex->mutex));
  328|  53.7k|}
opj_mutex_unlock:
  331|  53.7k|{
  332|  53.7k|    pthread_mutex_unlock(&(mutex->mutex));
  333|  53.7k|}
opj_mutex_destroy:
  336|  17.5k|{
  337|  17.5k|    if (!mutex) {
  ------------------
  |  Branch (337:9): [True: 9.21k, False: 8.35k]
  ------------------
  338|  9.21k|        return;
  339|  9.21k|    }
  340|  8.35k|    pthread_mutex_destroy(&(mutex->mutex));
  341|  8.35k|    opj_free(mutex);
  342|  8.35k|}
opj_tls_get:
  530|  3.60M|{
  531|  3.60M|    int i;
  532|  3.60M|    for (i = 0; i < tls->key_val_count; i++) {
  ------------------
  |  Branch (532:17): [True: 3.60M, False: 6.83k]
  ------------------
  533|  3.60M|        if (tls->key_val[i].key == key) {
  ------------------
  |  Branch (533:13): [True: 3.60M, False: 0]
  ------------------
  534|  3.60M|            return tls->key_val[i].value;
  535|  3.60M|        }
  536|  3.60M|    }
  537|  6.83k|    return NULL;
  538|  3.60M|}
opj_tls_set:
  542|  6.83k|{
  543|  6.83k|    opj_tls_key_val_t* new_key_val;
  544|  6.83k|    int i;
  545|       |
  546|  6.83k|    if (tls->key_val_count == INT_MAX) {
  ------------------
  |  Branch (546:9): [True: 0, False: 6.83k]
  ------------------
  547|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  548|      0|    }
  549|  6.83k|    for (i = 0; i < tls->key_val_count; i++) {
  ------------------
  |  Branch (549:17): [True: 0, False: 6.83k]
  ------------------
  550|      0|        if (tls->key_val[i].key == key) {
  ------------------
  |  Branch (550:13): [True: 0, False: 0]
  ------------------
  551|      0|            if (tls->key_val[i].opj_free_func) {
  ------------------
  |  Branch (551:17): [True: 0, False: 0]
  ------------------
  552|      0|                tls->key_val[i].opj_free_func(tls->key_val[i].value);
  553|      0|            }
  554|      0|            tls->key_val[i].value = value;
  555|      0|            tls->key_val[i].opj_free_func = opj_free_func;
  556|      0|            return OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
  557|      0|        }
  558|      0|    }
  559|  6.83k|    new_key_val = (opj_tls_key_val_t*) opj_realloc(tls->key_val,
  560|  6.83k|                  ((size_t)tls->key_val_count + 1U) * sizeof(opj_tls_key_val_t));
  561|  6.83k|    if (!new_key_val) {
  ------------------
  |  Branch (561:9): [True: 0, False: 6.83k]
  ------------------
  562|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  563|      0|    }
  564|  6.83k|    tls->key_val = new_key_val;
  565|  6.83k|    new_key_val[tls->key_val_count].key = key;
  566|  6.83k|    new_key_val[tls->key_val_count].value = value;
  567|  6.83k|    new_key_val[tls->key_val_count].opj_free_func = opj_free_func;
  568|  6.83k|    tls->key_val_count ++;
  569|  6.83k|    return OPJ_TRUE;
  ------------------
  |  |  117|  6.83k|#define OPJ_TRUE 1
  ------------------
  570|  6.83k|}
opj_thread_pool_create:
  626|  9.21k|{
  627|  9.21k|    opj_thread_pool_t* tp;
  628|       |
  629|  9.21k|    tp = (opj_thread_pool_t*) opj_calloc(1, sizeof(opj_thread_pool_t));
  630|  9.21k|    if (!tp) {
  ------------------
  |  Branch (630:9): [True: 0, False: 9.21k]
  ------------------
  631|      0|        return NULL;
  632|      0|    }
  633|  9.21k|    tp->state = OPJWTS_OK;
  634|       |
  635|  9.21k|    if (num_threads <= 0) {
  ------------------
  |  Branch (635:9): [True: 9.21k, False: 0]
  ------------------
  636|  9.21k|        tp->tls = opj_tls_new();
  637|  9.21k|        if (!tp->tls) {
  ------------------
  |  Branch (637:13): [True: 0, False: 9.21k]
  ------------------
  638|      0|            opj_free(tp);
  639|      0|            tp = NULL;
  640|      0|        }
  641|  9.21k|        return tp;
  642|  9.21k|    }
  643|       |
  644|      0|    tp->mutex = opj_mutex_create();
  645|      0|    if (!tp->mutex) {
  ------------------
  |  Branch (645:9): [True: 0, False: 0]
  ------------------
  646|      0|        opj_free(tp);
  647|      0|        return NULL;
  648|      0|    }
  649|      0|    if (!opj_thread_pool_setup(tp, num_threads)) {
  ------------------
  |  Branch (649:9): [True: 0, False: 0]
  ------------------
  650|      0|        opj_thread_pool_destroy(tp);
  651|      0|        return NULL;
  652|      0|    }
  653|      0|    return tp;
  654|      0|}
opj_thread_pool_submit_job:
  830|  3.60M|{
  831|  3.60M|    opj_worker_thread_job_t* job;
  832|  3.60M|    opj_job_list_t* item;
  833|       |
  834|  3.60M|    if (tp->mutex == NULL) {
  ------------------
  |  Branch (834:9): [True: 3.60M, False: 0]
  ------------------
  835|  3.60M|        job_fn(user_data, tp->tls);
  836|  3.60M|        return OPJ_TRUE;
  ------------------
  |  |  117|  3.60M|#define OPJ_TRUE 1
  ------------------
  837|  3.60M|    }
  838|       |
  839|      0|    job = (opj_worker_thread_job_t*)opj_malloc(sizeof(opj_worker_thread_job_t));
  840|      0|    if (job == NULL) {
  ------------------
  |  Branch (840:9): [True: 0, False: 0]
  ------------------
  841|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  842|      0|    }
  843|      0|    job->job_fn = job_fn;
  844|      0|    job->user_data = user_data;
  845|       |
  846|      0|    item = (opj_job_list_t*) opj_malloc(sizeof(opj_job_list_t));
  847|      0|    if (item == NULL) {
  ------------------
  |  Branch (847:9): [True: 0, False: 0]
  ------------------
  848|      0|        opj_free(job);
  849|      0|        return OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  850|      0|    }
  851|      0|    item->job = job;
  852|       |
  853|      0|    opj_mutex_lock(tp->mutex);
  854|       |
  855|      0|    tp->signaling_threshold = 100 * tp->worker_threads_count;
  856|      0|    while (tp->pending_jobs_count > tp->signaling_threshold) {
  ------------------
  |  Branch (856:12): [True: 0, False: 0]
  ------------------
  857|       |        /* printf("%d jobs enqueued. Waiting\n", tp->pending_jobs_count); */
  858|      0|        opj_cond_wait(tp->cond, tp->mutex);
  859|       |        /* printf("...%d jobs enqueued.\n", tp->pending_jobs_count); */
  860|      0|    }
  861|       |
  862|      0|    item->next = tp->job_queue;
  863|      0|    tp->job_queue = item;
  864|      0|    tp->pending_jobs_count ++;
  865|       |
  866|      0|    if (tp->waiting_worker_thread_list) {
  ------------------
  |  Branch (866:9): [True: 0, False: 0]
  ------------------
  867|      0|        opj_worker_thread_t* worker_thread;
  868|      0|        opj_worker_thread_list_t* next;
  869|      0|        opj_worker_thread_list_t* to_opj_free;
  870|       |
  871|      0|        worker_thread = tp->waiting_worker_thread_list->worker_thread;
  872|       |
  873|      0|        assert(worker_thread->marked_as_waiting);
  874|      0|        worker_thread->marked_as_waiting = OPJ_FALSE;
  ------------------
  |  |  118|      0|#define OPJ_FALSE 0
  ------------------
  875|       |
  876|      0|        next = tp->waiting_worker_thread_list->next;
  877|      0|        to_opj_free = tp->waiting_worker_thread_list;
  878|      0|        tp->waiting_worker_thread_list = next;
  879|      0|        tp->waiting_worker_thread_count --;
  880|       |
  881|      0|        opj_mutex_lock(worker_thread->mutex);
  882|      0|        opj_mutex_unlock(tp->mutex);
  883|      0|        opj_cond_signal(worker_thread->cond);
  884|      0|        opj_mutex_unlock(worker_thread->mutex);
  885|       |
  886|      0|        opj_free(to_opj_free);
  887|      0|    } else {
  888|      0|        opj_mutex_unlock(tp->mutex);
  889|      0|    }
  890|       |
  891|      0|    return OPJ_TRUE;
  ------------------
  |  |  117|      0|#define OPJ_TRUE 1
  ------------------
  892|      0|}
opj_thread_pool_wait_completion:
  896|  8.35k|{
  897|  8.35k|    if (tp->mutex == NULL) {
  ------------------
  |  Branch (897:9): [True: 8.35k, False: 0]
  ------------------
  898|  8.35k|        return;
  899|  8.35k|    }
  900|       |
  901|      0|    if (max_remaining_jobs < 0) {
  ------------------
  |  Branch (901:9): [True: 0, False: 0]
  ------------------
  902|      0|        max_remaining_jobs = 0;
  903|      0|    }
  904|      0|    opj_mutex_lock(tp->mutex);
  905|      0|    tp->signaling_threshold = max_remaining_jobs;
  906|      0|    while (tp->pending_jobs_count > max_remaining_jobs) {
  ------------------
  |  Branch (906:12): [True: 0, False: 0]
  ------------------
  907|       |        /*printf("tp=%p, jobs before wait = %d, max_remaining_jobs = %d\n", tp, tp->pending_jobs_count, max_remaining_jobs);*/
  908|      0|        opj_cond_wait(tp->cond, tp->mutex);
  909|       |        /*printf("tp=%p, jobs after wait = %d\n", tp, tp->pending_jobs_count);*/
  910|      0|    }
  911|      0|    opj_mutex_unlock(tp->mutex);
  912|      0|}
opj_thread_pool_get_thread_count:
  915|  3.61M|{
  916|  3.61M|    return tp->worker_threads_count;
  917|  3.61M|}
opj_thread_pool_destroy:
  920|  9.21k|{
  921|  9.21k|    if (!tp) {
  ------------------
  |  Branch (921:9): [True: 0, False: 9.21k]
  ------------------
  922|      0|        return;
  923|      0|    }
  924|  9.21k|    if (tp->cond) {
  ------------------
  |  Branch (924:9): [True: 0, False: 9.21k]
  ------------------
  925|      0|        int i;
  926|      0|        opj_thread_pool_wait_completion(tp, 0);
  927|       |
  928|      0|        opj_mutex_lock(tp->mutex);
  929|      0|        tp->state = OPJWTS_STOP;
  930|      0|        opj_mutex_unlock(tp->mutex);
  931|       |
  932|      0|        for (i = 0; i < tp->worker_threads_count; i++) {
  ------------------
  |  Branch (932:21): [True: 0, False: 0]
  ------------------
  933|      0|            opj_mutex_lock(tp->worker_threads[i].mutex);
  934|      0|            opj_cond_signal(tp->worker_threads[i].cond);
  935|      0|            opj_mutex_unlock(tp->worker_threads[i].mutex);
  936|      0|            opj_thread_join(tp->worker_threads[i].thread);
  937|      0|            opj_cond_destroy(tp->worker_threads[i].cond);
  938|      0|            opj_mutex_destroy(tp->worker_threads[i].mutex);
  939|      0|        }
  940|       |
  941|      0|        opj_free(tp->worker_threads);
  942|       |
  943|      0|        while (tp->waiting_worker_thread_list != NULL) {
  ------------------
  |  Branch (943:16): [True: 0, False: 0]
  ------------------
  944|      0|            opj_worker_thread_list_t* next = tp->waiting_worker_thread_list->next;
  945|      0|            opj_free(tp->waiting_worker_thread_list);
  946|      0|            tp->waiting_worker_thread_list = next;
  947|      0|        }
  948|       |
  949|      0|        opj_cond_destroy(tp->cond);
  950|      0|    }
  951|  9.21k|    opj_mutex_destroy(tp->mutex);
  952|  9.21k|    opj_tls_destroy(tp->tls);
  953|  9.21k|    opj_free(tp);
  954|  9.21k|}
thread.c:opj_tls_new:
  510|  9.21k|{
  511|  9.21k|    return (opj_tls_t*) opj_calloc(1, sizeof(opj_tls_t));
  512|  9.21k|}
thread.c:opj_tls_destroy:
  515|  9.21k|{
  516|  9.21k|    int i;
  517|  9.21k|    if (!tls) {
  ------------------
  |  Branch (517:9): [True: 0, False: 9.21k]
  ------------------
  518|      0|        return;
  519|      0|    }
  520|  16.0k|    for (i = 0; i < tls->key_val_count; i++) {
  ------------------
  |  Branch (520:17): [True: 6.83k, False: 9.21k]
  ------------------
  521|  6.83k|        if (tls->key_val[i].opj_free_func) {
  ------------------
  |  Branch (521:13): [True: 6.83k, False: 0]
  ------------------
  522|  6.83k|            tls->key_val[i].opj_free_func(tls->key_val[i].value);
  523|  6.83k|        }
  524|  6.83k|    }
  525|  9.21k|    opj_free(tls->key_val);
  526|  9.21k|    opj_free(tls);
  527|  9.21k|}

LLVMFuzzerInitialize:
  103|      2|{
  104|      2|    return 0;
  105|      2|}
LLVMFuzzerTestOneInput:
  111|  9.25k|{
  112|       |
  113|  9.25k|    OPJ_CODEC_FORMAT eCodecFormat;
  114|  9.25k|    if (len >= sizeof(jpc_header) &&
  ------------------
  |  Branch (114:9): [True: 9.25k, False: 1]
  ------------------
  115|  9.25k|            memcmp(buf, jpc_header, sizeof(jpc_header)) == 0) {
  ------------------
  |  Branch (115:13): [True: 9.21k, False: 37]
  ------------------
  116|  9.21k|        eCodecFormat = OPJ_CODEC_J2K;
  117|  9.21k|    } else {
  118|     38|        return 0;
  119|     38|    }
  120|       |
  121|  9.21k|    opj_codec_t* pCodec = opj_create_decompress(eCodecFormat);
  122|  9.21k|    opj_set_info_handler(pCodec, InfoCallback, NULL);
  123|  9.21k|    opj_set_warning_handler(pCodec, WarningCallback, NULL);
  124|  9.21k|    opj_set_error_handler(pCodec, ErrorCallback, NULL);
  125|       |
  126|  9.21k|    opj_dparameters_t parameters;
  127|  9.21k|    opj_set_default_decoder_parameters(&parameters);
  128|       |
  129|  9.21k|    opj_setup_decoder(pCodec, &parameters);
  130|       |
  131|  9.21k|    opj_stream_t *pStream = opj_stream_create(1024, OPJ_TRUE);
  ------------------
  |  |  117|  9.21k|#define OPJ_TRUE 1
  ------------------
  132|  9.21k|    MemFile memFile;
  133|  9.21k|    memFile.pabyData = buf;
  134|  9.21k|    memFile.nLength = len;
  135|  9.21k|    memFile.nCurPos = 0;
  136|  9.21k|    opj_stream_set_user_data_length(pStream, len);
  137|  9.21k|    opj_stream_set_read_function(pStream, ReadCallback);
  138|  9.21k|    opj_stream_set_seek_function(pStream, SeekCallback);
  139|  9.21k|    opj_stream_set_skip_function(pStream, SkipCallback);
  140|  9.21k|    opj_stream_set_user_data(pStream, &memFile, NULL);
  141|       |
  142|  9.21k|    opj_image_t * psImage = NULL;
  143|  9.21k|    if (!opj_read_header(pStream, pCodec, &psImage)) {
  ------------------
  |  Branch (143:9): [True: 1.36k, False: 7.85k]
  ------------------
  144|  1.36k|        opj_destroy_codec(pCodec);
  145|  1.36k|        opj_stream_destroy(pStream);
  146|  1.36k|        opj_image_destroy(psImage);
  147|  1.36k|        return 0;
  148|  1.36k|    }
  149|       |
  150|  7.85k|    OPJ_UINT32 width = psImage->x1 - psImage->x0;
  151|  7.85k|    OPJ_UINT32 height = psImage->y1 - psImage->y0;
  152|       |
  153|       |#if 0
  154|       |    // Reject too big images since that will require allocating a lot of
  155|       |    // memory
  156|       |    if (width != 0 && psImage->numcomps != 0 &&
  157|       |            (width > INT_MAX / psImage->numcomps ||
  158|       |             height > INT_MAX / (width * psImage->numcomps * sizeof(OPJ_UINT32)))) {
  159|       |        opj_stream_destroy(pStream);
  160|       |        opj_destroy_codec(pCodec);
  161|       |        opj_image_destroy(psImage);
  162|       |
  163|       |        return 0;
  164|       |    }
  165|       |
  166|       |    // Also reject too big tiles.
  167|       |    // TODO: remove this limitation when subtile decoding no longer imply
  168|       |    // allocation memory for whole tile
  169|       |    opj_codestream_info_v2_t* pCodeStreamInfo = opj_get_cstr_info(pCodec);
  170|       |    OPJ_UINT32 nTileW, nTileH;
  171|       |    nTileW = pCodeStreamInfo->tdx;
  172|       |    nTileH = pCodeStreamInfo->tdy;
  173|       |    opj_destroy_cstr_info(&pCodeStreamInfo);
  174|       |    if (nTileW > 2048 || nTileH > 2048) {
  175|       |        opj_stream_destroy(pStream);
  176|       |        opj_destroy_codec(pCodec);
  177|       |        opj_image_destroy(psImage);
  178|       |
  179|       |        return 0;
  180|       |    }
  181|       |#endif
  182|       |
  183|  7.85k|    OPJ_UINT32 width_to_read = width;
  184|  7.85k|    if (width_to_read > 1024) {
  ------------------
  |  Branch (184:9): [True: 2.68k, False: 5.16k]
  ------------------
  185|  2.68k|        width_to_read = 1024;
  186|  2.68k|    }
  187|  7.85k|    OPJ_UINT32 height_to_read = height;
  188|  7.85k|    if (height_to_read > 1024) {
  ------------------
  |  Branch (188:9): [True: 3.18k, False: 4.67k]
  ------------------
  189|  3.18k|        height_to_read = 1024;
  190|  3.18k|    }
  191|       |
  192|  7.85k|    if (opj_set_decode_area(pCodec, psImage,
  ------------------
  |  Branch (192:9): [True: 7.81k, False: 37]
  ------------------
  193|  7.85k|                            psImage->x0, psImage->y0,
  194|  7.85k|                            psImage->x0 + width_to_read,
  195|  7.85k|                            psImage->y0 + height_to_read)) {
  196|  7.81k|        if (opj_decode(pCodec, pStream, psImage)) {
  ------------------
  |  Branch (196:13): [True: 5.60k, False: 2.21k]
  ------------------
  197|       |            //printf("success\n");
  198|  5.60k|        }
  199|  7.81k|    }
  200|       |
  201|  7.85k|    opj_end_decompress(pCodec, pStream);
  202|  7.85k|    opj_stream_destroy(pStream);
  203|  7.85k|    opj_destroy_codec(pCodec);
  204|  7.85k|    opj_image_destroy(psImage);
  205|       |
  206|  7.85k|    return 0;
  207|  9.21k|}
opj_decompress_fuzzer_J2K.cpp:_ZL12InfoCallbackPKcPv:
   61|  56.7k|{
   62|  56.7k|}
opj_decompress_fuzzer_J2K.cpp:_ZL15WarningCallbackPKcPv:
   57|   664M|{
   58|   664M|}
opj_decompress_fuzzer_J2K.cpp:_ZL13ErrorCallbackPKcPv:
   50|  12.8k|{
   51|  12.8k|    (void)msg;
   52|       |    //fprintf(stderr, "%s\n", msg);
   53|  12.8k|}
opj_decompress_fuzzer_J2K.cpp:_ZL12ReadCallbackPvmS_:
   66|  15.5k|{
   67|  15.5k|    MemFile* memFile = (MemFile*)pUserData;
   68|       |    //printf("want to read %d bytes at %d\n", (int)memFile->nCurPos, (int)nBytes);
   69|  15.5k|    if (memFile->nCurPos >= memFile->nLength) {
  ------------------
  |  Branch (69:9): [True: 892, False: 14.6k]
  ------------------
   70|    892|        return -1;
   71|    892|    }
   72|  14.6k|    if (memFile->nCurPos + nBytes >= memFile->nLength) {
  ------------------
  |  Branch (72:9): [True: 9.64k, False: 5.00k]
  ------------------
   73|  9.64k|        size_t nToRead = memFile->nLength - memFile->nCurPos;
   74|  9.64k|        memcpy(pBuffer, memFile->pabyData + memFile->nCurPos, nToRead);
   75|  9.64k|        memFile->nCurPos = memFile->nLength;
   76|  9.64k|        return nToRead;
   77|  9.64k|    }
   78|  5.00k|    if (nBytes == 0) {
  ------------------
  |  Branch (78:9): [True: 0, False: 5.00k]
  ------------------
   79|      0|        return -1;
   80|      0|    }
   81|  5.00k|    memcpy(pBuffer, memFile->pabyData + memFile->nCurPos, nBytes);
   82|  5.00k|    memFile->nCurPos += nBytes;
   83|  5.00k|    return nBytes;
   84|  5.00k|}
opj_decompress_fuzzer_J2K.cpp:_ZL12SeekCallbacklPv:
   87|  1.01k|{
   88|  1.01k|    MemFile* memFile = (MemFile*)pUserData;
   89|       |    //printf("seek to %d\n", (int)nBytes);
   90|  1.01k|    memFile->nCurPos = nBytes;
   91|  1.01k|    return OPJ_TRUE;
  ------------------
  |  |  117|  1.01k|#define OPJ_TRUE 1
  ------------------
   92|  1.01k|}
opj_decompress_fuzzer_J2K.cpp:_ZL12SkipCallbacklPv:
   95|    458|{
   96|    458|    MemFile* memFile = (MemFile*)pUserData;
   97|    458|    memFile->nCurPos += nBytes;
   98|    458|    return nBytes;
   99|    458|}

