Skip to content

Commit 437b69a

Browse files
author
Mark Kendall
committed
OpenGL Video: Remove the YADIF opengl hardware deinterlacer.
I very much doubt anyone is actually using it, the GPU demands are extreme, it's almost impossible to maintain, I'm never going to write a GLSL or HLSL version and it will be broken by some imminent OpenGL performance improvements.
1 parent 3c324aa commit 437b69a

File tree

3 files changed

+0
-233
lines changed

3 files changed

+0
-233
lines changed

mythtv/libs/libmythtv/openglvideo.cpp

Lines changed: 0 additions & 223 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,12 +1135,6 @@ static const QString attrib_fast =
11351135
"ATTRIB tex = fragment.texcoord[0];\n"
11361136
"PARAM yuv[3] = { program.local[0..2] };\n";
11371137

1138-
static const QString var_alpha =
1139-
"TEMP alpha;\n";
1140-
1141-
static const QString tex_alpha =
1142-
"TEX alpha, tex, texture[3], %1;\n";
1143-
11441138
static const QString tex_fast =
11451139
"TEX res, tex, texture[0], %1;\n";
11461140

@@ -1242,217 +1236,6 @@ static const QString kerneldeint[2] = {
12421236
+ field_calc + deint_end_bot
12431237
};
12441238

