Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

image downscaling - confused about storing the data

Status
Not open for further replies.

serhannn

Member level 4
Joined
Sep 28, 2010
Messages
69
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,939
Hi,

I'm trying to downscale a stream of frames from 1920*1080 to 1920*540. I'm reading the RGB values from a text file and I use a sinc-filter for downscaling (actually the algorithm for the filter was given to me, I'm just implementing it.) In order to calculate the RGB values of a pixel for the downscaled version, the filter makes use of the pixels of the previous and next two lines in the frame, so I need to access these pixels in those lines to do the operation. My question is: Should I first read the whole from the text file into a block ram and then do the downscaling or should I do both at the same time? Also, should I keep 3 different block rams for R,G,B values each (10 bits each, 30 bits in total) ? What would be the most logical and optimized way?
To give an example, the algorithm says that in order to calculate the RGB values of the pixel (200,400) [height,width] , I have to access RGB info in pixels (398,400),(399,400),(400,400),(401,400),(402,400). Then I accumulate these values and divide by 16 (which is the sum of the coeff.s of the sinc-filter), which gives me the R,G,B values, respectively, of a certain pixel. Should these pixel be already stored in the block ram at the beginning of the downscaling operation, or should I store only 5 lines of pixels, changing the data every time I pass to a new line? What are your suggestions?

I'd appreciate your help. Thank you.
 

TrickyDicky

Advanced Member level 5
Joined
Jun 7, 2010
Messages
7,048
Helped
2,070
Reputation
4,157
Reaction score
2,023
Trophy points
1,393
Activity points
38,894
this should be easily calculated in real time. You'll need only 4 line delay memories, as you can do the filter as you're reading the source material. Lacency through the filter will be 4 lines.
 

smraise

Junior Member level 1
Joined
Nov 2, 2009
Messages
15
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,283
Location
uk
Activity points
1,435
Hmm i would suggest to read the erosion methods in real time image processing
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top