[mythtv] [PATCH] 16:9 vertical stretch

Jon Read mythtv at jonread.com
Sun Mar 28 08:32:19 EST 2004


Hi all,

Firstly, thanks for all the great work you've all been doing on MythTV - 
I've been using it for a month or so and it's transformed the way my 
girlfriend and I watch TV.

A minor annoyance has been that in the UK some DVB-T channels insist on 
broadcasting 16:9 material with black bars at the top and bottom of the 
picture, so that it looks OK on a 4:3 set.  However, in full screen on a 
16:9 set the picture is obviously stretched horizontally.

Most TVs do have a 16:9 zoom function to vertically stretch the picture, 
but this often just increases the space between each vertical scan line, 
making the image look like it's being viewed through a very fine 
horizontal grille.

This small patch (the first of many from me, I hope) adds a "16:9 
Vertical Stretch" mode to CVS MythTV that results in a much higher 
picture quality than the TV-based solution.  I don't know if this has 
been discussed before and rejected, but I find it worthwhile and so I'm 
including it here.  It works well for me, with the warning that I'm new 
to the Myth source and so may have missed something important.

Cheers,
Jon
-------------- next part --------------
diff -urb mythtv/libs/libmythtv/tv_play.cpp mythtv-modified/libs/libmythtv/tv_play.cpp
--- mythtv/libs/libmythtv/tv_play.cpp	2004-03-27 08:17:40.000000000 +0000
+++ mythtv-modified/libs/libmythtv/tv_play.cpp	2004-03-28 12:43:22.222111883 +0100
@@ -2925,6 +2925,7 @@
         case kLetterbox_4_3_Zoom:     text = tr("4:3 Zoom"); break;
         case kLetterbox_16_9_Zoom:    text = tr("16:9 Zoom"); break;
         case kLetterbox_16_9_Stretch: text = tr("16:9 Stretch"); break;
+	case kLetterbox_16_9_VStretch: text = tr("16:9 Vertical Stretch"); break;
     }
 
     if (osd && !browsemode && !osd->IsRunningTreeMenu())
@@ -3499,6 +3500,8 @@
                                  QString("%1").arg(kLetterbox_16_9_Zoom));
     subitem = new OSDGenericTree(item, tr("16:9 Stretch"), "TOGGLEASPECT" +
                                  QString("%1").arg(kLetterbox_16_9_Stretch));
+    subitem = new OSDGenericTree(item, tr("16:9 Vertical Stretch"), "TOGGLEASPECT" +
+                                 QString("%1").arg(kLetterbox_16_9_VStretch));
 
     item = new OSDGenericTree(treeMenu, tr("Manual Zoom Mode"), 
                              "TOGGLEMANUALZOOM");
diff -urb mythtv/libs/libmythtv/videooutbase.cpp mythtv-modified/libs/libmythtv/videooutbase.cpp
--- mythtv/libs/libmythtv/videooutbase.cpp	2004-03-27 08:17:40.000000000 +0000
+++ mythtv-modified/libs/libmythtv/videooutbase.cpp	2004-03-28 12:43:40.953905080 +0100
@@ -420,6 +420,15 @@
         dispwoff = dispwoff*4/3;
     }
 
+    if (letterbox == kLetterbox_16_9_VStretch)
+    {
+    	// Vertical stretch mode
+	// Used to elimate top and bottom bars on 16:9 material
+	// encoded to 4:3.
+	dispyoff -= (disphoff/6);
+	disphoff = disphoff*4/3;
+    }
+
     if (ZoomedIn)
     {
         int oldDW = dispwoff;
@@ -513,7 +522,8 @@
     {
         default:
         case kLetterbox_4_3:
-        case kLetterbox_4_3_Zoom:      AspectChanged(4.0 / 3);
+        case kLetterbox_4_3_Zoom:
+	case kLetterbox_16_9_VStretch: AspectChanged(4.0 / 3);
                                        break;
         case kLetterbox_16_9:
         case kLetterbox_16_9_Zoom:
diff -urb mythtv/libs/libmythtv/videooutbase.h mythtv-modified/libs/libmythtv/videooutbase.h
--- mythtv/libs/libmythtv/videooutbase.h	2004-03-27 08:17:40.000000000 +0000
+++ mythtv-modified/libs/libmythtv/videooutbase.h	2004-03-28 12:43:48.237658145 +0100
@@ -68,6 +68,7 @@
     kLetterbox_4_3_Zoom,
     kLetterbox_16_9_Zoom,
     kLetterbox_16_9_Stretch,
+    kLetterbox_16_9_VStretch,
     kLetterbox_END
 };
 


More information about the mythtv-dev mailing list