aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jcmarsha@gmail.com>2014-05-06 12:43:37 +1200
committerjmarshallnz <jcmarsha@gmail.com>2014-05-06 12:43:37 +1200
commit231e018fa2e9d1f2fc9cccd4bf8a697c1619fa86 (patch)
treefed01415ec3300a9dea76be5fcd20c2a6b224942
parenta7bd8a4c520954970dfca0017d7c9398133b4659 (diff)
parentfb82cedf2ea631c0e47296f461fe8d48dfc6d7b3 (diff)
Merge pull request #4647 from FernetMenta/vdpau2
VDPAU: fix cropping for interlaced frames
-rw-r--r--xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp8
-rw-r--r--xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h1
2 files changed, 6 insertions, 3 deletions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
index d0188bbacb..e58681b4a4 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
@@ -39,6 +39,7 @@
using namespace VDPAU;
#define NUM_RENDER_PICS 7
+#define NUM_CROP_PIX 3
#define ARSIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -2383,6 +2384,7 @@ void CMixer::InitCycle()
}
m_mixerstep = 0;
+ m_processPicture.crop = false;
if (m_mixerInput[1].DVDPic.format == RENDER_FMT_VDPAU)
{
m_processPicture.outputSurface = m_outputSurfaces.front();
@@ -2391,8 +2393,8 @@ void CMixer::InitCycle()
if (m_SeenInterlaceFlag)
{
double ratio = (double)m_mixerInput[1].DVDPic.iDisplayHeight / m_mixerInput[1].DVDPic.iHeight;
- m_mixerInput[1].DVDPic.iHeight -= 6;
- m_mixerInput[1].DVDPic.iDisplayHeight = lrint(ratio*m_mixerInput[1].DVDPic.iHeight);
+ m_mixerInput[1].DVDPic.iDisplayHeight = lrint(ratio*(m_mixerInput[1].DVDPic.iHeight-NUM_CROP_PIX*2));
+ m_processPicture.crop = true;
}
}
else
@@ -3066,7 +3068,7 @@ CVdpauRenderPicture* COutput::ProcessMixerPicture()
retPic->texWidth = m_config.outWidth;
retPic->texHeight = m_config.outHeight;
retPic->crop.x1 = 0;
- retPic->crop.y1 = (m_config.outHeight - retPic->DVDPic.iHeight) / 2;
+ retPic->crop.y1 = procPic.crop ? NUM_CROP_PIX : 0;
retPic->crop.x2 = m_config.outWidth;
retPic->crop.y2 = m_config.outHeight - retPic->crop.y1;
}
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
index 4d046c1b4f..8efadc1a1a 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
@@ -202,6 +202,7 @@ struct CVdpauProcessedPicture
DVDVideoPicture DVDPic;
VdpVideoSurface videoSurface;
VdpOutputSurface outputSurface;
+ bool crop;
};
/**