Forum Discussion
Altera_Forum
Honored Contributor
15 years agoUnderstanding Polyphase Scaler Taps
Hi, I am trying to understand the significance and effect of the number of taps in the polyphase filter. What does increasing the number of taps do to the scaling result? What is the differenc...
Altera_Forum
Honored Contributor
15 years agoHi Kieron,
Thanks for the reply! I have read the VIP user manual recommendation, but wanted to know why and what was happening "behind the scenes". I have been playing around with an 8-tap filter and various coefficient sets and I think I understand the process better now. For downscaling, where you want the anti-aliasing filter, the Lanczos-2 coefficients seems to provide good quality. But I do not agree 100% with the way Altera (and the UDX4 software) calculates the coefficients for the 8-tap filter. Altera does it as follows: C(k) = lanczos2(k/2+p), where lanczos2(x)=sinc(pi*x)*sinc(pi*x/2) and k is the tap [-3..3] and p in the phase fraction [0..15/16]. The effect is a Lanczos-2 filter spread across the interval [-3..3], but which is shifted across two taps by the phase increment. See the attached figure Altera_Lanczos2_8tap.jpg for a picture of phase 0 and phase 15. As far as I understand, the phase increments should shift the coefficients between a single pair of taps (pixels). Maybe for downscaling this does not matter since the Lanczos-2 already filters image, but if you use this for up-scaling, the results are terrible. See the attached file Altera_upscale_result.jpg. Note the extreme "blockiness" (also note the picture is a photo taken of the LCD screen with a camera - hence noisy background as you see the individual pixels on the screen). I have compiled my own set of coefficients with the following function: C(k) = lanczos2((k+p)/2) See the attached file Custom_Lanczos2_8tap.jpg. The phase is shifted by one tap and not by two taps. For downscaling I cannot see a difference between my coefficients and the Altera coefficients. For upscaling, my coefficients produce a much better result (filtered, as expected). See Custom_upscale_result.jpg. For equal and up-scaling I am using a Lanczos-4 8-tap coefficients (since I already have an 8-tap filter, might as well use it). See Lanczos4_8tap.jpg. This has a phase 0 coefficient set with only one non-zero tap, so if the input and output resolution are the same, there is no change to the video and the up-scaled video is sharper than with the 8-tap Lanczos2. I do not have bicubic coefficients (does anybody maybe have a set of bicubic coefficients I could try?). Would you expect a bicubic filter to give better results than the Lanczos-4, 8tap filter? Currently my system automatically switches between the two sets of coefficients (My custom Lanczos2 for downscaling, Lanczos4 for equal and upscaling). Sorry for the long posting! Regards, Niki