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