rv40: rearrange loop filter functions