Modérateurs: Modération Forum Home-Cinéma, Le Bureau de l’Association HCFR • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 105 invités

Toutes les solutions à base d'ordinateur (PC, Mac, Linux...)

[MPC] Filtre(s) Pixels shaders ...

Message » 10 Mar 2006 10:50

[Edit 2009.03.28 : Debug du filtre "SpacialSoften" : merci Dialhot :wink: ... bis ]
[Edit 2009.03.26 : Modif du filtre "SpacialSoften" : ajout d'un facteur de lissage...]
[Edit 2008.08.11 : Nouveau filtre : "Desinterlace CodeName : LeeperryBlending ... ]
[Edit 2008.01.07 : "Undot" devient "SpacialSoften" ... un vrai "Undot" arrivera un jour... ]
[Edit 2008.01.07 : correction syntaxe Sharpen_3x3 & 5x5 ]
[Edit 2008.01.21 : Modif Undot ... Seuil à l'envers ... ]
[Edit 2006.04.03 : Copier-coller des fitres du post ... ]

LeeperryBlending ( Seb.26 ) : Desentrelace à la bourrin !
Code: Tout sélectionner
// +deinterlace (blend).txt=ps_3_0
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)

float4 main(float2 tex : TEXCOORD0) : COLOR
{

   float2 h = float2(0, one_over_height);
   float4 c1 = tex2D(s0, tex-h);
   float4 c2 = tex2D(s0, tex+h);
   float4 c0 = (c1+c2)/2;
   
   return c0;
}


EdgeSharpen v1.1 ( Seb.26 ) : Detection des contours, puis sharpen de ces derniers
Code: Tout sélectionner
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)

#define Edge_width      2.0
#define Edge_threshold       0.2

#define Sharpen_width       1.0
#define Sharpen_val0       2.0
#define Sharpen_val1       0.125

float4 main(float2 tex : TEXCOORD0) : COLOR
{
   // Read current pixel color
   float4 Res = tex2D( s0, tex );

   // Edge detection width vector
   float dx = Edge_width / height;
   float dy = Edge_width / width;

   // Read corners color
   float4 c2 = tex2D(s0, tex + float2( 0,-dy) );
   float4 c3 = tex2D(s0, tex + float2(-dx,0) );
   float4 c4 = tex2D(s0, tex + float2( dx,0) );
   float4 c5 = tex2D(s0, tex + float2( 0, dy) );

   // Compute vector lenght
   float4 c0 = Res*4 - c2 - c3 - c4 - c5;

   // If vector lenght > Edge_threshold : sharp this pixel
   if( length(c0) > Edge_threshold )
   {
      // Compute sharpen's width vector
      dx = Sharpen_width / width;
      dy = Sharpen_width / height;
 
      // Read 8 around pixels color
      float4 c1 = tex2D(s0, tex + float2(-dx,-dy)) ;
      c2 = tex2D(s0, tex + float2(0,-dy)) ;
      c3 = tex2D(s0, tex + float2(-dx,0)) ;
      c4 = tex2D(s0, tex + float2(dx,0));
      c5 = tex2D(s0, tex + float2(0,dy)) ;
      float4 c6 = tex2D(s0, tex + float2(dx,dy)) ;
      float4 c7 = tex2D(s0, tex + float2(-dx,+dy));
      float4 c8 = tex2D(s0, tex + float2(+dx,-dy)) ;

      float4 c9 =Res * Sharpen_val0;

      Res = c9 - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * Sharpen_val1 ;

      // Remove '//' from next line to see detected Edges in red ...
      //Res = float4( 1.0, 0.0, 0.0, 0.0 );
   }

   return Res;
}


DisplayLessThan16 v1.1 ( Seb.26 ) : Affiche en vert fluo les pixels dont une des valeurs ( R G B ) est < 16 ...
Code: Tout sélectionner
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)
#define Value_16 (16.0/255.0)

