Hi, I used following equations for calculating resizing ratio and depending on that, output size can be calculated.
For 4 tap ow = ((iw - 7) * 256 - 32 * sph - 16) / hrsz + 1 oh = ((ih - 4) * 256 - 32 * spv - 16) / vrsz + 1 For 7 tap ow = ((iw - 7) * 256 - 64 * sph - 32) / hrsz + 1 oh = ((ih - 7) * 256 - 64 * spv - 32) / vrsz + 1 Let's say, input width is 180 and scaling ratio is 4x. Output = 180 * 4 = 720 Hrsz = 256 * 180 / 720 = 64 Now apply above equation for calculating output size. For 7 tap, Output width = ((180-7)*256 - 64 * 0 - 32) / 64 + 1 = 692 This is the final output width. With this output width, we can get the correct resizing ratio. hrsz = floor( (iw-7)*256/(ow-1) ) hrsz = floor( (180-7) * 256/ (692-1)) hrsz = floor( 64.092 ) hrsz = 64 For 4 Tap, Output width = ((180 - 7) * 256 - 32 * 0 - 16) / 64 + 1 = 691 hrsz = floor( (iw-4)*256/(ow-1) ) hrsz = floor( (180-4) * 256 / (692-1)) hrsz = floor(64.092) hrsz = 64 Thanks, Brijesh Jadav -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rafaël Carré Sent: Wednesday, September 10, 2008 8:22 PM To: Syed Mohammed, Khasim Cc: [email protected] Subject: RE: Davinci Resizer coefficients On Wed, 2008-09-10 at 20:10 +0530, Syed Mohammed, Khasim wrote: > Hi Rafael > I was having similar discussion with Xiangdong, Here is what he advice me, > The steps are clearly outlined in spraai7 > (http://focus.ti.com/lit/an/spraai7b/spraai7b.pdf ). Basically, one starts > with iw and ow, which are your input and output widths, respectively, and > gets the hrsz. Once this is done, use the second equation to recalculate the > ow. Now you have all iw, ow and rsz values that can be programmed to the > resizer. No more iterations are needed there. > > Hope this is helpful. > Let's follow the steps outlined in this document, we will do a 4x resizing. iw = 180 ow = iw * 4 = 180 * 4 = 720 floor, largest integral value not greater than argument. 4-tap filters hrsz = floor( (iw-4)*256/(ow-1) ) hrsz = floor( 176 * 256 / (719) ) hrsz = floor( 62.6648 ) hrsz = 62 HRSZ IS INVALID 7-tap filters hrsz = floor( (iw-7)*256/(ow-1) ) hrsz = floor( 173 * 256 / (719) ) hrsz = floor( 61.5966 ) hrsz = 61 HRSZ IS INVALID This is why I had thought you must start with a valid ow first and not try to guess one. -- Rafaël Carré <[EMAIL PROTECTED]> _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
