Revert "don't leak the bitmap filter"

This reverts commit f37f63100ff0160c51efc2a68881013bf0c760b7.
Fix two build issues:

  - clamp_max is still used, add it back
  - Remove extranneous #endif