float4 main(float2 tex : TEXCOORD0) : COLOR
{
   float4 c0 = tex2D(s0, tex);

   if( c0[0]<Value_16 )
      c0 = float4( 0, 1, 0, 0 );
   else if( c0[1]<Value_16 )
      c0 = float4( 0, 1, 0, 0 );
   else if( c0[2]<Value_16 )
      c0 = float4( 0, 1, 0, 0 );

   return c0;
}


Remap_16_235 ( Seb.26 ) : Remap les valeur de 16->235 vers 0->255 ( Low Quality )
NB: Ce script est "Low Quality" = incorrect/buggé ...
Code: Tout sélectionner
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)

#define Const_1 (16.0/255.0)
#define Const_2 (255.0/219.0)

float4 main(float2 tex : TEXCOORD0) : COLOR
{
   return( ( tex2D( s0, tex ) - Const_1 ) * Const_2 );
}


EdgeSharpen v1.1 ( jim.ro ) : Detection des contours ( Prewitt ), puis sharpen de ces derniers
Code: Tout sélectionner
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)

#define NbPixel      1

#define Edge_threshold       0.2

#define Sharpen_val0       2.0
#define Sharpen_val1       0.125

float4 main(float2 tex : TEXCOORD0) : COLOR
{
// taille de NbPixel pixels
float dx = NbPixel/width;
float dy = NbPixel/height;
float4 Res = 0;

// Détection de contour par Prewitt
   // récuppération des 9 points
   //   [ 1, 2, 3 ]
   //   [ 4, 0, 5 ]
   //   [ 6, 7, 8 ]
   float4 c0 = tex2D(s0, tex);
   float4 c1 = tex2D(s0, tex + float2(-dx,-dy));
   float4 c2 = tex2D(s0, tex + float2(0,-dy));
   float4 c3 = tex2D(s0, tex + float2(dx,-dy));
   float4 c4 = tex2D(s0, tex + float2(-dx,0));
   float4 c5 = tex2D(s0, tex + float2(dx,0));
   float4 c6 = tex2D(s0, tex + float2(-dx,dy));
   float4 c7 = tex2D(s0, tex + float2(0,dy));
   float4 c8 = tex2D(s0, tex + float2(dx,dy));

   // Calcul des 3 vecteurs dérivé (hor,vert, diag1, diag2)
   float4 delta1 = (c6+c4+c1-c3-c5-c8);
   float4 delta2 = (c4+c1+c2-c5-c8-c7);
   float4 delta3 = (c1+c2+c3-c8-c7-c6);
   float4 delta4 = (c2+c3+c5-c7-c6-c4);

   // calcul du Prewitt
   float value = length(abs(delta1) + abs(delta2) + abs(delta3) + abs(delta4))/6;

// Si c'est un contour (vector lenght > Edge_threshold) => filtre de sharpen
   if(value > Edge_threshold )
   {
      Res = c0 * Sharpen_val0 - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * Sharpen_val1 ;
      // Pour voir les contour en rouge ...
      //Res = float4( 1.0, 0.0, 0.0, 0.0 );

      return Res;
   }
   else
      return c0;
}


SharpenFlou ( jim.ro ) : Soustraction d'une image floutée
Code: Tout sélectionner
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)

float4 main( float2 tex : TEXCOORD0 ) : COLOR
{
float dx = one_over_width;
float dy = one_over_height;

// récuppération de la matrice de 9 points
//   [ 1, 2 , 3 ]
//   [ 4,ori, 5 ]
//   [ 6, 7 , 8 ]

   float4 ori = tex2D(s0, tex);
   float4 c1 = tex2D(s0, tex + float2(-dx,-dy));
   float4 c2 = tex2D(s0, tex + float2(0,-dy));
   float4 c3 = tex2D(s0, tex + float2(dx,-dy));
   float4 c4 = tex2D(s0, tex + float2(-dx,0));
   float4 c5 = tex2D(s0, tex + float2(dx,0));
   float4 c6 = tex2D(s0, tex + float2(-dx,dy));
   float4 c7 = tex2D(s0, tex + float2(0,dy));
   float4 c8 = tex2D(s0, tex + float2(dx,dy));

// calcul image floue (filtre gaussien)
float  multipliers[9]=
            {1,2,1,
             2,4,2,
             1,2,1};

float4 total=0;
   total +=  c1 * multipliers[0];
   total +=  c2 * multipliers[1];
   total +=  c3 * multipliers[2];
   total +=  c4 * multipliers[3];
   total +=  ori * multipliers[4];
   total +=  c5 * multipliers[5];
   total +=  c6 * multipliers[6];
   total +=  c7 * multipliers[7];
   total +=  c8 * multipliers[8];

   // 1/(1+2+1+2+4+2+1+2+1) = 1/ 16 = .0625
   total *= 0.0625f;

// soustraction de l'image flou à l'image originale
   total = 2*ori - total;
//return ori;
   return total;
}


Sharpen_3x3 ( Seb.26 ) : Autre matrice ...
Code: Tout sélectionner
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)

#define x 1.0

float4 main(float2 tex : TEXCOORD0) : COLOR
{

   float dx =(one_over_width*x);
   float dy =(one_over_height*x);

   float4 c9 = tex2D(s0, tex) * 2.0;

   float4 c1 =  tex2D( s0, tex + float2( -dx , -dy ) ) * 0.1;
   c1 +=  tex2D( s0, tex + float2( 0 , -dy ) ) * 0.15;
   c1 +=  tex2D( s0, tex + float2( dx , -dy ) ) * 0.1;

   c1 +=  tex2D( s0, tex + float2( -dx , 0 ) ) * 0.15;
   c1 +=  tex2D( s0, tex + float2( dx , 0 ) ) * 0.15;

   c1 +=  tex2D( s0, tex + float2( -dx , dy ) ) * 0.1;
   c1 +=  tex2D( s0, tex + float2( 0 , dy ) ) * 0.15;
   c1 +=  tex2D( s0, tex + float2( dx , dy ) ) * 0.1;

   float4 c0 = c9 -c1 ;

   return c0;
}


Sharpen_5x5 ( Seb.26 ) : Sharpen 5x5 ...
Code: Tout sélectionner
sampler s0 : register(s0);

float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)

#define x 1.0

float4 main(float2 tex : TEXCOORD0) : COLOR
{
   float dx = (one_over_width*x);
   float dy = (one_over_height*x);

   float dx2 = one_over_width * 2;
   float dy2 = one_over_height * 2;

   float4 coef = float4( 0.025, 0.05, 0.1, 2.0 );

   float4 c0 = tex2D( s0, tex ) * coef[3];

   float4 c1 =  tex2D( s0, tex + float2( -dx2 , -dy2 ) ) * coef[0];
   c1 +=  tex2D( s0, tex + float2( -dx , -dy2 ) ) * coef[0];
   c1 +=  tex2D( s0, tex + float2( 0 , -dy2 ) ) * coef[0];
   c1 +=  tex2D( s0, tex + float2( dx , -dy2 ) ) * coef[0];
   c1 +=  tex2D( s0, tex + float2( dx2 , -dy2 ) ) * coef[0];

   c1 +=  tex2D( s0, tex + float2( -dx2 , -dy ) )  * coef[0];
   c1 +=  tex2D( s0, tex + float2( -dx , -dy ) ) * coef[1] ;
   c1 +=  tex2D( s0, tex + float2( 0 , -dy ) ) * coef[2] ;
   c1 +=  tex2D( s0, tex + float2( dx , -dy ) ) * coef[1] ;
   c1 +=  tex2D( s0, tex + float2( dx2 , -dy ) )  * coef[0];

   c1 +=  tex2D( s0, tex + float2( -dx2 , 0 ) )  * coef[0];
   c1 +=  tex2D( s0, tex + float2( -dx , 0 ) ) * coef[2] ;
   c1 +=  tex2D( s0, tex + float2( dx , 0 ) ) * coef[2] ;
   c1 +=  tex2D( s0, tex + float2( dx2 , 0 ) )  * coef[0];

   c1 +=  tex2D( s0, tex + float2( -dx2 , dy ) )  * coef[0];
   c1 +=  tex2D( s0, tex + float2( -dx , dy ) ) * coef[1] ;
   c1 +=  tex2D( s0, tex + float2( 0 , dy ) ) * coef[2] ;
   c1 +=  tex2D( s0, tex + float2( dx , dy ) ) * coef[1] ;
   c1 +=  tex2D( s0, tex + float2( dx2 , dy ) )  * coef[0];

   c1 +=  tex2D( s0, tex + float2( -dx2 , dy2 ) ) * coef[0];
   c1 +=  tex2D( s0, tex + float2( -dx , dy2 ) ) * coef[0];
   c1 +=  tex2D( s0, tex + float2( 0 , dy2 ) ) * coef[0];
   c1 +=  tex2D( s0, tex + float2( dx , dy2 ) ) * coef[0];
   c1 +=  tex2D( s0, tex + float2( dx2 , dy2 ) ) * coef[0];

   c0 -= c1;

   return c0;
}


