File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -780,19 +780,26 @@ namespace ojph {
780780 ui32
781781 param_cod::propose_precision (const param_siz* siz, ui32 comp_num) const
782782 {
783- bool employing_color_transform = is_employing_color_transform () ? 1 : 0 ;
784- bool reversible = atk->is_reversible ();
783+ if (atk->is_reversible () == false )
784+ return 32 ;
785+ else
786+ {
787+ ui32 bit_depth = 0 ;
788+ if (comp_num < 3 && is_employing_color_transform ())
789+ {
790+ for (ui32 c = 0 ; c < 3 ; ++c)
791+ bit_depth = ojph_max (bit_depth, siz->get_bit_depth (c));
792+ ++bit_depth; // colour transform needs one extra bit
793+ }
794+ else
795+ bit_depth = siz->get_bit_depth (comp_num);
785796
786- ui32 bit_depth = 32 ;
787- if (reversible) {
788- bit_depth = siz->get_bit_depth (comp_num);
789- bit_depth += comp_num < 3 ? employing_color_transform : 0 ;
790797 // 3 or 4 is how many extra bits are needed for the HH band at the
791798 // bottom most level of decomposition.
792799 bit_depth += get_num_decompositions () > 5 ? 4 : 3 ;
793- }
794800
795- return bit_depth;
801+ return bit_depth;
802+ }
796803 }
797804
798805 // ////////////////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments