| View previous topic :: View next topic |
| Author |
Message |
willow :--)
Joined: 13 Jan 2007 Posts: 126
|
Posted: Sun May 04, 2008 12:38 am Post subject: fopen/open vs sceIoOpen vs libjpeg |
|
|
I am using libjpeg.h in order to load lots of files.
The standard functions of libjpeg expect a FILE *.
for example the one I am currently using :
| Code: | | jpeg_stdio_src(&cinfo, fp); |
However I've read several times that it is preferred (for performance reasons) to use sceIoOpen rather than fopen when opening files...
However sceIoOpen returns as sceUID object, not a FILE *
What are my options ? Which one do you think is the best ?
- Should I use fopen anyways and not care about speed to much ?
- Is there a modified libjpeg for the PSP ? if so, where is it ? (where did the svn go ?)
- I saw an attempt to read a jpeg from memory rather than a file. Unfortunately the code doing this had a memory leak and is not usable currently. Do somebody know a way to do simply read a jpeg from memory rather than a file, using libjpeg ?
- Any other trick that I should know about ? Any easy way to convert a SceUID into a FILE * or something ?
Thanks in advance for your answers. |
|
| Back to top |
|
 |
CpuWhiz
Joined: 04 Jun 2007 Posts: 42
|
Posted: Sun May 04, 2008 1:56 am Post subject: |
|
|
The SVN is still there:
| Code: | | svn co svn://svn.ps2dev.org/psp/trunk/jpeg |
If you look at jpeg_stdio_src in jdatasrc.c, I am sure you can get an idea of how to create a set of functions and fill your cinfo to get it reading any way you like (memory, file, network stream, whatever you like). I'm just not sure if it's worth your time. I have not benchmarked the two, but if it's working I would move on to something else. If when you go back to optimize it's really bogging things down, then I would look into fixing it. |
|
| Back to top |
|
 |
willow :--)
Joined: 13 Jan 2007 Posts: 126
|
Posted: Sun May 04, 2008 11:30 am Post subject: |
|
|
Thanks, that answers my questions. I should rather focus on the rest of my project, then optimize when (if) it is complete and working.
And thanks for the svn. Apparently the Web interface disappeared, and I didn't even try with a standard svn client. |
|
| Back to top |
|
 |
|