Some optimizations. Match finding is the major bottleneck of the encoder.