Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

JPEG on NIOS II

Altera_Forum
Honored Contributor II
2,216 Views

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
0 Kudos
14 Replies
Altera_Forum
Honored Contributor II
1,385 Views

use IJG jpeglib library (www.ijg.org), most software is based around this decoder. It's highly portable in that it literally takes a few minutes to port to a new target (should run straight out of the box!) and it's free - only rule is you have to put a small copyright notice somewhere (i.e documentation). In the past I've used it on various consoles, Playstation 1 & dreamcast without any effort. 

 

Adrian
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

Agree with Adrian's assertion about the freeware decoders. What is really cool is doing some HW acceleration to make it go faster :-) My guess is that a DCT would be necessary or something similar. If you do such a thing please post the result, I know a lot of people who are interested in such things!

0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

That sounds like a fun project, I'm trying to do something like that at home. 

 

My processor will probably be the size of 5 NIOS II processors but that&#39;s ok http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif  

 

I&#39;m going for a quad vector architecture so that I can work on the video in 2x2 blocks. 

 

and adac, are you a console developer?
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

Hi guys I’ve been trying to compile the jpeg source code for the NIOS II Linux Distro, but I’ve caught a snag. It seems that the libc.a that I have gives a compiler error. Now I am completely new to this cross-compiling thing so maybe I’m doing something wrong, or just missing something. But the source compiles flawlessly wit the gcc that came with the Windows NT update.  

 

Here is the ./configure output 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

checking for gcc... gcc 

checking whether the C compiler (gcc  ) works... yes 

checking whether the C compiler (gcc  ) is a cross-compiler... no 

checking whether we are using GNU C... egrep: not found 

no 

checking how to run the C preprocessor... gcc -E 

checking for function prototypes... yes 

checking for stddef.h... yes 

checking for stdlib.h... yes 

checking for string.h... yes 

checking for size_t... yes 

checking for type unsigned char... yes 

checking for type unsigned short... yes 

checking for type void... yes 

checking for working const... yes 

checking for inline... __inline__ 

checking for broken incomplete types... ok 

checking for short external names... ok 

checking to see if char is signed... yes 

checking to see if right shift is signed... yes 

checking to see if fopen accepts b spec... yes 

checking for a BSD compatible install... /bin/install -c 

checking for ranlib... ranlib 

checking libjpeg version number... 62 

creating ./config.status 

creating Makefile 

creating jconfig.h 

jconfig.h is unchanged[/b] 

--- Quote End ---  

 

 

Then I edit the Makefile and change the CC option from gcc to nios2-elf-gcc. 

Next I run nios2-elf-make. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

nios2-elf-gcc -O  -I. -c -o jcapistd.o jcapistd.c 

nios2-elf-gcc -O  -I. -c -o jctrans.o jctrans.c 

nios2-elf-gcc -O  -I. -c -o jcparam.o jcparam.c 

nios2-elf-gcc -O  -I. -c -o jdatadst.o jdatadst.c 

nios2-elf-gcc -O  -I. -c -o jcinit.o jcinit.c 

nios2-elf-gcc -O  -I. -c -o jcmaster.o jcmaster.c 

nios2-elf-gcc -O  -I. -c -o jcmarker.o jcmarker.c 

nios2-elf-gcc -O  -I. -c -o jcmainct.o jcmainct.c 

nios2-elf-gcc -O  -I. -c -o jcprepct.o jcprepct.c 

nios2-elf-gcc -O  -I. -c -o jccoefct.o jccoefct.c 

nios2-elf-gcc -O  -I. -c -o jccolor.o jccolor.c 

nios2-elf-gcc -O  -I. -c -o jcsample.o jcsample.c 

nios2-elf-gcc -O  -I. -c -o jchuff.o jchuff.c 

nios2-elf-gcc -O  -I. -c -o jcphuff.o jcphuff.c 

 

nios2-elf-gcc -O  -I. -c -o jcdctmgr.o jcdctmgr.c 

nios2-elf-gcc -O  -I. -c -o jfdctfst.o jfdctfst.c 

nios2-elf-gcc -O  -I. -c -o jfdctflt.o jfdctflt.c 

