Ticket #13230: greenline-precision.patch

File greenline-precision.patch, 2.7 KB (added by Mark Spieth, 15 months ago)

Precision + YV12 color

  • mythtv/libs/libmythtv/openglvideo.cpp

    diff --git a/mythtv/libs/libmythtv/openglvideo.cpp b/mythtv/libs/libmythtv/openglvideo.cpp
    index 0ab57caa72..f09ac21aef 100644
    a b void OpenGLVideo::CustomiseProgramString(QString &string) 
    14401440    float fieldSize = 1.0f / (lineHeight * 2.0);
    14411441
    14421442    string.replace("%2", QString::number(fieldSize, 'f', 8));
    1443     string.replace("%3", QString::number(lineHeight, 'f', 8));
    1444     string.replace("%4", QString::number(lineHeight * 2.0, 'f', 8));
    1445     string.replace("%5", QString::number(colWidth, 'f', 8));
     1443    string.replace("%3", QString::number(lineHeight, 'f', 16));
     1444    string.replace("%4", QString::number(lineHeight * 2.0, 'f', 16));
     1445    string.replace("%5", QString::number(colWidth, 'f', 16));
    14461446    string.replace("%6", QString::number((float)fb_size.width(), 'f', 1));
    14471447    string.replace("%7", QString::number((float)fb_size.height(), 'f', 1));
    1448     string.replace("%8", QString::number(1.0f / yselect, 'f', 8));
     1448    string.replace("%8", QString::number(1.0f / yselect, 'f', 16));
    14491449    string.replace("%9", QString::number(maxheight, 'f', 8));
    14501450
    14511451    float width = float(video_dim.width()) / inputTextureSize.width();
    static const QString YV12RGBVertexShader = 
    16621662"    v_texcoord0 = a_texcoord0;\n"
    16631663"}\n";
    16641664
     1665#ifdef ANDROID
     1666#define SAMPLEYVU "\
     1667vec3 sampleYVU(in GLSL_SAMPLER texture, vec2 texcoordY)\n\
     1668{\n\
     1669    vec2 texcoordV, texcoordU;\n\
     1670    texcoordV = vec2(texcoordY.s / 2.0, %HEIGHT% + texcoordY.t / 4.0);\n\
     1671    texcoordU = vec2(texcoordV.s, texcoordV.t + %HEIGHT% / 4.0);\n\
     1672    vec3 yvu;\n\
     1673    yvu.r = GLSL_TEXTURE(texture, texcoordY).r;\n\
     1674    yvu.g = GLSL_TEXTURE(texture, texcoordV).r;\n\
     1675    yvu.b = GLSL_TEXTURE(texture, texcoordU).r;\n\
     1676    return yvu;\n\
     1677}\n"
     1678#else
     1679
    16651680#define SAMPLEYVU "\
    16661681vec3 sampleYVU(in GLSL_SAMPLER texture, vec2 texcoordY)\n\
    16671682{\n\
    vec3 sampleYVU(in GLSL_SAMPLER texture, vec2 texcoordY)\n\ 
    16791694    yvu.b = GLSL_TEXTURE(texture, texcoordU).r;\n\
    16801695    return yvu;\n\
    16811696}\n"
     1697#endif
    16821698
    16831699static const QString YV12RGBFragmentShader =
    16841700"//YV12RGBFragmentShader\n"
  • mythtv/libs/libmythui/mythrender_opengl2es.h

    diff --git a/mythtv/libs/libmythui/mythrender_opengl2es.h b/mythtv/libs/libmythui/mythrender_opengl2es.h
    index bfec875831..3f3640f2b7 100644
    a b class MUI_PUBLIC MythRenderOpenGL2ES : public MythRenderOpenGL2 
    2121        // GLSL version
    2222        m_GLSLVersion = "#version 100\n";
    2323        // GLSL ES precision qualifiers
    24         m_qualifiers = "precision mediump float;\n";
     24        m_qualifiers = "precision highp float;\n";
    2525
    2626        // Default OpenGL ES 2.0
    2727        m_glCreateShader     = (MYTH_GLCREATESHADERPROC)