Skip to content
Permalink
Browse files

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.
  • Loading branch information
Mark Kendall
Mark Kendall committed Oct 31, 2011
1 parent 3c324aa commit 437b69a0e8c469cc491f4a1aa54d3243a29fb35f
@@ -1135,12 +1135,6 @@ static const QString attrib_fast =
"ATTRIB tex = fragment.texcoord[0];\n"
"PARAM yuv[3] = { program.local[0..2] };\n";

static const QString var_alpha =
"TEMP alpha;\n";

static const QString tex_alpha =
"TEX alpha, tex, texture[3], %1;\n";

static const QString tex_fast =
"TEX res, tex, texture[0], %1;\n";

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

static const QString yadif_setup =
"TEMP a,b,c,e,f,g,h,j,k,l;\n"
"TEMP a1,b1,f1,g1,h1,i1,j1,l1,m1,n1;\n"
"ALIAS d1 = f;\n"
"ALIAS k1 = g;\n"
"ALIAS c1 = prev;\n"
"ALIAS e1 = mov;\n"
"ALIAS p0 = res;\n"
"ALIAS p1 = c;\n"
"ALIAS p3 = h;\n"
"ALIAS spred1 = a;\n"
"ALIAS spred2 = b;\n"
"ALIAS spred3 = c;\n"
"ALIAS spred4 = e;\n"
"ALIAS spred5 = f;\n"
"ALIAS sscore = g;\n"
"ALIAS score1 = h;\n"
"ALIAS score2 = j;\n"
"ALIAS score3 = k;\n"
"ALIAS score4 = l;\n"
"ALIAS if1 = a1;\n"
"ALIAS if2 = b1;\n"
"TEMP p2, p4;\n"
"ALIAS diff1 = a;\n"
"ALIAS diff2 = b;\n"
"TEMP diff0;\n";

static const QString yadif_spatial_sample =
"ADD tmp, tex, {%5, %3, 0.0, 0.0};\n"
"TEX e1, tmp, texture[1], %1;\n"
"ADD tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
"TEX f1, tmp, texture[1], %1;\n"
"ADD tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
"TEX g1, tmp, texture[1], %1;\n"
"SUB tmp, tmp, {0.0, %4, 0.0, 0.0};\n"
"TEX n1, tmp, texture[1], %1;\n"
"SUB tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
"TEX m1, tmp, texture[1], %1;\n"
"SUB tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
"TEX l1, tmp, texture[1], %1;\n"

"SUB tmp, tex, {%5, %3, 0.0, 0.0};\n"
"TEX j1, tmp, texture[1], %1;\n"
"SUB tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
"TEX i1, tmp, texture[1], %1;\n"
"SUB tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
"TEX h1, tmp, texture[1], %1;\n"
"ADD tmp, tmp, {0.0, %4, 0.0, 0.0};\n"
"TEX a1, tmp, texture[1], %1;\n"
"ADD tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
"TEX b1, tmp, texture[1], %1;\n"
"ADD tmp, tmp, {%5, 0.0, 0.0, 0.0};\n"
"TEX c1, tmp, texture[1], %1;\n";

static const QString yadif_calc =
"LRP p0, 0.5, c, h;\n"
"MOV p1, f;\n"
"LRP p2, 0.5, d, i;\n"
"MOV p3, g;\n"
"LRP p4, 0.5, e, j;\n"

"SUB diff0, d, i;\n"
"ABS diff0, diff0;\n"
"SUB tmp, a, f;\n"
"ABS tmp, tmp;\n"
"SUB diff1, b, g;\n"
"ABS diff1, diff1;\n"
"LRP diff1, 0.5, diff1, tmp;\n"
"SUB tmp, k, f;\n"
"ABS tmp, tmp;\n"
"SUB diff2, g, l;\n"
"ABS diff2, diff2;\n"
"LRP diff2, 0.5, diff2, tmp;\n"
"MAX diff0, diff0, diff1;\n"
"MAX diff0, diff0, diff2;\n"

// mode < 2
"SUB tmp, p0, p1;\n"
"SUB other, p4, p3;\n"
"MIN spred1, tmp, other;\n"
"MAX spred2, tmp, other;\n"
"SUB tmp, p2, p1;\n"
"SUB other, p2, p3;\n"
"MAX spred1, spred1, tmp;\n"
"MAX spred1, spred1, other;\n"
"MIN spred2, spred2, tmp;\n"
"MIN spred2, spred2, other;\n"
"MAX spred1, spred2, -spred1;\n"
"MAX diff0, diff0, spred1;\n"

