FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6669 Discussions

scaler usage in run time control

Altera_Forum
Honored Contributor II
1,946 Views

I am using vip suite 9.0 and quartus 9.0 for out new project. 

 

I am able to process frames with scaler in static parameters mode there is problem with runtime controle mode.I had following issues 

 

1.I did not found any where a detailed procedure for giving the run time parameters.The vip suite pdf is very vague not detailed in this issue. 

 

2.I could not able to generate the frames using the run time control i could only process single frame that too not correctly 

 

the parameters i am giving are output width 64 and height 32 using the registers 

 

and input width and height as 32x32 using the control packet but the problem is the core is not discarding the extra data if i gave more than 1024 pixels and the output is same size as the input 

 

please help me regarding these issues 

 

Regards 

ysc
0 Kudos
16 Replies
Altera_Forum
Honored Contributor II
1,093 Views

The runtime control register map for the scaler is given on page A-19 of the user guide. The general description of avalon slave interfaces is given on page 4-14. 

 

1 - Which scaling algorithm are you using? 

2 - Are you using SoPC builder are interfacing directly to the core? 

3 -  

--- Quote Start ---  

and input width and height as 32x32 using the control packet but the problem is the core is not discarding the extra data if i gave more than 1024 pixels and the output is same size as the input 

--- Quote End ---  

 

This concerns me, why do you have "extra data". The length of the video packet should match exactly what's specified in the control packet. Where is the "extra data" coming from? Who is creating the control packets? 

 

The biggest problem I've seen so far that people have had with the VIP suite is not that the cores aren't working but that they misunderstand how the entire video system must be architected. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

I am using nearest neighbour now and i am not using SOPC.I am using my own logic. 

 

I am controlling the control packets and just gave the extra packets to check if the error recovery is working or not .I am giving the exact number of packets of video data normaly but the problems i mentioned are in that case only.
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

Can I ask what you saw or read that made you assume the scaler would simply discard any data that existed beyond the length specified in the control packet? I would be surprised if that were the case. The control packet is simply to inform the scaler of how many pixels are in each line, and how many lines there are. Using this information it can determine things like: 

- Which phase to use given a certain scaling ratio. 

- When to begin reading in the next line vs. continuing to operate on a currently buffered line. 

 

Maybe if you give the "endofpacket" signal with the 1024th pixel, the following extra pixels will be ignored. I guess I'm thinking if we lie to the scaler, we can't expect it to behave in any certain way. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

 

--- Quote Start ---  

Can I ask what you saw or read that made you assume the scaler would simply discard any data that existed beyond the length specified in the control packet? I would be surprised if that were the case. The control packet is simply to inform the scaler of how many pixels are in each line, and how many lines there are. Using this information it can determine things like: 

- Which phase to use given a certain scaling ratio. 

- When to begin reading in the next line vs. continuing to operate on a currently buffered line. 

 

Maybe if you give the "endofpacket" signal with the 1024th pixel, the following extra pixels will be ignored. I guess I'm thinking if we lie to the scaler, we can't expect it to behave in any certain way. 

 

Jake 

--- Quote End ---  

 

 

I saw the error recovery section of the used guide and understood the extra data discarding behaviour.At last i could able to solve the scaler runtime controlling problem. But still some issues are there regarding the algorithm and my kit. 

 

I had no problem using the nearest neithbour,bilinear , bicubic and polyphase upto 12 taps and 16 phases but with 12 taps and 16 phased the error led on my cyclone 3 development kit is glowing and i could not get the output. 

 

Do u have any idea regarding the phase and tap selections and their effects regarding my problem. 

 

Do u have used the deinterlacer megacore with motion adaptive algorithm,since i had some doubts regarding it.can u help me in clearing them.
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

I have used the deinterlacer in motion adaptive mode. What are your questions? 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

In my project i want to develop video system which can support upto 1920x1080 resolution and I am not using sopc builder. 

 

I want to use the deinterlacer function with 10bit input of 3 colour planed in parallel.I am using ddr2sdram for frame buffering. 

 

1.can u help me regarding the datawidth of ddr2sdram required.Avalon interface usage. 

 

2.I want to use ddr2 high performance memory controller.so how can i interface my 30bit din_data to the ddr2 controller in input 

 

3.can u help me in selecting the avalon master parameters in megawizard for efficient implementation . 

 

4.It would be great help if u had any detailed deinterlacer function application interfacing document  

 

regards  

Ysc
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

I can run the memory bandwidth calculations for you. 

1 - How wide physically is your ddr2 memory? 

2 - Are you running 1080p or just 1080i? 

