Feature #85

720p support/1080i support

Added by foft about 1 month ago. Updated 4 days ago.

In Progress
Start date:
Due date:
% Done:



Implement 720p60 and 720p50 support, with suitable scaling

723978_FULLTEXT01.pdf - Scaling algo paper (8.72 MB) foft, 12/20/2019 09:50 PM


#1 Updated by foft about 1 month ago

  • Status changed from New to In Progress

HDMI syncs with 74.25MHz pixel clock. Cyclone V seems surprisingly happy with 742MHz gpio outputs via DDR registers.

#2 Updated by foft about 1 month ago

Experimented with filter based scaling. Going with an area based scaler for now instead.

#3 Updated by foft about 1 month ago

Great paper on scaling algos

#4 Updated by foft about 1 month ago

I wrote some octave scripts to try these out. Plugging mister filters in for one set and for the other set doing area scaling with a bunch of different optimization options.

#5 Updated by foft about 1 month ago

All the methods seem to need a bunch of multipliers, but fortunately we have some on Cyclone V. 25 DSP blocks on A2 and 66 DSP blocks on A4.
Each DSP block can be 3 9x9, 2 18x18 or 1 27x27 multiplier.
Only using a few already so they are mostly free.

#6 Updated by foft about 1 month ago

I guess 1080i is also possible.
Want to note that for 720p60 I need to adjust the frame rate again. Was using 59.94 for the 27MHz option and here its 60.

I wonder if I can get the fractional pll to give an accurate enough 27MHz and 74.25MHz at the same time?

#7 Updated by foft about 1 month ago

I implemented winscale and am debugging it!

It seems to work except I have some vertical stripes. I think this is because its actually down-scaling for the x axis (4x 1/2 colour clock width to 1280). While the attached paper says I can downscale up to 50% I think this is incorrect! Since the target pixel will overlap 3 source pixels even if the target pixel is even slightly wider than the source pixel.

#8 Updated by foft 26 days ago

  • Subject changed from 720p support to 720p support/1080i support

#9 Updated by foft 26 days ago

The scaler is looking very nice now, a few border/locations bugs to fix.

Looking at the plls, need to have: 27MHz, 135MHz, 74.25MHz and 371.25MHz at the same time. This looks to be possible by feeding 54MHz from the USB pll to the HDMI pll.

It looks like 74.25 will also work for 1080i, so may as well enable that too.
Speaking of other modes, with these two clocks can also support:
1440x576i@50 (also 288 option, but not quite 50Hz)
(also 240 option, but not quite 59.94Hz)

These are probably the best fit of all, for 4x colour clock modes :-)
For 720p, 480p, 576p only sampling every other pixel at the moment, since can't downscale...
For 1080i and 1440x its either upscaling or exact.
Not that there is any software for 2x or 4x anyway!

#10 Updated by foft 26 days ago

I put in the modelines for 1080i. I need to add interlace support (different vtotal, mid line vsync etc) to the hcnt/vcnt logic. Probably will rewrite it since its not in my style at the moment (_next, _reg, integer based etc).

#11 Updated by foft 20 days ago

Plumbed in a 4x4 block of pixels so I can try out polyphasic filters too.

For now its just using a 2x2 block with the area based scale, but got some vertical bug. Stripey!

Using 16KB of block ram now, which is a bit wasteful. 360*4 pixels/line, 8 lines = 11.25KB. However, addressing is tricker. So using 2048 bytes/line.

#12 Updated by foft 20 days ago

Forgot to mention 1080i working fine as well as 720p.

I was looking at the 3d modes too, but not sure what to use those for ;-)

#13 Updated by foft 10 days ago

I have a polyphasic version working too, I think. So far I only gave it nearest neighbour coefficients. Rebuilding with Lanczos.

#14 Updated by foft 4 days ago

A weeks debugging later, this filter actually really works!

Also available in: Atom PDF