// spatial prediction
"LRP spred1, 0.5, d1, k1;\n"
"LRP spred2, 0.5, c1, l1;\n"
"LRP spred3, 0.5, b1, m1;\n"
"LRP spred4, 0.5, e1, j1;\n"
"LRP spred5, 0.5, f1, i1;\n"

"SUB sscore, c1, j1;\n"
"ABS sscore, sscore;\n"
"SUB tmp, d1, k1;\n"
"ABS tmp, tmp;\n"
"ADD sscore, sscore, tmp;\n"
"SUB tmp, e1, l1;\n"
"ABS tmp, tmp;\n"
"ADD sscore, sscore, tmp;\n"
"SUB sscore, sscore, 1.0;\n"

"SUB score1, b1, k1;\n"
"ABS score1, score1;\n"
"SUB tmp, c1, l1;\n"
"ABS tmp, tmp;\n"
"ADD score1, score1, tmp;\n"
"SUB tmp, d1, m1;\n"
"ABS tmp, tmp;\n"
"ADD score1, score1, tmp;\n"

"SUB score2, a1, l1;\n"
"ABS score2, score2;\n"
"SUB tmp, b1, m1;\n"
"ABS tmp, tmp;\n"
"ADD score2, score2, tmp;\n"
"SUB tmp, c1, n1;\n"
"ABS tmp, tmp;\n"
"ADD score2, score2, tmp;\n"

"SUB score3, d1, i1;\n"
"ABS score3, score3;\n"
"SUB tmp, e1, j1;\n"
"ABS tmp, tmp;\n"
"ADD score3, score3, tmp;\n"
"SUB tmp, f1, k1;\n"
"ABS tmp, tmp;\n"
"ADD score3, score3, tmp;\n"

"SUB score4, e1, h1;\n"
"ABS score4, score4;\n"
"SUB tmp, f1, i1;\n"
"ABS tmp, tmp;\n"
"ADD score4, score4, tmp;\n"
"SUB tmp, g1, j1;\n"
"ABS tmp, tmp;\n"
"ADD score4, score4, tmp;\n"
"SUB if1, sscore, score1;\n"
"SUB if2, score1, score2;\n"
"CMP if2, if1, -1.0, if2;\n"
"CMP spred1, if1, spred1, spred2;\n"
"CMP spred1, if2, spred1, spred3;\n"
"CMP sscore, if1, sscore, score1;\n"
"CMP sscore, if2, sscore, score2;\n"
"SUB if1, sscore, score3;\n"
"SUB if2, score3, score4;\n"
"CMP if2, if1, -1.0, if2;\n"
"CMP spred1, if1, spred1, spred4;\n"
"CMP spred1, if2, spred1, spred5;\n"
"ADD spred4, p2, diff0;\n"
"SUB spred5, p2, diff0;\n"
"SUB if1, spred4, spred1;\n"
"SUB if2, spred1, spred5;\n"
"CMP spred1, if1, spred4, spred1;\n"
"CMP spred1, if2, spred5, spred1;\n";

static const QString yadif[2] = {
yadif_setup +
"TEMP d;\n"
"ALIAS i = current;\n"
"TEX current, tex, texture[1], %1;\n"
"TEX d, tex, texture[2], %1;\n"
"ADD tmp, tex, {0.0, %3, 0.0, 0.0};\n"
"TEX a, tmp, texture[2], %1;\n"
"TEX f, tmp, texture[1], %1;\n"
"TEX k, tmp, texture[0], %1;\n"
"ADD tmp, tex, {0.0, %4, 0.0, 0.0};\n"
"TEX c, tmp, texture[2], %1;\n"
"TEX h, tmp, texture[1], %1;\n"
"SUB tmp, tex, {0.0, %3, 0.0, 0.0};\n"
"TEX b, tmp, texture[2], %1;\n"
"TEX g, tmp, texture[1], %1;\n"
"TEX l, tmp, texture[0], %1;\n"
"SUB tmp, tex, {0.0, %4, 0.0, 0.0};\n"
"TEX e, tmp, texture[2], %1;\n"
"TEX j, tmp, texture[1], %1;\n"
+ yadif_spatial_sample
+ yadif_calc
+ field_calc +
"CMP res, prev, current, spred1;\n"
,
yadif_setup +
"TEMP i;\n"
"ALIAS d = current;\n"
"TEX current, tex, texture[1], %1;\n"
"TEX i, tex, texture[0], %1;\n"
"ADD tmp, tex, {0.0, %3, 0.0, 0.0};\n"
"TEX a, tmp, texture[2], %1;\n"
"TEX f, tmp, texture[1], %1;\n"
"TEX k, tmp, texture[0], %1;\n"
"ADD tmp, tex, {0.0, %4, 0.0, 0.0};\n"
"TEX c, tmp, texture[1], %1;\n"
"TEX h, tmp, texture[0], %1;\n"
"SUB tmp, tex, {0.0, %3, 0.0, 0.0};\n"
"TEX b, tmp, texture[2], %1;\n"
"TEX g, tmp, texture[1], %1;\n"
"TEX l, tmp, texture[0], %1;\n"
"SUB tmp, tex, {0.0, %4, 0.0, 0.0};\n"
"TEX e, tmp, texture[1], %1;\n"
"TEX j, tmp, texture[0], %1;\n"
+ yadif_spatial_sample
+ yadif_calc
+ field_calc +
"CMP res, prev, spred1, current;\n"
};

