Loading a JPEG with the ZPU

I’ve been playing around with the ZPU again, and exploring what’s needed to get such things as malloc() and rudimentary filesystem support working. By re-using the FAT filesystem code from the Minimig project’s firmware and creating a simple wrapper, I now have a complete enough system that I can load and display a JPEG file from SD card.

An image in the process of being loaded

A 640×480 JPEG currently takes approximately 39 seconds to load and display – my next project will be to explore hardware acceleration of the DCT and see how much faster this can be made.

A binary snapshot with DE1 and DE2 bitstreams, and files to go on the SD card can be found here
The source repo is tagged to match this snapshot.

4 thoughts on “Loading a JPEG with the ZPU

  1. Hello Alastair,

    First off, I want to say great work you’re doing with your FPGA projects!

    I hope you don’t mind, but I’ve taken the liberty to port some of your code to my homebrew FPGA-based board (FleaFPGA) with some additional tweaks added..

    Through our porting efforts, we noticed a problem within the vga_controller.vhd module. Color outputs were not being silenced during the blank periods.. ie:

    red ‘0’); — Fix to silence color guns
    green ‘0’); — ” ” ” ” ” ” ”
    blue ‘0’); — ” ” ” ” ” ” ”
    if currentY=vsize and currentX=16 then
    end if;

    I noticed the guns are silenced in the original .bak file on github. Makes a big difference to the multiple monitors I’ve tried here. Please disregard the above if you were already aware of it. Thanks!

    By the way. Is there a recommended means to contact you privately? Feel free to drop me an email. 🙂

    Regards Valentin Angelovski

    • Thanks for the feedback – glad you’ve found this stuff helpful, and please do feel free to port it and modify it however you wish!

      I moved the blanking out of the vga_controller module when I got my DE2 board, because the video DAC chip on the DE2 handles blanking internally. For boards that don’t have such a DAC it’s probably best either to handle blanking in the board-specific toplevel, or just use the dithering module, which also does blanking.

    • Yeah WordPress mangled that, didn’t it? I don’t know whether code tags work in comments – only one way to find out:
      if this = ‘working’ then
      mood <= good; end if; [/code] Edit: no, code tags don't work in comments. Nuts!

Leave a Reply

Your email address will not be published. Required fields are marked *