Polynomial fitting for period prediction in sliding-DCT-based filtering