SpacialSoften ( Seb.26 ) ( PS3.0 ) : Lisse avec les voisins dont le delta luma est faible ...
Code: Tout sélectionner
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])
#define counter (p0[2])
#define clock (p0[3])
#define one_over_width (p1[0])
#define one_over_height (p1[1])

#define PI acos(-1)

#define dx one_over_width
#define dy one_over_height

#define val0 0.3
#define val1 0.6

float4 main(float2 tex : TEXCOORD0) : COLOR
{
   float4 current = tex2D(s0, tex);

   float4 Total = current ;
   float n = 1;

   float4 c0 =  tex2D( s0, tex + float2( -dx , -dy ) );
   if( length( current - c0 ) < val0  )
   {
      Total += c0*val1;
      n += val1 ;
   }


   c0 =  tex2D( s0, tex + float2( 0 , -dy ) );
   if( length( current - c0 ) < val0  )
   {
      Total += c0*val1;
      n += val1 ;
   }

   c0 =  tex2D( s0, tex + float2( dx , -dy ) );
   if( length( current - c0 ) < val0  )
   {
      Total += c0*val1;
      n += val1 ;
   }

   c0 =  tex2D( s0, tex + float2( -dx , 0 ) );
   if( length( current - c0 ) < val0  )
   {
      Total += c0*val1;
      n += val1 ;
   }

   c0 =  tex2D( s0, tex + float2( dx , 0 ) );
   if( length( current - c0 ) < val0  )
   {
      Total += c0*val1;
      n += val1 ;
   }

   c0 =  tex2D( s0, tex + float2( -dx , dy ) );
   if( length( current - c0 ) < val0  )
   {
      Total += c0*val1;
      n += val1 ;
   }

   c0 =  tex2D( s0, tex + float2( 0 , dy ) );
   if( length( current - c0 ) < val0  )
   {
      Total += c0*val1;
      n += val1 ;
   }

   c0 =  tex2D( s0, tex + float2( dx , dy ) );
   if( length( current - c0 ) < val0  )
   {
      Total += c0*val1;
      n += val1 ;
   }

   return( Total / n );
}


SharpenComplex ( jim.ro ) : Un autre sharpen ( accentuation des détails par soustraction d'une image flou puis accentuation des contours aprés leurs détections)
Code: Tout sélectionner
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);

#define width (p0[0])
#define height (p0[1])

#define dx (p1[0])
#define dy (p1[1])