static const QString bicubic =
"TEMP coord, coord2, cdelta, parmx, parmy, a, b, c, d;\n"
"MAD coord.xy, fragment.texcoord[0], {%6, %7}, {0.5, 0.5};\n"
@@ -1506,12 +1289,6 @@ QString OpenGLVideo::GetProgramString(OpenGLFilterType name,
deint_bit = kerneldeint[tmp_field];
if (!tmp_field) { need_tex = false; }
}
else if (deint == "openglyadif" ||
deint == "opengldoublerateyadif")
{
deint_bit = yadif[tmp_field];
need_tex = false;
}
else
{
LOG(VB_PLAYBACK, LOG_ERR, LOC +
@@ -728,10 +728,6 @@ QString VideoDisplayProfile::GetDeinterlacerName(const QString short_name)
return QObject::tr("Linear blend (2x, HW)");
else if ("opengldoubleratefieldorder" == short_name)
return QObject::tr("Interlaced (2x, HW)");
else if ("opengldoublerateyadif" == short_name)
return QObject::tr("Yadif (2x, HW)");
else if ("openglyadif" == short_name)
return QObject::tr("Yadif (HW)");
else if ("vdpauonefield" == short_name)
return QObject::tr("One Field (1x, HW)");
else if ("vdpaubobdeint" == short_name)
@@ -1291,8 +1287,6 @@ QString VideoDisplayProfile::GetDeinterlacerHelp(const QString &deint)
msg = kLinearBlendMsg + " " + kUsingGPU;
else if (deint == "openglkerneldeint")
msg = kKernelMsg + " " + kUsingGPU;
else if (deint == "openglyadif")
msg = kYadifMsg + " " + kUsingGPU;
else if (deint == "opengldoubleratelinearblend")
msg = kLinearBlendMsg + " " + kDoubleRateMsg + " " + kUsingGPU;
else if (deint == "opengldoubleratekerneldeint")
@@ -1309,8 +1303,6 @@ QString VideoDisplayProfile::GetDeinterlacerHelp(const QString &deint)
msg = kYadifMsg + " " + kDoubleRateMsg;
else if (deint == "fieldorderdoubleprocessdeint")
msg = kFieldOrderMsg + " " + kDoubleRateMsg;
else if (deint == "opengldoublerateyadif")
msg = kYadifMsg + " " + kDoubleRateMsg + " " + kUsingGPU;
else if (deint == "vdpauonefield")
msg = kOneFieldMsg + " " + kUsingGPU;
else if (deint == "vdpaubobdeint")
@@ -24,8 +24,6 @@ void VideoOutputOpenGL::GetRenderOptions(render_opts &opts,
(*opts.deints)["opengl"].append("opengldoubleratelinearblend");
(*opts.deints)["opengl"].append("opengldoubleratekerneldeint");
(*opts.deints)["opengl"].append("opengldoubleratefieldorder");
(*opts.deints)["opengl"].append("opengldoublerateyadif");
(*opts.deints)["opengl"].append("openglyadif");
(*opts.osds)["opengl"].append("opengl2");
(*opts.safe_renderers)["dummy"].append("opengl");
(*opts.safe_renderers)["nuppel"].append("opengl");

0 comments on commit 437b69a

Please sign in to comment.
You can’t perform that action at this time.