@@ -952,16 +952,16 @@ namespace ojph {
952952 int s = 0 ;
953953 double bibo_l = bibo_gains::get_bibo_gain_l (num_decomps, true );
954954 ui32 X = (ui32) ceil (log (bibo_l * bibo_l) / M_LN2);
955- u8_SPqcd[s++] = ( ui8)(( B + X) << reversible_SPqcd_shift );
955+ u8_SPqcd[s++] = encode_SPqcd (( ui8)(B + X));
956956 for (ui32 d = num_decomps; d > 0 ; --d)
957957 {
958958 double bibo_l = bibo_gains::get_bibo_gain_l (d, true );
959959 double bibo_h = bibo_gains::get_bibo_gain_h (d - 1 , true );
960960 X = (ui32) ceil (log (bibo_h * bibo_l) / M_LN2);
961- u8_SPqcd[s++] = ( ui8)(( B + X) << reversible_SPqcd_shift );
962- u8_SPqcd[s++] = ( ui8)(( B + X) << reversible_SPqcd_shift );
961+ u8_SPqcd[s++] = encode_SPqcd (( ui8)(B + X));
962+ u8_SPqcd[s++] = encode_SPqcd (( ui8)(B + X));
963963 X = (ui32) ceil (log (bibo_h * bibo_h) / M_LN2);
964- u8_SPqcd[s++] = ( ui8)(( B + X) << reversible_SPqcd_shift );
964+ u8_SPqcd[s++] = encode_SPqcd (( ui8)(B + X));
965965 }
966966 }
967967
@@ -1018,7 +1018,7 @@ namespace ojph {
10181018 int irrev = Sqcd & 0x1F ;
10191019 if (irrev == 0 ) // reversible
10201020 for (ui32 i = 0 ; i < num_subbands; ++i) {
1021- ui32 t = (u8_SPqcd[i] >> reversible_SPqcd_shift );
1021+ ui32 t = decode_SPqcd (u8_SPqcd[i]);
10221022 t += get_num_guard_bits () - 1u ;
10231023 B = ojph_max (B, t);
10241024 }
@@ -1093,7 +1093,7 @@ namespace ojph {
10931093 int irrev = Sqcd & 0x1F ;
10941094 if (irrev == 0 ) // reversible; this is (10.22) from the J2K book
10951095 {
1096- num_bits += u8_SPqcd[idx] >> reversible_SPqcd_shift ;
1096+ num_bits += decode_SPqcd ( u8_SPqcd[idx]) ;
10971097 num_bits = num_bits == 0 ? 0 : num_bits - 1 ;
10981098 }
10991099 else if (irrev == 1 )
0 commit comments