Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,484 Views

Problem with Scaler II in polyphase 422 mode

Hi, 

 

I am using Scaler II in polyphase mode with 4:2:2 video enabled and I am getting strange results. The output video is correctly scaled, but the colour is messed up. I have uploaded the Altera default Lanczos-2 coefficients (since Scaler II does not have compile time coefficients) for an 8 tap and 9 tap (16 phases) version and in both cases it looks like the chroma signals are mixed up. The output video becomes green or purple (depending on the coefficients). I am fairly sure the Scaler is correctly connected to the rest of my system, and that the problem is with the scaler, since if I put it in Linear Interpolation mode (also 4:2:2) then it works perfectly - but I want the polyphase scaler. 

 

I cannot see how the Scaler can change the colour unless it is not handling 4:2:2 correctly in polyphase mode. I have used the following parameterization: 

8 bits per symbol 

2 symbols in parallel 

1 symbol in sequence 

Run Time control with max input and output res 1920 x 1080 (scaler is used to scale up or down SD->HD or HD->SD) 

4:2:2 video data 

Polyphase 

8 (or 9) taps vertical and horizontal 

16 phases v & h 

H & V coefficients signed 

1 integer bit 

7 fraction bit 

7 fraction bits preserved (not sure what this does?) 

1 bank V & H 

Extra pipelining added 

 

Has anybody had success using the Scaler II working in polyphase mode? If so, how many taps did you use and what coefficients? I have tried both the Altera coefficients and calculating my own, with simillar results. I have also uploaded a set of coefficients where each phase was set equal to: {0,0,0,0,128,0,0,0,0} (this was for the 9 tap version). This effectively implements the nearest neighbour scaling and then it works perfectly again (albeit with low quality scaling results), so I am fairly sure my coefficient loading process works correctly.  

 

Thanks, 

Niki
0 Kudos
4 Replies
Altera_Forum
Honored Contributor I
48 Views

Hi, 

 

I have tried some more combinations and found that I can get it to work using a 4 or a 5 tap filter. In both of these cases I have used the Lanczos-2 function to generate the coefficients. It could be that I am generating the coefficients incorrectly for the 8/9 tap case. The Lanczos-2 function (f(x)) is defined over the interval [-2;2], but for the 9 tap coefficients, I need a function which is defined over [-4;4]. Should I stretch the Lanczos-2 function as follows: F'(x) = f(x/2)? According to the Altera documents, one should stretch it, but I have seen other documentation with coefficients for an 8-tap filter where the function is not stretched - it is simply used over the interval [-4; 4]. My DSP theory is severely rusted - otherwise I am sure the answer would have been obvious!  

 

Regards, 

Niki
Altera_Forum
Honored Contributor I
48 Views

Hi, 

 

I am using the Scaler II in Polyphase and it works fine. 

I am using the Altera sample code that include the Scaler_Coefficient_Generator.hpp and Scaler_Coefficient_Set.hpp files. 

 

You can try to understand this code in order to see the way they do the calculations.  

 

BR,
Altera_Forum
Honored Contributor I
48 Views

Hi, 

 

Thanks for the response! How many taps do you have in your scaler? I have looked for the Scaler_Coefficient_Generator.hpp and Scaler_Coefficient_Set.hpp files in my installation but cannot find them. From which Altera sample code did you get these files? 

 

Regards, 

Niki
Altera_Forum
Honored Contributor I
48 Views

Altera usually ships the Nios code with reference designs (eg, UDX4) or with the example design (check if the 11.0 example design has been released). 

Be aware that you must not use the Scaler I coefficients generation code with Scaler II. The slave interface has changed and there were also minor algorithmic modifications so the old coefficients will not be appropriate for the new Scaler.
Reply