In r5571 I updated elph130 and elph180 viewport functions to be mostly correct for video out, fixing various issues with PTP live view, zebra, histogram, edge overlay and MD.
This adds yet more complexity to the various size/offset functions, and the exact changes required will vary between ports (see
https://chdk.setepontos.com/index.php?topic=13451.msg142423#msg142423). I don't intend to implement it for every cam, but I wanted to a have a couple examples. Support can be added to other cams on request if someone actually needs these these things.
One thing I noticed is that in playback mode when output is set to PAL, both cameras viewport height is 576, while in NTSC it's 480. This means things like zebra and edge overlay won't be correct, since vid_get_viewport_yscale is an integer. Given that it only affects playback, it's not something I'd put effort into fixing.
edit:
Also did g7x. Although the buffer (for non-HDMI) stays 720x480 (technically 736, but max 720 is used), the assumed aspect ratio of the display changes, which changes the offsets at different aspect ratios. So on the real LCD, 3:2 is 720x480 and 4:3 is 640x480, with TV out it's 720x426 and 720x480, respectively. Unlike the pre-digic 6 cams, NTSC and PAL appear to be the same in playback.