[MPlayer-cvslog] r30078 - trunk/libvo/gl_common.c

reimar subversion at mplayerhq.hu
Sun Dec 20 15:32:34 CET 2009


Author: reimar
Date: Sun Dec 20 15:32:34 2009
New Revision: 30078

Log:
Change %f to %e in generated fragment programs to avoid losing precision unnecessarily.

Modified:
   trunk/libvo/gl_common.c

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Sun Dec 20 15:14:56 2009	(r30077)
+++ trunk/libvo/gl_common.c	Sun Dec 20 15:32:34 2009	(r30078)
@@ -833,11 +833,11 @@ static const char *bilin_filt_template =
   "LRP yuv.%c, parmx.b, a.bbbb, a.aaaa;"
 
 static const char *bicub_filt_template_2D =
-  "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};"
+  "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};"
   "TEX parmx, coord.x, texture[%c], 1D;"
-  "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};"
+  "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};"
   "TEX parmy, coord.y, texture[%c], 1D;"
-  "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};"
+  "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};"
   BICUB_FILT_MAIN("2D");
 
 static const char *bicub_filt_template_RECT =
@@ -859,12 +859,12 @@ static const char *bicub_filt_template_R
   "SUB "t".y, "t".yyyy, "s";"
 
 static const char *bicub_notex_filt_template_2D =
-  "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};"
+  "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};"
   "FRC coord.xy, coord.xyxy;"
   CALCWEIGHTS("parmx", "coord.xxxx")
-  "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};"
+  "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};"
   CALCWEIGHTS("parmy", "coord.yyyy")
-  "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};"
+  "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};"
   BICUB_FILT_MAIN("2D");
 
 static const char *bicub_notex_filt_template_RECT =
@@ -885,9 +885,9 @@ static const char *bicub_notex_filt_temp
   "LRP yuv.%c, parmx.b, a.rrrr, b.rrrr;"
 
 static const char *bicub_x_filt_template_2D =
-  "MAD coord.x, fragment.texcoord[%c], {%f}, {0.5};"
+  "MAD coord.x, fragment.texcoord[%c], {%e}, {0.5};"
   "TEX parmx, coord, texture[%c], 1D;"
-  "MUL cdelta.xyz, parmx.rrgg, {-%f, 0, %f};"
+  "MUL cdelta.xyz, parmx.rrgg, {-%e, 0, %e};"
   BICUB_X_FILT_MAIN("2D");
 
 static const char *bicub_x_filt_template_RECT =
@@ -897,7 +897,7 @@ static const char *bicub_x_filt_template
   BICUB_X_FILT_MAIN("RECT");
 
 static const char *unsharp_filt_template =
-  "PARAM dcoord%c = {%f, %f, %f, %f};"
+  "PARAM dcoord%c = {%e, %e, %e, %e};"
   "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;"
   "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;"
   "TEX a.r, fragment.texcoord[%c], texture[%c], %s;"
@@ -908,11 +908,11 @@ static const char *unsharp_filt_template
   "TEX b.g, coord2.zwzw, texture[%c], %s;"
   "DP3 b, b, {0.25, 0.25, 0.25};"
   "SUB b.r, a.r, b.r;"
-  "MAD yuv.%c, b.r, {%f}, a.r;";
+  "MAD yuv.%c, b.r, {%e}, a.r;";
 
 static const char *unsharp_filt_template2 =
-  "PARAM dcoord%c = {%f, %f, %f, %f};"
-  "PARAM dcoord2%c = {%f, 0, 0, %f};"
+  "PARAM dcoord%c = {%e, %e, %e, %e};"
+  "PARAM dcoord2%c = {%e, 0, 0, %e};"
   "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;"
   "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;"
   "TEX a.r, fragment.texcoord[%c], texture[%c], %s;"
@@ -932,13 +932,13 @@ static const char *unsharp_filt_template
   "TEX b.g, coord2.zwzw, texture[%c], %s;"
   "DP4 b.r, b, {-0.1171875, -0.1171875, -0.1171875, -0.09765625};"
   "MAD b.r, a.r, {0.859375}, b.r;"
-  "MAD yuv.%c, b.r, {%f}, a.r;";
+  "MAD yuv.%c, b.r, {%e}, a.r;";
 
 static const char *yuv_prog_template =
-  "PARAM ycoef = {%.4f, %.4f, %.4f};"
-  "PARAM ucoef = {%.4f, %.4f, %.4f};"
-  "PARAM vcoef = {%.4f, %.4f, %.4f};"
-  "PARAM offsets = {%.4f, %.4f, %.4f};"
+  "PARAM ycoef = {%e, %e, %e};"
+  "PARAM ucoef = {%e, %e, %e};"
+  "PARAM vcoef = {%e, %e, %e};"
+  "PARAM offsets = {%e, %e, %e};"
   "TEMP res;"
   "MAD res.rgb, yuv.rrrr, ycoef, offsets;"
   "MAD res.rgb, yuv.gggg, ucoef, res;"
@@ -946,11 +946,11 @@ static const char *yuv_prog_template =
   "END";
 
 static const char *yuv_pow_prog_template =
-  "PARAM ycoef = {%.4f, %.4f, %.4f};"
-  "PARAM ucoef = {%.4f, %.4f, %.4f};"
-  "PARAM vcoef = {%.4f, %.4f, %.4f};"
-  "PARAM offsets = {%.4f, %.4f, %.4f};"
-  "PARAM gamma = {%.4f, %.4f, %.4f};"
+  "PARAM ycoef = {%e, %e, %e};"
+  "PARAM ucoef = {%e, %e, %e};"
+  "PARAM vcoef = {%e, %e, %e};"
+  "PARAM offsets = {%e, %e, %e};"
+  "PARAM gamma = {%e, %e, %e};"
   "TEMP res;"
   "MAD res.rgb, yuv.rrrr, ycoef, offsets;"
   "MAD res.rgb, yuv.gggg, ucoef, res;"
@@ -961,10 +961,10 @@ static const char *yuv_pow_prog_template
   "END";
 
 static const char *yuv_lookup_prog_template =
-  "PARAM ycoef = {%.4f, %.4f, %.4f, 0};"
-  "PARAM ucoef = {%.4f, %.4f, %.4f, 0};"
-  "PARAM vcoef = {%.4f, %.4f, %.4f, 0};"
-  "PARAM offsets = {%.4f, %.4f, %.4f, 0.125};"
+  "PARAM ycoef = {%e, %e, %e, 0};"
+  "PARAM ucoef = {%e, %e, %e, 0};"
+  "PARAM vcoef = {%e, %e, %e, 0};"
+  "PARAM offsets = {%e, %e, %e, 0.125};"
   "TEMP res;"
   "MAD res, yuv.rrrr, ycoef, offsets;"
   "MAD res.rgb, yuv.gggg, ucoef, res;"


More information about the MPlayer-cvslog mailing list