decoder.py
def decode_ACs_progressive_first_per_block(self, ACht, block, Ss, Se, Al, length_EOB_run):
        """the first scan of successive approximation or spectral selection only"""
        # this is a EOB
        if length_EOB_run > 0:
            return length_EOB_run - 1

        idx = Ss
        while idx <= Se:
            symbol = self.read_huffman_symbol(ACht)
            RUNLENGTH, SIZE = symbol >> 4, symbol % (2**4)

            if SIZE == 0:
                if RUNLENGTH == 15: # ZRL(15,0)
                    idx += 16
                else: # EOBn, n=0-14
                    return self.read_n_bits(RUNLENGTH, False) + (2**RUNLENGTH) - 1
            else:
                idx += RUNLENGTH
                block[idx] = self.read_n_bits(SIZE) << Al
                idx += 1
        return 0
the first scan of successive approximation or spectral selection only
the first scan of successive approximation or spectral selection only
the first scan of successive approximation or spectral selection only
def decode_ACs_progressive_first_per_block(self, ACht, block, Ss, Se, Al, length_EOB_run):
        if length_EOB_run > 0:
            return length_EOB_run - 1
        idx = Ss
        while idx <= Se:
            symbol = self.read_huffman_symbol(ACht)
            RUNLENGTH, SIZE = symbol >> 4, symbol % (2**4)
            if SIZE == 0:
                if RUNLENGTH == 15: 
                    idx += 16
                else: 
                    return self.read_n_bits(RUNLENGTH, False) + (2**RUNLENGTH) - 1
            else:
                idx += RUNLENGTH
                block[idx] = self.read_n_bits(SIZE) << Al
                idx += 1
        return 0
def decode_ACs_progressive_first_per_block ( self , ACht , block , Ss , Se , Al , length_EOB_run ) : if length_EOB_run > 0 : return length_EOB_run - 1 idx = Ss while idx <= Se : symbol = self . read_huffman_symbol ( ACht ) RUNLENGTH , SIZE = symbol >> 4 , symbol % ( 2 ** 4 ) if SIZE == 0 : if RUNLENGTH == 15 : idx += 16 else : return self . read_n_bits ( RUNLENGTH , False ) + ( 2 ** RUNLENGTH ) - 1 else : idx += RUNLENGTH block [ idx ] = self . read_n_bits ( SIZE ) << Al idx += 1 return 0
the first scan of successive approximation or spectral selection only
the first scan of successive approximation or spectral selection only
"""the first scan of successive approximation or spectral selection only""" # this is a EOB
 # ZRL(15,0)
 # EOBn, n=0-14

self
ACht
block
Ss
Se
Al
length_EOB_run