[mythtv] Patch to autodetect 4:3 Zoom aspect ratio

Mårten Bohlin mabo at mochc.net
Mon Feb 25 13:17:48 UTC 2008

On Fri, Feb 22, 2008 at 4:06 PM, Mark Kendall <mark.kendall at gmail.com> wrote:
> On 22/02/2008, Mårten Bohlin <mabo at mochc.net> wrote:
>  > Hi!
>  >
>  >   I have written a patch for the release-0-20-fixes branch (svn
>  >   revision: 16162) that detects black bars on the top and bottom of the
>  >   frames. When that is detected it toggles to "Letterbox 4:3 Zoom". And
>  >   if no bars is detected it toggles back to "Letterbox Off".
>  >   Comments are welcome.
>  Mårten
>  What about material that is (for example) 2.35:1 displayed on a
>  widescreen (16:9) display? (i.e. 'super' widescreen dvds) If you
>  updated your patch for trunk, you would apply the correct 'zoom'
>  (either half or full) but the scan lines you're using may not work
>  (i.e. they might still fall within the actual content - though I
>  haven't checked).

I have not tested with content 2.35:1 content, but if it does not work
as it is there is just som minor adjustments of the limits to get it
to fill to full zoom.

>  Also, is the letterbox detection robust enough? As far as I can tell,
>  it's taking a very  limited sample set and doesn't check for
>  consistency within the 'actual' frame content. So how would it react
>  to a dark sequence for example? Would it be better to check for 'dark'
>  letterboxing and 'non-dark' content?
>  My apologies if my quick scan of your code has missed something.
>  Regards
>  Mark
> _______________________________________________

Yes it only looks at two lines on the screen for performance reasons,
but it also checks that it seems to be vertical lines on the top and
bottom of the screen before it makes a switch to the detected zoom mode. So yes
I find it very robust, I have used it daily for over a week now and
are happy with it.

It only switches if it finds out that it should switch in 3 frames in
a row. So it should not switch because of noise in the picture.
Sometimes the switch is delayed if the 'actual' content is dark, since
it can not detect where the content starts, but I have never seen that
it has switched to full zoom because of dark content. And that is
because it searches for a very straight lines in the picture.

A situation that it does not handle today is if there is 16:9 content
and then subtitles in the black bar on the bottom. The text will
probably not be visible. But I do not think that it is very common to
do that any more. And you can always turn off the full zoom manually.


More information about the mythtv-dev mailing list