[dxva] Prefer standard Microsoft H.264 device instead of Intel H.264 VLD, no FGT...
authorAnton Fedchin <afedchin@ruswizards.com>
Mon, 10 Feb 2014 14:46:07 +0000 (18:46 +0400)
committerAnton Fedchin <afedchin@ruswizards.com>
Fri, 7 Mar 2014 17:18:50 +0000 (21:18 +0400)
This fix h264 decoding with refs > 11 on recent Intel GPUs (SNB/IVB). The latest Intel drivers for IVB/Haswell already has no support old Intel H.264 VLD, no FGT (ClearVideo) device, so this actually needs for SNB and older.

xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp

index e82b0d4..369a447 100644 (file)
@@ -103,11 +103,13 @@ static const dxva2_mode_t dxva2_modes[] = {
     { "MPEG2 MoComp", &DXVA2_ModeMPEG2_MoComp,  0 },
     { "MPEG2 IDCT",   &DXVA2_ModeMPEG2_IDCT,    0 },
 
-    // Intel drivers return standard modes in addition to the Intel specific ones. Try the Intel specific first, they work better for Sandy Bridges.
+#ifndef FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO
+    /* We must prefer Intel specific ones if the flag doesn't exists */
     { "Intel H.264 VLD, no FGT",                                      &DXVADDI_Intel_ModeH264_E, AV_CODEC_ID_H264 },
     { "Intel H.264 inverse discrete cosine transform (IDCT), no FGT", &DXVADDI_Intel_ModeH264_C, 0 },
     { "Intel H.264 motion compensation (MoComp), no FGT",             &DXVADDI_Intel_ModeH264_A, 0 },
     { "Intel VC-1 VLD",                                               &DXVADDI_Intel_ModeVC1_E,  0 },
+#endif
 
     { "H.264 variable-length decoder (VLD), FGT",               &DXVA2_ModeH264_F, AV_CODEC_ID_H264 },
     { "H.264 VLD, no FGT",                                      &DXVA2_ModeH264_E, AV_CODEC_ID_H264 },
@@ -131,6 +133,14 @@ static const dxva2_mode_t dxva2_modes[] = {
     { "VC-1 MoComp",          &DXVA2_ModeVC1_B,    0 },
     { "VC-1 post processing", &DXVA2_ModeVC1_A,    0 },
 
+#ifdef FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO
+    /* Intel specific modes (only useful on older GPUs) */
+    { "Intel H.264 VLD, no FGT",                                      &DXVADDI_Intel_ModeH264_E, AV_CODEC_ID_H264 },
+    { "Intel H.264 inverse discrete cosine transform (IDCT), no FGT", &DXVADDI_Intel_ModeH264_C, 0 },
+    { "Intel H.264 motion compensation (MoComp), no FGT",             &DXVADDI_Intel_ModeH264_A, 0 },
+    { "Intel VC-1 VLD",                                               &DXVADDI_Intel_ModeVC1_E,  0 },
+#endif
+
     { NULL, NULL, 0 }
 };