Welcome, Unregistered.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Reply
Old 28-Nov-2005, 20:38   #1
CMAN
Member
 
Join Date: Mar 2004
Location: St Louey
Posts: 620
Default Senior Project Help

This isn't 3D related, so I'll put it in here.

For my senior project I'm trying to adapt JPEG-LS for use in a digital camera. The biggest downfall to using JPEG-LS in a digital camera is the buffer requirements for the process. Since there is a predictor step, I'd need to be able to buffer up to two lines. My biggest headache is how to not need to buffer two entire lines since I only need 4 pixels for each individual pixel. For example)

c b d
a x

x is the current pixel being predicted and the other letters are the other pixels I need in relation to the current pixel. This allows me to detect horizontal and verticle lines and find smoothness.

Anyone have any ideas?
__________________
Bikes or Computer? What to do with my refund check...
CMAN is offline   Reply With Quote
Old 28-Nov-2005, 21:21   #2
Geo
Mostly Harmless
 
Join Date: Apr 2002
Location: Uffda-land
Posts: 9,156
Send a message via MSN to Geo
Default

I think you might have done better to put this in 3d arch and coding, with an apology for it being somewhat off-topic --at least there the "right people" would be sure to see it. You could put "Somewhat off-topic" in the subject line and hope Neeyik is feeling expansive that day. Holiday season and all. . .
__________________
"We'll thrash them --absolutely thrash them."--Richard Huddy on Larrabee
"Our multi-decade old 3D graphics rendering architecture that's based on a rasterization approach is no longer scalable and suitable for the demands of the future." --Pat Gelsinger, Intel
". . .its taking us longer than we would have liked to get a [Crossfire game] profiling system out there" --Terry Makedon, ATI, July 2006
"Christ, this is Beyond3D; just get rid of any f**ker talking about patterned chihuahuas! Can the dog write GLSL? No. Then it can f**k off." --Da Boss
Geo is offline   Reply With Quote
Old 28-Nov-2005, 21:28   #3
RussSchultz
Professional Malcontent
 
Join Date: Feb 2002
Location: HTTP 404
Posts: 2,855
Default

Just wondering, why would you not be able to buffer two full lines? Almost all still digital cameras have multiple megs of SDRAM available.

Granted, any optimization is good, but I think based on the way a CCD is read, you're going to be stuck having to get the full lines in succession.
__________________
Sigmatel, R.I.P.
Me[X-------:--------]You
RussSchultz is offline   Reply With Quote
Old 29-Nov-2005, 01:14   #4
CMAN
Member
 
Join Date: Mar 2004
Location: St Louey
Posts: 620
Default can someone move this to 3D arch and coding?

I think I'm going to try a streaming type system where instead of sending the entire rows it would only request a matrix of size 2xN. This would reduce the internal memory necessary by a good deal and not require another cache just for the DSP.

The downfall to the approach is going to be increased bandwidth needed (2x since the same data will need to be sent to the DSP twice) for the same performance, and the existing cache will need to hold each row until the next one is processed.

I'm going to help account for the increased bandwidth by pre-caching the next matrix while the current matrix is being calculated. And I can optimize for individual systems by increasing the matrix size until the time necessary to transer the next matrix equals the time necessary to complete the current calculations up to the point where the memory is full with the two matrixes.

Does this sound like a good plan?

And can someone move this to 3D arch and coding?
__________________
Bikes or Computer? What to do with my refund check...
CMAN is offline   Reply With Quote
Old 29-Nov-2005, 01:15   #5
CMAN
Member
 
Join Date: Mar 2004
Location: St Louey
Posts: 620
Default

Quote:
Originally Posted by RussSchultz
Just wondering, why would you not be able to buffer two full lines? Almost all still digital cameras have multiple megs of SDRAM available.

Granted, any optimization is good, but I think based on the way a CCD is read, you're going to be stuck having to get the full lines in succession.
I'm trying to not need to use the existing buffer so that it doesn't affect other operations on the camera. Basically it wouldn't change too much existing structures.
__________________
Bikes or Computer? What to do with my refund check...
CMAN is offline   Reply With Quote
Old 29-Nov-2005, 08:32   #6
Captain Chickenpants
Regular
 
Join Date: Feb 2002
Location: Kings Langley
Posts: 446
Default

Hmm, I will firstly confess I don't know anything about Jpeg-LS. But looking at your example and making some big assumptions you should only need to actually buffer one line.


I am assuming that one you have worked out a prediction for x you will subtract it from the actual value X to get 'X and that it is 'X that you store.

CBD
Ax

You have got CBD buffered. Once x has been predicted you can discard C, read X into the location that just became free by discarding C and do your subtraction.
So you would only need a buffer of width+1.

Or am I missing something?

CC
__________________
Flickr
Captain Chickenpants is offline   Reply With Quote
Old 29-Nov-2005, 10:55   #7
pcchen
Moderator
 