nios2-elf-gcc -O  -I. -c -o jfdctint.o jfdctint.c 

nios2-elf-gcc -O  -I. -c -o jdapimin.o jdapimin.c 

nios2-elf-gcc -O  -I. -c -o jdapistd.o jdapistd.c 

nios2-elf-gcc -O  -I. -c -o jdtrans.o jdtrans.c 

nios2-elf-gcc -O  -I. -c -o jdatasrc.o jdatasrc.c 

nios2-elf-gcc -O  -I. -c -o jdmaster.o jdmaster.c 

nios2-elf-gcc -O  -I. -c -o jdinput.o jdinput.c 

nios2-elf-gcc -O  -I. -c -o jdmarker.o jdmarker.c 

nios2-elf-gcc -O  -I. -c -o jdhuff.o jdhuff.c 

nios2-elf-gcc -O  -I. -c -o jdphuff.o jdphuff.c 

nios2-elf-gcc -O  -I. -c -o jdmainct.o jdmainct.c 

nios2-elf-gcc -O  -I. -c -o jdcoefct.o jdcoefct.c 

nios2-elf-gcc -O  -I. -c -o jdpostct.o jdpostct.c 

nios2-elf-gcc -O  -I. -c -o jddctmgr.o jddctmgr.c 

nios2-elf-gcc -O  -I. -c -o jidctfst.o jidctfst.c 

nios2-elf-gcc -O  -I. -c -o jidctflt.o jidctflt.c 

nios2-elf-gcc -O  -I. -c -o jidctint.o jidctint.c 

nios2-elf-gcc -O  -I. -c -o jidctred.o jidctred.c 

nios2-elf-gcc -O  -I. -c -o jdsample.o jdsample.c 

nios2-elf-gcc -O  -I. -c -o jdcolor.o jdcolor.c 

nios2-elf-gcc -O  -I. -c -o jquant1.o jquant1.c 

nios2-elf-gcc -O  -I. -c -o jquant2.o jquant2.c 

nios2-elf-gcc -O  -I. -c -o jdmerge.o jdmerge.c 

nios2-elf-gcc -O  -I. -c -o jcomapi.o jcomapi.c 

nios2-elf-gcc -O  -I. -c -o jutils.o jutils.c 

nios2-elf-gcc -O  -I. -c -o jerror.o jerror.c 

nios2-elf-gcc -O  -I. -c -o jmemmgr.o jmemmgr.c 

nios2-elf-gcc -O  -I. -c -o jmemnobs.o jmemnobs.c 

rm -f libjpeg.a 

ar rc libjpeg.a  jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o j 

cmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsample.o jchuf 

f.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimin.o jdapistd.o 

jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct 

.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o 

jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomapi.o jutils.o jerror.o j 

memmgr.o jmemnobs.o 

ranlib libjpeg.a 

nios2-elf-gcc -O  -I. -c -o cjpeg.o cjpeg.c 

nios2-elf-gcc -O  -I. -c -o rdppm.o rdppm.c 

nios2-elf-gcc -O  -I. -c -o rdgif.o rdgif.c 

nios2-elf-gcc -O  -I. -c -o rdtarga.o rdtarga.c 

nios2-elf-gcc -O  -I. -c -o rdrle.o rdrle.c 

nios2-elf-gcc -O  -I. -c -o rdbmp.o rdbmp.c 

nios2-elf-gcc -O  -I. -c -o rdswitch.o rdswitch.c 

nios2-elf-gcc -O  -I. -c -o cdjpeg.o cdjpeg.c 

nios2-elf-gcc  -o cjpeg cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswit 

ch.o cdjpeg.o libjpeg.a 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(closer.o): In function `_c 

lose_r&#39;: 

closer.o(.text+0x20): warning: _close is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(fstatr.o): In function `_f 

stat_r&#39;: 

fstatr.o(.text+0x28): warning: _fstat is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(makebuf.o): In function `_ 

_smakebuf&#39;: 

makebuf.o(.text+0xf8): warning: isatty is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(lseekr.o): In function `_l 

seek_r&#39;: 

lseekr.o(.text+0x2c): warning: _lseek is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(openr.o): In function `_op 

en_r&#39;: 

openr.o(.text+0x2c): warning: _open is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(readr.o): In function `_re 

