38#define _USE_MATH_DEFINES
62 state->set_image_extent(dims);
68 state->set_tile_size(s);
74 state->set_image_offset(offset);
80 state->set_tile_offset(offset);
86 state->set_num_components(num_comps);
93 state->set_comp_info(comp_num, downsampling, bit_depth,
is_signed);
129 return state->get_bit_depth(comp_num);
135 return state->is_signed(comp_num);
141 return state->get_downsampling(comp_num);
147 return state->get_recon_width(comp_num);
153 return state->get_recon_height(comp_num);
167 if (num_decompositions > 32)
169 "maximum number of decompositions cannot exceed 32");
170 state->SPcod.num_decomp = (
ui8)num_decompositions;
178 if (width == 0 || width != (1u << log_width)
179 || height == 0 || height != (1u << log_height)
180 || log_width < 2 || log_height < 2
181 || log_width + log_height > 12)
182 OJPH_ERROR(0x00050011,
"incorrect code block dimensions");
183 state->SPcod.block_width = (
ui8)(log_width - 2);
184 state->SPcod.block_height = (
ui8)(log_height - 2);
190 if (num_levels == 0 || precinct_size == NULL)
195 for (
int i = 0; i <=
state->SPcod.num_decomp; ++i)
197 size t = precinct_size[i < num_levels ? i : num_levels - 1];
201 if (t.
w == 0 || t.
h == 0)
202 OJPH_ERROR(0x00050021,
"precinct width or height cannot be 0");
203 if (t.
w != (1u<<PPx) || t.
h != (1u<<PPy))
205 "precinct width and height should be a power of 2");
206 if (PPx > 15 || PPy > 15)
207 OJPH_ERROR(0x00050023,
"precinct size is too large");
208 if (i > 0 && (PPx == 0 || PPy == 0))
209 OJPH_ERROR(0x00050024,
"precinct size is too small");
210 state->SPcod.precinct_size[i] = (
ui8)(PPx | (PPy << 4));
219 size_t len = strlen(name);
233 OJPH_ERROR(0x00050031,
"unknown progression order");
236 OJPH_ERROR(0x00050032,
"improper progression order");
239 state->SGCod.prog_order = (
ui8)prog_order;
245 state->employ_color_transform(color_transform ? 1 : 0);
251 state->set_reversible(reversible);
259 p =
state->add_coc_object(component_idx);
266 return state->get_num_decompositions();
272 return state->get_block_dims();
278 return state->get_log_block_dims();
284 return state->is_reversible();
290 return state->get_precinct_size(level_num);
296 return state->get_log_precinct_size(level_num);
302 return state->SGCod.prog_order;
326 return state->SGCod.num_layers;
332 return state->is_employing_color_transform();
338 return state->packets_may_use_sop();
344 return state->packets_use_eph();
350 return state->get_block_vertical_causality();
417 state->set_delta(delta);
423 state->set_delta(comp_idx, delta);
437 state->set_nonlinear_transform(comp_num, nl_type);
442 bool& is_signed,
ui8& nl_type)
const
444 return state->get_nonlinear_transform(comp_num, bit_depth, is_signed,
459 size_t t = strlen(str);
462 "COM marker string length cannot be larger than 65531");
473 "COM marker string length cannot be larger than 65531");
508 1.4021e+00f, 2.0304e+00f, 2.9012e+00f, 4.1153e+00f, 5.8245e+00f,
509 8.2388e+00f, 1.1652e+01f, 1.6479e+01f, 2.3304e+01f, 3.2957e+01f,
510 4.6609e+01f, 6.5915e+01f, 9.3217e+01f, 1.3183e+02f, 1.8643e+02f,
511 2.6366e+02f, 3.7287e+02f, 5.2732e+02f, 7.4574e+02f, 1.0546e+03f,
512 1.4915e+03f, 2.1093e+03f, 2.9830e+03f, 4.2185e+03f, 5.9659e+03f,
513 8.4371e+03f, 1.1932e+04f, 1.6874e+04f, 2.3864e+04f, 3.3748e+04f,
514 4.7727e+04f, 6.7496e+04f, 9.5454e+04f };
516 1.9669e+00f, 2.8839e+00f, 4.1475e+00f, 5.8946e+00f, 8.3472e+00f,
517 1.1809e+01f, 1.6701e+01f, 2.3620e+01f, 3.3403e+01f, 4.7240e+01f,
518 6.6807e+01f, 9.4479e+01f, 1.3361e+02f, 1.8896e+02f, 2.6723e+02f,
519 3.7792e+02f, 5.3446e+02f, 7.5583e+02f, 1.0689e+03f, 1.5117e+03f,
520 2.1378e+03f, 3.0233e+03f, 4.2756e+03f, 6.0467e+03f, 8.5513e+03f,
521 1.2093e+04f, 1.7103e+04f, 2.4187e+04f, 3.4205e+04f, 4.8373e+04f,
522 6.8410e+04f, 9.6747e+04f, 1.3682e+05f };
524 1.2247e+00f, 1.3229e+00f, 1.5411e+00f, 1.7139e+00f, 1.9605e+00f,
525 2.2044e+00f, 2.5047e+00f, 2.8277e+00f, 3.2049e+00f, 3.6238e+00f,
526 4.1033e+00f, 4.6423e+00f, 5.2548e+00f, 5.9462e+00f, 6.7299e+00f,
527 7.6159e+00f, 8.6193e+00f, 9.7544e+00f, 1.1039e+01f, 1.2493e+01f,
528 1.4139e+01f, 1.6001e+01f, 1.8108e+01f, 2.0493e+01f, 2.3192e+01f,
529 2.6246e+01f, 2.9702e+01f, 3.3614e+01f, 3.8041e+01f, 4.3051e+01f,
530 4.8721e+01f, 5.5138e+01f, 6.2399e+01f };
532 1.3975e+00f, 1.4389e+00f, 1.7287e+00f, 1.8880e+00f, 2.1841e+00f,
533 2.4392e+00f, 2.7830e+00f, 3.1341e+00f, 3.5576e+00f, 4.0188e+00f,
534 4.5532e+00f, 5.1494e+00f, 5.8301e+00f, 6.5963e+00f, 7.4663e+00f,
535 8.4489e+00f, 9.5623e+00f, 1.0821e+01f, 1.2247e+01f, 1.3860e+01f,
536 1.5685e+01f, 1.7751e+01f, 2.0089e+01f, 2.2735e+01f, 2.5729e+01f,
537 2.9117e+01f, 3.2952e+01f, 3.7292e+01f, 4.2203e+01f, 4.7761e+01f,
538 5.4051e+01f, 6.1170e+01f, 6.9226e+01f };
559 1.3328e+00f, 1.3067e+00f, 1.3028e+00f, 1.3001e+00f, 1.2993e+00f,
560 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f,
561 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f,
562 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f,
563 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f,
564 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f, 1.2992e+00f,
565 1.2992e+00f, 1.2992e+00f };
567 1.2757e+00f, 1.2352e+00f, 1.2312e+00f, 1.2285e+00f, 1.2280e+00f,
568 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f,
569 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f,
570 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f,
571 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f,
572 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f, 1.2278e+00f,
573 1.2278e+00f, 1.2278e+00f };
575 1.6250e+00f, 1.6875e+00f, 1.6963e+00f, 1.7067e+00f, 1.7116e+00f,
576 1.7129e+00f, 1.7141e+00f, 1.7145e+00f, 1.7151e+00f, 1.7152e+00f,
577 1.7155e+00f, 1.7155e+00f, 1.7156e+00f, 1.7156e+00f, 1.7156e+00f,
578 1.7156e+00f, 1.7156e+00f, 1.7156e+00f, 1.7156e+00f, 1.7156e+00f,
579 1.7156e+00f, 1.7156e+00f, 1.7156e+00f, 1.7156e+00f, 1.7156e+00f,
580 1.7156e+00f, 1.7156e+00f, 1.7156e+00f, 1.7156e+00f, 1.7156e+00f,
581 1.7156e+00f, 1.7156e+00f };
583 2.7500e+00f, 2.8047e+00f, 2.8198e+00f, 2.8410e+00f, 2.8558e+00f,
584 2.8601e+00f, 2.8628e+00f, 2.8656e+00f, 2.8662e+00f, 2.8667e+00f,
585 2.8669e+00f, 2.8670e+00f, 2.8671e+00f, 2.8671e+00f, 2.8671e+00f,
586 2.8671e+00f, 2.8671e+00f, 2.8671e+00f, 2.8671e+00f, 2.8671e+00f,
587 2.8671e+00f, 2.8671e+00f, 2.8671e+00f, 2.8671e+00f, 2.8671e+00f,
588 2.8671e+00f, 2.8671e+00f, 2.8671e+00f, 2.8671e+00f, 2.8671e+00f,
589 2.8671e+00f, 2.8671e+00f };
611 result &= file->
write(&buf, 2) == 2;
613 result &= file->
write(&buf, 2) == 2;
615 result &= file->
write(&buf, 2) == 2;
617 result &= file->
write(&buf, 4) == 4;
619 result &= file->
write(&buf, 4) == 4;
621 result &= file->
write(&buf, 4) == 4;
623 result &= file->
write(&buf, 4) == 4;
625 result &= file->
write(&buf, 4) == 4;
627 result &= file->
write(&buf, 4) == 4;
629 result &= file->
write(&buf, 4) == 4;
631 result &= file->
write(&buf, 4) == 4;
633 result &= file->
write(&buf, 2) == 2;
634 for (
int c = 0; c <
Csiz; ++c)
636 buf[0] =
cptr[c].SSiz;
637 buf[1] =
cptr[c].XRsiz;
638 buf[2] =
cptr[c].YRsiz;
639 result &= file->
write(&buf, 3) == 3;
649 OJPH_ERROR(0x00050041,
"error reading SIZ marker");
651 int num_comps = (
Lsiz - 38) / 3;
652 if (
Lsiz != 38 + 3 * num_comps)
653 OJPH_ERROR(0x00050042,
"error in SIZ marker length");
655 OJPH_ERROR(0x00050043,
"error reading SIZ marker");
657 if ((
Rsiz & 0x4000) == 0)
659 "Rsiz bit 14 is not set (this is not a JPH file)");
660 if ((
Rsiz & 0x8000) != 0 && (
Rsiz & 0xD5F) != 0)
661 OJPH_WARN(0x00050001,
"Rsiz in SIZ has unimplemented fields");
663 OJPH_ERROR(0x00050045,
"error reading SIZ marker");
666 OJPH_ERROR(0x00050046,
"error reading SIZ marker");
668 ui32 t_XOsiz, t_YOsiz;
669 if (file->
read(&t_XOsiz, 4) != 4)
670 OJPH_ERROR(0x00050047,
"error reading SIZ marker");
671 if (file->
read(&t_YOsiz, 4) != 4)
672 OJPH_ERROR(0x00050048,
"error reading SIZ marker");
676 ui32 t_XTsiz, t_YTsiz;
677 if (file->
read(&t_XTsiz, 4) != 4)
678 OJPH_ERROR(0x00050049,
"error reading SIZ marker");
679 if (file->
read(&t_YTsiz, 4) != 4)
680 OJPH_ERROR(0x0005004A,
"error reading SIZ marker");
684 ui32 t_XTOsiz, t_YTOsiz;
685 if (file->
read(&t_XTOsiz, 4) != 4)
686 OJPH_ERROR(0x0005004B,
"error reading SIZ marker");
687 if (file->
read(&t_YTOsiz, 4) != 4)
688 OJPH_ERROR(0x0005004C,
"error reading SIZ marker");
693 OJPH_ERROR(0x0005004D,
"error reading SIZ marker");
695 if (
Csiz != num_comps)
696 OJPH_ERROR(0x0005004E,
"Csiz does not match the SIZ marker size");
698 OJPH_ERROR(0x0005004F,
"Wrong Csiz value of 0 in SIZ marker segment");
700 for (
int c = 0; c <
Csiz; ++c)
702 if (file->
read(&
cptr[c].SSiz, 1) != 1)
703 OJPH_ERROR(0x00050051,
"error reading SIZ marker");
704 if (file->
read(&
cptr[c].XRsiz, 1) != 1)
705 OJPH_ERROR(0x00050052,
"error reading SIZ marker");
706 if (file->
read(&
cptr[c].YRsiz, 1) != 1)
707 OJPH_ERROR(0x00050053,
"error reading SIZ marker");
708 if ((
cptr[c].SSiz & 0x7F) > 37)
709 OJPH_ERROR(0x00050054,
"Wrong SIZ-SSiz value of %d",
cptr[c].SSiz);
710 if (
cptr[c].XRsiz == 0)
711 OJPH_ERROR(0x00050055,
"Wrong SIZ-XRsiz value of %d",
cptr[c].XRsiz);
712 if (
cptr[c].YRsiz == 0)
713 OJPH_ERROR(0x00050056,
"Wrong SIZ-YRsiz value of %d",
cptr[c].YRsiz);
770 result &= file->
write(&buf, 2) == 2;
772 result &= file->
write(&buf, 2) == 2;
774 result &= file->
write(&buf, 4) == 4;
777 result &= file->
write(&buf, 2) == 2;
786 OJPH_ERROR(0x00050061,
"error reading CAP marker");
789 OJPH_ERROR(0x00050062,
"error reading CAP marker");
792 if (
Pcap & 0xFFFDFFFF)
794 "error Pcap in CAP has options that are not supported");
795 if ((
Pcap & 0x00020000) == 0)
797 "error Pcap should have its 15th MSB set, Pcap^15. "
798 " This is not a JPH file");
799 for (
ui32 i = 0; i < count; ++i)
801 OJPH_ERROR(0x00050065,
"error reading CAP marker");
802 if (
Lcap != 6 + 2 * count)
803 OJPH_ERROR(0x00050066,
"error in CAP marker length");
817 if (
SPcod.wavelet_trans <= 1)
821 return atk->is_reversible();
839 result &= file->
write(&buf, 2) == 2;
841 result &= file->
write(&buf, 2) == 2;
843 result &= file->
write(&buf, 1) == 1;
845 result &= file->
write(&buf, 1) == 1;
847 result &= file->
write(&buf, 2) == 2;
849 result &= file->
write(&buf, 1) == 1;
850 buf[0] =
SPcod.num_decomp;
851 buf[1] =
SPcod.block_width;
852 buf[2] =
SPcod.block_height;
853 buf[3] =
SPcod.block_style;
854 result &= file->
write(&buf, 4) == 4;
856 result &= file->
write(&buf, 1) == 1;
858 for (
int i = 0; i <=
SPcod.num_decomp; ++i)
860 *(
ui8*)buf =
SPcod.precinct_size[i];
861 result &= file->
write(&buf, 1) == 1;
888 Lcod = num_comps < 257 ? 9 : 10;
896 result &= file->
write(&buf, 2) == 2;
898 result &= file->
write(&buf, 2) == 2;
902 result &= file->
write(&buf, 1) == 1;
907 result &= file->
write(&buf, 2) == 2;
910 result &= file->
write(&buf, 1) == 1;
911 buf[0] =
SPcod.num_decomp;
912 buf[1] =
SPcod.block_width;
913 buf[2] =
SPcod.block_height;
914 buf[3] =
SPcod.block_style;
915 result &= file->
write(&buf, 4) == 4;
917 result &= file->
write(&buf, 1) == 1;
919 for (
int i = 0; i <=
SPcod.num_decomp; ++i)
921 *(
ui8*)buf =
SPcod.precinct_size[i];
922 result &= file->
write(&buf, 1) == 1;
934 OJPH_ERROR(0x00050071,
"error reading COD segment");
937 OJPH_ERROR(0x00050072,
"error reading COD segment");
938 if (file->
read(&
SGCod.prog_order, 1) != 1)
939 OJPH_ERROR(0x00050073,
"error reading COD segment");
940 if (file->
read(&
SGCod.num_layers, 2) != 2)
941 {
OJPH_ERROR(0x00050074,
"error reading COD segment"); }
945 OJPH_ERROR(0x00050075,
"error reading COD segment");
946 if (file->
read(&
SPcod.num_decomp, 1) != 1)
947 OJPH_ERROR(0x00050076,
"error reading COD segment");
948 if (file->
read(&
SPcod.block_width, 1) != 1)
949 OJPH_ERROR(0x00050077,
"error reading COD segment");
950 if (file->
read(&
SPcod.block_height, 1) != 1)
951 OJPH_ERROR(0x00050078,
"error reading COD segment");
952 if (file->
read(&
SPcod.block_style, 1) != 1)
953 OJPH_ERROR(0x00050079,
"error reading COD segment");
954 if (file->
read(&
SPcod.wavelet_trans, 1) != 1)
955 OJPH_ERROR(0x0005007A,
"error reading COD segment");
958 ||
SPcod.block_width > 8
959 ||
SPcod.block_height > 8
961 || (
SPcod.block_style & 0x40) != 0x40
962 || (
SPcod.block_style & 0xB7) != 0x00)
963 OJPH_ERROR(0x0005007D,
"wrong settings in a COD-SPcod parameter");
964 if ((
SPcod.block_style & 0x40) != 0x40
965 || (
SPcod.block_style & 0xB7) != 0x00)
966 OJPH_ERROR(0x0005007E,
"unsupported settings in a COD-SPcod parameter");
970 for (
int i = 0; i <= num_decompositions; ++i) {
971 if (file->
read(&
SPcod.precinct_size[i], 1) != 1)
972 OJPH_ERROR(0x0005007B,
"error reading COD segment");
974 if ((
SPcod.precinct_size[i] & 0x0F) == 0 ||
975 (
SPcod.precinct_size[i] >> 4) == 0)
977 "Precinct width or height for resolutions other than the"
978 " coarsest must be larger than 1; here, they are %d and %d,"
980 1 << (
SPcod.precinct_size[i] & 0x0F),
981 1 << (
SPcod.precinct_size[i] >> 4));
985 OJPH_ERROR(0x0005007C,
"error in COD segment length");
998 OJPH_ERROR(0x00050121,
"error reading COC segment");
1000 if (num_comps < 257) {
1002 if (file->
read(&t, 1) != 1)
1003 OJPH_ERROR(0x00050122,
"error reading COC segment");
1008 OJPH_ERROR(0x00050123,
"error reading COC segment");
1012 OJPH_ERROR(0x00050124,
"error reading COC segment");
1015 "Unsupported options in Scoc field of the COC segment");
1016 if (file->
read(&
SPcod.num_decomp, 1) != 1)
1017 OJPH_ERROR(0x00050125,
"error reading COC segment");
1018 if (file->
read(&
SPcod.block_width, 1) != 1)
1019 OJPH_ERROR(0x00050126,
"error reading COC segment");
1020 if (file->
read(&
SPcod.block_height, 1) != 1)
1021 OJPH_ERROR(0x00050127,
"error reading COC segment");
1022 if (file->
read(&
SPcod.block_style, 1) != 1)
1023 OJPH_ERROR(0x00050128,
"error reading COC segment");
1024 if (file->
read(&
SPcod.wavelet_trans, 1) != 1)
1025 OJPH_ERROR(0x00050129,
"error reading COC segment");
1028 ||
SPcod.block_width > 8
1029 ||
SPcod.block_height > 8
1030 ||
SPcod.block_width +
SPcod.block_height > 8
1031 || (
SPcod.block_style & 0x40) != 0x40
1032 || (
SPcod.block_style & 0xB7) != 0x00)
1033 OJPH_ERROR(0x0005012C,
"wrong settings in a COC-SPcoc parameter");
1034 if ((
SPcod.block_style & 0x40) != 0x40
1035 || (
SPcod.block_style & 0xB7) != 0x00)
1036 OJPH_ERROR(0x0005012D,
"unsupported settings in a COC-SPcoc parameter");
1040 for (
int i = 0; i <= num_decompositions; ++i) {
1041 if (file->
read(&
SPcod.precinct_size[i], 1) != 1)
1042 OJPH_ERROR(0x0005012A,
"error reading COC segment");
1044 if ((
SPcod.precinct_size[i] & 0x0F) == 0 ||
1045 (
SPcod.precinct_size[i] >> 4) == 0)
1047 "Precinct width or height for resolutions other than the"
1048 " coarsest must be larger than 1; here, they are %d and %d,"
1050 1 << (
SPcod.precinct_size[i] & 0x0F),
1051 1 << (
SPcod.precinct_size[i] >> 4));
1055 t += num_comps < 257 ? 0 : 1;
1056 t += (
Scod & 1) ? 1 + num_decompositions : 0;
1058 OJPH_ERROR(0x0005012B,
"error in COC segment length");
1065 this->atk =
atk->get_atk(
SPcod.wavelet_trans);
1066 if (this->atk == NULL)
1067 OJPH_ERROR(0x00050131,
"A COD segment employs the DWT kernel "
1068 "atk = %d, but a corresponding ATK segment cannot be found.",
1069 SPcod.wavelet_trans);
1075 OJPH_ERROR(0x00050132,
"A COC segment employs the DWT kernel "
1076 "atk = %d, but a corresponding ATK segment cannot be found",
1077 SPcod.wavelet_trans);
1110 while (p->
next != NULL)
1139 bool all_same =
true;
1140 bool other_comps_exist =
false;
1141 ui32 first_comp = 0xFFFF;
1143 ui32 num_decompositions = 0;
1145 bool is_signed =
false;
1148 for (
ui32 c = 0; c < num_comps; ++c)
1171 other_comps_exist =
true;
1176 ui32 qcd_num_decompositions;
1179 ui32 qcd_wavelet_kern;
1181 ui32 qcd_component = first_comp != 0xFFFF ? first_comp : 0;
1185 qcd_is_signed = siz.
is_signed(qcd_component);
1190 qcd_component < 3 ? employing_color_transform :
false);
1207 for (
ui32 c = 0; c < num_comps; ++c)
1226 c < 3 ? employing_color_transform :
false);
1245 else if (other_comps_exist)
1248 for (
ui32 c = 0; c < num_comps; ++c)
1259 c < 3 ? employing_color_transform :
false);
1292 bool is_employing_color_transform)
1295 B += is_employing_color_transform ? 1 : 0;
1298 ui32 X = (
ui32) ceil(log(bibo_l * bibo_l) / M_LN2);
1301 for (
ui32 d = num_decomps; d > 0; --d)
1305 X = (
ui32) ceil(log(bibo_h * bibo_l) / M_LN2);
1307 max_B_plus_X =
ojph_max(max_B_plus_X, B + X);
1309 max_B_plus_X =
ojph_max(max_B_plus_X, B + X);
1310 X = (
ui32) ceil(log(bibo_h * bibo_h) / M_LN2);
1312 max_B_plus_X =
ojph_max(max_B_plus_X, B + X);
1315 if (max_B_plus_X > 38)
1316 OJPH_ERROR(0x00050151,
"The specified combination of bit_depth, "
1317 "colour transform, and type of wavelet transform requires more than "
1318 "38 bits; it requires %d bits. This is beyond what is allowed in "
1319 "the JPEG2000 image coding format.", max_B_plus_X);
1322 Sqcd = (
ui8)(guard_bits << 5);
1326 for (
ui32 d = num_decomps; d > 0; --d)
1341 Sqcd = (
ui8)((guard_bits<<5)|0x2);
1344 float delta_b =
base_delta / (gain_l * gain_l);
1345 int exp = 0, mantissa;
1346 while (delta_b < 1.0f)
1347 { exp++; delta_b *= 2.0f; }
1350 mantissa = (int)round(delta_b * (
float)(1<<11)) - (1<<11);
1351 mantissa = mantissa < (1<<11) ? mantissa : 0x7FF;
1352 SPqcd.u16[s++] = (
ui16)((exp << 11) | mantissa);
1353 for (
ui32 d = num_decomps; d > 0; --d)
1360 int exp = 0, mantissa;
1361 while (delta_b < 1.0f)
1362 { exp++; delta_b *= 2.0f; }
1363 mantissa = (int)round(delta_b * (
float)(1<<11)) - (1<<11);
1364 mantissa = mantissa < (1<<11) ? mantissa : 0x7FF;
1365 SPqcd.u16[s++] = (
ui16)((exp << 11) | mantissa);
1366 SPqcd.u16[s++] = (
ui16)((exp << 11) | mantissa);
1372 { exp++; delta_b *= 2.0f; }
1373 mantissa = (int)round(delta_b * (
float)(1<<11)) - (1<<11);
1374 mantissa = mantissa < (1<<11) ? mantissa : 0x7FF;
1375 SPqcd.u16[s++] = (
ui16)((exp << 11) | mantissa);
1391 int irrev = p->
Sqcd & 0x1F;
1398 else if (irrev == 2)
1401 ui32 nb = num_decomps - (i ? (i - 1) / 3 : 0);
1416 ui32 num_decompositions,
ui32 comp_num,
1419 float arr[] = { 1.0f, 2.0f, 2.0f, 4.0f };
1420 if ((
Sqcd & 0x1F) != 2)
1421 OJPH_ERROR(0x00050101,
"There is something wrong in the configuration "
1422 "of the codestream; for component %d, the codestream defines an "
1423 "irreversible transform, for which the codestream provides a "
1424 "reversible (no quantization) step sizes in Sqcd/Sqcc.", comp_num);
1427 if (dfs != NULL && dfs->
exists())
1432 OJPH_INFO(0x00050101,
"Trying to access quantization step size for "
1433 "subband %d when the QCD/QCC marker segment specifies "
1434 "quantization step sizes for %d subbands only. To continue "
1435 "decoding, we are using the step size for subband %d, which can "
1436 "produce incorrect results",
1440 int eps =
SPqcd.u16[idx] >> 11;
1442 mantissa = (float)((
SPqcd.u16[idx] & 0x7FF) | 0x800) * arr[
subband];
1443 mantissa /= (float)(1 << 11);
1444 mantissa /= (float)(1u << eps);
1455 if (
main->is_employing_color_transform() &&
comp_idx < 3)
1457 for (
ui32 i = 0; i < 3; ++i) {
1470 return precision + 1 + 1;
1484 if (dfs != NULL && dfs->
exists())
1489 OJPH_INFO(0x00050111,
"Trying to access quantization step size for "
1490 "subband %d when the QCD/QCC marker segment specifies "
1491 "quantization step sizes for %d subbands only. To continue "
1492 "decoding, we are using the step size for subband %d, which can "
1493 "produce incorrect results",
1498 int irrev =
Sqcd & 0x1F;
1503 num_bits = num_bits == 0 ? 0 : num_bits - 1;
1505 else if (irrev == 1)
1507 else if (irrev == 2)
1508 num_bits = (
SPqcd.u16[idx] >> 11) - 1;
1518 int irrev =
Sqcd & 0x1F;
1524 num_bits =
ojph_max(num_bits, t == 0 ? 0 : t - 1);
1527 else if (irrev == 1)
1529 else if (irrev == 2)
1545 int irrev =
Sqcd & 0x1F;
1551 else if (irrev == 2)
1561 result &= file->
write(&buf, 2) == 2;
1563 result &= file->
write(&buf, 2) == 2;
1565 result &= file->
write(&buf, 1) == 1;
1571 result &= file->
write(&buf, 1) == 1;
1573 else if (irrev == 2)
1577 result &= file->
write(&buf, 2) == 2;
1603 int irrev =
Sqcd & 0x1F;
1606 Lqcd = (
ui16)(4 + (num_comps < 257 ? 0 : 1));
1609 else if (irrev == 2)
1619 result &= file->
write(&buf, 2) == 2;
1621 result &= file->
write(&buf, 2) == 2;
1622 if (num_comps < 257)
1625 result &= file->
write(&buf, 1) == 1;
1630 result &= file->
write(&buf, 2) == 2;
1633 result &= file->
write(&buf, 1) == 1;
1638 result &= file->
write(&buf, 1) == 1;
1640 else if (irrev == 2)
1644 result &= file->
write(&buf, 2) == 2;
1669 OJPH_ERROR(0x00050081,
"error reading QCD marker");
1672 OJPH_ERROR(0x00050082,
"error reading QCD marker");
1673 if ((
Sqcd & 0x1F) == 0)
1677 OJPH_ERROR(0x0005008A,
"QCD marker segment that specifies no "
1678 "quantization informtion");
1680 OJPH_ERROR(0x00050083,
"wrong Lqcd value of %d in QCD marker",
Lqcd);
1683 OJPH_ERROR(0x00050084,
"error reading QCD marker");
1685 else if ((
Sqcd & 0x1F) == 1)
1689 "Scalar derived quantization is not supported yet in QCD marker");
1691 OJPH_ERROR(0x00050085,
"wrong Lqcd value in QCD marker");
1693 else if ((
Sqcd & 0x1F) == 2)
1697 OJPH_ERROR(0x0005008B,
"QCD marker segment that specifies no "
1698 "quantization informtion");
1700 OJPH_ERROR(0x00050086,
"wrong Lqcd value of %d in QCD marker",
Lqcd);
1704 OJPH_ERROR(0x00050087,
"error reading QCD marker");
1709 OJPH_ERROR(0x00050088,
"wrong Sqcd value in QCD marker");
1716 OJPH_ERROR(0x000500A1,
"error reading QCC marker");
1718 if (num_comps < 257)
1721 if (file->
read(&v, 1) != 1)
1722 OJPH_ERROR(0x000500A2,
"error reading QCC marker");
1728 OJPH_ERROR(0x000500A3,
"error reading QCC marker");
1732 OJPH_ERROR(0x000500A4,
"error reading QCC marker");
1733 ui32 offset = num_comps < 257 ? 4 : 5;
1734 if ((
Sqcd & 0x1F) == 0)
1738 OJPH_ERROR(0x000500AC,
"QCC marker segment that specifies no "
1739 "quantization informtion");
1741 OJPH_ERROR(0x000500A5,
"wrong Lqcd value of %d in QCC marker",
Lqcd);
1744 OJPH_ERROR(0x000500A6,
"error reading QCC marker");
1746 else if ((
Sqcd & 0x1F) == 1)
1750 "Scalar derived quantization is not supported yet in QCC marker");
1752 OJPH_ERROR(0x000500A7,
"wrong Lqcc value in QCC marker");
1754 else if ((
Sqcd & 0x1F) == 2)
1758 OJPH_ERROR(0x000500AD,
"QCC marker segment that specifies no "
1759 "quantization informtion");
1761 OJPH_ERROR(0x000500A8,
"wrong Lqcc value of %d in QCC marker",
Lqcd);
1765 OJPH_ERROR(0x000500A9,
"error reading QCC marker");
1770 OJPH_ERROR(0x000500AA,
"wrong Sqcc value in QCC marker");
1801 while (p->
next != NULL)
1828 if (this->
enabled && this->
Tnlt == nonlinearity::OJPH_NLT_NO_NLT)
1832 this->
Tnlt == nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT)
1834 bool all_same =
true;
1842 bool is_signed =
false;
1843 for (
ui32 c = 0; c < num_comps; ++c)
1852 all_same = all_same && (is_signed == siz.
is_signed(c));
1868 if (all_same && bit_depth != 0)
1870 this->
BDnlt = (
ui8)(bit_depth - 1);
1876 for (
ui32 c = 0; c < num_comps; ++c)
1884 p->
Tnlt = nonlinearity::OJPH_NLT_BINARY_COMPLEMENT_NLT;
1894 for (
ui32 c = 0; c < num_comps; ++c)
1916 OJPH_ERROR(0x00050171,
"Nonliearities other than type 0 "
1917 "(No Nonlinearity) or type 3 (Binary Binary Complement to Sign "
1918 "Magnitude Conversion) are not supported yet");
1929 bool& is_signed,
ui8& nl_type)
const
1931 assert(
Cnlt == special_comp_num::ALL_COMPS);
1933 p = (p && p->
enabled) ? p :
this;
1936 bit_depth = (
ui8)((p->
BDnlt & 0x7F) + 1);
1937 bit_depth = bit_depth <= 38 ? bit_depth : 38;
1938 is_signed = (p->
BDnlt & 0x80) == 0x80;
1960 result &= file->
write(&buf, 2) == 2;
1962 result &= file->
write(&buf, 2) == 2;
1964 result &= file->
write(&buf, 2) == 2;
1966 result &= file->
write(&p->
Tnlt, 1) == 1;
1978 if (file->
read(buf, 6) != 6)
1979 OJPH_ERROR(0x00050141,
"error reading NLT marker segment");
1982 if (length != 6 || (buf[5] != 3 && buf[5] != 0))
1983 OJPH_ERROR(0x00050142,
"Unsupported NLT type %d\n", buf[5]);
2008 while (p && p->
Cnlt != comp_num)
2016 assert(comp_num != special_comp_num::ALL_COMPS);
2017 assert(
Cnlt == special_comp_num::ALL_COMPS);
2019 while (p->
next != NULL) {
2020 assert(p->
Cnlt != comp_num);
2041 while (p && p->
enabled ==
false)
2053 OJPH_INFO(0x00050161,
"The NLT marker segment for the "
2054 "non-existing component %d has been removed.", p->
Cnlt);
2075 this->
Psot = payload_len + 14;
2079 result &= file->
write(&buf, 2) == 2;
2081 result &= file->
write(&buf, 2) == 2;
2083 result &= file->
write(&buf, 2) == 2;
2085 result &= file->
write(&buf, 4) == 4;
2101 result &= file->
write(&buf, 2) == 2;
2103 result &= file->
write(&buf, 2) == 2;
2105 result &= file->
write(&buf, 2) == 2;
2107 result &= file->
write(&buf, 4) == 4;
2121 OJPH_INFO(0x00050091,
"error reading SOT marker");
2128 OJPH_INFO(0x00050092,
"error in SOT length");
2134 OJPH_INFO(0x00050093,
"error reading tile index");
2141 OJPH_INFO(0x00050094,
"tile index in SOT marker cannot be 0xFFFF");
2147 OJPH_INFO(0x00050095,
"error reading SOT marker");
2154 OJPH_INFO(0x00050096,
"error reading SOT marker");
2160 OJPH_INFO(0x00050097,
"error reading SOT marker");
2168 OJPH_ERROR(0x00050091,
"error reading SOT marker");
2171 OJPH_ERROR(0x00050092,
"error in SOT length");
2173 OJPH_ERROR(0x00050093,
"error reading SOT tile index");
2176 OJPH_ERROR(0x00050094,
"tile index in SOT marker cannot be 0xFFFF");
2178 OJPH_ERROR(0x00050095,
"error reading SOT marker");
2181 OJPH_ERROR(0x00050096,
"error reading SOT marker");
2183 OJPH_ERROR(0x00050097,
"error reading SOT marker");
2200 OJPH_ERROR(0x000500B1,
"Trying to allocate more than 65535 bytes for "
2201 "a TLM marker; this can be resolved by having more than "
2202 "one TLM marker, but the code does not support this. "
2203 "In any case, this limit means that we have 10922 "
2204 "tileparts or more, which is a huge number.");
2230 result &= file->
write(&buf, 2) == 2;
2232 result &= file->
write(&buf, 2) == 2;
2238 result &= file->
write(&buf, 2) == 2;
2240 result &= file->
write(&buf, 4) == 4;
2257 while (p && p->
Sdfs != index)
2266 ui32 d = decomp_level - 1;
2268 ui32 bits = d & 0x3;
2269 ui32 val = (
Ddfs[idx] >> (6 - 2 * bits)) & 0x3;
2280 ui32 ns[4] = { 0, 3, 1, 1 };
2302 ui32 decomp_level = 1;
2303 while (skipped_resolutions > 0)
2307 { factor.
x *= 2; factor.
y *= 2; }
2314 --skipped_resolutions;
2324 while (p->
next != NULL)
2335 return p->
read(file);
2339 OJPH_ERROR(0x000500D1,
"error reading DFS-Ldfs parameter");
2342 OJPH_ERROR(0x000500D2,
"error reading DFS-Sdfs parameter");
2345 OJPH_ERROR(0x000500D3,
"The DFS-Sdfs parameter is %d, which is "
2346 "larger than the permissible 15",
Sdfs);
2348 if (file->
read(&l_Ids, 1) != 1)
2349 OJPH_ERROR(0x000500D4,
"error reading DFS-Ids parameter");
2352 "The value of the Ids member in the DFS marker segment cannot be 0");
2353 constexpr int max_Ddfs =
sizeof(
Ddfs) * 4;
2354 if (l_Ids > max_Ddfs)
2355 OJPH_INFO(0x000500D5,
"The DFS-Ids parameter is %d; while this is "
2356 "valid, the number is unnessarily large -- you do not need more "
2357 "than %d. Please contact me regarding this issue.",
2359 Ids = l_Ids < max_Ddfs ? l_Ids : max_Ddfs;
2360 for (
int i = 0; i <
Ids; i += 4)
2361 if (file->
read(&
Ddfs[i / 4], 1) != 1)
2362 OJPH_ERROR(0x000500D6,
"error reading DFS-Ddfs parameters");
2363 for (
int i =
Ids; i < l_Ids; i += 4)
2364 if (file->
read(&t, 1) != 1)
2365 OJPH_ERROR(0x000500D7,
"error reading DFS-Ddfs parameters");
2388 if (index == 0) { this->
init_irv97();
return this; }
2389 else if (index == 1) { this->
init_rev53();
return this; }
2396 if (p == NULL && (index == 0 || index == 1))
2403 else if (index == 1)
2414 if (coeff_type == 0) {
2416 if (file->
read(&v, 1) != 1)
return false;
2420 else if (coeff_type == 1) {
2422 if (file->
read(&v, 2) != 2)
return false;
2426 else if (coeff_type == 2) {
2431 if (file->
read(&v.i, 4) != 4)
return false;
2436 else if (coeff_type == 3) {
2441 if (file->
read(&v.i, 8) != 8)
return false;
2446 else if (coeff_type == 4) {
2448 if (file->
read(&v, 8) != 8)
return false;
2450 if (file->
read(&v1, 8) != 8)
return false;
2461 si32 e = (
si32)((v >> 48) & 0x7FFF);
2467 s.i |= ((
ui32)(v >> 32) & 0x80000000);
2469 s.i |= (
ui32)((v >> 25) & 0x007FFFFF);
2480 if (coeff_type == 0) {
2482 if (file->
read(&v, 1) != 1)
return false;
2486 else if (coeff_type == 1) {
2488 if (file->
read(&v, 2) != 2)
return false;
2504 OJPH_ERROR(0x000500E1,
"error reading ATK-Latk parameter");
2508 if (file->
read(&temp_Satk, 2) != 2)
2509 OJPH_ERROR(0x000500E2,
"error reading ATK-Satk parameter");
2512 int tmp_idx = temp_Satk & 0xFF;
2514 || tmp_idx == 0 || tmp_idx == 1)
2515 OJPH_ERROR(0x000500F3,
"ATK-Satk parameter sets ATK marker index to "
2516 "the illegal value of %d. ATK-Satk should be in (2-255) and, I "
2517 "believe, must not be repeated; otherwise, it would be unclear "
2518 "what marker segment must be employed when an index is repeated.",
2522 OJPH_ERROR(0x000500E3,
"ATK-Satk parameter sets m_init to 1, "
2523 "requiring odd-indexed subsequence in first reconstruction step, "
2524 "which is not supported yet.");
2526 OJPH_ERROR(0x000500E4,
"ATK-Satk parameter specified ARB filter, "
2527 "which is not supported yet.");
2529 OJPH_ERROR(0x000500E5,
"ATK-Satk parameter does not make sense. "
2530 "It employs floats with reversible filtering.");
2532 OJPH_ERROR(0x000500E6,
"ATK-Satk parameter requires constant "
2533 "boundary extension, which is not supported yet.");
2536 OJPH_ERROR(0x000500E7,
"error reading ATK-Katk parameter");
2538 OJPH_ERROR(0x000500E8,
"error reading ATK-Natk parameter");
2549 for (
int s = 0; s <
Natk; ++s)
2551 if (file->
read(&
d[s].rev.Eatk, 1) != 1)
2552 OJPH_ERROR(0x000500E9,
"error reading ATK-Eatk parameter");
2554 if (file->
read(&
d[s].rev.Batk, 2) != 2)
2555 OJPH_ERROR(0x000500EA,
"error reading ATK-Batk parameter");
2559 if (file->
read(&LCatk, 1) != 1)
2560 OJPH_ERROR(0x000500EB,
"error reading ATK-LCatk parameter");
2563 OJPH_ERROR(0x000500EC,
"Encountered a ATK-LCatk value of zero; "
2564 "something is wrong.");
2566 OJPH_ERROR(0x000500ED,
"ATK-LCatk value greater than 1; "
2567 "that is, a multitap filter is not supported");
2569 OJPH_ERROR(0x000500EE,
"Error reding ATK-Aatk parameter");
2574 for (
int s = 0; s <
Natk; ++s)
2577 if (file->
read(&LCatk, 1) != 1)
2578 OJPH_ERROR(0x000500EF,
"error reading ATK-LCatk parameter");
2581 OJPH_ERROR(0x000500F0,
"Encountered a ATK-LCatk value of zero; "
2582 "something is wrong.");
2584 OJPH_ERROR(0x000500F1,
"ATK-LCatk value greater than 1; "
2585 "that is, a multitap filter is not supported.");
2587 OJPH_ERROR(0x000500F2,
"Error reding ATK-Aatk parameter");
2591 OJPH_ERROR(0x000500F3,
"The length of an ATK marker segment "
2592 "(ATK-Latk) is not correct");
2601 Katk = (float)1.230174104914001;
2605 d[0].irv.Aatk = (float)0.443506852043971;
2606 d[1].irv.Aatk = (float)0.882911075530934;
2607 d[2].irv.Aatk = (float)-0.052980118572961;
2608 d[3].irv.Aatk = (float)-1.586134342059924;
2631 while (p->
next != NULL)
virtual size_t read(void *ptr, size_t size)=0
static const float gain_5x3_l[34]
static float get_bibo_gain_l(ui32 num_decomp, bool reversible)
static const float gain_5x3_h[34]
static float get_bibo_gain_h(ui32 num_decomp, bool reversible)
static const float gain_9x7_h[34]
static const float gain_9x7_l[34]
static const float gain_5x3_l[34]
static const float gain_5x3_h[34]
static float get_gain_l(ui32 num_decomp, bool reversible)
static const float gain_9x7_l[34]
static float get_gain_h(ui32 num_decomp, bool reversible)
static const float gain_9x7_h[34]
virtual size_t write(const void *ptr, size_t size)=0
bool is_reversible() const
void set_precinct_size(int num_levels, size *precinct_size)
size get_block_dims() const
void set_reversible(bool reversible)
size get_precinct_size(ui32 level_num) const
ui32 get_num_decompositions() const
size get_log_block_dims() const
size get_log_precinct_size(ui32 level_num) const
void set_num_decomposition(ui32 num_decompositions)
bool get_block_vertical_causality() const
void set_block_dims(ui32 width, ui32 height)
size get_block_dims() const
int get_progression_order() const
bool is_using_color_transform() const
param_coc get_coc(ui32 component_idx)
void set_num_decomposition(ui32 num_decompositions)
ui32 get_num_decompositions() const
size get_log_block_dims() const
bool packets_may_use_sop() const
size get_precinct_size(ui32 level_num) const
const char * get_progression_order_as_string() const
void set_precinct_size(int num_levels, size *precinct_size)
bool packets_use_eph() const
bool is_reversible() const
void set_progression_order(const char *name)
bool get_block_vertical_causality() const
void set_block_dims(ui32 width, ui32 height)
size get_log_precinct_size(ui32 level_num) const
int get_num_layers() const
void set_color_transform(bool color_transform)
void set_reversible(bool reversible)
@ OJPH_NLT_BINARY_COMPLEMENT_NLT
bool get_nonlinear_transform(ui32 comp_num, ui8 &bit_depth, bool &is_signed, ui8 &nl_type) const
get the nonlinearity type associated with comp_num, which should be one from enum nonlinearity
void set_nonlinear_transform(ui32 comp_num, ui8 nl_type)
enables or disables type 3 nonlinearity for a component or the default setting
void set_irrev_quant(float delta)
Set the irreversible quantization base delta.
void set_tile_size(size s)
point get_image_extent() const
void set_component(ui32 comp_num, const point &downsampling, ui32 bit_depth, bool is_signed)
void set_num_components(ui32 num_comps)
ui32 get_bit_depth(ui32 comp_num) const
void set_tile_offset(point offset)
point get_image_offset() const
void set_image_offset(point offset)
size get_tile_size() const
ui32 get_recon_height(ui32 comp_num) const
point get_downsampling(ui32 comp_num) const
void set_image_extent(point extent)
point get_tile_offset() const
ui32 get_recon_width(ui32 comp_num) const
bool is_signed(ui32 comp_num) const
ui32 get_num_components() const
static ui16 swap_bytes_if_le(ui16 t)
const char OJPH_PO_STRING_PCRL[]
static ui32 population_count(ui32 val)
const char OJPH_PO_STRING_RLCP[]
const char OJPH_PO_STRING_RPCL[]
const char OJPH_PO_STRING_CPRL[]
static ui32 count_leading_zeros(ui32 val)
const char OJPH_PO_STRING_LRCP[]
int main(int argc, char *argv[])
#define ojph_div_ceil(a, b)
#define OJPH_INFO(t,...)
MACROs to insert file and line number for info, warning, and error.
#define OJPH_ERROR(t,...)
bool read_coefficient(infile_base *file, float &K, si32 &bytes)
void init(param_atk *top_atk)
bool is_reversible() const
bool read(infile_base *file)
int get_coeff_type() const
param_atk * get_atk(int index)
bool is_whole_sample() const
bool is_using_ws_extension() const
void read(infile_base *file)
bool write(outfile_base *file)
bool write(outfile_base *file)
const param_cod * get_coc(ui32 comp_idx) const
bool internal_write_coc(outfile_base *file, ui32 num_comps)
ui16 get_dfs_index() const
bool write_coc(outfile_base *file, ui32 num_comps)
bool is_employing_color_transform() const
ui32 get_comp_idx() const
void read(infile_base *file)
void init(param_cod *top_cod, ui16 comp_idx)
void read_coc(infile_base *file, ui32 num_comps, param_cod *top_cod)
void update_atk(param_atk *atk)
bool is_dfs_defined() const
ui8 get_num_decompositions() const
bool is_reversible() const
param_cod(param_cod *top_cod=NULL, ui16 comp_idx=OJPH_COD_DEFAULT)
ui8 get_wavelet_kern() const
param_cod * add_coc_object(ui32 comp_idx)
bool read(infile_base *file)
dfs_dwt_type get_dwt_type(ui32 decomp_level) const
point get_res_downsamp(ui32 skipped_resolutions) const
ui32 get_subband_idx(ui32 num_decompositions, ui32 resolution, ui32 subband) const
const param_dfs * get_dfs(int index) const
bool write(outfile_base *file) const
param_nlt * add_object(ui32 comp_num)
void trim_non_existing_components(ui32 num_comps)
void read(infile_base *file)
ojph::param_nlt::nonlinearity nonlinearity
bool get_nonlinear_transform(ui32 comp_num, ui8 &bit_depth, bool &is_signed, ui8 &nl_type) const
const param_nlt * get_nlt_object(ui32 comp_num) const
void check_validity(param_siz &siz)
bool is_any_enabled() const
void set_nonlinear_transform(ui32 comp_num, ui8 nl_type)
ui8 encode_SPqcd(ui8 v) const
bool write_qcc(outfile_base *file, ui32 num_comps)
float get_irrev_delta(const param_dfs *dfs, ui32 num_decompositions, ui32 comp_num, ui32 resolution, ui32 subband) const
void set_rev_quant(ui32 num_decomps, ui32 bit_depth, bool is_employing_color_transform)
void set_irrev_quant(ui32 num_decomps)
ui32 get_largest_Kmax() const
ui32 get_num_guard_bits() const
void set_delta(float delta)
void read_qcc(infile_base *file, ui32 num_comps)
void check_validity(const param_siz &siz, const param_cod &cod)
bool write(outfile_base *file)
ui32 propose_precision(const param_cod *cod) const
void read(infile_base *file)
void init(param_qcd *top_qcd, ui16 comp_idx)
param_qcd * add_qcc_object(ui32 comp_idx)
ui32 get_Kmax(const param_dfs *dfs, ui32 num_decompositions, ui32 resolution, ui32 subband) const
ui8 decode_SPqcd(ui8 v) const
param_qcd * get_qcc(ui32 comp_idx)
param_qcd(param_qcd *top_qcd=NULL, ui16 comp_idx=OJPH_QCD_DEFAULT)
void trim_non_existing_components(ui32 num_comps)
bool internal_write_qcc(outfile_base *file, ui32 num_comps)
union ojph::local::param_qcd::@140013103227173134364232343330020031205064137337 SPqcd
ui32 get_bit_depth(ui32 comp_num) const
bool ws_kern_support_needed
bool is_signed(ui32 comp_num) const
void set_image_offset(point offset)
bool write(outfile_base *file)
ui16 get_num_components() const
void set_tile_size(size s)
point get_recon_downsampling(ui32 comp_num) const
void set_Rsiz_flag(ui16 flag)
point get_recon_size(ui32 comp_num) const
void set_tile_offset(point offset)
void read(infile_base *file)
void set_num_components(ui32 num_comps)
bool read(infile_base *file, bool resilient)
bool write(outfile_base *file, ui32 payload_len)
void set_next_pair(ui16 Ttlm, ui32 Ptlm)
bool write(outfile_base *file)
void init(ui32 num_pairs, Ttlm_Ptlm_pair *store)