float4 main( float2 tex : TEXCOORD0 ) : COLOR
{
// definition des pixels : original, flouté, corigé, final
float4 ori;
float4 flou;
float4 cori;
float4 final;

////////////////////////////////////////////////////
// récuppération de la matrice de 9 points
//   [ 1, 2 , 3 ]
//   [ 4,ori, 5 ]
//   [ 6, 7 , 8 ]

   ori = tex2D(s0, tex);
   float4 c1 = tex2D(s0, tex + float2(-dx,-dy));
   float4 c2 = tex2D(s0, tex + float2(0,-dy));
   float4 c3 = tex2D(s0, tex + float2(dx,-dy));
   float4 c4 = tex2D(s0, tex + float2(-dx,0));
   float4 c5 = tex2D(s0, tex + float2(dx,0));
   float4 c6 = tex2D(s0, tex + float2(-dx,dy));
   float4 c7 = tex2D(s0, tex + float2(0,dy));
   float4 c8 = tex2D(s0, tex + float2(dx,dy));

////////////////////////////////////////////////////
// calcul image floue (filtre gaussien)
   // pour normaliser les valeurs, il faut diviser par la somme des coef
   // 1/(1+2+1+2+4+2+1+2+1) = 1/ 16 = .0625
   flou = (c1+c3+c6+c8 + 2*(c2+c4+c5+c7)+ 4*ori)*0.0625;

// soustraction de l'image flou à l'image originale
   cori = 2*ori - flou;

////////////////////////////////////////////////////
// détection des contours
float delta1;
float delta2;
float value;

// par filtre de sobel
   // Gradient horizontal
   //   [ -1, 0 ,1 ]
   //   [ -2, 0, 2 ]
   //   [ -1, 0 ,1 ]
   delta1 =  (c3 + 2*c5 + c8)-(c1 + 2*c4 + c6);

   // Gradient vertical
   //   [ -1,- 2,-1 ]
   //   [  0,  0, 0 ]
   //   [  1,  2, 1 ]
   delta2 = (c6 + 2*c7 + c8)-(c1 + 2*c2 + c3);

   // calcul
   value = sqrt( mul(delta1,delta1) + mul(delta2,delta2) ) ;

   if( value >.3 )
   {
////////////////////////////////////////////////////
// si contour, sharpen
#define Sharpen_val0       2.0
#define Sharpen_val1       0.125
      final = ori*2 - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * 0.125 ;
//      final= float4(1,0,0,0);
      return final;
   }
   else
   {
////////////////////////////////////////////////////
// sinon, image corrigée
      return cori;
   }
}
Dernière édition par Seb.26 le 28 Mar 2009 18:20, édité 25 fois.
Seb.26
 
Messages: 3256
Inscription Forum: 04 Mar 2004 16:43
  • offline

Message » 10 Mar 2006 11:50

Salut,

Heureuse initiative :wink:

Voilà des liens:

Flou adaptatif http://www.tzim.net/?2005/09/25/27-le-cadeau-du-jour-un-shader-pour-mpc

Un truc incompréhensible mais qui explique 2 - 3 trucs :mdr: :http://www.squarecn.com/ff/bbsshow.asp?owner=B103&ID=1573314&bbsID=0

Pour les réglages j'ai essayé le filtre sharpen sur de la HD en le mettant à 0.7 (au lieu de 1.6 par défaut), c'est sublime par contre en lecture DVD ça me dénature l'image sur mon écran LCD (1280 x 1024), je regarderai sur le VP ce que ça donne.

A+
artefact
 
Messages: 676
Inscription Forum: 18 Mai 2003 10:24
  • offline

Message » 10 Mar 2006 11:59

artefact a écrit:Un truc incompréhensible mais qui explique 2 - 3 trucs :mdr: :http://www.squarecn.com/ff/bbsshow.asp?owner=B103&ID=1573314&bbsID=0
A+

:lol: ... Si tu trouve le même en Fr, je suis preneur ... sinon, y'a pas mal de doc chez M$ aussi ... ;o)
Seb.26
 
Messages: 3256
Inscription Forum: 04 Mar 2004 16:43
  • offline

Message » 10 Mar 2006 12:51

Bonne idée ce post car les pixels shaders sont probablement l'avenir du PCHC.

Pour l'instant, seul le sharpen à faible niveau (0.2 chez moi) m'a convaincu. Pour le Flou adaptatif et le Edgesharpen, il y a des modifications à faire sur les scripts mais le nombre de variable est un peu élevé pour que je me lance dans les tests.

Si vous trouvez d'autres shaders utilisables, n'hésitez pas...
Halfcat fr
 
Messages: 210
Inscription Forum: 05 Déc 2002 12:03
  • offline