ad_r&#39;: 

readr.o(.text+0x2c): warning: _read is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(writer.o): In function `_w 

rite_r&#39;: 

writer.o(.text+0x2c): warning: _write is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(getenv_r.o): In function ` 

_findenv_r&#39;: 

getenv_r.o(.text+0x34): undefined reference to `__env_lock&#39; 

getenv_r.o(.text+0xb8): undefined reference to `__env_unlock&#39; 

getenv_r.o(.text+0x100): undefined reference to `__env_unlock&#39; 

collect2: ld returned 1 exit status 

nios2-elf-make: *** [cjpeg] Error 1[/b] 

--- Quote End ---  

 

 

How do I regenerate libc.a? Is that even where the problem is? Is there another way to compile the jpeg source for the NIOS II Linux distro?  

 

MORE INFO: 

JPEG source version : 6b 

gcc version: 2.95.3-5 (cygwin special) 

nios2-elf-gcc version: 3.3.3 (Altera Nios II 1.0 b316)
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

 

--- Quote Start ---  

originally posted by janhendrik@Aug 18 2004, 11:49 AM 

hi guys i’ve been trying to compile the jpeg source code for the nios ii linux distro, but i’ve caught a snag. it seems that the libc.a that i have gives a compiler error. now i am completely new to this cross-compiling thing so maybe i’m doing something wrong, or just missing something. but the source compiles flawlessly wit the gcc that came with the windows nt update.  

 

here is the ./configure output 

<div class='quotetop'>quote  

--- quote end ---  

 

--- quote start ---  

 

checking for gcc... gcc 

checking whether the c compiler (gcc  ) works... yes 

checking whether the c compiler (gcc  ) is a cross-compiler... no 

checking whether we are using gnu c... egrep: not found 

no 

checking how to run the c preprocessor... gcc -e 

checking for function prototypes... yes 

checking for stddef.h... yes 

checking for stdlib.h... yes 

checking for string.h... yes 

checking for size_t... yes 

checking for type unsigned char... yes 

checking for type unsigned short... yes 

checking for type void... yes 

checking for working const... yes 

checking for inline... __inline__ 

checking for broken incomplete types... ok 

checking for short external names... ok 

checking to see if char is signed... yes 

checking to see if right shift is signed... yes 

checking to see if fopen accepts b spec... yes 

checking for a bsd compatible install... /bin/install -c 

checking for ranlib... ranlib 

checking libjpeg version number... 62 

creating ./config.status 

creating makefile 

creating jconfig.h 

jconfig.h is unchanged 

--- Quote End ---  

 

 

Then I edit the Makefile and change the CC option from gcc to nios2-elf-gcc. 

Next I run nios2-elf-make. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

nios2-elf-gcc -O  -I. -c -o jcapistd.o jcapistd.c 

nios2-elf-gcc -O  -I. -c -o jctrans.o jctrans.c 

nios2-elf-gcc -O  -I. -c -o jcparam.o jcparam.c 

nios2-elf-gcc -O  -I. -c -o jdatadst.o jdatadst.c 

nios2-elf-gcc -O  -I. -c -o jcinit.o jcinit.c 

nios2-elf-gcc -O  -I. -c -o jcmaster.o jcmaster.c 

nios2-elf-gcc -O  -I. -c -o jcmarker.o jcmarker.c 

nios2-elf-gcc -O  -I. -c -o jcmainct.o jcmainct.c 

nios2-elf-gcc -O  -I. -c -o jcprepct.o jcprepct.c 

nios2-elf-gcc -O  -I. -c -o jccoefct.o jccoefct.c 

nios2-elf-gcc -O  -I. -c -o jccolor.o jccolor.c 

nios2-elf-gcc -O  -I. -c -o jcsample.o jcsample.c 

nios2-elf-gcc -O  -I. -c -o jchuff.o jchuff.c 

nios2-elf-gcc -O  -I. -c -o jcphuff.o jcphuff.c 

 

nios2-elf-gcc -O  -I. -c -o jcdctmgr.o jcdctmgr.c 

nios2-elf-gcc -O  -I. -c -o jfdctfst.o jfdctfst.c 

nios2-elf-gcc -O  -I. -c -o jfdctflt.o jfdctflt.c 

nios2-elf-gcc -O  -I. -c -o jfdctint.o jfdctint.c 

nios2-elf-gcc -O  -I. -c -o jdapimin.o jdapimin.c 

nios2-elf-gcc -O  -I. -c -o jdapistd.o jdapistd.c 

nios2-elf-gcc -O  -I. -c -o jdtrans.o jdtrans.c 

nios2-elf-gcc -O  -I. -c -o jdatasrc.o jdatasrc.c 

nios2-elf-gcc -O  -I. -c -o jdmaster.o jdmaster.c 

nios2-elf-gcc -O  -I. -c -o jdinput.o jdinput.c 

nios2-elf-gcc -O  -I. -c -o jdmarker.o jdmarker.c 

nios2-elf-gcc -O  -I. -c -o jdhuff.o jdhuff.c 

nios2-elf-gcc -O  -I. -c -o jdphuff.o jdphuff.c 

nios2-elf-gcc -O  -I. -c -o jdmainct.o jdmainct.c 

nios2-elf-gcc -O  -I. -c -o jdcoefct.o jdcoefct.c 

nios2-elf-gcc -O  -I. -c -o jdpostct.o jdpostct.c 

nios2-elf-gcc -O  -I. -c -o jddctmgr.o jddctmgr.c 

nios2-elf-gcc -O  -I. -c -o jidctfst.o jidctfst.c 

nios2-elf-gcc -O  -I. -c -o jidctflt.o jidctflt.c 

nios2-elf-gcc -O  -I. -c -o jidctint.o jidctint.c 

nios2-elf-gcc -O  -I. -c -o jidctred.o jidctred.c 

nios2-elf-gcc -O  -I. -c -o jdsample.o jdsample.c 

nios2-elf-gcc -O  -I. -c -o jdcolor.o jdcolor.c 

nios2-elf-gcc -O  -I. -c -o jquant1.o jquant1.c 

nios2-elf-gcc -O  -I. -c -o jquant2.o jquant2.c 

nios2-elf-gcc -O  -I. -c -o jdmerge.o jdmerge.c 

nios2-elf-gcc -O  -I. -c -o jcomapi.o jcomapi.c 

nios2-elf-gcc -O  -I. -c -o jutils.o jutils.c 

nios2-elf-gcc -O  -I. -c -o jerror.o jerror.c 

nios2-elf-gcc -O  -I. -c -o jmemmgr.o jmemmgr.c 

nios2-elf-gcc -O  -I. -c -o jmemnobs.o jmemnobs.c 

rm -f libjpeg.a 

ar rc libjpeg.a  jcapimin.o jcapistd.o jctrans.o jcparam.o jdatadst.o jcinit.o j 

cmaster.o jcmarker.o jcmainct.o jcprepct.o jccoefct.o jccolor.o jcsample.o jchuf 

f.o jcphuff.o jcdctmgr.o jfdctfst.o jfdctflt.o jfdctint.o jdapimin.o jdapistd.o 

jdtrans.o jdatasrc.o jdmaster.o jdinput.o jdmarker.o jdhuff.o jdphuff.o jdmainct 

.o jdcoefct.o jdpostct.o jddctmgr.o jidctfst.o jidctflt.o jidctint.o jidctred.o 

jdsample.o jdcolor.o jquant1.o jquant2.o jdmerge.o jcomapi.o jutils.o jerror.o j 

memmgr.o jmemnobs.o 

ranlib libjpeg.a 

nios2-elf-gcc -O  -I. -c -o cjpeg.o cjpeg.c 

nios2-elf-gcc -O  -I. -c -o rdppm.o rdppm.c 

nios2-elf-gcc -O  -I. -c -o rdgif.o rdgif.c 

nios2-elf-gcc -O  -I. -c -o rdtarga.o rdtarga.c 

nios2-elf-gcc -O  -I. -c -o rdrle.o rdrle.c 

nios2-elf-gcc -O  -I. -c -o rdbmp.o rdbmp.c 

nios2-elf-gcc -O  -I. -c -o rdswitch.o rdswitch.c 

nios2-elf-gcc -O  -I. -c -o cdjpeg.o cdjpeg.c 

nios2-elf-gcc  -o cjpeg cjpeg.o rdppm.o rdgif.o rdtarga.o rdrle.o rdbmp.o rdswit 

ch.o cdjpeg.o libjpeg.a 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(closer.o): In function `_c 

