From: Bram R. <bra...@ph...> - 2006-06-27 07:41:25
|
Dear all, The changes as described below have been implemented. Note however, that the behaviour of p_create_header() is not modified since the SD image size still causes the default 4:3 aspect ratio. >From the readme file: - The display aspect ratio setting can now have value P_AS_WH, indicating that the intended aspect ratio of the diplay is equal to the width/height ratio in pixels. This value is an indication of square pixels as long as the width/height ratio remains the same. - Function p_create_ext_header() can now be called with value P_UNKNOWN_ASPECT_RATIO in the ratio parameter. This causes an automatic 16:9/4:3 selection. See cpfspd.h for details on the selection algorithm. >From the cpfspd.h file: The pfspd file format supports a display aspect ratio setting. This setting defines the intended shape of the physical display used by the image. Function p_create_ext_header() accepts the aspect ratio as input parameter. The default aspect ratio setting is 4:3 when using function p_create_header(). When using function p_create_ext_header() with ratio argument P_UNKNOWN_ASPECT_RATIO, then an automatic aspect ratio is choosen, according to: - For image size HDi and HDp: the aspect ratio is always 16:9. - For other image sizes (SD, CIF, QCIF): If the number of pixels per line is larger than the default value, then the aspect ratio is 16:9; otherwise, the aspect ratio is 4:3. Notes: 1) Aspect ratio setting P_AS_WH indicates that the aspect ratio of the display equals the aspect ratio of the image width/height. This is equal to a "square pixel" setting. However, after scaling or cropping (i.e. changing the width and/or height of the image) then the application is responsible to maintain a square pixel setting, since the pfspd file stores the display aspect ratio (without any knowledge on the pixel aspect ratio). This can be achieved by calling p_mod_aspect_ratio(). Developers, please update your sandboxes. Regards, Bram. -- A.K. (Bram) Riemens Principal Scientist, DSP group, Philips Research Office: WO-p-94, Postbox WO02 High Tech Campus 36 (WO), 5656 AE Eindhoven, The Netherlands Tel: +31 40 27 43833, Fax: +31 40 27 44675 E-mail: bra...@ph... Bram Riemens Sent by: pfs...@li... 26-06-2006 11:50 To pfs...@li... cc Frank van Heesch/EHV/RESEARCH/PHILIPS@PHILIPS Subject [Pfs...@sf...] Cpfspd change proposal on aspect ratiobehaviour Classification Hi all, Frank van Heesch triggered a disussion on the use of the display aspect ratio in cpfspd and related tools. This email outlines a CPFSPD change proposal. Current situation Cpfspd supports two display aspect ratios: 4:3 and 16:9. These are both commonly used in current TV standards. For several reasons, current tools and files do not use the 16:9 values properly - the 4:3 default is almost always used. Consequently, almost every file is tagged as 4:3. Up till now, we did not really pay attention to the aspect ratio. Frank pointed out some good reasons to pay attention: - Frank is working on an application that needs to use the information - Wrong values are confusing Requirements - Appropriate defaults for aspect ration (so most tools will "automatically" set correct aspect ratio values). - Support for "square pixel" aspect ratio (since many pfspd files contain a graphics image) Boundary conditions - Minimal or no change in API. - Consistency with current API semantics. - No change in pfspd file format. The file format describes only a __display__ aspect ratio (or image aspect ratio). Hence, a "square pixel" aspect ratio is only valid for a certain image width/height and cannot be preserved automatically over scaling operations. Propsed solution Both PV and PP will NOT be adapted. Main focus of these tools is visulisation of the pixels. A deformation of the image aspect ratio is acceptable and clearly favourable over scaling (requiering filtering with two main disadvantages: original pixel values are lost and slowdown due to the extra calculations). cpfspd.h - Add P_AS_WH to pT_asp_rat. cpfspd_get.c / p_get_aspect_ratio() - Add P_AS_WH; use largest common divider from image width/height to check this value. cpfspd_mod.c / p_mod_aspect_ratio() - Add P_AS_WH; use largest common divider from image width/height to calculate this value. Note that this is only "square pixel" for the current width/height setting. cpfspd_hdr.c / p_set_header_values() internal function - Add P_AS_WH as parameter value; use largest common divider from image width/height to calculate this value. - Add P_UNKNOWN_ASPECT_RATIO to serve as "default" parameter value to enable automatic setting depending on pT_size values: P_4_3 for P_SD, P_CIF, P_QCIF P_16_9 for P_HDp, P_HDi cpfspd_hdr.c / p_set_stream_header_values() internal function As p_set_header_values(). cpfspd_hdr.c / p_create_header() - Pass P_UNKNOWN_ASPECT_RATIO (not P_4_3) to p_create_ext_header(). cpfspd_hdr.c / p_create_ext_header() - No code change, funcionality changed by underlaying p_set_header_values() / p_set_stream_header_values(). Non-cpfspd issues Cpfspd application/tools that change image size (scale, border, crop, trim) need to handle the aspect ratio explicitely. If input file has P_AS_WH then output must be explicitely set at P_AS_WH to retain the "square pixel" property. Your comments / suggestions / improvements are appreciated. Regards, Bram. PS: Frank, please subscribe to the relevant mailing list via https://sourceforge.net/mail/?group_id=137382 -- A.K. (Bram) Riemens Principal Scientist, DSP group, Philips Research Office: WO-p-94, Postbox WO02 High Tech Campus 36 (WO), 5656 AE Eindhoven, The Netherlands Tel: +31 40 27 43833, Fax: +31 40 27 44675 E-mail: bra...@ph...Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Pfspd-users mailing list Pfs...@li... https://lists.sourceforge.net/lists/listinfo/pfspd-users |