Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

JPEG on NIOS II

Does anyone know how to display JPEGs on the Lancelot VGA daughter card on a NIOS II system? Is there a freely available jpeg component? Could one use the Linux jpeg libraries? Any ideas?

I want to load a jpeg from network share (or send it from a host PC) , decode it to a memory space and then DMA the image to the Lancelot ( which is basically a 3 x 8bit video DAC with H & V sync pins)

Any suggestions

Thanks everyone

14 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    originally posted by janhendrik@Aug 20 2004, 06:34 AM

    hi adrian,

    thaks for the help.

    you mention a sample,<div class='quotetop'>quote

    --- quote end ---

    --- quote start ---

    you&#39;ll need to create a source manager to handle the requests from the jpeg decompressor for memory, but it&#39;s all very trivial. i think there&#39;s a basic sample somewhere and you should be able to figure out exactly what you need.

    --- Quote End ---

    Is it a NIOS II sample or one of the JPEG samples. I&#39;d like to get the decoder to work and then perhaps try to implement a hardware DCT/inverse DCT.

    Thanks again.

    Jan Hendrik [/b]

    --- Quote End ---

    Did you want to do the DCT/IDCT yourself? (I think I saw a free opencore on the altera site for doing this).

    Cheers
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks BadOmen,

    I&#39;ll go and have a look-see, If there is a free core for dct/Idct then I would rather use that, I&#39;d just like to use "hardware accelaration" to speed things up http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif

    **Wondering how fast I can decode 800x600x16bit jpeg. On cylone with NIOS II core/f**
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi janhendrik,

    Here is an sample result of JPEG decoding on Nios II. No Hardware Acceleration.

    I have only Stratix Edition, so -mno-hw-mul option is used to near to Cyclone.

    -- Hardware --

    Nios Dev Board : Stratix edition

    SOPC config : based on standard32

    Nios II /f , ic 4k, dc 8k, hw-div enabled

    VGA controller added(original)

    Frecuency : SOPC core : 90MHz

    VGA dot frec : 40MHz

    VGA config : 800x600x16

    -- Software --

    OS : none (HAL)

    JPEG Decoder : modified "JPEGLS" library. I got from Japanese WEB site. (You may find "jpegls mona" on Google if you read Japanese...). This library uses Divide operation.# I tryed to use IJG source code before. Compiling was passed but it did not work correctly. I give up. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif

    JPEG Image file : "Sunset.jpeg (800x600)". WindowsXP may include this sample image. JPEG Image is put to ROZIPFS, so this file access might be overhead.

    -- Result --

    Compile Options : Clocks : Time@90MHz

    (1) -O2 -mno-hw-mul : 3,198M : 35[s]

    (2) -O2 : 1,280M : 14[s]

    (3) -O2 -mhw-div : 327M : 3.6[s]

    I think the result of Cyclone may slower than (1). Because Nios II on Cyclone can not have Barrel Shifter. I&#39;m not sure -mno-hw-mul disable Barrel Shift or not.

    I hope the info helps.

    p.s.

    for More faster JPEG decoding, I think I need to do ...

    - eliminate divide operation

    - SIMD custom instruction

    - Hardware DCT/IDCT

    - Hardware color conversion (YUV-RGB)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Koma,

    Thaks a lot for the info. It took longer than I thought it would, but then again its only @90Mhz not 2.4Ghz http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif

    I&#39;ll have a google for "jpegls mona" because I still cant compile all the JPEG source from ijp.org. I will (soon) try to write my own decoder based on adac&#39;s advice, and when I&#39;m done I&#39;ll post the results here some where.

    Thanks for eveybody&#39;s guidance and support.