lose_r&#39;: 

closer.o(.text+0x20): warning: _close is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(fstatr.o): In function `_f 

stat_r&#39;: 

fstatr.o(.text+0x28): warning: _fstat is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(makebuf.o): In function `_ 

_smakebuf&#39;: 

makebuf.o(.text+0xf8): warning: isatty is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(lseekr.o): In function `_l 

seek_r&#39;: 

lseekr.o(.text+0x2c): warning: _lseek is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(openr.o): In function `_op 

en_r&#39;: 

openr.o(.text+0x2c): warning: _open is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(readr.o): In function `_re 

ad_r&#39;: 

readr.o(.text+0x2c): warning: _read is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(writer.o): In function `_w 

rite_r&#39;: 

writer.o(.text+0x2c): warning: _write is not implemented and will always fail 

/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc 

-lib/nios2-elf/3.3.3/../../../../nios2-elf/lib/libc.a(getenv_r.o): In function ` 

_findenv_r&#39;: 

getenv_r.o(.text+0x34): undefined reference to `__env_lock&#39; 

getenv_r.o(.text+0xb8): undefined reference to `__env_unlock&#39; 

getenv_r.o(.text+0x100): undefined reference to `__env_unlock&#39; 

collect2: ld returned 1 exit status 

nios2-elf-make: *** [cjpeg] Error 1[/b] 