3 - It would help if you gave me a description of your entire video processing path (what blocks you have and in what order). 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

1.ddr2 16 bit wide 

 

2.output resolution is 1080p 

 

3.There two paths one for sdi and another for cvbs,component,dvi,vga 

the paths will have Deinterlacer,CSC,scaler in second path and CRS and Gamma corrector if required in another path.
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

According to my calculations: 

 

You did not mention the color space you are working in. I'm going to assume 4:4:4 YCbCr. Your 16 bit wide DDR2 has a bandwidth of 10.656 Gbps if operated at 333MHz (666 data rate). Obviously the calculations change if you run it slower or faster than this. This gives you a local interface width of 64 bits using the Altera high performance controller.  

 

Here are the calculations for the MA deinterlacer. 

1 - Converting 4:4:4 1080i60 to 4:4:4 1080p60 - MA deinterlacer bandwidth is ~11.281Gbps (106% of your available bandwidth). Not enough bandwidth 

2 - Converting 4:4:4 1080i60 to 4:4:4 1080p30 - MA deinterlacer bandwidth is ~7.299Gbps (68% of your available bandwidth). 

 

The above calculations are valid for either 10bit 4:4:4 YCbCr or 10bit RGB. 

 

In 9.1, Altera is supposed to release the 4:2:2 version of the deinterlacer. So if you are doing YCbCr and you can process it in 4:2:2 

1 - Converting 1080i60 to 1080p60 results in a bandwidth of ~8Gbps or ~75% of your available bandwidth. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

Hi jake 

 

Thanks for ur reply. 

 

Can u help me in best avalon parameter selection and how to interface the ddr2 high performance controller with the deinterlacer. 

 

Regards 

ysc
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

My first recommendation is that you do the video processing path inside SoPC builder. This will make your life significantly easier. At the very least, I would do the deinterlacer and DDR2 memory in SoPC builder.  

 

The MA Deinterlacer has 5 memory masters. If you do it inside SoPC builder, it will take care of the memory arbitration for you. If you do it on your own, you'll have to write a memory arbitrator. 

 

As far as configuring the DDR2 interface in the deinterlacer: 

- Set the Avalon-MM ports width to 64 (match your local DDR2 interface). 

- Set the FIFO depths to 128 if you are using a device family that uses M4K RAM blocks. Set it to 256 if you are using a device family that uses M9K blocks (Stratix III, Stratix IV, Cyclone III, Arria II). 

- Set the burst target to 32. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

I am not using NIOS 11 can i still build the video system using SOPC. 

 

IF so can u help me with an example design using deinterlacer and ddr2sdram in SOPC(vhdl) but without NIOS 11.
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

Hi jake i had developed an system using sopc and ddr2 controller using sopc but i could not make out how to control the run time parameters of deinterlacer while using in sopc.can u help me out from this issue.

0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

What you can do is create an avalon master using the component editor. Just create it from the template without basing it on HDL code. Then when you add this component to your system, it will basically export the avalon bus out of the system and you can control it from outside. You would have had to have done something similar to get the video in and out of the system as well. 

 

Alternatively, you don't necessarily have to enable run-time control on the deinterlacer if you don't need it. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

Hi jake i tried out ur method , i had a problem i could not able to get the output from sclaler while using in runtime control. 

 

MY system with sopc consiste of test pattern in run time and scaler in runtime,i am giving the output of test patterm directly to the scaler input and external avalon mm controllers for run time controlling and exported the scaler output using avalon sink. 

 

with the system i can get the output when both test pattern and scaler are constant and when test pattern in run time controlled and scaler is constant but couldn't get the output when both are are in runtime control mode.I think the input packet to scaler might be the problem from testpattern output .can u suggest me an solution. 

 

One more question the address width is 4 bits and datawidth 16.for scaler address width 8bits and datawidth 32bits while using them in sopc but in megawizard they are address 2 bits and data 16 bits and address 2 bits and data 32 bits. why is it so and is there any thing to take care or change in adressing while using in sopc that is different than while accessing throungh custom code. 

 

regards 

ysc
0 Kudos
Altera_Forum
Honored Contributor II
1,093 Views

All addresses in SoPC builder are byte addresses. So for example, if you had a scaler located at base address 0; register 0 of the scaler would be located at address 0 but register 1 would be located at address 4. Maybe you could send me a screenshot of your SoPC system?  

 

Also, the address space of the scaler will change depending on which scaling algorithm you have selected. I think there are only 4 addresses for the bilinear and nearest neighbor algorithm but it increases for the polyphasic. 

 

Jake
0 Kudos
Reply