On Fri, 2008-09-12 at 10:47 +0530, Jadav, Brijesh R wrote: > Hi, > > I used following equations for calculating resizing ratio and depending on > that, output size can be calculated.
Thanks, this indeed works very well. To sum up for people reading, the order is (for each dimension): 1/ Calculate rsz (256 / resizing ratio desired) 2/ Calculate output size possible given calculated rsz 3/ Recalculate rsz given calculated output size > 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 -- Rafaël Carré <[EMAIL PROTECTED]> _______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