Join Date: Feb 2002
Location: Taiwan
Posts: 2,348
Default

As Captain Chickenpants said, I think one row plus some additional storage is enough.

Consider this:

1 2 3 4 5 6 7 8 9 ...

is the buffered row. A temp variable a for storing the first pixel of next row. The second pixel is loaded into a "current pixel" variable called x.

Now, with 1, 2, 3, and a, the prediction of x can be handled. Now, replace 1 with a, and put the original x into a, and proceed to the next pixel. This time, after prediction, replace 2 with a, and put x into a, and so on. After the row is completed, the buffer will contain the second row.
pcchen is offline   Reply With Quote
Old 29-Nov-2005, 11:12   #8
Guden Oden
Senior Member
 
Join Date: Dec 2003
Posts: 6,201
Default

Sorry for not adding to the topic, but which digital camera(s) are open to be reprogrammed by the user, and how is that accomplished really? Has someone reverse-engineered the hardware or something?
__________________
Top one reason why capital punishment is immoral and wrong:
You can release an innocently convicted man from jail,
but you cannot release an innocently convicted man from death.
Guden Oden is offline   Reply With Quote
Old 29-Nov-2005, 12:11   #9
Captain Chickenpants
Regular
 
Join Date: Feb 2002
Location: Kings Langley
Posts: 446
Default

Hmm, just been thinking about this a little more.

Are you reading directly from a ccd?
If so then I think you will need to do demosaicing, white balance, gamma, saturation, sharpending etc as well as jpeg compression.

Demosaicing will probably require at least 3 lines of data, as will sharpending.

CC
__________________
Flickr
Captain Chickenpants is offline   Reply With Quote
Old 29-Nov-2005, 17:48   #10
CMAN
Member
 
Join Date: Mar 2004
Location: St Louey
Posts: 620
Default

Right now we are just going to simulate the process for a proof of concept idea. Therefore we are going to be reading from a file on a computer into a DSP and back into a computer (possibly modulated by the first DSP and then sending the signal to another DSP which we might use to demoudlate and decode then save).

We are not reverse engineering anything, just simulating a digital camera at the moment to see if it could work. We are also going to try to ignore CBD and see how it works (it may not), and try Peano scran rather than a raster scan to see if that could work.
__________________
Bikes or Computer? What to do with my refund check...
CMAN is offline   Reply With Quote
Old 29-Nov-2005, 23:02   #11
CMAN
Member
 
Join Date: Mar 2004
Location: St Louey
Posts: 620
Default

Quote:
Originally Posted by Captain Chickenpants
Hmm, just been thinking about this a little more.

Are you reading directly from a ccd?
If so then I think you will need to do demosaicing, white balance, gamma, saturation, sharpending etc as well as jpeg compression.

Demosaicing will probably require at least 3 lines of data, as will sharpending.

CC
Thanks! Do you have a link handy that shows a block diagram and or white pages for the above processes?
__________________
Bikes or Computer? What to do with my refund check...
CMAN is offline   Reply With Quote
Old 30-Nov-2005, 09:28   #12
Captain Chickenpants
Regular
 
Join Date: Feb 2002
Location: Kings Langley
Posts: 446
Default

Some general links.

Demosaicing stuff.
http://research.microsoft.com/users/...emosaicing.pdf
http://www.cs.huji.ac.il/~werman/Pap...nts_icip04.pdf


Color temperature/ white balance stuff
http://www.nationmaster.com/encyclop...or-temperature

Hue, saturation, brightness and contrast can all (I beleive)be done with 4x4 matrix transforms. Which you should be able to concatenate into a single matrix. The site below has the transforms for hue/sat and brightness, I think that contrast should be a simple scaling transform
http://www.sgi.com/misc/grafica/matrix/


General color stuff
http://www.efg2.com/Lab/Library/Color/Science.htm
http://akvis.com/en/articles/index.php

Sharpening.
http://www.engr.panam.edu/~caharlow/...dgeEnhance.pdf


Not sure on the best order for doing things, apart from sharpening last.
__________________
Flickr
Captain Chickenpants is offline   Reply With Quote
Old 30-Nov-2005, 10:06   #13
Snyder
Member
 
Join Date: Feb 2002
Location: Vienna, Austria
Posts: 582
Default

Quote:
Originally Posted by Guden Oden
Sorry for not adding to the topic, but which digital camera(s) are open to be reprogrammed by the user, and how is that accomplished really? Has someone reverse-engineered the hardware or something?
Sorry as well for being slightly off-topic, but take a look here for example:
http://digita.mame.net/

(Is there any system out there mame hasn't been ported to? )
Snyder is offline   Reply With Quote
Old 01-Dec-2005, 01:28   #14
CMAN
Member
 
Join Date: Mar 2004
Location: St Louey
Posts: 620
Default

Thanks Chickenpants!
__________________
Bikes or Computer? What to do with my refund check...
CMAN is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:07.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.