Adaptive two-step method for providing the desired visual quality for SPIHT