code: def undo_filter_sub(filter_unit, scanline, previous, result):
      
  
      ai = 0
      # Loops starts at index fu.  Observe that the initial part
      # of the result is already filled in correctly with
      # scanline.
      for i in range(filter_unit, len(result)):
          x = scanline[i]
          a = result[ai]
          result[i] = (x + a) & 0xff
          ai += 1
docs: Undo sub filter.