Message » 10 Mar 2006 13:29

C'est clair, ce WE, je vais completer mon EdgeSharpen pour y ajouter un etage 16-255 -> 0-255 ... Histoire de regler ces histoires de YUY2, YV12 ...ect... :wink:
Seb.26
 
Messages: 3256
Inscription Forum: 04 Mar 2004 16:43
  • offline

Message » 10 Mar 2006 17:21

artefact a écrit:Pour les réglages j'ai essayé le filtre sharpen sur de la HD en le mettant à 0.7 (au lieu de 1.6 par défaut), c'est sublime par contre en lecture DVD ça me dénature l'image sur mon écran LCD (1280 x 1024), je regarderai sur le VP ce que ça donne.

Attention, selon les valeurs de val0 et val1 ( Sharpen et EdgeSharpen ), vous pouvez eclaicir ou assombrir les frames ... il faut calculer pour que ce soit equilibré ... :idee:
Seb.26
 
Messages: 3256
Inscription Forum: 04 Mar 2004 16:43
  • offline

Message » 10 Mar 2006 18:50

Oui c'est la valeur de define effect_width que j'ai passé à 0.7, j'ai tatonné sur les deux autres valeurs, mais je suis revenu aux valeurs par défaut.

A+
artefact
 
Messages: 676
Inscription Forum: 18 Mai 2003 10:24
  • offline

Message » 13 Mar 2006 17:35

UP !

Nouveaux filtres :
> DisplayLessThan16
> Remap_16_235

Voir le 1er post ... ;)
Seb.26
 
Messages: 3256
Inscription Forum: 04 Mar 2004 16:43
  • offline

Message » 13 Mar 2006 22:59

Pour le remap 16-235 sur 0-255, c'est déjà fait si le VMR9 est en sortie RVB32.
Halfcat fr
 
Messages: 210
Inscription Forum: 05 Déc 2002 12:03
  • offline

Message » 14 Mar 2006 10:52

Updated : DisplayLessThan16 : un bug dans MPC fait que on ne peut enregistrer ce filtre : MPC n'aime pas les '||' ...

Halfcat fr a écrit:Pour le remap 16-235 sur 0-255, c'est déjà fait si le VMR9 est en sortie RVB32.

Oui, mais justement : "si le VRM9 est en RGB" :wink: ... ça evite de faire ça dans ffdshow si DSCaler sort en YUY2 ... par exemple ... :mdr:

D'ailleur, je trouve ça bizarre : même en YV12, sans ffdshow, il y a toujours beacoup de pixels <16 ... vous êtes sûr de ces histoires de 16->235 pas corrigé en YV12 ?! ... fais l'essai, tu comprendra ce que je veux dire ... :wink:
Seb.26
 
Messages: 3256
Inscription Forum: 04 Mar 2004 16:43
  • offline

Message » 14 Mar 2006 12:17

J'ai testé le remap en 0-255 avec le script de shader :

