forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fopen/open vs sceIoOpen vs libjpeg

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
willow :--)



Joined: 13 Jan 2007
Posts: 126

PostPosted: Sun May 04, 2008 12:38 am    Post subject: fopen/open vs sceIoOpen vs libjpeg Reply with quote

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
View user's profile Send private message
CpuWhiz



Joined: 04 Jun 2007
Posts: 42

PostPosted: Sun May 04, 2008 1:56 am    Post subject: Reply with quote

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
View user's profile Send private message
willow :--)



Joined: 13 Jan 2007
Posts: 126

PostPosted: Sun May 04, 2008 11:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group