--- Quote End ---  

 

 

How do I regenerate libc.a? Is that even where the problem is? Is there another way to compile the jpeg source for the NIOS II Linux distro?  

 

MORE INFO: 

JPEG source version : 6b 

gcc version: 2.95.3-5 (cygwin special) 

nios2-elf-gcc version: 3.3.3 (Altera Nios II 1.0 b316) [/b] 

--- Quote End ---  

 

it looks like the library compiled with the PC compiler. I think you&#39;ll need to force the cc & library tools to be the nios2-elf ones. 

 

Adrian
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

TO_BE_DONE

0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

Ok, I see now that you used ./configure which configued for a PC version but then changed the generated makefile. 

 

The library looks like it built ok and it&#39;s only the sample applications that don&#39;t work, they&#39;re using filing system functions which don&#39;t look like they&#39;re implemented in the nios library. If the jpeg library has been built with support for these functions then you&#39;ll need to disable that support. Good place to look is in jconfig.h to see what options are enabled when the library is built. 

 

All you do is use the nios functions to read the file into memory, then use: 

 

jpeg_create_decompress 

 

jpeg_read_header 

 

jpeg_start_decompress 

 

[loop] jpeg_read_scanlines 

 

jpeg_finish_decompress 

 

jpeg_destroy_compress 

 

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. 

 

Adrian
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

you might also be better off using makefile.ansi as a starting point rather than auto-configuring from the host system. 

 

Adrian
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

Hi Adrian, 

 

Thaks for the help.  

You mention a sample,<div class='quotetop'>QUOTE </div> 

--- 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.[/b] 

--- 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
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

 

--- 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 ---  

 

jpeg sample, but as far as I can remember with the library you can get away with the only "dependancy" being malloc/free. 

 

I posted the commands that I have here (on a windows app) that decodes an image, I can&#39;t post the whole code because although I wrote it, it&#39;s not mine to post - but the code is not that much larger than the outline I posted before, if you read the documentation with the library you&#39;ll be able to figure it out. 

 

Although my code here is for windows, as mentioned before I&#39;ve implemented this before on other non wintel systems without any problems. I&#39;ve got some of my own code possibly at home, if I can find it and dig it out then I&#39;ll post it - don&#39;t hold your breath though, it&#39;s most likely on one of my many deathstar drivers. 

 

Adrian
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

 

--- 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
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

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**
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

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)
0 Kudos
Altera_Forum
Honored Contributor II
1,385 Views

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.
0 Kudos
Reply