Sur mes captures, images identiques au RVB32 de ffdshow. le NVIDIA decoder m'indique que j'entre en YUY2.
Niveau CPU, ça baisse de 3% par rapport à ffdshow (je passe d'un max de 15% à 12% de charge CPU)

DTSman, je n'ai pas tes mires DVD pour comparer. ça serait intéressant d'ajouter à ton comparatif ( http://perso.wanadoo.fr/nicolas.phil/fr/DPCHC_VMR9.html ) :

- Resize bicubic -1 par shader (MPC) en YUY2-->RVB32 (ffdshow juste pour l'entrée-sortie)
- Resize bicubic -1 par shader + Remap 0-255 par shader (MPC)

- ainsi qu'un test de sharpen par shader (MPC) en 0.2 ou 0.3 par rapport au Lanczos/bicubic avec luma à 0.8 de ffdshow. (le tout avec le NVIDIA decoder en YUY2 et VMR9 renderless)

Si la qualité était équivalente, la meilleure config PCHC du moment serait finalement MPC et ses shaders. N'importe quel PC pouvant faire fonctionner cette config (12% de CPU avec un P4 3,6 Ghz, ça laisse de la marge. J'utilise de plus le filtre Reclock 1.6)
Halfcat fr
 
Messages: 210
Inscription Forum: 05 Déc 2002 12:03
  • offline

Message » 14 Mar 2006 12:41

Tu as regardé avec le DisplayLess16 ? ... Tu trouve pas ça bizarre le nombre de pixels < 16 ?! ... C'est comme si on etait toujours en 0-255 ... ?!
Seb.26
 
Messages: 3256
Inscription Forum: 04 Mar 2004 16:43
  • offline

Message » 14 Mar 2006 16:06

J'ai testé le shader "DisplayLessThan16" sur la mire THX :

La mire THX contient les valeurs 0 à 255 avec une ombre à 4 et la 8ème case de gris à 16
Le PC affiche toujours les valeurs de couleur sur 0-255
L'image doit être réglée de façon à ce que les noirs < 16 (sur la source) soient invisibles

- Quand on est en YUY2 en sortie, le "DisplayLessThan16" montre bien les valeurs < 16 (vert fluo à partir de la 8ème case de gris). On les voit car le PC affiche toutes les valeurs 0-255 même si la source est en 16-235. Dans un DVD, le niveau officiel du noir est fixé a 16 ce qui n'empeche pas qu'il y a quand meme de l'info en bas de 16 meme chose a l'inverse avec le blanc. Le but du réglage est justement de ne plus voir les noirs < 16.
- Si on fait un remapping 16-235 vers 0-255, le noir à 16 devient maximum (=0) et le blanc à 235 devient maximum (=255) = c'est l'image que l'on doit avoir = c'est l'image que le PC afficherait si il sortait du 16-235 (noir max à 16 et blanc max à 235) mais vu qu'il sort toujours du 0-255, le remapping est indispensable pour garder la luminosité de la source.
- Si on fait un "DisplayLessThan16" aprés un remapping sur 0-255, la partie en vert fluo est beaucoup plus importante puisque les noirs de 0 à 32 (2 x16) de l'image source sont réellement masqués : c'est comme si on supprimait une 2ème fois les noirs < 16.

PS : A propos des valeurs < 16 et > 235 des DVD, j'ai lu ceci sur AVSforum :

Blacker than black information (bellow level 16) may exists into every MPEG2 compression, even into a THX formated compression film: it is the result of compression artefact and or video transport line configuration (I will not enter deeper into the subject). The presence of below black information should not be consider as a visual information, but just as a signal transport.
lien : http://www.avsforum.com/avs-vb/showthre ... e=21&pp=20
Halfcat fr
 
Messages: 210
Inscription Forum: 05 Déc 2002 12:03
  • offline

Message » 14 Mar 2006 17:02

Halfcat fr a écrit:On les voit car le PC affiche toutes les valeurs 0-255 même si la source est en 16-235.

Ce qui veut dire que sur un DVD video, on trouve des pixels <16 ? ... Je croyais que ça devait rester entre 16 à 235 ...

En fait j'etais surpris, car je m'attendais à ne voir aucun pixels en dessous de 16, puisque 16-235 ...

Maintenant, il faudrait pouvoir faire le remappage avant le resize, pour que le resize puisse utiliser tout le spectre, et pas seulement 16-235 ...

Il faudrait que Gabest nous offre les PS pre-resize ET les shaders post-resize ... :lol:

Mais sinon, c'est absolument genial ces shaders !!!
Seb.26
 
Messages: 3256
Inscription Forum: 04 Mar 2004 16:43
  • offline

Message » 14 Mar 2006 18:17

Seb.26 a écrit:Ce qui veut dire que sur un DVD video, on trouve des pixels <16 ? ... Je croyais que ça devait rester entre 16 à 235 ...

Si le diffuseur sort du 16-235, ça reste bien entre 16 et 235.
Halfcat fr
 
Messages: 210
Inscription Forum: 05 Déc 2002 12:03
  • offline


Retourner vers Matériel PC Home-cinéma