1245-
static const QString yadif_setup =
1246-
"TEMP a,b,c,e,f,g,h,j,k,l;\n"
1247-
"TEMP a1,b1,f1,g1,h1,i1,j1,l1,m1,n1;\n"
1248-
"ALIAS d1 = f;\n"
1249-
"ALIAS k1 = g;\n"
1250-
"ALIAS c1 = prev;\n"
1251-
"ALIAS e1 = mov;\n"
1252-
"ALIAS p0 = res;\n"
1253-
"ALIAS p1 = c;\n"
1254-
"ALIAS p3 = h;\n"
1255-
"ALIAS spred1 = a;\n"
1256-
"ALIAS spred2 = b;\n"
1257-
"ALIAS spred3 = c;\n"
1258-
"ALIAS spred4 = e;\n"
1259-
"ALIAS spred5 = f;\n"
1260-
"ALIAS sscore = g;\n"
1261-
"ALIAS score1 = h;\n"
1262-
"ALIAS score2 = j;\n"
1263-
"ALIAS score3 = k;\n"
1264-
"ALIAS score4 = l;\n"
1265-
"ALIAS if1 = a1;\n"
1266-
"ALIAS if2 = b1;\n"
1267-
"TEMP p2, p4;\n"
1268-
"ALIAS diff1 = a;\n"
1269-
"ALIAS diff2 = b;\n"
1270-
"TEMP diff0;\n";
1271-
1272-
static const QString yadif_spatial_sample =
1273-
"ADD tmp, tex, {%5, %3, 0.0, 0.0};\n"
1274-
"TEX e1, tmp, texture[1], %1;\n"
1275-
"ADD tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
1276-
"TEX f1, tmp, texture[1], %1;\n"
1277-
"ADD tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
1278-
"TEX g1, tmp, texture[1], %1;\n"
1279-
"SUB tmp, tmp, {0.0, %4, 0.0, 0.0};\n"
1280-
"TEX n1, tmp, texture[1], %1;\n"
1281-
"SUB tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
1282-
"TEX m1, tmp, texture[1], %1;\n"
1283-
"SUB tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
1284-
"TEX l1, tmp, texture[1], %1;\n"
1285-
1286-
"SUB tmp, tex, {%5, %3, 0.0, 0.0};\n"
1287-
"TEX j1, tmp, texture[1], %1;\n"
1288-
"SUB tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
1289-
"TEX i1, tmp, texture[1], %1;\n"
1290-
"SUB tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
1291-
"TEX h1, tmp, texture[1], %1;\n"
1292-
"ADD tmp, tmp, {0.0, %4, 0.0, 0.0};\n"
1293-
"TEX a1, tmp, texture[1], %1;\n"
1294-
"ADD tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
1295-
"TEX b1, tmp, texture[1], %1;\n"
1296-
"ADD tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
1297-
"TEX c1, tmp, texture[1], %1;\n";
1298-
1299-
static const QString yadif_calc =
1300-
"LRP p0, 0.5, c, h;\n"
1301-
"MOV p1, f;\n"
1302-
"LRP p2, 0.5, d, i;\n"
1303-
"MOV p3, g;\n"
1304-
"LRP p4, 0.5, e, j;\n"
1305-
1306-
"SUB diff0, d, i;\n"
1307-
"ABS diff0, diff0;\n"
1308-
"SUB tmp, a, f;\n"
1309-
"ABS tmp, tmp;\n"
1310-
"SUB diff1, b, g;\n"
1311-
"ABS diff1, diff1;\n"
1312-
"LRP diff1, 0.5, diff1, tmp;\n"
1313-
"SUB tmp, k, f;\n"
1314-
"ABS tmp, tmp;\n"
1315-
"SUB diff2, g, l;\n"
1316-
"ABS diff2, diff2;\n"
1317-
"LRP diff2, 0.5, diff2, tmp;\n"
1318-
"MAX diff0, diff0, diff1;\n"
1319-
"MAX diff0, diff0, diff2;\n"
1320-
1321-
// mode < 2
1322-
"SUB tmp, p0, p1;\n"
1323-
"SUB other, p4, p3;\n"
1324-
"MIN spred1, tmp, other;\n"
1325-
"MAX spred2, tmp, other;\n"
1326-
"SUB tmp, p2, p1;\n"
1327-
"SUB other, p2, p3;\n"
1328-
"MAX spred1, spred1, tmp;\n"
1329-
"MAX spred1, spred1, other;\n"
1330-
"MIN spred2, spred2, tmp;\n"
1331-
"MIN spred2, spred2, other;\n"
1332-
"MAX spred1, spred2, -spred1;\n"
1333-
"MAX diff0, diff0, spred1;\n"
1334-
1335-
// spatial prediction
1336-
"LRP spred1, 0.5, d1, k1;\n"
1337-
"LRP spred2, 0.5, c1, l1;\n"
1338-
"LRP spred3, 0.5, b1, m1;\n"
1339-
"LRP spred4, 0.5, e1, j1;\n"
1340-
"LRP spred5, 0.5, f1, i1;\n"
1341-
1342-
"SUB sscore, c1, j1;\n"
1343-
"ABS sscore, sscore;\n"
1344-
"SUB tmp, d1, k1;\n"
1345-
"ABS tmp, tmp;\n"
1346-
"ADD sscore, sscore, tmp;\n"
1347-
"SUB tmp, e1, l1;\n"
1348-
"ABS tmp, tmp;\n"
1349-
"ADD sscore, sscore, tmp;\n"
1350-
"SUB sscore, sscore, 1.0;\n"
1351-
1352-
"SUB score1, b1, k1;\n"
1353-
"ABS score1, score1;\n"
1354-
"SUB tmp, c1, l1;\n"
1355-
"ABS tmp, tmp;\n"
1356-
"ADD score1, score1, tmp;\n"
1357-
"SUB tmp, d1, m1;\n"
1358-
"ABS tmp, tmp;\n"
1359-
"ADD score1, score1, tmp;\n"
1360-
1361-
"SUB score2, a1, l1;\n"
1362-
"ABS score2, score2;\n"
1363-
"SUB tmp, b1, m1;\n"
1364-
"ABS tmp, tmp;\n"
1365-
"ADD score2, score2, tmp;\n"
1366-
"SUB tmp, c1, n1;\n"
1367-
"ABS tmp, tmp;\n"
1368-
"ADD score2, score2, tmp;\n"
1369-
1370-
"SUB score3, d1, i1;\n"
1371-
"ABS score3, score3;\n"
1372-
"SUB tmp, e1, j1;\n"
1373-
"ABS tmp, tmp;\n"
1374-
"ADD score3, score3, tmp;\n"
1375-
"SUB tmp, f1, k1;\n"
1376-
"ABS tmp, tmp;\n"
1377-
"ADD score3, score3, tmp;\n"
1378-
1379-
"SUB score4, e1, h1;\n"
1380-
"ABS score4, score4;\n"
1381-
"SUB tmp, f1, i1;\n"
1382-
"ABS tmp, tmp;\n"
1383-
"ADD score4, score4, tmp;\n"
1384-
"SUB tmp, g1, j1;\n"
1385-
"ABS tmp, tmp;\n"
1386-
"ADD score4, score4, tmp;\n"
1387-
"SUB if1, sscore, score1;\n"
1388-
"SUB if2, score1, score2;\n"
1389-
"CMP if2, if1, -1.0, if2;\n"
1390-
"CMP spred1, if1, spred1, spred2;\n"
1391-
"CMP spred1, if2, spred1, spred3;\n"
1392-
"CMP sscore, if1, sscore, score1;\n"
1393-
"CMP sscore, if2, sscore, score2;\n"
1394-
"SUB if1, sscore, score3;\n"
1395-
"SUB if2, score3, score4;\n"
1396-
"CMP if2, if1, -1.0, if2;\n"
1397-
"CMP spred1, if1, spred1, spred4;\n"
1398-
"CMP spred1, if2, spred1, spred5;\n"
1399-
"ADD spred4, p2, diff0;\n"
1400-
"SUB spred5, p2, diff0;\n"
1401-
"SUB if1, spred4, spred1;\n"
1402-
"SUB if2, spred1, spred5;\n"
1403-
"CMP spred1, if1, spred4, spred1;\n"
1404-
"CMP spred1, if2, spred5, spred1;\n";
1405-
1406-
static const QString yadif[2] = {
1407-
yadif_setup +
1408-
"TEMP d;\n"
1409-
"ALIAS i = current;\n"
1410-
"TEX current, tex, texture[1], %1;\n"
1411-
"TEX d, tex, texture[2], %1;\n"
1412-
"ADD tmp, tex, {0.0, %3, 0.0, 0.0};\n"
1413-
"TEX a, tmp, texture[2], %1;\n"
1414-
"TEX f, tmp, texture[1], %1;\n"
1415-
"TEX k, tmp, texture[0], %1;\n"
1416-
"ADD tmp, tex, {0.0, %4, 0.0, 0.0};\n"
1417-
"TEX c, tmp, texture[2], %1;\n"
1418-
"TEX h, tmp, texture[1], %1;\n"
1419-
"SUB tmp, tex, {0.0, %3, 0.0, 0.0};\n"
1420-
"TEX b, tmp, texture[2], %1;\n"
1421-
"TEX g, tmp, texture[1], %1;\n"
1422-
"TEX l, tmp, texture[0], %1;\n"
1423-
"SUB tmp, tex, {0.0, %4, 0.0, 0.0};\n"
1424-
"TEX e, tmp, texture[2], %1;\n"
1425-
"TEX j, tmp, texture[1], %1;\n"
1426-
+ yadif_spatial_sample
1427-
+ yadif_calc
1428-
+ field_calc +
1429-
"CMP res, prev, current, spred1;\n"
1430-
,
1431-
yadif_setup +
1432-
"TEMP i;\n"
1433-
"ALIAS d = current;\n"
1434-
"TEX current, tex, texture[1], %1;\n"
1435-
"TEX i, tex, texture[0], %1;\n"
1436-
"ADD tmp, tex, {0.0, %3, 0.0, 0.0};\n"
1437-
"TEX a, tmp, texture[2], %1;\n"
1438-
"TEX f, tmp, texture[1], %1;\n"
1439-
"TEX k, tmp, texture[0], %1;\n"
1440-
"ADD tmp, tex, {0.0, %4, 0.0, 0.0};\n"
1441-
"TEX c, tmp, texture[1], %1;\n"
1442-
"TEX h, tmp, texture[0], %1;\n"
1443-
"SUB tmp, tex, {0.0, %3, 0.0, 0.0};\n"
1444-
"TEX b, tmp, texture[2], %1;\n"
1445-
"TEX g, tmp, texture[1], %1;\n"
1446-
"TEX l, tmp, texture[0], %1;\n"
1447-
"SUB tmp, tex, {0.0, %4, 0.0, 0.0};\n"
1448-
"TEX e, tmp, texture[1], %1;\n"
1449-
"TEX j, tmp, texture[0], %1;\n"
1450-
+ yadif_spatial_sample
1451-
+ yadif_calc
1452-
+ field_calc +
1453-
"CMP res, prev, spred1, current;\n"
1454-
};
1455-
14561239
static const QString bicubic =
14571240
"TEMP coord, coord2, cdelta, parmx, parmy, a, b, c, d;\n"
14581241
"MAD coord.xy, fragment.texcoord[0], {%6, %7}, {0.5, 0.5};\n"
@@ -1506,12 +1289,6 @@ QString OpenGLVideo::GetProgramString(OpenGLFilterType name,
15061289
deint_bit = kerneldeint[tmp_field];
15071290
if (!tmp_field) { need_tex = false; }
15081291
}
1509-
else if (deint == "openglyadif" ||
1510-
deint == "opengldoublerateyadif")
1511-
{
1512-
deint_bit = yadif[tmp_field];
1513-
need_tex = false;
1514-
}
15151292
else
15161293
{
15171294
LOG(VB_PLAYBACK, LOG_ERR, LOC +

mythtv/libs/libmythtv/videodisplayprofile.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,6 @@ QString VideoDisplayProfile::GetDeinterlacerName(const QString short_name)
728728
return QObject::tr("Linear blend (2x, HW)");
729729
else if ("opengldoubleratefieldorder" == short_name)
730730
return QObject::tr("Interlaced (2x, HW)");
731-
else if ("opengldoublerateyadif" == short_name)
732-
return QObject::tr("Yadif (2x, HW)");
733-
else if ("openglyadif" == short_name)
734-
return QObject::tr("Yadif (HW)");
735731
else if ("vdpauonefield" == short_name)
736732
return QObject::tr("One Field (1x, HW)");
737733
else if ("vdpaubobdeint" == short_name)
@@ -1291,8 +1287,6 @@ QString VideoDisplayProfile::GetDeinterlacerHelp(const QString &deint)
12911287
msg = kLinearBlendMsg + " " + kUsingGPU;
12921288
else if (deint == "openglkerneldeint")
12931289
msg = kKernelMsg + " " + kUsingGPU;
1294-
else if (deint == "openglyadif")
1295-
msg = kYadifMsg + " " + kUsingGPU;
12961290
else if (deint == "opengldoubleratelinearblend")
12971291
msg = kLinearBlendMsg + " " + kDoubleRateMsg + " " + kUsingGPU;
12981292
else if (deint == "opengldoubleratekerneldeint")
@@ -1309,8 +1303,6 @@ QString VideoDisplayProfile::GetDeinterlacerHelp(const QString &deint)
13091303
msg = kYadifMsg + " " + kDoubleRateMsg;
13101304
else if (deint == "fieldorderdoubleprocessdeint")
13111305
msg = kFieldOrderMsg + " " + kDoubleRateMsg;
1312-
else if (deint == "opengldoublerateyadif")
1313-
msg = kYadifMsg + " " + kDoubleRateMsg + " " + kUsingGPU;
13141306
else if (deint == "vdpauonefield")
13151307
msg = kOneFieldMsg + " " + kUsingGPU;
13161308
else if (deint == "vdpaubobdeint")

mythtv/libs/libmythtv/videoout_opengl.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ void VideoOutputOpenGL::GetRenderOptions(render_opts &opts,
2424
(*opts.deints)["opengl"].append("opengldoubleratelinearblend");
2525
(*opts.deints)["opengl"].append("opengldoubleratekerneldeint");
2626
(*opts.deints)["opengl"].append("opengldoubleratefieldorder");
27-
(*opts.deints)["opengl"].append("opengldoublerateyadif");
28-
(*opts.deints)["opengl"].append("openglyadif");
2927
(*opts.osds)["opengl"].append("opengl2");
3028
(*opts.safe_renderers)["dummy"].append("opengl");
3129
(*opts.safe_renderers)["nuppel"].append("opengl");

0 commit comments

Comments
 (0)