[mythtv] [PATCH] Potential display aspect ratio patch for non-4:3

Chris Pinkham cpinkham at bc2va.org
Thu Feb 12 02:16:15 EST 2004


> >         float pixNeeded = h_mm * XJ_aspect * ((float)dispw / w_mm);
> > 
> >         dispxoff += (dispwoff - (int)pixNeeded) / 2;
> >         dispwoff = (int)pixNeeded;

> >         float pixNeeded = (w_mm / XJ_aspect) * ((float)disph / h_mm);
> > 
> >         dispyoff += (disphoff - (int)pixNeeded) / 2;
> >         disphoff = (int)pixNeeded;

> I could easily be wrong, but I think that the use of "dispw" and "disph" above 
> is incorrect for under/overscanned screens. I think it should really be 
> "(dispwoff-dispxoff)" and "(disphoff-dispyoff)" respectively to cater for the 
> modifications already made to the display area.
> 
> Regards,
> Steve

I think it may be more than these that would need to be corrected.  pixNeeded
should end up being the final video width/height for the 2 cases after the
over/underscan is applied.  The problem with just replacing dispw with
(dispwoff-dispxoff) is that then divides by w_mm which would give an
over-inflated dots-per-mm which would cause the aspect to be off.

I wonder if a temp w_mm and h_mm should be used that are corrected for the
dispxoff and dispyoff.  So if I have to underscan by 10% horizontally, my
temp w_mm would be 90% of my real w_mm.

I'll try to get an equation setup and tested tomorrow if I can and post
a patch for others to try before putting in CVS.

> I also agree with Mike Wilcox's patch yesterday, which fixes 16:9 video in a 
> 4:3 window for me.

I applied this and also changed videooutbase.cpp so it should work no matter
what the aspect ratio of the video window is.  I set my video/gui size to
800x800 and it properly letterboxed 4:3 video, then I set my video/gui size
to 1000x600 and it put the bars on the sides instead of the top/bottom.  I
basically made it compare the video aspect with the video window aspect
and add in horizonal/vertical bars where needed.  If video aspect is
higher than video window aspect then add in horizontal bars (like 16:9
video on 4:3 window).  If video aspect is lower than video window aspect
then add in vertical bars (like 4:3 video on 16:9 window).

-- 

Chris



More information about the mythtv-dev mailing list