Advertisement
Guest User

Untitled

a guest
Mar 26th, 2011
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 19.37 KB | None | 0 0
  1. diff --git a/language/English/strings.xml b/language/English/strings.xml
  2. index 95d081f..2d8bcf6 100644
  3. --- a/language/English/strings.xml
  4. +++ b/language/English/strings.xml
  5. @@ -1517,6 +1517,8 @@
  6.    <string id="16317">Temporal (Half)</string>
  7.    <string id="16318">Temporal/Spatial (Half)</string>
  8.    <string id="16319">DXVA</string>
  9. +  <string id="16320">Best available</string>
  10. +  <string id="16321">Best available (inverted)</string>
  11.  
  12.    <string id="16400">Post-processing</string>
  13.  
  14. diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp
  15. index 8e8486b..8e2bd10 100644
  16. --- a/xbmc/cores/VideoRenderers/RenderManager.cpp
  17. +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp
  18. @@ -517,7 +517,7 @@ void CXBMCRenderManager::FlipPage(volatile bool& bStop, double timestamp /* = 0L
  19.      {
  20.        if(m_presentfield == FS_NONE)
  21.          m_presentmethod = VS_INTERLACEMETHOD_NONE;
  22. -      else if(m_pRenderer->Supports(VS_INTERLACEMETHOD_RENDER_BOB))
  23. +      else if(m_pRenderer->Supports(VS_INTERLACEMETHOD_RENDER_BOB) || m_pRenderer->Supports(VS_INTERLACEMETHOD_DXVA_BOB))
  24.          m_presentmethod = VS_INTERLACEMETHOD_RENDER_BOB;
  25.        else
  26.          m_presentmethod = VS_INTERLACEMETHOD_NONE;
  27. @@ -583,8 +583,12 @@ void CXBMCRenderManager::Present()
  28.  
  29.    CSharedLock lock(m_sharedSection);
  30.  
  31. -  if     ( m_presentmethod == VS_INTERLACEMETHOD_RENDER_BOB
  32. -        || m_presentmethod == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED)
  33. +  if ( m_presentmethod == VS_INTERLACEMETHOD_RENDER_BOB
  34. +    || m_presentmethod == VS_INTERLACEMETHOD_RENDER_BOB_INVERTED
  35. +    || m_presentmethod == VS_INTERLACEMETHOD_DXVA_BOB
  36. +    || m_presentmethod == VS_INTERLACEMETHOD_DXVA_BOB_INVERTED
  37. +    || m_presentmethod == VS_INTERLACEMETHOD_DXVA_HQ
  38. +    || m_presentmethod == VS_INTERLACEMETHOD_DXVA_HQ_INVERTED)
  39.      PresentBob();
  40.    else if( m_presentmethod == VS_INTERLACEMETHOD_RENDER_WEAVE
  41.          || m_presentmethod == VS_INTERLACEMETHOD_RENDER_WEAVE_INVERTED)
  42. diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp
  43. index 0fada69..201427c 100644
  44. --- a/xbmc/cores/VideoRenderers/WinRenderer.cpp
  45. +++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp
  46. @@ -957,7 +957,7 @@ void CWinRenderer::RenderProcessor(DWORD flags)
  47.      return;
  48.    }
  49.  
  50. -  image->proc->Render(rect, target, image->id);
  51. +  image->proc->Render(rect, target, image->id, flags == RENDER_FLAG_BOT ? 1 : 0);
  52.  
  53.    target->Release();
  54.  }
  55. @@ -1045,7 +1045,12 @@ bool CWinRenderer::Supports(EINTERLACEMETHOD method)
  56.  {
  57.    if(CONF_FLAGS_FORMAT_MASK(m_flags) == CONF_FLAGS_FORMAT_DXVA)
  58.    {
  59. -    if(method == VS_INTERLACEMETHOD_NONE)
  60. +    if(method == VS_INTERLACEMETHOD_NONE
  61. +    || method == VS_INTERLACEMETHOD_DXVA_BOB
  62. +    || method == VS_INTERLACEMETHOD_DXVA_BOB_INVERTED
  63. +    || method == VS_INTERLACEMETHOD_DXVA_HQ
  64. +    || method == VS_INTERLACEMETHOD_DXVA_HQ_INVERTED
  65. +    || method == VS_INTERLACEMETHOD_AUTO)
  66.        return true;
  67.      return false;
  68.    }
  69. diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
  70. index cafaff0..1929f49 100644
  71. --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
  72. +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp
  73. @@ -120,6 +120,49 @@ static const dxva2_mode_t dxva2_modes[] = {
  74.      { NULL, NULL, 0 }
  75.  };
  76.  
  77. +DEFINE_GUID(DXVA2_VideoProcATIVectorAdaptiveDevice,   0x3C5323C1,0x6fb7,0x44f5,0x90,0x81,0x05,0x6b,0xf2,0xee,0x44,0x9d);
  78. +DEFINE_GUID(DXVA2_VideoProcATIMotionAdaptiveDevice,   0x552C0DAD,0xccbc,0x420b,0x83,0xc8,0x74,0x94,0x3c,0xf9,0xf1,0xa6);
  79. +DEFINE_GUID(DXVA2_VideoProcATIAdaptiveDevice,         0x6E8329FF,0xb642,0x418b,0xbc,0xf0,0xbc,0xb6,0x59,0x1e,0x25,0x5f);
  80. +DEFINE_GUID(DXVA2_VideoProcNVidiaAdaptiveDevice,      0x6CB69578,0x7617,0x4637,0x91,0xE5,0x1C,0x02,0xDB,0x81,0x02,0x85);
  81. +DEFINE_GUID(DXVA2_VideoProcIntelEdgeDevice,           0xBF752EF6,0x8CC4,0x457A,0xBE,0x1B,0x08,0xBD,0x1C,0xAE,0xEE,0x9F);
  82. +
  83. +typedef struct {
  84. +  const char   *name;
  85. +  const GUID   *guid;
  86. +  int          score;
  87. +} dxva2_device_t;
  88. +
  89. +// List of all known DXVA2 processor devices and their deinterlace scores (0 = progressive or standard bob)
  90. +static const dxva2_device_t dxva2_devices[] = {
  91. +  { "Vector adaptive device (ATI)",       &DXVA2_VideoProcATIVectorAdaptiveDevice,   100 },
  92. +  { "Motion adaptive device (ATI)",       &DXVA2_VideoProcATIMotionAdaptiveDevice,    90 },
  93. +  { "Adaptive device (ATI)",              &DXVA2_VideoProcATIAdaptiveDevice,          80 },
  94. +  { "Spatial-temporal device (nVidia)",   &DXVA2_VideoProcNVidiaAdaptiveDevice,      100 },
  95. +  { "Edge directed device (Intel)",       &DXVA2_VideoProcIntelEdgeDevice,           100 },
  96. +  { "Bob device",                         &DXVA2_VideoProcBobDevice,                   0 },
  97. +  { "Progressive device",                 &DXVA2_VideoProcProgressiveDevice,           0 },
  98. +  { NULL, NULL, 0 }
  99. +};
  100. +
  101. +typedef struct {
  102. +  const char   *name;
  103. +  unsigned     deinterlacetech_flag;
  104. +  int          score;
  105. +} dxva2_deinterlacetech_t;
  106. +
  107. +// List of all considered DXVA2 deinterlace technology flags and their scores for unknown processor devices, preferred must come first
  108. +static const dxva2_deinterlacetech_t dxva2_deinterlacetechs[] = {
  109. +  { "Motion vector steered",              DXVA2_DeinterlaceTech_MotionVectorSteered,     100 },
  110. +  { "Pixel adaptive",                     DXVA2_DeinterlaceTech_PixelAdaptive,            90 },
  111. +  { "Field adaptive",                     DXVA2_DeinterlaceTech_FieldAdaptive,            80 },
  112. +  { "Edge filtering",                     DXVA2_DeinterlaceTech_EdgeFiltering,            70 },
  113. +  { "Median filtering",                   DXVA2_DeinterlaceTech_MedianFiltering,          60 },
  114. +  { "Bob vertical stretch 4-tap",         DXVA2_DeinterlaceTech_BOBVerticalStretch4Tap,   50 },
  115. +  { "Bob vertical stretch",               DXVA2_DeinterlaceTech_BOBVerticalStretch,       40 },
  116. +  { "Bob line replicate",                 DXVA2_DeinterlaceTech_BOBLineReplicate,         30 },
  117. +  { NULL, 0, 0 }
  118. +};
  119. +
  120.  // List of PCI Device ID of ATI cards with UVD or UVD+ decoding block.
  121.  static DWORD UVDDeviceID [] = {
  122.    0x95C0, // ATI Radeon HD 3400 Series (and others)
  123. @@ -240,6 +283,8 @@ CDecoder::CDecoder()
  124.    m_buffer_count = 0;
  125.    m_buffer_age   = 0;
  126.    m_refs         = 0;
  127. +  m_SampleFormat = DXVA2_SampleProgressiveFrame;
  128. +  m_StreamSampleFormat = DXVA2_SampleProgressiveFrame;
  129.    memset(&m_format, 0, sizeof(m_format));
  130.    m_context          = (dxva_context*)calloc(1, sizeof(dxva_context));
  131.    m_context->cfg     = (DXVA2_ConfigPictureDecode*)calloc(1, sizeof(DXVA2_ConfigPictureDecode));
  132. @@ -419,9 +464,27 @@ bool CDecoder::Open(AVCodecContext *avctx, enum PixelFormat fmt)
  133.      return false;
  134.    }
  135.  
  136. +  // TODO: How to check interlace format of stream at this point?
  137. +  // It should be checked here and set m_StreamSampleFormat accordingly.
  138. +  // Right now we check in GetPicture() and adjust later, but this causes
  139. +  // 2x DXVA initialization if source is interlaced and method is automatic.
  140. +
  141. +  // Set sample format based on selected interlace method
  142. +  m_CurrInterlaceMethod = g_settings.m_currentVideoSettings.m_InterlaceMethod;
  143. +  if (m_CurrInterlaceMethod == VS_INTERLACEMETHOD_AUTO)
  144. +    m_SampleFormat = m_StreamSampleFormat;
  145. +  if (m_CurrInterlaceMethod == VS_INTERLACEMETHOD_NONE)
  146. +    m_SampleFormat = DXVA2_SampleProgressiveFrame;
  147. +  if (m_CurrInterlaceMethod == VS_INTERLACEMETHOD_DXVA_BOB
  148. +   || m_CurrInterlaceMethod == VS_INTERLACEMETHOD_DXVA_HQ)
  149. +    m_SampleFormat = DXVA2_SampleFieldInterleavedEvenFirst;
  150. +  else if (m_CurrInterlaceMethod == VS_INTERLACEMETHOD_DXVA_BOB_INVERTED
  151. +        || m_CurrInterlaceMethod == VS_INTERLACEMETHOD_DXVA_HQ_INVERTED)
  152. +    m_SampleFormat = DXVA2_SampleFieldInterleavedOddFirst;
  153. +
  154.    m_format.SampleWidth  = avctx->width;
  155.    m_format.SampleHeight = avctx->height;
  156. -  m_format.SampleFormat.SampleFormat           = DXVA2_SampleProgressiveFrame;
  157. +  m_format.SampleFormat.SampleFormat           = m_SampleFormat;
  158.    m_format.SampleFormat.VideoLighting          = DXVA2_VideoLighting_dim;
  159.  
  160.    if     (avctx->color_range == AVCOL_RANGE_JPEG)
  161. @@ -631,6 +694,12 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture
  162.    CSingleLock lock(m_section);
  163.    picture->format = DVDVideoPicture::FMT_DXVA;
  164.    picture->proc   = m_processor;
  165. +
  166. +  // Detect and store stream sample format, used for automatic deinterlacing
  167. +  if (picture->iFlags & DVP_FLAG_INTERLACED && picture->iFlags & DVP_FLAG_TOP_FIELD_FIRST) m_StreamSampleFormat = DXVA2_SampleFieldInterleavedEvenFirst;
  168. +  else if (picture->iFlags & DVP_FLAG_INTERLACED) m_StreamSampleFormat = DXVA2_SampleFieldInterleavedOddFirst;
  169. +  else m_StreamSampleFormat = DXVA2_SampleProgressiveFrame;
  170. +
  171.    if(picture->iFlags & DVP_FLAG_DROPPED)
  172.      picture->proc_id = 0;
  173.    else
  174. @@ -642,6 +711,22 @@ int CDecoder::Check(AVCodecContext* avctx)
  175.  {
  176.    CSingleLock lock(m_section);
  177.  
  178. +  // Check if deinterlacing method or stream format has changed and reinitialize decoder
  179. +  if (m_CurrInterlaceMethod != g_settings.m_currentVideoSettings.m_InterlaceMethod)
  180. +  {
  181. +    CLog::Log(LOGDEBUG,"CDecoder::Check - deinterlace method changed, recreating decoder");
  182. +    m_CurrInterlaceMethod = g_settings.m_currentVideoSettings.m_InterlaceMethod;
  183. +    Close();
  184. +    return VC_FLUSHED;
  185. +  }
  186. +  if (m_CurrInterlaceMethod == VS_INTERLACEMETHOD_AUTO && m_SampleFormat != m_StreamSampleFormat)
  187. +  {
  188. +    CLog::Log(LOGDEBUG,"CDecoder::Check - stream interlace format change detected, recreating decoder");
  189. +    m_SampleFormat = m_StreamSampleFormat;
  190. +    Close();
  191. +    return VC_FLUSHED;
  192. +  }
  193. +
  194.    if(m_state == DXVA_RESET)
  195.      Close();
  196.  
  197. @@ -721,6 +806,7 @@ int CDecoder::Check(AVCodecContext* avctx)
  198.  
  199.  bool CDecoder::OpenTarget(const GUID &guid)
  200.  {
  201. +  bool       output_found = false;
  202.    UINT       output_count = 0;
  203.    D3DFORMAT *output_list  = NULL;
  204.    CHECK(m_service->GetDecoderRenderTargets(guid, &output_count, &output_list))
  205. @@ -733,10 +819,13 @@ bool CDecoder::OpenTarget(const GUID &guid)
  206.      {
  207.        m_input         = guid;
  208.        m_format.Format = output_list[k];
  209. -      return true;
  210. +      if (output_list[k] == MAKEFOURCC('N','V','1','2'))
  211. +        return true;
  212. +      else
  213. +        output_found = true;
  214.      }
  215.    }
  216. -  return false;
  217. +  return output_found;
  218.  }
  219.  
  220.  bool CDecoder::OpenDecoder()
  221. @@ -904,6 +993,14 @@ bool CProcessor::Open(const DXVA2_VideoDesc& dsc)
  222.    CSingleLock lock(m_section);
  223.    m_desc = dsc;
  224.  
  225. +  // Handle automatic deinterlacing
  226. +  EINTERLACEMETHOD deint = g_settings.m_currentVideoSettings.m_InterlaceMethod;
  227. +  m_SampleFormat = m_desc.SampleFormat.SampleFormat;
  228. +  m_BFF = m_desc.SampleFormat.SampleFormat == DXVA2_SampleFieldInterleavedOddFirst ? true : false;
  229. +  if (deint == VS_INTERLACEMETHOD_AUTO && m_BFF) deint = VS_INTERLACEMETHOD_DXVA_HQ_INVERTED;
  230. +  else if (deint == VS_INTERLACEMETHOD_AUTO && m_desc.SampleFormat.SampleFormat != DXVA2_SampleProgressiveFrame) deint = VS_INTERLACEMETHOD_DXVA_HQ;
  231. +  else if (deint == VS_INTERLACEMETHOD_AUTO) deint = VS_INTERLACEMETHOD_NONE;
  232. +
  233.    CHECK(g_DXVA2CreateVideoService(g_Windowing.Get3DDevice(), IID_IDirectXVideoProcessorService, (void**)&m_service));
  234.  
  235.    GUID*    guid_list;
  236. @@ -918,13 +1015,80 @@ bool CProcessor::Open(const DXVA2_VideoDesc& dsc)
  237.    }
  238.  
  239.    m_device = guid_list[0];
  240. +
  241. +  GUID progdevice = GUID_NULL;
  242. +  GUID bobdevice = GUID_NULL;
  243. +  GUID knownhqdevice = GUID_NULL;
  244. +  GUID unknownhqdevice = GUID_NULL;
  245. +  int  knownhqdevicescore = 0;
  246. +  int  unknownhqdevicescore = 0;
  247. +
  248.    for(unsigned i = 0; i < guid_count; i++)
  249.    {
  250.      GUID* g = &guid_list[i];
  251. -    CLog::Log(LOGDEBUG, "DXVA - processor found %s", GUIDToString(*g).c_str());
  252. +    int   j;
  253. +
  254. +    // Lookup known devices
  255. +    for (j = 0; dxva2_devices[j].name; j++ )
  256. +    {
  257. +      if (IsEqualGUID(*g, *dxva2_devices[j].guid))
  258. +      {
  259. +        CLog::Log(LOGDEBUG, "DXVA - known processor found: %s, deinterlace quality score: %d, guid: %s", dxva2_devices[j].name, dxva2_devices[j].score, GUIDToString(*g).c_str());
  260. +        if (dxva2_devices[j].score > knownhqdevicescore)
  261. +        {
  262. +          knownhqdevice = *g;
  263. +          knownhqdevicescore = dxva2_devices[j].score;
  264. +        }
  265. +        break;
  266. +      }
  267. +      if (IsEqualGUID(*g, DXVA2_VideoProcProgressiveDevice))
  268. +        progdevice = *g;
  269. +      else if (IsEqualGUID(*g, DXVA2_VideoProcBobDevice))
  270. +        bobdevice = *g;
  271. +    }
  272. +
  273. +    // Check unknown device deinterlace capabilities
  274. +    if (!dxva2_devices[j].name)
  275. +    {
  276. +      CHECK(m_service->GetVideoProcessorCaps(*g, &m_desc, D3DFMT_X8R8G8B8, &m_caps))
  277. +      for (j = 0; dxva2_deinterlacetechs[j].name; j++)
  278. +      {
  279. +        if (m_caps.DeinterlaceTechnology & dxva2_deinterlacetechs[j].deinterlacetech_flag)
  280. +        {
  281. +          int score = dxva2_deinterlacetechs[j].score * 100 + m_caps.NumBackwardRefSamples + m_caps.NumForwardRefSamples;
  282. +          CLog::Log(LOGDEBUG, "DXVA - unknown processor found, deinterlace technology: %s, deinterlace quality score: %d, guid: %s", dxva2_deinterlacetechs[j].name, score, GUIDToString(*g).c_str());
  283. +          if (dxva2_deinterlacetechs[j].score > score)
  284. +          {
  285. +            unknownhqdevice = *g;
  286. +            unknownhqdevicescore = score;
  287. +          }
  288. +          break;
  289. +        }
  290. +      }
  291. +
  292. +      if (!dxva2_deinterlacetechs[j].name)
  293. +        CLog::Log(LOGDEBUG, "DXVA - unknown processor found (not considered), guid: %s", GUIDToString(*g).c_str());
  294. +    }
  295. +  }
  296.  
  297. -    if(IsEqualGUID(*g, DXVA2_VideoProcProgressiveDevice))
  298. -      m_device = *g;
  299. +  // Select appropriate device based on deinterlace settings
  300. +  switch (deint)
  301. +  {
  302. +    case VS_INTERLACEMETHOD_NONE:
  303. +      if (progdevice != GUID_NULL)
  304. +        m_device = progdevice;
  305. +      break;
  306. +    case VS_INTERLACEMETHOD_DXVA_BOB:
  307. +    case VS_INTERLACEMETHOD_DXVA_BOB_INVERTED:
  308. +      if (bobdevice != GUID_NULL) m_device = bobdevice;
  309. +      else if (knownhqdevice != GUID_NULL) m_device = knownhqdevice;
  310. +      else if (unknownhqdevice != GUID_NULL) m_device = unknownhqdevice;
  311. +      break;
  312. +    case VS_INTERLACEMETHOD_DXVA_HQ:
  313. +    case VS_INTERLACEMETHOD_DXVA_HQ_INVERTED:
  314. +      if (knownhqdevice != GUID_NULL) m_device = knownhqdevice;
  315. +      else if (unknownhqdevice != GUID_NULL) m_device = unknownhqdevice;
  316. +      break;
  317.    }
  318.  
  319.    CLog::Log(LOGDEBUG, "DXVA - processor selected %s", GUIDToString(m_device).c_str());
  320. @@ -1010,7 +1174,7 @@ static DXVA2_Fixed32 ConvertRange(const DXVA2_ValueRange& range, int value, int
  321.      return range.DefaultValue;
  322.  }
  323.  
  324. -bool CProcessor::Render(const RECT &dst, IDirect3DSurface9* target, REFERENCE_TIME time)
  325. +bool CProcessor::Render(const RECT &dst, IDirect3DSurface9* target, REFERENCE_TIME time, int fieldflag)
  326.  {
  327.    CSingleLock lock(m_section);
  328.  
  329. @@ -1070,13 +1234,13 @@ bool CProcessor::Render(const RECT &dst, IDirect3DSurface9* target, REFERENCE_TI
  330.    }  
  331.  
  332.    DXVA2_VideoProcessBltParams blt = {};
  333. -  blt.TargetFrame = time;
  334. +  blt.TargetFrame = time + (m_BFF ? 1 - fieldflag : fieldflag);
  335.    blt.TargetRect  = samp[0].DstRect;
  336.    blt.ConstrictionSize.cx = 0;
  337.    blt.ConstrictionSize.cy = 0;
  338.  
  339.    blt.DestFormat.VideoTransferFunction = DXVA2_VideoTransFunc_sRGB;
  340. -  blt.DestFormat.SampleFormat          = DXVA2_SampleProgressiveFrame;
  341. +  blt.DestFormat.SampleFormat          = m_SampleFormat;
  342.    blt.DestFormat.NominalRange          = DXVA2_NominalRange_0_255;
  343.    blt.Alpha = DXVA2_Fixed32OpaqueAlpha();
  344.  
  345. diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
  346. index cabd440..112eda4 100644
  347. --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
  348. +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.h
  349. @@ -20,6 +20,7 @@
  350.   */
  351.  #pragma once
  352.  
  353. +#include "settings/VideoSettings.h"
  354.  #include "DllAvCodec.h"
  355.  #include "DVDCodecs/Video/DVDVideoCodecFFmpeg.h"
  356.  #include "guilib/D3DResource.h"
  357. @@ -89,6 +90,10 @@ protected:
  358.    unsigned                     m_buffer_age;
  359.    int                          m_refs;
  360.  
  361. +  EINTERLACEMETHOD             m_CurrInterlaceMethod;
  362. +  unsigned                     m_SampleFormat;
  363. +  unsigned                     m_StreamSampleFormat;
  364. +
  365.    struct dxva_context*         m_context;
  366.  
  367.    CProcessor*                  m_processor;
  368. @@ -108,7 +113,7 @@ public:
  369.    void           Close();
  370.    void           HoldSurface(IDirect3DSurface9* surface);
  371.    REFERENCE_TIME Add(IDirect3DSurface9* source);
  372. -  bool           Render(const RECT& dst, IDirect3DSurface9* target, const REFERENCE_TIME time);
  373. +  bool           Render(const RECT& dst, IDirect3DSurface9* target, const REFERENCE_TIME time, int fieldflag);
  374.    int            Size() { return m_size; }
  375.  
  376.    CProcessor* Acquire();
  377. @@ -123,6 +128,9 @@ public:
  378.    IDirectXVideoProcessor*        m_process;
  379.    GUID                           m_device;
  380.  
  381. +  unsigned                     m_SampleFormat;
  382. +  int                          m_BFF;
  383. +
  384.    DXVA2_VideoProcessorCaps m_caps;
  385.    DXVA2_VideoDesc  m_desc;
  386.  
  387. diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
  388. index 9ea1936..ff6d4d5 100644
  389. --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
  390. +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
  391. @@ -587,7 +587,8 @@ void CDVDPlayerVideo::Process()
  392.              EINTERLACEMETHOD mInt = g_settings.m_currentVideoSettings.m_InterlaceMethod;
  393.              if((mInt == VS_INTERLACEMETHOD_DEINTERLACE)
  394.              || (mInt == VS_INTERLACEMETHOD_AUTO && (picture.iFlags & DVP_FLAG_INTERLACED)
  395. -                                                && !g_renderManager.Supports(VS_INTERLACEMETHOD_RENDER_BOB)))
  396. +                                                && !g_renderManager.Supports(VS_INTERLACEMETHOD_RENDER_BOB)
  397. +                                                && !g_renderManager.Supports(VS_INTERLACEMETHOD_DXVA_BOB)))
  398.              {
  399.                if (!sPostProcessType.empty())
  400.                  sPostProcessType += ",";
  401. diff --git a/xbmc/settings/VideoSettings.h b/xbmc/settings/VideoSettings.h
  402. index e5124f4..b5828fe 100644
  403. --- a/xbmc/settings/VideoSettings.h
  404. +++ b/xbmc/settings/VideoSettings.h
  405. @@ -51,6 +51,11 @@ enum EINTERLACEMETHOD
  406.    VS_INTERLACEMETHOD_VDPAU_TEMPORAL_HALF=13,
  407.    VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL=14,
  408.    VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL_HALF=15,
  409. +
  410. +  VS_INTERLACEMETHOD_DXVA_BOB=21,
  411. +  VS_INTERLACEMETHOD_DXVA_BOB_INVERTED=22,
  412. +  VS_INTERLACEMETHOD_DXVA_HQ=23,
  413. +  VS_INTERLACEMETHOD_DXVA_HQ_INVERTED=24,
  414.  };
  415.  
  416.  enum ESCALINGMETHOD
  417. diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
  418. index 3919993..ad57d4a 100644
  419. --- a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
  420. +++ b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp
  421. @@ -90,6 +90,10 @@ void CGUIDialogVideoSettings::CreateSettings()
  422.      entries.push_back(make_pair(VS_INTERLACEMETHOD_VDPAU_TEMPORAL_SPATIAL_HALF, 16318));
  423.      entries.push_back(make_pair(VS_INTERLACEMETHOD_VDPAU_TEMPORAL_HALF        , 16317));
  424.      entries.push_back(make_pair(VS_INTERLACEMETHOD_VDPAU_INVERSE_TELECINE     , 16314));
  425. +    entries.push_back(make_pair(VS_INTERLACEMETHOD_DXVA_BOB                   , 16021));
  426. +    entries.push_back(make_pair(VS_INTERLACEMETHOD_DXVA_BOB_INVERTED          , 16022));
  427. +    entries.push_back(make_pair(VS_INTERLACEMETHOD_DXVA_HQ                    , 16320));
  428. +    entries.push_back(make_pair(VS_INTERLACEMETHOD_DXVA_HQ_INVERTED           , 16321));
  429.  
  430.      /* remove unsupported methods */
  431.      for(vector<pair<int, int> >::iterator it = entries.begin(); it != entries.end();)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement