Lines Matching refs:t1

60 #define T1_FLAGS(x, y) (t1->flags[x + 1 + ((y / 4) + 1) * (t1->w+2)])
81 opj_t1_t *t1,
88 opj_t1_t *t1,
99 static void opj_t1_enc_sigpass(opj_t1_t *t1,
109 opj_t1_t *t1,
116 static void opj_t1_enc_refpass(opj_t1_t *t1,
125 opj_t1_t *t1,
134 opj_t1_t *t1,
140 opj_t1_t *t1,
152 opj_t1_t *t1,
163 opj_t1_t *t1,
180 static void opj_t1_encode_cblk(opj_t1_t *t1,
204 static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1,
213 static OPJ_BOOL opj_t1_allocate_buffers(opj_t1_t *t1,
332 static INLINE void opj_t1_enc_sigpass_step(opj_t1_t *t1, in opj_t1_enc_sigpass_step() argument
344 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_enc_sigpass_step()
383 opj_t1_update_flags(flagsp, ci, v, t1->w + 2, vsc); in opj_t1_enc_sigpass_step()
390 opj_t1_t *t1, in opj_t1_dec_sigpass_step_raw() argument
398 opj_mqc_t *mqc = &(t1->mqc); /* RAW component */ in opj_t1_dec_sigpass_step_raw()
407 opj_t1_update_flags(flagsp, ci, v, t1->w + 2, vsc); in opj_t1_dec_sigpass_step_raw()
440 opj_t1_t *t1, in opj_t1_dec_sigpass_step_mqc() argument
450 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_dec_sigpass_step_mqc()
456 static void opj_t1_enc_sigpass(opj_t1_t *t1, in opj_t1_enc_sigpass() argument
472 for (k = 0; k < (t1->h & ~3U); k += 4) { in opj_t1_enc_sigpass()
476 for (i = 0; i < t1->w; ++i) { in opj_t1_enc_sigpass()
486 t1, in opj_t1_enc_sigpass()
488 &t1->data[((k + 0) * t1->data_stride) + i], in opj_t1_enc_sigpass()
495 t1, in opj_t1_enc_sigpass()
497 &t1->data[((k + 1) * t1->data_stride) + i], in opj_t1_enc_sigpass()
504 t1, in opj_t1_enc_sigpass()
506 &t1->data[((k + 2) * t1->data_stride) + i], in opj_t1_enc_sigpass()
513 t1, in opj_t1_enc_sigpass()
515 &t1->data[((k + 3) * t1->data_stride) + i], in opj_t1_enc_sigpass()
526 if (k < t1->h) { in opj_t1_enc_sigpass()
531 for (i = 0; i < t1->w; ++i) { in opj_t1_enc_sigpass()
540 for (j = k; j < t1->h; ++j) { in opj_t1_enc_sigpass()
542 t1, in opj_t1_enc_sigpass()
544 &t1->data[(j * t1->data_stride) + i], in opj_t1_enc_sigpass()
558 opj_t1_t *t1, in opj_t1_dec_sigpass_raw() argument
564 OPJ_INT32 *data = t1->data; in opj_t1_dec_sigpass_raw()
566 const OPJ_UINT32 l_w = t1->w; in opj_t1_dec_sigpass_raw()
571 for (k = 0; k < (t1->h & ~3U); k += 4, flagsp += 2, data += 3 * l_w) { in opj_t1_dec_sigpass_raw()
576 t1, in opj_t1_dec_sigpass_raw()
583 t1, in opj_t1_dec_sigpass_raw()
590 t1, in opj_t1_dec_sigpass_raw()
597 t1, in opj_t1_dec_sigpass_raw()
606 if (k < t1->h) { in opj_t1_dec_sigpass_raw()
608 for (j = 0; j < t1->h - k; ++j) { in opj_t1_dec_sigpass_raw()
610 t1, in opj_t1_dec_sigpass_raw()
621 #define opj_t1_dec_sigpass_mqc_internal(t1, bpno, vsc, w, h, flags_stride) \ argument
625 register OPJ_INT32 *data = t1->data; \
626 register opj_flag_t *flagsp = &t1->flags[(flags_stride) + 1]; \
628 opj_mqc_t* mqc = &(t1->mqc); \
658 opj_t1_dec_sigpass_step_mqc(t1, flagsp, \
666 opj_t1_t *t1, in opj_t1_dec_sigpass_mqc_64x64_novsc() argument
669 opj_t1_dec_sigpass_mqc_internal(t1, bpno, OPJ_FALSE, 64, 64, 66); in opj_t1_dec_sigpass_mqc_64x64_novsc()
673 opj_t1_t *t1, in opj_t1_dec_sigpass_mqc_64x64_vsc() argument
676 opj_t1_dec_sigpass_mqc_internal(t1, bpno, OPJ_TRUE, 64, 64, 66); in opj_t1_dec_sigpass_mqc_64x64_vsc()
680 opj_t1_t *t1, in opj_t1_dec_sigpass_mqc_generic_novsc() argument
683 opj_t1_dec_sigpass_mqc_internal(t1, bpno, OPJ_FALSE, t1->w, t1->h, in opj_t1_dec_sigpass_mqc_generic_novsc()
684 t1->w + 2U); in opj_t1_dec_sigpass_mqc_generic_novsc()
688 opj_t1_t *t1, in opj_t1_dec_sigpass_mqc_generic_vsc() argument
691 opj_t1_dec_sigpass_mqc_internal(t1, bpno, OPJ_TRUE, t1->w, t1->h, in opj_t1_dec_sigpass_mqc_generic_vsc()
692 t1->w + 2U); in opj_t1_dec_sigpass_mqc_generic_vsc()
696 opj_t1_t *t1, in opj_t1_dec_sigpass_mqc() argument
700 if (t1->w == 64 && t1->h == 64) { in opj_t1_dec_sigpass_mqc()
702 opj_t1_dec_sigpass_mqc_64x64_vsc(t1, bpno); in opj_t1_dec_sigpass_mqc()
704 opj_t1_dec_sigpass_mqc_64x64_novsc(t1, bpno); in opj_t1_dec_sigpass_mqc()
708 opj_t1_dec_sigpass_mqc_generic_vsc(t1, bpno); in opj_t1_dec_sigpass_mqc()
710 opj_t1_dec_sigpass_mqc_generic_novsc(t1, bpno); in opj_t1_dec_sigpass_mqc()
718 static INLINE void opj_t1_enc_refpass_step(opj_t1_t *t1, in opj_t1_enc_refpass_step() argument
729 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_enc_refpass_step()
754 opj_t1_t *t1, in opj_t1_dec_refpass_step_raw() argument
762 opj_mqc_t *mqc = &(t1->mqc); /* RAW component */ in opj_t1_dec_refpass_step_raw()
786 opj_t1_t *t1, in opj_t1_dec_refpass_step_mqc() argument
794 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_dec_refpass_step_mqc()
801 opj_t1_t *t1, in opj_t1_enc_refpass() argument
815 for (k = 0; k < (t1->h & ~3U); k += 4) { in opj_t1_enc_refpass()
819 for (i = 0; i < t1->w; ++i) { in opj_t1_enc_refpass()
836 t1, in opj_t1_enc_refpass()
838 &t1->data[((k + 0) * t1->data_stride) + i], in opj_t1_enc_refpass()
845 t1, in opj_t1_enc_refpass()
847 &t1->data[((k + 1) * t1->data_stride) + i], in opj_t1_enc_refpass()
854 t1, in opj_t1_enc_refpass()
856 &t1->data[((k + 2) * t1->data_stride) + i], in opj_t1_enc_refpass()
863 t1, in opj_t1_enc_refpass()
865 &t1->data[((k + 3) * t1->data_stride) + i], in opj_t1_enc_refpass()
876 if (k < t1->h) { in opj_t1_enc_refpass()
881 for (i = 0; i < t1->w; ++i) { in opj_t1_enc_refpass()
890 for (j = k; j < t1->h; ++j) { in opj_t1_enc_refpass()
892 t1, in opj_t1_enc_refpass()
894 &t1->data[(j * t1->data_stride) + i], in opj_t1_enc_refpass()
908 opj_t1_t *t1, in opj_t1_dec_refpass_raw() argument
913 OPJ_INT32 *data = t1->data; in opj_t1_dec_refpass_raw()
915 const OPJ_UINT32 l_w = t1->w; in opj_t1_dec_refpass_raw()
918 for (k = 0; k < (t1->h & ~3U); k += 4, flagsp += 2, data += 3 * l_w) { in opj_t1_dec_refpass_raw()
923 t1, in opj_t1_dec_refpass_raw()
929 t1, in opj_t1_dec_refpass_raw()
935 t1, in opj_t1_dec_refpass_raw()
941 t1, in opj_t1_dec_refpass_raw()
949 if (k < t1->h) { in opj_t1_dec_refpass_raw()
951 for (j = 0; j < t1->h - k; ++j) { in opj_t1_dec_refpass_raw()
953 t1, in opj_t1_dec_refpass_raw()
963 #define opj_t1_dec_refpass_mqc_internal(t1, bpno, w, h, flags_stride) \ argument
967 register OPJ_INT32 *data = t1->data; \
968 register opj_flag_t *flagsp = &t1->flags[flags_stride + 1]; \
970 opj_mqc_t* mqc = &(t1->mqc); \
999 opj_t1_dec_refpass_step_mqc(t1, flagsp, data + j * l_w, poshalf, j); \
1006 opj_t1_t *t1, in opj_t1_dec_refpass_mqc_64x64() argument
1009 opj_t1_dec_refpass_mqc_internal(t1, bpno, 64, 64, 66); in opj_t1_dec_refpass_mqc_64x64()
1013 opj_t1_t *t1, in opj_t1_dec_refpass_mqc_generic() argument
1016 opj_t1_dec_refpass_mqc_internal(t1, bpno, t1->w, t1->h, t1->w + 2U); in opj_t1_dec_refpass_mqc_generic()
1020 opj_t1_t *t1, in opj_t1_dec_refpass_mqc() argument
1023 if (t1->w == 64 && t1->h == 64) { in opj_t1_dec_refpass_mqc()
1024 opj_t1_dec_refpass_mqc_64x64(t1, bpno); in opj_t1_dec_refpass_mqc()
1026 opj_t1_dec_refpass_mqc_generic(t1, bpno); in opj_t1_dec_refpass_mqc()
1034 opj_t1_t *t1, in opj_t1_enc_clnpass_step() argument
1047 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_enc_clnpass_step()
1107 opj_t1_update_flags(flagsp, ci, v, t1->w + 2U, vsc); in opj_t1_enc_clnpass_step()
1111 datap += t1->data_stride; in opj_t1_enc_clnpass_step()
1144 opj_t1_t *t1, in opj_t1_dec_clnpass_step() argument
1153 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_dec_clnpass_step()
1155 *flagsp, flagsp, t1->w + 2U, datap, in opj_t1_dec_clnpass_step()
1161 opj_t1_t *t1, in opj_t1_enc_clnpass() argument
1170 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_enc_clnpass()
1176 for (k = 0; k < (t1->h & ~3U); k += 4) { in opj_t1_enc_clnpass()
1180 for (i = 0; i < t1->w; ++i) { in opj_t1_enc_clnpass()
1190 if (opj_int_abs(t1->data[((k + runlen)*t1->data_stride) + i]) & one) { in opj_t1_enc_clnpass()
1206 t1, in opj_t1_enc_clnpass()
1208 &t1->data[((k + runlen) * t1->data_stride) + i], in opj_t1_enc_clnpass()
1218 if (k < t1->h) { in opj_t1_enc_clnpass()
1224 for (i = 0; i < t1->w; ++i) { in opj_t1_enc_clnpass()
1230 t1, in opj_t1_enc_clnpass()
1232 &t1->data[((k + runlen) * t1->data_stride) + i], in opj_t1_enc_clnpass()
1238 t1->h - k, in opj_t1_enc_clnpass()
1244 #define opj_t1_dec_clnpass_internal(t1, bpno, vsc, w, h, flags_stride) \ argument
1250 opj_mqc_t* mqc = &(t1->mqc); \
1251 register OPJ_INT32 *data = t1->data; \
1252 register opj_flag_t *flagsp = &t1->flags[flags_stride + 1]; \
1326 opj_t1_dec_clnpass_step(t1, flagsp, data + j * l_w, oneplushalf, j, vsc); \
1333 static void opj_t1_dec_clnpass_check_segsym(opj_t1_t *t1, OPJ_INT32 cblksty) in opj_t1_dec_clnpass_check_segsym() argument
1336 opj_mqc_t* mqc = &(t1->mqc); in opj_t1_dec_clnpass_check_segsym()
1355 opj_t1_t *t1, in opj_t1_dec_clnpass_64x64_novsc() argument
1358 opj_t1_dec_clnpass_internal(t1, bpno, OPJ_FALSE, 64, 64, 66); in opj_t1_dec_clnpass_64x64_novsc()
1362 opj_t1_t *t1, in opj_t1_dec_clnpass_64x64_vsc() argument
1365 opj_t1_dec_clnpass_internal(t1, bpno, OPJ_TRUE, 64, 64, 66); in opj_t1_dec_clnpass_64x64_vsc()
1369 opj_t1_t *t1, in opj_t1_dec_clnpass_generic_novsc() argument
1372 opj_t1_dec_clnpass_internal(t1, bpno, OPJ_FALSE, t1->w, t1->h, in opj_t1_dec_clnpass_generic_novsc()
1373 t1->w + 2U); in opj_t1_dec_clnpass_generic_novsc()
1377 opj_t1_t *t1, in opj_t1_dec_clnpass_generic_vsc() argument
1380 opj_t1_dec_clnpass_internal(t1, bpno, OPJ_TRUE, t1->w, t1->h, in opj_t1_dec_clnpass_generic_vsc()
1381 t1->w + 2U); in opj_t1_dec_clnpass_generic_vsc()
1385 opj_t1_t *t1, in opj_t1_dec_clnpass() argument
1389 if (t1->w == 64 && t1->h == 64) { in opj_t1_dec_clnpass()
1391 opj_t1_dec_clnpass_64x64_vsc(t1, bpno); in opj_t1_dec_clnpass()
1393 opj_t1_dec_clnpass_64x64_novsc(t1, bpno); in opj_t1_dec_clnpass()
1397 opj_t1_dec_clnpass_generic_vsc(t1, bpno); in opj_t1_dec_clnpass()
1399 opj_t1_dec_clnpass_generic_novsc(t1, bpno); in opj_t1_dec_clnpass()
1402 opj_t1_dec_clnpass_check_segsym(t1, cblksty); in opj_t1_dec_clnpass()
1439 opj_t1_t *t1, in opj_t1_allocate_buffers() argument
1453 if (!t1->encoder) { in opj_t1_allocate_buffers()
1456 if (datasize > t1->datasize) { in opj_t1_allocate_buffers()
1457 opj_aligned_free(t1->data); in opj_t1_allocate_buffers()
1458 t1->data = (OPJ_INT32*) opj_aligned_malloc(datasize * sizeof(OPJ_INT32)); in opj_t1_allocate_buffers()
1459 if (!t1->data) { in opj_t1_allocate_buffers()
1463 t1->datasize = datasize; in opj_t1_allocate_buffers()
1466 if (t1->data != NULL) { in opj_t1_allocate_buffers()
1467 memset(t1->data, 0, datasize * sizeof(OPJ_INT32)); in opj_t1_allocate_buffers()
1481 if (flagssize > t1->flagssize) { in opj_t1_allocate_buffers()
1483 opj_aligned_free(t1->flags); in opj_t1_allocate_buffers()
1484 t1->flags = (opj_flag_t*) opj_aligned_malloc(flagssize * sizeof( in opj_t1_allocate_buffers()
1486 if (!t1->flags) { in opj_t1_allocate_buffers()
1491 t1->flagssize = flagssize; in opj_t1_allocate_buffers()
1493 memset(t1->flags, 0, flagssize * sizeof(opj_flag_t)); in opj_t1_allocate_buffers()
1495 p = &t1->flags[0]; in opj_t1_allocate_buffers()
1501 p = &t1->flags[((flags_height + 1) * flags_stride)]; in opj_t1_allocate_buffers()
1509 p = &t1->flags[((flags_height) * flags_stride)]; in opj_t1_allocate_buffers()
1523 t1->w = w; in opj_t1_allocate_buffers()
1524 t1->h = h; in opj_t1_allocate_buffers()
1593 static void opj_t1_destroy_wrapper(void* t1) in opj_t1_destroy_wrapper() argument
1595 opj_t1_destroy((opj_t1_t*) t1); in opj_t1_destroy_wrapper()
1609 opj_t1_t* t1; in opj_t1_clbl_decode_processor() local
1658 t1 = (opj_t1_t*) opj_tls_get(tls, OPJ_TLS_KEY_T1); in opj_t1_clbl_decode_processor()
1659 if (t1 == NULL) { in opj_t1_clbl_decode_processor()
1660 t1 = opj_t1_create(OPJ_FALSE); in opj_t1_clbl_decode_processor()
1661 opj_tls_set(tls, OPJ_TLS_KEY_T1, t1, opj_t1_destroy_wrapper); in opj_t1_clbl_decode_processor()
1663 t1->mustuse_cblkdatabuffer = job->mustuse_cblkdatabuffer; in opj_t1_clbl_decode_processor()
1666 t1, in opj_t1_clbl_decode_processor()
1690 datap = cblk->decoded_data ? cblk->decoded_data : t1->data; in opj_t1_clbl_decode_processor()
1691 cblk_w = t1->w; in opj_t1_clbl_decode_processor()
1692 cblk_h = t1->h; in opj_t1_clbl_decode_processor()
1920 static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1, in opj_t1_decode_cblk() argument
1929 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_decode_cblk()
1942 t1, in opj_t1_decode_cblk()
1971 if (cblk->numchunks > 1 || t1->mustuse_cblkdatabuffer) { in opj_t1_decode_cblk()
1982 if (cblk_len + OPJ_COMMON_CBLK_DATA_EXTRA > t1->cblkdatabuffersize) { in opj_t1_decode_cblk()
1983 cblkdata = (OPJ_BYTE*)opj_realloc(t1->cblkdatabuffer, in opj_t1_decode_cblk()
1988 t1->cblkdatabuffer = cblkdata; in opj_t1_decode_cblk()
1989 memset(t1->cblkdatabuffer + cblk_len, 0, OPJ_COMMON_CBLK_DATA_EXTRA); in opj_t1_decode_cblk()
1990 t1->cblkdatabuffersize = cblk_len + OPJ_COMMON_CBLK_DATA_EXTRA; in opj_t1_decode_cblk()
1994 cblkdata = t1->cblkdatabuffer; in opj_t1_decode_cblk()
2011 original_t1_data = t1->data; in opj_t1_decode_cblk()
2012 t1->data = cblk->decoded_data; in opj_t1_decode_cblk()
2036 opj_t1_dec_sigpass_raw(t1, bpno_plus_one, (OPJ_INT32)cblksty); in opj_t1_decode_cblk()
2038 opj_t1_dec_sigpass_mqc(t1, bpno_plus_one, (OPJ_INT32)cblksty); in opj_t1_decode_cblk()
2043 opj_t1_dec_refpass_raw(t1, bpno_plus_one); in opj_t1_decode_cblk()
2045 opj_t1_dec_refpass_mqc(t1, bpno_plus_one); in opj_t1_decode_cblk()
2049 opj_t1_dec_clnpass(t1, bpno_plus_one, (OPJ_INT32)cblksty); in opj_t1_decode_cblk()
2096 t1->data = original_t1_data; in opj_t1_decode_cblk()
2105 OPJ_BOOL opj_t1_encode_cblks(opj_t1_t *t1, in opj_t1_encode_cblks() argument
2157 t1, in opj_t1_encode_cblks()
2163 cblk_w = t1->w; in opj_t1_encode_cblks()
2164 cblk_h = t1->h; in opj_t1_encode_cblks()
2168 t1->data = tiledp; in opj_t1_encode_cblks()
2169 t1->data_stride = tile_w; in opj_t1_encode_cblks()
2193 t1, in opj_t1_encode_cblks()
2246 static void opj_t1_encode_cblk(opj_t1_t *t1, in opj_t1_encode_cblk() argument
2261 opj_mqc_t *mqc = &(t1->mqc); /* MQC component */ in opj_t1_encode_cblk()
2280 for (i = 0; i < t1->w; ++i) { in opj_t1_encode_cblk()
2281 for (j = 0; j < t1->h; ++j) { in opj_t1_encode_cblk()
2282 OPJ_INT32 tmp = abs(t1->data[i + j * t1->data_stride]); in opj_t1_encode_cblk()
2319 opj_t1_enc_sigpass(t1, bpno, &nmsedec, type, cblksty); in opj_t1_encode_cblk()
2322 opj_t1_enc_refpass(t1, bpno, &nmsedec, type); in opj_t1_encode_cblk()
2325 opj_t1_enc_clnpass(t1, bpno, &nmsedec, cblksty); in opj_t1_encode_cblk()