Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2011-01-13 17:16:32 +0300
committerXhmikosR <xhmikosr@users.sourceforge.net>2011-01-13 17:16:32 +0300
commit001cf8d4a8999557a10d28ef1ecf3223c6d973a9 (patch)
tree11118cae65d6b8e4f1789a2029632ae00f502d59 /src/filters
parent0eb98dcebf3ff5c8fbdc1235474c0d5640f9a04c (diff)
legacy branch: merge r2827-r2843 from trunk
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/branches/legacy@2844 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters')
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitter.cpp28
-rw-r--r--src/filters/parser/BaseSplitter/BaseSplitter.h1
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitter.cpp14
-rw-r--r--src/filters/parser/MpegSplitter/MpegSplitter.h20
-rw-r--r--src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp139
-rw-r--r--src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h6
-rw-r--r--src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp109
-rw-r--r--src/filters/renderer/VideoRenderers/DX9RenderingEngine.h5
-rw-r--r--src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp38
-rw-r--r--src/filters/renderer/VideoRenderers/RenderersSettings.cpp2
-rw-r--r--src/filters/renderer/VideoRenderers/RenderersSettings.h1
-rw-r--r--src/filters/renderer/VideoRenderers/SyncRenderer.cpp76
-rw-r--r--src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h6
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/ffcodecs.h22
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/allcodecs.c1
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h75
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c3
-rw-r--r--src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c11
-rw-r--r--src/filters/transform/VSFilter/DirectVobSubPropPage.cpp4
19 files changed, 280 insertions, 281 deletions
diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.cpp b/src/filters/parser/BaseSplitter/BaseSplitter.cpp
index c23a2cd8a..9749ac27a 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitter.cpp
+++ b/src/filters/parser/BaseSplitter/BaseSplitter.cpp
@@ -1206,18 +1206,38 @@ STDMETHODIMP CBaseSplitterFilter::Load(LPCOLESTR pszFileName, const AM_MEDIA_TYP
HRESULT hr = E_FAIL;
CComPtr<IAsyncReader> pAsyncReader;
CAtlList<CHdmvClipInfo::PlaylistItem> Items;
- if (BuildPlaylist (pszFileName, Items)) {
+ CAtlList<CHdmvClipInfo::PlaylistChapter> Chapters;
+
+ if (BuildPlaylist (pszFileName, Items))
pAsyncReader = (IAsyncReader*)DNew CAsyncFileReader(Items, hr);
- } else {
+ else
pAsyncReader = (IAsyncReader*)DNew CAsyncFileReader(CString(pszFileName), hr);
- }
+
if(FAILED(hr)
|| FAILED(hr = DeleteOutputs())
- || FAILED(hr = CreateOutputs(pAsyncReader))) {
+ || FAILED(hr = CreateOutputs(pAsyncReader)))
+ {
m_fn = "";
return hr;
}
+ if (BuildChapters (pszFileName, Items, Chapters))
+ {
+ POSITION pos = Chapters.GetHeadPosition();
+ int i = 1;
+ while(pos)
+ {
+ CString str;
+ CHdmvClipInfo::PlaylistChapter& chap = Chapters.GetNext(pos);
+ if (chap.m_nMarkType == CHdmvClipInfo::PlaylistMarkType::EntryMark)
+ {
+ str.Format (_T("Chapter %d"), i);
+ ChapAppend (chap.m_rtTimestamp, str);
+ i++;
+ }
+ }
+ }
+
ChapSort();
m_pSyncReader = pAsyncReader;
diff --git a/src/filters/parser/BaseSplitter/BaseSplitter.h b/src/filters/parser/BaseSplitter/BaseSplitter.h
index e030187c1..255f7af72 100644
--- a/src/filters/parser/BaseSplitter/BaseSplitter.h
+++ b/src/filters/parser/BaseSplitter/BaseSplitter.h
@@ -295,6 +295,7 @@ protected:
virtual bool BuildPlaylist(LPCTSTR pszFileName, CAtlList<CHdmvClipInfo::PlaylistItem>& Items) {
return false;
};
+ virtual bool BuildChapters(LPCTSTR pszFileName, CAtlList<CHdmvClipInfo::PlaylistItem>& PlaylistItems, CAtlList<CHdmvClipInfo::PlaylistChapter>& Items) { return false; };
public:
CBaseSplitterFilter(LPCTSTR pName, LPUNKNOWN pUnk, HRESULT* phr, const CLSID& clsid);
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.cpp b/src/filters/parser/MpegSplitter/MpegSplitter.cpp
index 9a29a446e..8d28a7256 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitter.cpp
+++ b/src/filters/parser/MpegSplitter/MpegSplitter.cpp
@@ -794,6 +794,7 @@ void CMpegSplitterFilter::DemuxSeek(REFERENCE_TIME rt)
if(pPin && pPin->IsConnected()) {
m_pFile->Seek(seekpos);
+ __int64 curpos = seekpos;
REFERENCE_TIME pdt = _I64_MIN;
for(int j = 0; j < 10; j++) {
@@ -810,11 +811,12 @@ void CMpegSplitterFilter::DemuxSeek(REFERENCE_TIME rt)
if(rtmin <= rt && rt <= rtmax || pdt > 0 && dt < 0) {
- minseekpos = min(minseekpos, m_pFile->GetPos());
+ minseekpos = min(minseekpos, curpos);
break;
}
- m_pFile->Seek(m_pFile->GetPos() - (__int64)(1.0*dt/m_rtDuration*len));
+ curpos -= (__int64)(1.0*dt/m_rtDuration*len);
+ m_pFile->Seek(curpos);
//pdt = dt;
}
@@ -858,6 +860,11 @@ bool CMpegSplitterFilter::BuildPlaylist(LPCTSTR pszFileName, CAtlList<CHdmvClipI
return SUCCEEDED (m_ClipInfo.ReadPlaylist (pszFileName, m_rtPlaylistDuration, Items)) ? true : false;
}
+bool CMpegSplitterFilter::BuildChapters(LPCTSTR pszFileName, CAtlList<CHdmvClipInfo::PlaylistItem>& PlaylistItems, CAtlList<CHdmvClipInfo::PlaylistChapter>& Items)
+{
+ return SUCCEEDED (m_ClipInfo.ReadChapters (pszFileName, PlaylistItems, Items)) ? true : false;
+}
+
// IAMStreamSelect
STDMETHODIMP CMpegSplitterFilter::Count(DWORD* pcStreams)
@@ -899,6 +906,9 @@ STDMETHODIMP CMpegSplitterFilter::Enable(long lIndex, DWORD dwFlags)
continue;
}
+ PauseGraph;
+ ResumeGraph;
+
HRESULT hr;
if(FAILED(hr = RenameOutputPin(from, to, &to.mt))) {
return hr;
diff --git a/src/filters/parser/MpegSplitter/MpegSplitter.h b/src/filters/parser/MpegSplitter/MpegSplitter.h
index abceb4cd9..73118a690 100644
--- a/src/filters/parser/MpegSplitter/MpegSplitter.h
+++ b/src/filters/parser/MpegSplitter/MpegSplitter.h
@@ -24,6 +24,25 @@
#include "../BaseSplitter/BaseSplitter.h"
#include "MpegSplitterFile.h"
+#define PauseGraph \
+ CComQIPtr<IMediaControl> _pMC(m_pGraph); \
+ OAFilterState _fs = -1; \
+ if(_pMC) _pMC->GetState(1000, &_fs); \
+ if(_fs == State_Running) \
+ _pMC->Pause(); \
+ \
+ HRESULT _hr = E_FAIL; \
+ CComQIPtr<IMediaSeeking> _pMS((IUnknown*)(INonDelegatingUnknown*)m_pGraph); \
+ LONGLONG _rtNow = 0; \
+ if(_pMS) _hr = _pMS->GetCurrentPosition(&_rtNow); \
+
+#define ResumeGraph \
+ if(SUCCEEDED(_hr) && _pMS && _fs != State_Stopped) \
+ _hr = _pMS->SetPositions(&_rtNow, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning); \
+ \
+ if(_fs == State_Running && _pMS) \
+ _pMC->Run(); \
+
class __declspec(uuid("DC257063-045F-4BE2-BD5B-E12279C464F0"))
CMpegSplitterFilter : public CBaseSplitterFilter, public IAMStreamSelect
{
@@ -40,6 +59,7 @@ protected:
void DemuxSeek(REFERENCE_TIME rt);
bool DemuxLoop();
bool BuildPlaylist(LPCTSTR pszFileName, CAtlList<CHdmvClipInfo::PlaylistItem>& files);
+ bool BuildChapters(LPCTSTR pszFileName, CAtlList<CHdmvClipInfo::PlaylistItem>& PlaylistItems, CAtlList<CHdmvClipInfo::PlaylistChapter>& Items);
HRESULT DemuxNextPacket(REFERENCE_TIME rtStartOffset);
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
index 8844f2bb5..4855bf443 100644
--- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.cpp
@@ -2,7 +2,7 @@
* $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -756,11 +756,6 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
}
#endif
- if (!SetCurrentDisplayMode()) {
- _Error += L"GetAdapterDisplayMode failed\n";
- return E_UNEXPECTED;
- }
-
D3DPRESENT_PARAMETERS pp;
ZeroMemory(&pp, sizeof(pp));
@@ -770,45 +765,65 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
}
m_bCompositionEnabled = bCompositionEnabled != 0;
-
m_bAlternativeVSync = s.m_RenderSettings.fVMR9AlterativeVSync;
- m_bHighColorResolution = s.m_RenderSettings.iEVRHighColorResolution && m_bIsEVR;
+
+ // detect FP textures support
+ renderersData->m_bFP16Support = SUCCEEDED(m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_FILTER, D3DRTYPE_VOLUMETEXTURE, D3DFMT_A32B32G32R32F));
+
+ // detect 10-bit textures support
+ renderersData->m_b10bitSupport = SUCCEEDED(m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_FILTER, D3DRTYPE_TEXTURE, D3DFMT_A2R10G10B10));
+
+ // set settings that depend on hardware feature support
+ m_bForceInputHighColorResolution = s.m_RenderSettings.iEVRForceInputHighColorResolution && m_bIsEVR && renderersData->m_b10bitSupport;
+ m_bHighColorResolution = s.m_RenderSettings.iEVRHighColorResolution && m_bIsEVR && renderersData->m_b10bitSupport;
+ m_bFullFloatingPointProcessing = s.m_RenderSettings.iVMR9FullFloatingPointProcessing && renderersData->m_bFP16Support;
+ m_bHalfFloatingPointProcessing = s.m_RenderSettings.iVMR9HalfFloatingPointProcessing && renderersData->m_bFP16Support && !m_bFullFloatingPointProcessing;
+
+ // set color formats
+ if (m_bFullFloatingPointProcessing) {
+ m_SurfaceType = D3DFMT_A32B32G32R32F;
+ } else if (m_bHalfFloatingPointProcessing) {
+ m_SurfaceType = D3DFMT_A16B16G16R16F;
+ } else if (m_bForceInputHighColorResolution || m_bHighColorResolution) {
+ m_SurfaceType = D3DFMT_A2R10G10B10;
+ } else {
+ m_SurfaceType = D3DFMT_A8R8G8B8;
+ }
+
+ if (m_bHighColorResolution) {
+ pp.BackBufferFormat = D3DFMT_A2R10G10B10;
+ } else {
+ pp.BackBufferFormat = D3DFMT_X8R8G8B8;
+ }
+
+ D3DDISPLAYMODEEX DisplayMode;
+ ZeroMemory(&DisplayMode, sizeof(DisplayMode));
+ DisplayMode.Size = sizeof(DisplayMode);
+ D3DDISPLAYMODE d3ddm;
+ ZeroMemory(&d3ddm, sizeof(d3ddm));
if (m_bIsFullscreen) {
pp.Windowed = false;
- pp.BackBufferWidth = m_ScreenSize.cx;
- pp.BackBufferHeight = m_ScreenSize.cy;
+ pp.BackBufferCount = 3;
+ pp.SwapEffect = D3DSWAPEFFECT_FLIP;
pp.hDeviceWindow = m_hWnd;
if(m_bAlternativeVSync) {
- pp.BackBufferCount = 3;
- pp.SwapEffect = D3DSWAPEFFECT_DISCARD; // Ne pas mettre D3DSWAPEFFECT_COPY car cela entraine une desynchro audio sur les MKV ! // Copy needed for sync now? FLIP only stutters.
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- } else {
- pp.BackBufferCount = 3;
- pp.SwapEffect = D3DSWAPEFFECT_DISCARD; // Ne pas mettre D3DSWAPEFFECT_COPY car cela entraine une desynchro audio sur les MKV ! // Copy needed for sync now? FLIP only stutters.
- pp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
}
pp.Flags = D3DPRESENTFLAG_VIDEO;
if (s.m_RenderSettings.iVMR9FullscreenGUISupport && !m_bHighColorResolution) {
pp.Flags |= D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
}
- if (m_bHighColorResolution) {
- pp.BackBufferFormat = D3DFMT_A2R10G10B10;
- } else {
- pp.BackBufferFormat = m_DisplayType;
- }
-
m_D3DDevExError = L"No m_pD3DEx";
if (m_pD3DEx) {
- D3DDISPLAYMODEEX DisplayMode;
- ZeroMemory(&DisplayMode, sizeof(DisplayMode));
- DisplayMode.Size = sizeof(DisplayMode);
m_pD3DEx->GetAdapterDisplayModeEx(m_CurrentAdapter, &DisplayMode, NULL);
DisplayMode.Format = pp.BackBufferFormat;
- pp.FullScreen_RefreshRateInHz = DisplayMode.RefreshRate;
+ m_ScreenSize.SetSize(DisplayMode.Width, DisplayMode.Height);
+ pp.FullScreen_RefreshRateInHz = m_RefreshRate = DisplayMode.RefreshRate;
+ pp.BackBufferWidth = m_ScreenSize.cx;
+ pp.BackBufferHeight = m_ScreenSize.cy;
- m_CurrentAdapter = GetAdapter(m_pD3D, true);
hr = m_pD3DEx->CreateDeviceEx(
m_CurrentAdapter, D3DDEVTYPE_HAL, m_hWnd,
GetVertexProcessing() | D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_ENABLE_PRESENTSTATS, //D3DCREATE_MANAGED
@@ -821,16 +836,20 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
m_DisplayType = DisplayMode.Format;
}
}
-
if (!m_pD3DDev) {
- m_CurrentAdapter = GetAdapter(m_pD3D, true);
+ m_pD3D->GetAdapterDisplayMode(m_CurrentAdapter, &d3ddm);
+ d3ddm.Format = pp.BackBufferFormat;
+ m_ScreenSize.SetSize(d3ddm.Width, d3ddm.Height);
+ pp.FullScreen_RefreshRateInHz = m_RefreshRate = d3ddm.RefreshRate;
+ pp.BackBufferWidth = m_ScreenSize.cx;
+ pp.BackBufferHeight = m_ScreenSize.cy;
+
hr = m_pD3D->CreateDevice(
m_CurrentAdapter, D3DDEVTYPE_HAL, m_hWnd,
GetVertexProcessing() | D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED, //D3DCREATE_MANAGED
&pp, &m_pD3DDev);
- if (m_pD3DDev) {
- m_BackbufferType = pp.BackBufferFormat;
- }
+ m_DisplayType = d3ddm.Format;
+ m_BackbufferType = pp.BackBufferFormat;
}
if (m_pD3DDev && s.m_RenderSettings.iVMR9FullscreenGUISupport && !m_bHighColorResolution) {
m_pD3DDev->SetDialogBoxMode(true);
@@ -843,38 +862,44 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
pp.SwapEffect = D3DSWAPEFFECT_COPY;
pp.Flags = D3DPRESENTFLAG_VIDEO;
pp.BackBufferCount = 1;
- pp.BackBufferWidth = m_ScreenSize.cx;
- pp.BackBufferHeight = m_ScreenSize.cy;
- m_BackbufferType = m_DisplayType;
- if (m_bHighColorResolution) {
- m_BackbufferType = D3DFMT_A2R10G10B10;
- pp.BackBufferFormat = D3DFMT_A2R10G10B10;
- }
if (bCompositionEnabled || m_bAlternativeVSync) {
// Desktop composition takes care of the VSYNC
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- } else {
- pp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
}
// if(m_fVMRSyncFix = GetRenderersData()->m_s.fVMRSyncFix)
// pp.Flags |= D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
- m_CurrentAdapter = GetAdapter(m_pD3D, true);
if (m_pD3DEx) {
+ m_pD3DEx->GetAdapterDisplayModeEx(m_CurrentAdapter, &DisplayMode, NULL);
+ m_ScreenSize.SetSize(DisplayMode.Width, DisplayMode.Height);
+ m_RefreshRate = DisplayMode.RefreshRate;
+ pp.BackBufferWidth = m_ScreenSize.cx;
+ pp.BackBufferHeight = m_ScreenSize.cy;
+
hr = m_pD3DEx->CreateDeviceEx(
m_CurrentAdapter, D3DDEVTYPE_HAL, m_hWnd,
GetVertexProcessing() | D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED | D3DCREATE_ENABLE_PRESENTSTATS, //D3DCREATE_MANAGED
&pp, NULL, &m_pD3DDevEx);
if (m_pD3DDevEx) {
m_pD3DDev = m_pD3DDevEx;
+ m_DisplayType = DisplayMode.Format;
}
- } else {
+ }
+ if (!m_pD3DDev) {
+ m_pD3D->GetAdapterDisplayMode(m_CurrentAdapter, &d3ddm);
+ m_ScreenSize.SetSize(d3ddm.Width, d3ddm.Height);
+ m_RefreshRate = d3ddm.RefreshRate;
+ pp.BackBufferWidth = m_ScreenSize.cx;
+ pp.BackBufferHeight = m_ScreenSize.cy;
+
hr = m_pD3D->CreateDevice(
m_CurrentAdapter, D3DDEVTYPE_HAL, m_hWnd,
GetVertexProcessing() | D3DCREATE_FPU_PRESERVE | D3DCREATE_MULTITHREADED, //D3DCREATE_MANAGED
&pp, &m_pD3DDev);
+ m_DisplayType = d3ddm.Format;
}
+ m_BackbufferType = pp.BackBufferFormat;
}
while(hr == D3DERR_DEVICELOST) {
@@ -905,12 +930,9 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
ZeroMemory(&m_Caps, sizeof(m_Caps));
m_pD3DDev->GetDeviceCaps(&m_Caps);
- // Initialize the rendering engine and detect supported hardware features
+ // Initialize the rendering engine
InitRenderingEngine();
- // Get settings that depend on hardware feature support
- m_bForceInputHighColorResolution = s.m_RenderSettings.iEVRForceInputHighColorResolution && m_bIsEVR && renderersData->m_b10bitSupport;
-
CComPtr<ISubPicProvider> pSubPicProvider;
if(m_pSubPicQueue) {
m_pSubPicQueue->GetSubPicProvider(&pSubPicProvider);
@@ -1016,12 +1038,12 @@ HRESULT CDX9AllocatorPresenter::CreateDevice(CString &_Error)
return S_OK;
}
-HRESULT CDX9AllocatorPresenter::AllocSurfaces(D3DFORMAT Format)
+HRESULT CDX9AllocatorPresenter::AllocSurfaces()
{
CAutoLock cAutoLock(this);
CAutoLock cRenderLock(&m_RenderLock);
- return CreateVideoSurfaces(Format);
+ return CreateVideoSurfaces();
}
void CDX9AllocatorPresenter::DeleteSurfaces()
@@ -1032,19 +1054,6 @@ void CDX9AllocatorPresenter::DeleteSurfaces()
FreeVideoSurfaces();
}
-bool CDX9AllocatorPresenter::SetCurrentDisplayMode()
-{
- D3DDISPLAYMODE d3ddm;
- ZeroMemory(&d3ddm, sizeof(d3ddm));
- if(FAILED(m_pD3D->GetAdapterDisplayMode(m_CurrentAdapter, &d3ddm))) {
- return false;
- }
- m_RefreshRate = d3ddm.RefreshRate;
- m_ScreenSize.SetSize(d3ddm.Width, d3ddm.Height);
- m_DisplayType = d3ddm.Format;
- return true;
-}
-
UINT CDX9AllocatorPresenter::GetAdapter(IDirect3D9* pD3D, bool bCreateDevice)
{
if(m_hWnd == NULL || pD3D == NULL) {
@@ -1506,8 +1515,6 @@ STDMETHODIMP_(bool) CDX9AllocatorPresenter::Paint(bool fAll)
HRESULT hr;
- SetCurrentDisplayMode();
-
m_pD3DDev->BeginScene();
CComPtr<IDirect3DSurface9> pBackBuffer;
@@ -2016,6 +2023,10 @@ void CDX9AllocatorPresenter::DrawStats()
strText += "FullFP ";
}
+ if (m_bHalfFloatingPointProcessing) {
+ strText += "HalfFP ";
+ }
+
if (m_bIsEVR) {
if (m_bHighColorResolution) {
strText += "10bitOut ";
diff --git a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h
index 6d8bd84a3..d58d28567 100644
--- a/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h
+++ b/src/filters/renderer/VideoRenderers/DX9AllocatorPresenter.h
@@ -2,7 +2,7 @@
* $Id$
*
* (C) 2003-2006 Gabest
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -104,7 +104,7 @@ namespace DSObjects
bool SettingsNeedResetDevice();
virtual HRESULT CreateDevice(CString &_Error);
- virtual HRESULT AllocSurfaces(D3DFORMAT Format = D3DFMT_A8R8G8B8);
+ virtual HRESULT AllocSurfaces();
virtual void DeleteSurfaces();
// Thread stuff
@@ -196,8 +196,6 @@ namespace DSObjects
double m_DetectedScanlineTimePrim;
double m_DetectedScanlinesPerFrame;
- bool SetCurrentDisplayMode();
-
double GetRefreshRate() {
if (m_DetectedRefreshRate) {
return m_DetectedRefreshRate;
diff --git a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
index 7c34f1703..7450e7e09 100644
--- a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
+++ b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.cpp
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -64,7 +64,7 @@ static void AdjustQuad(MYD3DVERTEX<texcoords>* v, double dx, double dy)
}
template<int texcoords>
-static HRESULT TextureBlt(IDirect3DDevice9* pD3DDev, MYD3DVERTEX<texcoords> v[4], D3DTEXTUREFILTERTYPE filter = D3DTEXF_LINEAR)
+static HRESULT TextureBlt(IDirect3DDevice9* pD3DDev, MYD3DVERTEX<texcoords> v[4], D3DTEXTUREFILTERTYPE filter)
{
if(!pD3DDev) {
return E_POINTER;
@@ -115,7 +115,7 @@ static HRESULT TextureBlt(IDirect3DDevice9* pD3DDev, MYD3DVERTEX<texcoords> v[4]
for(int i = 0; i < texcoords; i++) {
hr = pD3DDev->SetSamplerState(i, D3DSAMP_MAGFILTER, filter);
hr = pD3DDev->SetSamplerState(i, D3DSAMP_MINFILTER, filter);
- hr = pD3DDev->SetSamplerState(i, D3DSAMP_MIPFILTER, filter);
+ hr = pD3DDev->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
hr = pD3DDev->SetSamplerState(i, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
hr = pD3DDev->SetSamplerState(i, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
@@ -161,39 +161,7 @@ CDX9RenderingEngine::CDX9RenderingEngine(HWND hWnd, HRESULT& hr, CString *_pErro
void CDX9RenderingEngine::InitRenderingEngine()
{
- HRESULT hr;
- CRenderersData* renderersData = GetRenderersData();
-
- // Detect supported StrechRect filter
- m_StretchRectFilter = D3DTEXF_NONE;
- if((m_Caps.StretchRectFilterCaps&D3DPTFILTERCAPS_MINFLINEAR)
- && (m_Caps.StretchRectFilterCaps&D3DPTFILTERCAPS_MAGFLINEAR)) {
- m_StretchRectFilter = D3DTEXF_LINEAR;
- }
-
- // Detect FP16 support
- renderersData->m_bFP16Support = true;
-
- hr = m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, m_DisplayType, D3DUSAGE_DYNAMIC, D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16F);
- renderersData->m_bFP16Support &= SUCCEEDED(hr);
- hr = m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, m_DisplayType, D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16F);
- renderersData->m_bFP16Support &= SUCCEEDED(hr);
- hr = m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, m_DisplayType, D3DUSAGE_QUERY_FILTER, D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16F);
- renderersData->m_bFP16Support &= SUCCEEDED(hr);
- hr = m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, m_DisplayType, D3DUSAGE_DYNAMIC, D3DRTYPE_VOLUMETEXTURE, D3DFMT_A16B16G16R16F);
- renderersData->m_bFP16Support &= SUCCEEDED(hr);
- hr = m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, m_DisplayType, D3DUSAGE_QUERY_FILTER, D3DRTYPE_VOLUMETEXTURE, D3DFMT_A16B16G16R16F);
- renderersData->m_bFP16Support &= SUCCEEDED(hr);
-
- // Detect 10-bit support
- renderersData->m_b10bitSupport = true;
-
- hr = m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, m_DisplayType, D3DUSAGE_DYNAMIC, D3DRTYPE_TEXTURE, D3DFMT_A2R10G10B10);
- renderersData->m_b10bitSupport &= SUCCEEDED(hr);
- hr = m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, m_DisplayType, D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, D3DFMT_A2R10G10B10);
- renderersData->m_b10bitSupport &= SUCCEEDED(hr);
- hr = m_pD3D->CheckDeviceFormat(m_CurrentAdapter, D3DDEVTYPE_HAL, m_DisplayType, D3DUSAGE_QUERY_FILTER, D3DRTYPE_TEXTURE, D3DFMT_A2R10G10B10);
- renderersData->m_b10bitSupport &= SUCCEEDED(hr);
+ m_StretchRectFilter = D3DTEXF_LINEAR;// eliminate this chain ASAP
// Initialize the pixel shader compiler
m_pPSC.Attach(DNew CPixelShaderCompiler(m_pD3DDev, true));
@@ -202,7 +170,6 @@ void CDX9RenderingEngine::InitRenderingEngine()
m_BicubicA = 0;
m_bFinalPass = false;
- m_bFullFloatingPointProcessing = false;
m_bColorManagement = false;
}
@@ -233,7 +200,7 @@ void CDX9RenderingEngine::CleanupRenderingEngine()
}
}
-HRESULT CDX9RenderingEngine::CreateVideoSurfaces(D3DFORMAT format)
+HRESULT CDX9RenderingEngine::CreateVideoSurfaces()
{
HRESULT hr;
CRenderersSettings& settings = GetRenderersSettings();
@@ -246,15 +213,13 @@ HRESULT CDX9RenderingEngine::CreateVideoSurfaces(D3DFORMAT format)
m_pTemporaryVideoTextures[i] = NULL;
}
- m_SurfaceType = format;
-
if (settings.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE2D || settings.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D) {
int nTexturesNeeded = settings.iAPSurfaceUsage == VIDRNDT_AP_TEXTURE3D ? m_nNbDXSurface : 1;
for (int i = 0; i < nTexturesNeeded; i++) {
if(FAILED(hr = m_pD3DDev->CreateTexture(
m_NativeVideoSize.cx, m_NativeVideoSize.cy, 1,
- D3DUSAGE_RENDERTARGET, format,
+ D3DUSAGE_RENDERTARGET, m_SurfaceType,
D3DPOOL_DEFAULT, &m_pVideoTexture[i], NULL))) {
return hr;
}
@@ -278,7 +243,7 @@ HRESULT CDX9RenderingEngine::CreateVideoSurfaces(D3DFORMAT format)
if (FAILED(hr = m_pD3DDev->CreateOffscreenPlainSurface(
m_NativeVideoSize.cx, m_NativeVideoSize.cy,
- format,
+ m_SurfaceType,
D3DPOOL_DEFAULT, &m_pVideoSurface[m_nCurSurface], NULL))) {
return hr;
}
@@ -545,19 +510,8 @@ HRESULT CDX9RenderingEngine::InitTemporaryVideoTextures(int count)
for (int i = 0; i < count; i++) {
if (m_pTemporaryVideoTextures[i] == NULL) {
- D3DFORMAT format;
- if (m_bFullFloatingPointProcessing) {
- format = D3DFMT_A16B16G16R16F;
- } else {
- if (m_bHighColorResolution || m_bForceInputHighColorResolution) {
- format = D3DFMT_A2R10G10B10;
- } else {
- format = D3DFMT_A8R8G8B8;
- }
- }
-
hr = m_pD3DDev->CreateTexture(
- m_NativeVideoSize.cx, m_NativeVideoSize.cy, 1, D3DUSAGE_RENDERTARGET, format,
+ m_NativeVideoSize.cx, m_NativeVideoSize.cy, 1, D3DUSAGE_RENDERTARGET, m_SurfaceType,
D3DPOOL_DEFAULT, &m_pTemporaryVideoTextures[i], NULL);
if (FAILED(hr)) {
@@ -604,20 +558,8 @@ HRESULT CDX9RenderingEngine::InitTemporaryScreenSpaceTextures(int count)
if (m_pTemporaryScreenSpaceTextures[i] == NULL) {
m_TemporaryScreenSpaceTextureSize = CSize(min(m_ScreenSize.cx, (int)m_Caps.MaxTextureWidth),
min(max(m_ScreenSize.cy, m_NativeVideoSize.cy), (int)m_Caps.MaxTextureHeight));
-
- D3DFORMAT format;
- if (m_bFullFloatingPointProcessing) {
- format = D3DFMT_A16B16G16R16F;
- } else {
- if (m_bHighColorResolution || m_bForceInputHighColorResolution) {
- format = D3DFMT_A2R10G10B10;
- } else {
- format = D3DFMT_A8R8G8B8;
- }
- }
-
hr = m_pD3DDev->CreateTexture(
- m_TemporaryScreenSpaceTextureSize.cx, m_TemporaryScreenSpaceTextureSize.cy, 1, D3DUSAGE_RENDERTARGET, format,
+ m_TemporaryScreenSpaceTextureSize.cx, m_TemporaryScreenSpaceTextureSize.cy, 1, D3DUSAGE_RENDERTARGET, m_SurfaceType,
D3DPOOL_DEFAULT, &m_pTemporaryScreenSpaceTextures[i], NULL);
if (FAILED(hr)) {
@@ -981,7 +923,6 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
CRenderersData* data = GetRenderersData();
// Check whether the final pass must be initialized
- bool bFullFloatingPointProcessing = settings.m_RenderSettings.iVMR9FullFloatingPointProcessing;
bool bColorManagement = settings.m_RenderSettings.iVMR9ColorManagementEnable;
VideoSystem inputVideoSystem = static_cast<VideoSystem>(settings.m_RenderSettings.iVMR9ColorManagementInput);
AmbientLight ambientLight = static_cast<AmbientLight>(settings.m_RenderSettings.iVMR9ColorManagementAmbientLight);
@@ -989,8 +930,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
bool bInitRequired = false;
- if ((m_bFullFloatingPointProcessing != bFullFloatingPointProcessing) ||
- (m_bColorManagement != bColorManagement)) {
+ if (m_bColorManagement != bColorManagement) {
bInitRequired = true;
}
@@ -1016,15 +956,13 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
}
// Update the settings
- m_bFullFloatingPointProcessing = bFullFloatingPointProcessing;
m_bColorManagement = bColorManagement;
m_InputVideoSystem = inputVideoSystem;
m_AmbientLight = ambientLight;
m_RenderingIntent = renderingIntent;
// Check whether the final pass is required
- m_bFinalPass = bFullFloatingPointProcessing || bColorManagement ||
- (m_bForceInputHighColorResolution && !m_bHighColorResolution);
+ m_bFinalPass = bColorManagement || (m_bForceInputHighColorResolution && !m_bHighColorResolution);
if (!m_bFinalPass) {
return S_OK;
@@ -1177,7 +1115,7 @@ HRESULT CDX9RenderingEngine::InitFinalPass()
}
int quantization;
- if (m_bHighColorResolution && (m_DisplayType == D3DFMT_A2R10G10B10 || m_DisplayType == D3DFMT_A2B10G10R10)) {
+ if (m_DisplayType == D3DFMT_A2R10G10B10) {
quantization = 1023; // 10-bit
} else {
quantization = 255; // 8-bit
@@ -1291,8 +1229,8 @@ HRESULT CDX9RenderingEngine::CreateIccProfileLut(TCHAR* profilePath, float* lut3
// Set the input white point. It's D65 in all cases.
cmsCIExyY whitePoint;
- whitePoint.x = 0.3127;
- whitePoint.y = 0.3290;
+ whitePoint.x = 0.31271;
+ whitePoint.y = 0.32902;
whitePoint.Y = 1.0;
// Set the input primaries
@@ -1452,12 +1390,19 @@ HRESULT CDX9RenderingEngine::FinalPass(IDirect3DTexture9* pTexture)
hr = m_pD3DDev->SetPixelShader(m_pFinalPixelShader);
// Set sampler: image
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
+
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
+
hr = m_pD3DDev->SetTexture(0, pTexture);
// Set sampler: ditherMap
hr = m_pD3DDev->SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
hr = m_pD3DDev->SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_POINT);
- hr = m_pD3DDev->SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_POINT);
+ hr = m_pD3DDev->SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
hr = m_pD3DDev->SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
hr = m_pD3DDev->SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
@@ -1467,7 +1412,7 @@ HRESULT CDX9RenderingEngine::FinalPass(IDirect3DTexture9* pTexture)
if (m_bColorManagement) {
hr = m_pD3DDev->SetSamplerState(2, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
hr = m_pD3DDev->SetSamplerState(2, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
- hr = m_pD3DDev->SetSamplerState(2, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
+ hr = m_pD3DDev->SetSamplerState(2, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
hr = m_pD3DDev->SetSamplerState(2, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
hr = m_pD3DDev->SetSamplerState(2, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
@@ -1517,7 +1462,7 @@ HRESULT CDX9RenderingEngine::TextureCopy(IDirect3DTexture9* pTexture)
hr = m_pD3DDev->SetTexture(0, pTexture);
- return TextureBlt(m_pD3DDev, v, D3DTEXF_LINEAR);
+ return TextureBlt(m_pD3DDev, v, D3DTEXF_POINT);
}
bool CDX9RenderingEngine::ClipToSurface(IDirect3DSurface9* pSurface, CRect& s, CRect& d)
@@ -1658,9 +1603,9 @@ HRESULT CDX9RenderingEngine::AlphaBlt(RECT* pSrc, RECT* pDst, IDirect3DTexture9*
hr = m_pD3DDev->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
hr = m_pD3DDev->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
- hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
- hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
- hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
diff --git a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.h b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.h
index f90a03a81..38ffe2a27 100644
--- a/src/filters/renderer/VideoRenderers/DX9RenderingEngine.h
+++ b/src/filters/renderer/VideoRenderers/DX9RenderingEngine.h
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -67,6 +67,7 @@ namespace DSObjects
CComPtr<IDirect3DSurface9> m_pVideoSurface[MAX_VIDEO_SURFACES];
bool m_bFullFloatingPointProcessing;
+ bool m_bHalfFloatingPointProcessing;
bool m_bColorManagement;
CDX9RenderingEngine(HWND hWnd, HRESULT& hr, CString *_pError);
@@ -74,7 +75,7 @@ namespace DSObjects
void InitRenderingEngine();
void CleanupRenderingEngine();
- HRESULT CreateVideoSurfaces(D3DFORMAT format);
+ HRESULT CreateVideoSurfaces();
void FreeVideoSurfaces();
HRESULT RenderVideo(IDirect3DSurface9* pRenderTarget, const CRect& srcRect, const CRect& destRect);
diff --git a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
index 58f143ca3..10cb71e1c 100644
--- a/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
+++ b/src/filters/renderer/VideoRenderers/EVRAllocatorPresenter.cpp
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -1082,7 +1082,7 @@ HRESULT CEVRAllocatorPresenter::GetMediaTypeMerit(IMFMediaType* pType, int* pMer
// We only support RGB mixer output surface formats
switch (Format) {
case D3DFMT_A2R10G10B10:
- if (m_bHighColorResolution || m_bForceInputHighColorResolution || m_bFullFloatingPointProcessing) {
+ if (m_bHighColorResolution || m_bForceInputHighColorResolution || m_bHalfFloatingPointProcessing || m_bFullFloatingPointProcessing) {
*pMerit = 950;
} else {
*pMerit = 650;
@@ -1090,15 +1090,6 @@ HRESULT CEVRAllocatorPresenter::GetMediaTypeMerit(IMFMediaType* pType, int* pMer
break;
- case D3DFMT_A2B10G10R10:
- if (m_bHighColorResolution || m_bForceInputHighColorResolution || m_bFullFloatingPointProcessing) {
- *pMerit = 900;
- } else {
- *pMerit = 600;
- }
-
- break;
-
case D3DFMT_X8R8G8B8:
if (m_bForceInputHighColorResolution) {
*pMerit = 800;
@@ -1117,23 +1108,6 @@ HRESULT CEVRAllocatorPresenter::GetMediaTypeMerit(IMFMediaType* pType, int* pMer
break;
- case D3DFMT_X8B8G8R8:
- if (m_bForceInputHighColorResolution) {
- *pMerit = 700;
- } else {
- *pMerit = 750;
- }
-
- break;
-
- case D3DFMT_A8B8G8R8:
- if (m_bForceInputHighColorResolution) {
- *pMerit = 750;
- } else {
- *pMerit = 700;
- }
- break;
-
default:
// Unsupported format
*pMerit = 0;
@@ -1651,13 +1625,7 @@ STDMETHODIMP CEVRAllocatorPresenter::InitializeDevice(IMFMediaType* pMediaType)
}
if (SUCCEEDED(hr)) {
- if (m_bForceInputHighColorResolution)
- // May crash or not work correctly!
- {
- hr = AllocSurfaces(D3DFMT_A2R10G10B10);
- } else {
- hr = AllocSurfaces(Format);
- }
+ hr = AllocSurfaces();
}
if (SUCCEEDED(hr)) {
diff --git a/src/filters/renderer/VideoRenderers/RenderersSettings.cpp b/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
index b7267e574..a5c3c7833 100644
--- a/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
+++ b/src/filters/renderer/VideoRenderers/RenderersSettings.cpp
@@ -39,6 +39,7 @@ void CRenderersSettings::CRendererSettingsShared::SetDefault()
iVMR9FullscreenGUISupport = 0;
iVMR9VSync = 1;
iVMR9FullFloatingPointProcessing = 0;
+ iVMR9HalfFloatingPointProcessing = 0;
iVMR9ColorManagementEnable = 0;
iVMR9ColorManagementInput = VIDEO_SYSTEM_UNKNOWN;
iVMR9ColorManagementAmbientLight = AMBIENT_LIGHT_BRIGHT;
@@ -63,6 +64,7 @@ void CRenderersSettings::CRendererSettingsShared::SetOptimal()
iVMR9VSyncAccurate = 1;
iVMR9VSync = 1;
iVMR9FullFloatingPointProcessing = 1;
+ iVMR9HalfFloatingPointProcessing = 0;
iVMR9ColorManagementEnable = 0;
iVMR9ColorManagementInput = VIDEO_SYSTEM_UNKNOWN;
iVMR9ColorManagementAmbientLight = AMBIENT_LIGHT_BRIGHT;
diff --git a/src/filters/renderer/VideoRenderers/RenderersSettings.h b/src/filters/renderer/VideoRenderers/RenderersSettings.h
index e5b19f015..3b94bd685 100644
--- a/src/filters/renderer/VideoRenderers/RenderersSettings.h
+++ b/src/filters/renderer/VideoRenderers/RenderersSettings.h
@@ -86,6 +86,7 @@ public:
bool iVMR9FullscreenGUISupport;
bool iVMR9VSync;
bool iVMR9FullFloatingPointProcessing;
+ bool iVMR9HalfFloatingPointProcessing;
bool iVMR9ColorManagementEnable;
int iVMR9ColorManagementInput;
int iVMR9ColorManagementAmbientLight;
diff --git a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
index 9a1a35eab..6a84b881a 100644
--- a/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
+++ b/src/filters/renderer/VideoRenderers/SyncRenderer.cpp
@@ -2,7 +2,7 @@
* $Id$
*
* (C) 2003-2006 Gabest
-* (C) 2006-2010 see AUTHORS
+* (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -271,7 +271,7 @@ HRESULT CBaseAP::TextureBlt(IDirect3DDevice9* pD3DDev, MYD3DVERTEX<texcoords> v[
for(int i = 0; i < texcoords; i++) {
hr = pD3DDev->SetSamplerState(i, D3DSAMP_MAGFILTER, filter);
hr = pD3DDev->SetSamplerState(i, D3DSAMP_MINFILTER, filter);
- hr = pD3DDev->SetSamplerState(i, D3DSAMP_MIPFILTER, filter);
+ hr = pD3DDev->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
hr = pD3DDev->SetSamplerState(i, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
hr = pD3DDev->SetSamplerState(i, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
@@ -1162,7 +1162,7 @@ HRESULT CBaseAP::TextureCopy(IDirect3DTexture9* pTexture)
v[i].y -= 0.5;
}
hr = m_pD3DDev->SetTexture(0, pTexture);
- return TextureBlt(m_pD3DDev, v, D3DTEXF_LINEAR);
+ return TextureBlt(m_pD3DDev, v, D3DTEXF_POINT);
}
HRESULT CBaseAP::DrawRect(DWORD _Color, DWORD _Alpha, const CRect &_Rect)
@@ -1409,9 +1409,9 @@ HRESULT CBaseAP::AlphaBlt(RECT* pSrc, RECT* pDst, IDirect3DTexture9* pTexture)
hr = m_pD3DDev->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
hr = m_pD3DDev->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
- hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
- hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
- hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
+ hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_NONE);
hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
hr = m_pD3DDev->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
@@ -1968,34 +1968,30 @@ void CBaseAP::DrawStats()
OffsetRect(&rc, 0, TextHeight);
if (pApp->m_fDisplayStats == 1) {
- strText.Format(L"Frame cycle: %.3f ms [%.3f ms, %.3f ms] | Frame rate: %.3f fps", m_dFrameCycle, m_pGenlock->minFrameCycle, m_pGenlock->maxFrameCycle, m_fps);
+ strText.Format(L"Frame cycle : %.3f ms [%.3f ms, %.3f ms] Actual %+5.3f ms [%+.3f ms, %+.3f ms]", m_dFrameCycle, m_pGenlock->minFrameCycle, m_pGenlock->maxFrameCycle, m_fJitterMean / 10000.0, (double(llMinJitter)/10000.0), (double(llMaxJitter)/10000.0));
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
- strText.Format(L"Measured closest match display cycle: %.3f ms | Measured base display cycle: %.3f ms", m_dOptimumDisplayCycle, m_dEstRefreshCycle);
+ strText.Format(L"Display cycle: Measured closest match %.3f ms Measured base %.3f ms", m_dOptimumDisplayCycle, m_dEstRefreshCycle);
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
- strText.Format(L"Display cycle - frame cycle mismatch: %.3f %%", 100 * m_dCycleDifference);
+ strText.Format(L"Frame rate : %.3f fps Actual frame rate: %.3f fps", m_fps, 10000000.0 / m_fJitterMean);
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
- strText.Format(L"Actual frame cycle: %+5.3f ms [%+.3f ms, %+.3f ms] | Actual frame rate: %.3f fps", m_fJitterMean / 10000.0, (double(llMinJitter)/10000.0), (double(llMaxJitter)/10000.0), 10000000.0 / m_fJitterMean);
- DrawText(rc, strText, 1);
- OffsetRect(&rc, 0, TextHeight);
-
- strText.Format(L"Display cycle from Windows: %.3f ms | Display refresh rate from Windows: %d Hz", m_dD3DRefreshCycle, m_uD3DRefreshRate);
+ strText.Format(L"Windows : Display cycle %.3f ms Display refresh rate %d Hz", m_dD3DRefreshCycle, m_uD3DRefreshRate);
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
if (m_pGenlock->powerstripTimingExists) {
- strText.Format(L"Display cycle from Powerstrip: %.3f ms | Display refresh rate from Powerstrip: %.3f Hz", 1000.0 / m_pGenlock->curDisplayFreq, m_pGenlock->curDisplayFreq);
+ strText.Format(L"Powerstrip : Display cycle %.3f ms Display refresh rate %.3f Hz", 1000.0 / m_pGenlock->curDisplayFreq, m_pGenlock->curDisplayFreq);
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
}
if ((m_caps.Caps & D3DCAPS_READ_SCANLINE) == 0) {
- strText.Format(L"Graphics device does not support scan line access. No sync is possible");
+ strText.Format(L"Scan line err: Graphics device does not support scan line access. No sync is possible");
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
}
@@ -2034,62 +2030,52 @@ void CBaseAP::DrawStats()
}
#endif
- strText.Format(L"Video resolution: %d x %d | Aspect ratio: %d : %d", m_NativeVideoSize.cx, m_NativeVideoSize.cy, m_AspectRatio.cx, m_AspectRatio.cy);
- DrawText(rc, strText, 1);
- OffsetRect(&rc, 0, TextHeight);
-
- strText.Format(L"Display resolution: %d x %d", m_ScreenSize.cx, m_ScreenSize.cy);
+ strText.Format(L"Video size : %d x %d (AR = %d : %d) Display resolution %d x %d ", m_NativeVideoSize.cx, m_NativeVideoSize.cy, m_AspectRatio.cx, m_AspectRatio.cy, m_ScreenSize.cx, m_ScreenSize.cy);
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
if (s.m_RenderSettings.bSynchronizeDisplay || s.m_RenderSettings.bSynchronizeVideo) {
if (s.m_RenderSettings.bSynchronizeDisplay && !m_pGenlock->PowerstripRunning()) {
- strText.Format(L"PowerStrip is not running. No display sync is possible.");
+ strText.Format(L"Sync error : PowerStrip is not running. No display sync is possible.");
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
} else {
- strText.Format(L"Sync adjustment: %d | # of adjustments: %d", m_pGenlock->adjDelta, (m_pGenlock->clockAdjustmentsMade + m_pGenlock->displayAdjustmentsMade) / 2);
+ strText.Format(L"Sync adjust : %d | # of adjustments: %d", m_pGenlock->adjDelta, (m_pGenlock->clockAdjustmentsMade + m_pGenlock->displayAdjustmentsMade) / 2);
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
}
}
}
- strText.Format(L"Average sync offset: %3.1f ms [%.1f ms, %.1f ms] | Target sync offset: %3.1f ms", m_pGenlock->syncOffsetAvg, m_pGenlock->minSyncOffset, m_pGenlock->maxSyncOffset, s.m_RenderSettings.fTargetSyncOffset);
+ strText.Format(L"Sync offset : Average %3.1f ms [%.1f ms, %.1f ms] Target %3.1f ms", m_pGenlock->syncOffsetAvg, m_pGenlock->minSyncOffset, m_pGenlock->maxSyncOffset, s.m_RenderSettings.fTargetSyncOffset);
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
- if (pApp->m_fDisplayStats < 3) {
- strText.Format(L"# of sync glitches: %d", m_uSyncGlitches);
- DrawText(rc, strText, 1);
- OffsetRect(&rc, 0, TextHeight);
-
- strText.Format(L"# of frames dropped: %d", m_pcFramesDropped);
- DrawText(rc, strText, 1);
- OffsetRect(&rc, 0, TextHeight);
- }
+ strText.Format(L"Sync status : glitches %d, display-frame cycle mismatch: %7.3f %%, dropped frames %d", m_uSyncGlitches, 100 * m_dCycleDifference, m_pcFramesDropped);
+ DrawText(rc, strText, 1);
+ OffsetRect(&rc, 0, TextHeight);
if (pApp->m_fDisplayStats == 1) {
if (m_pAudioStats && s.m_RenderSettings.bSynchronizeVideo) {
- strText.Format(L"Audio lag: %3d ms [%d ms, %d ms] | %s", m_lAudioLag, m_lAudioLagMin, m_lAudioLagMax, (m_lAudioSlaveMode == 4) ? _T("Audio renderer is matching rate (for analog sound output)") : _T("Audio renderer is not matching rate"));
+ strText.Format(L"Audio lag : %3d ms [%d ms, %d ms] | %s", m_lAudioLag, m_lAudioLagMin, m_lAudioLagMax, (m_lAudioSlaveMode == 4) ? _T("Audio renderer is matching rate (for analog sound output)") : _T("Audio renderer is not matching rate"));
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
}
- strText.Format(L"Sample waiting time: %d ms", m_lNextSampleWait);
- DrawText(rc, strText, 1);
- OffsetRect(&rc, 0, TextHeight);
+ strText.Format(L"Sample time : waiting %3d ms", m_lNextSampleWait);
if (s.m_RenderSettings.bSynchronizeNearest) {
- strText.Format(L"Sample paint time correction: %2d ms | Hysteresis: %d", m_lShiftToNearest, m_llHysteresis /10000);
- DrawText(rc, strText, 1);
- OffsetRect(&rc, 0, TextHeight);
+ CString temp;
+ temp.Format(L" paint time correction: %3d ms Hysteresis: %d", m_lShiftToNearest, m_llHysteresis /10000);
+ strText += temp;
}
+ DrawText(rc, strText, 1);
+ OffsetRect(&rc, 0, TextHeight);
- strText.Format(L"Buffered: %3d | Free: %3d | Current surface: %3d", m_nUsedBuffer, m_nDXSurface - m_nUsedBuffer, m_nCurSurface, m_nVMR9Surfaces, m_iVMR9Surface);
+ strText.Format(L"Buffering : Buffered %3d Free %3d Current Surface %3d", m_nUsedBuffer, m_nDXSurface - m_nUsedBuffer, m_nCurSurface, m_nVMR9Surfaces, m_iVMR9Surface);
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
- strText.Format(L"Settings: ");
+ strText.Format(L"Settings : ");
if (m_bIsFullscreen) {
strText += "D3DFS ";
@@ -2118,11 +2104,11 @@ void CBaseAP::DrawStats()
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
- strText.Format(L"%s: %s", GetDXVAVersion(), GetDXVADecoderDescription());
+ strText.Format(L"%-13s: %s", GetDXVAVersion(), GetDXVADecoderDescription());
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
- strText.Format(L"DirectX SDK: %d", GetRenderersData()->GetDXSdkRelease());
+ strText.Format(L"DirectX SDK : %d", GetRenderersData()->GetDXSdkRelease());
DrawText(rc, strText, 1);
OffsetRect(&rc, 0, TextHeight);
@@ -2984,7 +2970,7 @@ HRESULT CSyncAP::SetMediaType(IMFMediaType* pType)
if (SUCCEEDED(hr)) {
strTemp = GetMediaTypeName(pAMMedia->subtype);
strTemp.Replace(L"MEDIASUBTYPE_", L"");
- m_strStatsMsg[MSG_MIXEROUT].Format (L"Mixer output: %s", strTemp);
+ m_strStatsMsg[MSG_MIXEROUT].Format (L"Mixer output : %s", strTemp);
}
pType->FreeRepresentation(FORMAT_VideoInfo2, (void*)pAMMedia);
diff --git a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
index a8c763324..8b9542f96 100644
--- a/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
+++ b/src/filters/renderer/VideoRenderers/madVRAllocatorPresenter.h
@@ -1,7 +1,7 @@
/*
* $Id$
*
- * (C) 2006-2010 see AUTHORS
+ * (C) 2006-2011 see AUTHORS
*
* This file is part of mplayerc.
*
@@ -23,8 +23,8 @@
#pragma once
#include "AllocatorCommon.h"
-#include "../SubPic/SubPicAllocatorPresenterImpl.h"
-#include "../SubPic/ISubRender.h"
+#include "../../../SubPic/SubPicAllocatorPresenterImpl.h"
+#include "../../../SubPic/ISubRender.h"
namespace DSObjects
{
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/ffcodecs.h b/src/filters/transform/MPCVideoDec/ffmpeg/ffcodecs.h
index 22b6a4130..e64f71913 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/ffcodecs.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/ffcodecs.h
@@ -302,11 +302,11 @@ static __inline bool sup_VBR_QUAL(int x)
}
static __inline bool sup_VBR_QUANT(int x)
{
- return (lavc_codec(x) || xvid_codec(x)) && !lossless_codec(x) && x!=CODEC_ID_SNOW;
+ return (lavc_codec(x) || xvid_codec(x)) && !lossless_codec(x);
}
static __inline bool sup_XVID2PASS(int x)
{
- return sup_VBR_QUANT(x) && x!=CODEC_ID_SNOW;
+ return sup_VBR_QUANT(x);
}
static __inline bool sup_LAVC2PASS(int x)
{
@@ -319,7 +319,7 @@ static __inline bool sup_interlace(int x)
}
static __inline bool sup_gray(int x)
{
- return x!=CODEC_ID_LJPEG && x!=CODEC_ID_FFV1 && x!=CODEC_ID_SNOW && !wmv9_codec(x) && !raw_codec(x) && x!=CODEC_ID_DVVIDEO;
+ return x!=CODEC_ID_LJPEG && x!=CODEC_ID_FFV1 && !wmv9_codec(x) && !raw_codec(x) && x!=CODEC_ID_DVVIDEO;
}
static __inline bool sup_globalheader(int x)
{
@@ -335,7 +335,7 @@ static __inline bool sup_packedBitstream(int x)
}
static __inline bool sup_minKeySet(int x)
{
- return x!=CODEC_ID_MJPEG && x!=CODEC_ID_SNOW && !lossless_codec(x) && !wmv9_codec(x) && !raw_codec(x);
+ return x!=CODEC_ID_MJPEG && !lossless_codec(x) && !wmv9_codec(x) && !raw_codec(x);
}
static __inline bool sup_maxKeySet(int x)
{
@@ -359,7 +359,7 @@ static __inline bool sup_lavcme(int x)
}
static __inline bool sup_quantProps(int x)
{
- return !lossless_codec(x) && !wmv9_codec(x) && !raw_codec(x) && x!=CODEC_ID_SNOW;
+ return !lossless_codec(x) && !wmv9_codec(x) && !raw_codec(x);
}
static __inline bool sup_trellisQuant(int x)
{
@@ -375,15 +375,15 @@ static __inline bool sup_lavcOnePass(int x)
}
static __inline bool sup_perFrameQuant(int x)
{
- return !lossless_codec(x) && !wmv9_codec(x) && !raw_codec(x) && x!=CODEC_ID_SNOW;
+ return !lossless_codec(x) && !wmv9_codec(x) && !raw_codec(x);
}
static __inline bool sup_4mv(int x)
{
- return x==CODEC_ID_MPEG4 || x==CODEC_ID_H263 || x==CODEC_ID_H263P || x==CODEC_ID_SNOW;
+ return x==CODEC_ID_MPEG4 || x==CODEC_ID_H263 || x==CODEC_ID_H263P;
}
static __inline bool sup_aspect(int x)
{
- return x==CODEC_ID_MPEG4 || x==CODEC_ID_MPEG1VIDEO || x==CODEC_ID_MPEG2VIDEO || x==CODEC_ID_XVID4;
+ return x==CODEC_ID_MPEG4 || x==CODEC_ID_MPEG1VIDEO || x==CODEC_ID_MPEG2VIDEO;
}
static __inline bool sup_PSNR(int x)
{
@@ -407,7 +407,7 @@ static __inline bool sup_customQuantTables(int x)
}
static __inline bool sup_qpel(int x)
{
- return x==CODEC_ID_MPEG4 || x==CODEC_ID_SNOW || xvid_codec(x);
+ return x==CODEC_ID_MPEG4 || xvid_codec(x);
}
static __inline bool sup_gmc(int x)
{
@@ -415,7 +415,7 @@ static __inline bool sup_gmc(int x)
}
static __inline bool sup_me_mv0(int x)
{
- return sup_lavcme(x) && x!=CODEC_ID_SNOW;
+ return sup_lavcme(x);
}
static __inline bool sup_cbp_rd(int x)
{
@@ -423,7 +423,7 @@ static __inline bool sup_cbp_rd(int x)
}
static __inline bool sup_qns(int x)
{
- return lavc_codec(x) && sup_quantProps(x) && x!=CODEC_ID_MSMPEG4V3 && x!=CODEC_ID_MSMPEG4V2 && x!=CODEC_ID_MSMPEG4V1 && x!=CODEC_ID_WMV1 && x!=CODEC_ID_WMV2 && x!=CODEC_ID_MJPEG && x!=CODEC_ID_SNOW;
+ return lavc_codec(x) && sup_quantProps(x) && x!=CODEC_ID_MSMPEG4V3 && x!=CODEC_ID_MSMPEG4V2 && x!=CODEC_ID_MSMPEG4V1 && x!=CODEC_ID_WMV1 && x!=CODEC_ID_WMV2 && x!=CODEC_ID_MJPEG;
}
static __inline bool sup_threads(int x)
{
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/allcodecs.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/allcodecs.c
index c760fdcb5..a8053a9ae 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/allcodecs.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/allcodecs.c
@@ -149,6 +149,7 @@ void avcodec_register_all(void)
//REGISTER_DECODER (WMAV1, wmav1);
//REGISTER_DECODER (WMAV2, wmav2);
//REGISTER_DECODER (WAVPACK, wavpack);
+
//REGISTER_ENCODER (AC3, ac3);
//REGISTER_ENCODER (AC3_FIXED, ac3_fixed);
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
index 43f308393..03374cfe8 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/avcodec.h
@@ -46,8 +46,8 @@
#include "libavutil/cpu.h"
#define LIBAVCODEC_VERSION_MAJOR 52
-#define LIBAVCODEC_VERSION_MINOR 103
-#define LIBAVCODEC_VERSION_MICRO 1
+#define LIBAVCODEC_VERSION_MINOR 108
+#define LIBAVCODEC_VERSION_MICRO 0
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
@@ -718,6 +718,7 @@ typedef struct AVPanScan{
* that time,\
* the decoder reorders values as needed and sets AVFrame.reordered_opaque\
* to exactly one of the values provided by the user through AVCodecContext.reordered_opaque \
+ * @deprecated in favor of pkt_pts\
* - encoding: unused\
* - decoding: Read by user.\
*/\
@@ -732,13 +733,25 @@ typedef struct AVPanScan{
*/\
void *hwaccel_picture_private;\
\
- /* ffdshow custom code */\
+ /**\
+ * reordered pts from the last AVPacket that has been input into the decoder\
+ * - encoding: unused\
+ * - decoding: Read by user.\
+ */\
+ int64_t pkt_pts;\
+\
+ /**\
+ * dts from the last AVPacket that has been input into the decoder\
+ * - encoding: unused\
+ * - decoding: Read by user.\
+ */\
+ int64_t pkt_dts;\
+\
+ /* ffdshow custom code (begin) */\
int mb_width,mb_height,mb_stride,b8_stride;\
int num_sprite_warping_points,real_sprite_warping_points;\
int play_flags;\
\
- /* ffdshow custom stuff (begin) */\
-\
/**\
* the AVCodecContext which ff_thread_get_buffer() was last called on\
* - encoding: Set by libavcodec.\
@@ -772,7 +785,7 @@ typedef struct AVPanScan{
* - decoding: Set by libavcodec.\
*/\
YCbCr_RGB_MatrixCoefficientsType YCbCr_RGB_matrix_coefficients;
- /* ffdshow custom stuff (end) */
+ /* ffdshow custom code (end) */
#define FF_QSCALE_TYPE_MPEG1 0
@@ -2328,6 +2341,7 @@ typedef struct AVCodecContext {
/**
* opaque 64bit number (generally a PTS) that will be reordered and
* output in AVFrame.reordered_opaque
+ * @deprecated in favor of pkt_pts
* - encoding: unused
* - decoding: Set by user.
*/
@@ -2521,6 +2535,15 @@ typedef struct AVCodecContext {
*/
int slices;
+ /**
+ * Current packet as passed into the decoder, to avoid having
+ * to pass the packet into every function. Currently only valid
+ * inside lavc and get/release_buffer callbacks.
+ * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
+ * - encoding: unused
+ */
+ AVPacket *pkt;
+
/* ffdshow custom stuff (begin) */
/**
* Whether this is a copy of the context which had init() called on it.
@@ -2549,7 +2572,7 @@ typedef struct AVCodecContext {
* - decoding: Set by libavcodec.
*/
int active_thread_type;
-
+
/**
* minimum and maxminum quantizer for I frames. If 0, derived from qmin, i_quant_factor, i_quant_offset
* - encoding: set by user.
@@ -2584,6 +2607,14 @@ typedef struct AVCodecContext {
} AVCodecContext;
/**
+ * AVProfile.
+ */
+typedef struct AVProfile {
+ int profile;
+ const char *name; ///< short name for the profile
+} AVProfile;
+
+/**
* AVHWAccel.
*/
typedef struct AVHWAccel {
@@ -2715,28 +2746,11 @@ typedef struct AVCodec {
uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
/* ffmpeg-mt */
- /**
- * @defgroup framethreading Frame-level threading support functions.
- * @{
- */
- /**
- * If defined, called on thread contexts when they are created.
- * If the codec allocates writable tables in init(), re-allocate them here.
- * priv_data will be set to a copy of the original.
- */
int (*init_thread_copy)(AVCodecContext *);
- /**
- * Copy necessary context variables from a previous thread context to the current one.
- * If not defined, the next thread will start automatically; otherwise, the codec
- * must call ff_thread_finish_setup().
- *
- * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
- */
int (*update_thread_context)(AVCodecContext *dst, AVCodecContext *src);
- /** @} */
-
- /* this must be at the end of the struct */
+
AVClass *priv_class; ///< AVClass for the private context
+ const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
} AVCodec;
/**
@@ -2825,6 +2839,15 @@ AVCodec *avcodec_find_decoder_by_name(const char *name);
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
/**
+ * Return a name for the specified profile, if available.
+ *
+ * @param codec the codec that is searched for the given profile
+ * @param profile the profile value for which a name is requested
+ * @return A name for the profile if found, NULL otherwise.
+ */
+const char *av_get_profile_name(const AVCodec *codec, int profile);
+
+/**
* Set the fields of the given AVCodecContext to default values.
*
* @param s The AVCodecContext of which the fields should be set to default values.
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c
index d6f9a63f4..f63cd5b1d 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/h264.c
@@ -1308,7 +1308,8 @@ static int pred_weight_table(H264Context *h){
h->use_weight= 0;
h->use_weight_chroma= 0;
h->luma_log2_weight_denom= get_ue_golomb(&s->gb);
- h->chroma_log2_weight_denom= get_ue_golomb(&s->gb);
+ if(CHROMA)
+ h->chroma_log2_weight_denom= get_ue_golomb(&s->gb);
luma_def = 1<<h->luma_log2_weight_denom;
chroma_def = 1<<h->chroma_log2_weight_denom;
diff --git a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
index 06ffd6b8c..d1dcc426d 100644
--- a/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
+++ b/src/filters/transform/MPCVideoDec/ffmpeg/libavcodec/utils.c
@@ -328,6 +328,8 @@ int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){
}
s->internal_buffer_count++;
+ if(s->pkt) pic->pkt_pts= s->pkt->pts;
+ else pic->pkt_pts= AV_NOPTS_VALUE;
pic->reordered_opaque= s->reordered_opaque;
pic->reordered_opaque2= s->reordered_opaque2; /* ffdshow custom code */
pic->reordered_opaque3= s->reordered_opaque3; /* ffdshow custom code */
@@ -467,11 +469,13 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
goto end;
if (codec->priv_data_size > 0) {
+ if(!avctx->priv_data){
avctx->priv_data = av_mallocz(codec->priv_data_size);
if (!avctx->priv_data) {
ret = AVERROR(ENOMEM);
goto end;
}
+ }
} else {
avctx->priv_data = NULL;
}
@@ -583,12 +587,17 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi
*got_picture_ptr= 0;
if((avctx->coded_width||avctx->coded_height) && av_image_check_size(avctx->coded_width, avctx->coded_height, 0, avctx))
return -1;
+
+ avctx->pkt = avpkt;
+
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
avpkt);
emms_c(); //needed to avoid an emms_c() call before every return;
+ picture->pkt_dts= avpkt->dts;
+
if (*got_picture_ptr)
avctx->frame_number++;
}else
@@ -617,6 +626,8 @@ int attribute_align_arg avcodec_decode_audio3(AVCodecContext *avctx, int16_t *sa
{
int ret;
+ avctx->pkt = avpkt;
+
if((avctx->codec->capabilities & CODEC_CAP_DELAY) || avpkt->size){
//FIXME remove the check below _after_ ensuring that all audio check that the available space is enough
if(*frame_size_ptr < AVCODEC_MAX_AUDIO_FRAME_SIZE){
diff --git a/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp b/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp
index 79196273c..cf15ff9a5 100644
--- a/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp
+++ b/src/filters/transform/VSFilter/DirectVobSubPropPage.cpp
@@ -780,9 +780,9 @@ bool CDVSAboutPPage::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
switch(uMsg) {
case WM_INITDIALOG: {
#ifdef _VSMOD
- SetDlgItemTextA( m_Dlg, IDC_VERSION, "DirectVobSub 2.40."MAKE_STR(MPC_VERSION_REV)"."MAKE_STR(MPC_VERSION_PATCH)" "MAKE_STR(VERSION_ARCH)", MOD\nCopyright 2001-2010 MPC-HC & VSFilterMod Teams" );
+ SetDlgItemTextA( m_Dlg, IDC_VERSION, "DirectVobSub 2.40."MAKE_STR(MPC_VERSION_PATCH)"."MAKE_STR(MPC_VERSION_REV)" "MAKE_STR(VERSION_ARCH)", MOD\nCopyright 2001-2010 MPC-HC & VSFilterMod Teams" );
#else
- SetDlgItemTextA( m_Dlg, IDC_VERSION, "DirectVobSub 2.40."MAKE_STR(MPC_VERSION_REV)"."MAKE_STR(MPC_VERSION_PATCH)" "MAKE_STR(VERSION_ARCH)"\nCopyright 2001-2010 MPC-HC Team" );
+ SetDlgItemTextA( m_Dlg, IDC_VERSION, "DirectVobSub 2.40."MAKE_STR(MPC_VERSION_PATCH)"."MAKE_STR(MPC_VERSION_REV)" "MAKE_STR(VERSION_ARCH)"\nCopyright 2001-2010 MPC-HC Team" );
#endif
}
break;