Подскажите, пожалуйста, чем может быть вызвано появление артефактов (распадается на квадратики) при воспроизведении некоторых видео в режиме [DXVA]?
Как правило, это
.mkv файлы.
Например:
ОС: Win7 x64
Видео: ATI HD4570, AtiCatalyst 10.3
Версия плеера: 1.3.1775 x64
[more=mpc-hc64.ini][Settings]
LastUsedPage=0
HideCaptionMenu=0
ControlState=23
DefaultVideoFrame=4
KeepAspectRatio=1
CompMonDeskARDiff=0
Volume=1
Balance=0
Mute=0
LoopNum=1
Loop=0
Rewind=1
Zoom=1
AllowMultipleInstances=0
TitleBarTextStyle=1
TitleBarTextTitle=0
OnTop=2
TrayIcon=0
AutoZoom=1
FullScreenCtrls=1
FullScreenCtrlsTimeOut=0
FullscreenRes=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
ExitFullscreenAtTheEnd=1
RestoreResAfterExit=1
RememberWindowPos=0
RememberWindowSize=0
SnapToDesktopEdges=1
LastWindowRect=AAAAAAAABHAAAAAAIEBAAAAAHNBAAAAA
LastWindowType=0
AspectRatioX=0
AspectRatioY=0
KeepHistory=1
DSVidRen=11
RMVidRen=2
QTVidRen=2
APSurfaceUsage=2
DX9Resizer=1
VMR9MixerMode=1
VMRMixerYUV=0
VMRAlternateVSync=0
VMRVSyncOffset=0
VMRVSyncAccurate2=1
VMRFullscreenGUISupport=0
VMRVSync=0
VMRDisableDesktopComposition=0
EVROutputRange=0
EVRHighColorRes=0
EVREnableFrameTimeCorrection=0
VMRFlushGPUBeforeVSync=1
VMRFlushGPUAfterPresent=1
VMRFlushGPUWait=0
SynchronizeClock=0
SynchronizeDisplay=0
SynchronizeNearest=1
LineDelta=0
ColumnDelta=0
CycleDelta=BGCDFFADKCJKDFPD
TargetSyncOffset=AAAAAAAAAAAAICAE
ControlLimit=AAAAAAAAAAAAAAAE
ResetDevice=1
AudioRendererType=@device:cm:{E0F158E1-CB04-11D0-BD4E-00A0C911CE86}\Динамики (Realtek High Definiti
AutoloadAudio=1
AutoloadSubtitles=1
SubtitlesLanguageOrder=
AudiosLanguageOrder=
BlockVSFilter=1
EnableWorkerThreadForOpening=1
ReportFailedPins=1
UseDVDPath=0
MenuLang=1049
AudioLang=1049
SubtitlesLang=1049
AutoSpeakerConf=1
SPDefaultStyle=20;20;20;20;2;0;2.000000;2.000000;3.000000;3.000000;0xffffff;0x00ffff;0x000000;0x000000;0x00;0x00;0x00;0x80;204;Verdana;16.000000;100.000000;100.000000;0.000000;700;0;0;0;0;0.000000;0.000000;0.000000;0.000000;2
SPOverridePlacement=0
SPHorPos=50
SPVerPos=90
SPCSize=3
SPCMaxRes=2
SubDelayInterval=500
SPCPow2Tex=1
SPCAllowAnimationWhenBuffering=0
EnableSubtitles=0
UseDefaultsubtitlesStyle=0
EnableAudioSwitcher=1
EnableAudioTimeShift=0
AudioTimeShift=0
DownSampleTo441=0
CustomChannelMapping=0
SpeakerToChannelMapping=BAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAACAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ACAAAAAAAEAAAAAAAIAAAAAAAABAAAAAAACAAAAAAAEAAAAAAAIAAAAAAAABAAAAAAACAAAAAAAEAAAAAAAIAAAAAAAABAAAAAAACAAA
AudioNormalize=1
AudioNormalizeRecover=1
AudioBoost=1
FullScreenMonitor=
PreventMinimize=0
UseWin7TaskBar=1
ExitAfterPlayBack=0
AssociatedWithIcon=1
LastOpenDir=C:\
D3DFullScreen=0
MonitorAutoRefreshRate=0
Color Brightness=1.000000
Color Contrast=1.000000
Color Hue=0.000000
Color Saturation=1.000000
Shaders List=
ShaderListScreenSpace=
ToggleShader=0
ToggleShaderScreenSpace=0
EVRBuffers=5
Show OSD=1
EnableEDLEditor=0
InterfaceLanguage=0
DefaultCapture=0
Remember DVD Pos=1
Remember File Pos=1
LastFullScreen=0
IntRealMedia=0
RealMediaFPS=1103626240
UseWinLirc=0
WinLircAddr=127.0.0.1:8765
UseUICE=0
UICEAddr=127.0.0.1:1234
UseGlobalMedia=0
DisableXPToolbars=0
UseWMASFReader=0
JumpDistS=1000
JumpDistM=5000
JumpDistL=20000
FreeWindowResizing=0
NotifyMSN2=0
NotifyGTSdll=0
LogoFile=
LogoID2=211
LogoExt=0
HideCDROMsSubMenu=0
Priority=32
LaunchFullScreen=0
EnableWebServer=0
WebServerPort=13579
WebServerPrintDebugIfo=0
WebServerUseCompression=1
WebServerLocalhostOnly=0
WebRoot=*./webroot
WebDefIndex=index.html;index.php
WebServerCGI=
SnapShotPath=
SnapShotExt=.jpg
ThumbRows=4
ThumbCols=4
ThumbWidth=1024
ISDb=www.opensubtitles.org/isdb
SpeakerChannels=2
HideNavigation=0
SearchInDirAfterPlayBack=0
D3D9RenderDevice=
DontUseSearchInFolder=0
OSD_Size=20
OSD_Font=Arial
LimitWindowProportions=0
[Capture]
VidDispName=@device:pnp:\\?\usb#vid_064e&pid_a103&mi_00#6&e51765b&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
AudDispName=@device:cm:{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Realtek Digital Input (Realtek
Country=1
VidOutput=1
AudOutput=1
VidPreview=1
AudPreview=1
FileFormat=0
FileName=.avi
SepAudio=1
[DVB configuration]
BDANetworkProvider=@device:sw:{71985F4B-1CA1-11D3-9CC8-00C04F7971E0}\Microsoft ATSC Network Provider
BDATuner=
BDAReceiver=
LastChannel=1
[Internal Filters]
SrcFilters=-304193
TraFilters=-1026
DXVAFilters=-1
FFmpegFilters=-1
[ToolBars\Subresync]
Visible=0
DockState=59419
[ToolBars\Subresync\State-SCBar-0]
sizeHorzCX=200
sizeHorzCY=200
sizeVertCX=200
sizeVertCY=200
sizeFloatCX=200
sizeFloatCY=200
[ToolBars\Playlist]
Visible=0
DockState=59422
[ToolBars\Playlist\State-SCBar-0]
sizeHorzCX=516
sizeHorzCY=100
sizeVertCX=200
sizeVertCY=100
sizeFloatCX=200
sizeFloatCY=100
[ToolBars\Edit list editor]
Visible=0
DockState=59421
[ToolBars\Edit list editor\State-SCBar-0]
sizeHorzCX=200
sizeHorzCY=100
sizeVertCX=200
sizeVertCY=100
sizeFloatCX=200
sizeFloatCY=100
[ToolBars\Capture Settings]
Visible=0
DockState=59420
[ToolBars\Capture Settings\State-SCBar-0]
sizeHorzCX=191
sizeHorzCY=470
sizeVertCX=191
sizeVertCY=470
sizeFloatCX=191
sizeFloatCY=470
[ToolBars\Shader Editor]
Visible=0
DockState=59419
[ToolBars\Shader Editor\State-SCBar-0]
sizeHorzCX=1034
sizeHorzCY=115
sizeVertCX=297
sizeVertCY=115
sizeFloatCX=297
sizeFloatCY=115
[ToolBars\Navigation bar]
Visible=0
DockState=59420
[ToolBars\Navigation bar\State-SCBar-0]
sizeHorzCX=213
sizeHorzCY=496
sizeVertCX=213
sizeVertCY=496
sizeFloatCX=213
sizeFloatCY=496
[Settings\PnSPresets]
Preset0=Scale to 16:9 TV,0.500,0.500,1.000,1.333
Preset1=Zoom To Widescreen,0.500,0.500,1.333,1.333
Preset2=Zoom To Ultra-Widescreen,0.500,0.500,1.763,1.763
[Commands2]
CommandMod0=891 3 0 "" 5 0 0
CommandMod1=892 3 0 "" 5 0 0
CommandMod2=902 3 27 "" 5 0 0
CommandMod3=901 3 25 "" 5 0 0
[FileFormats]
RtspHandler=1
RtspFileExtFirst=1
Windows Media file=wmv wmp wm asf \0
Windows Media Audio file=wma \0
Video file=avi \0
Audio file=wav \0
MPEG Media file=mpg mpeg mpe m1v m2v mpv2 mp2v ts tp tpr pva m2ts m2t mts evo m2p \0
VCD file=dat \0
MPEG Audio file=mpa mp2 m1a m2a \0
DVD file=vob ifo \0
DVD Audio file=ac3 dts \0
MP3 Format Sound=mp3 \0
MIDI file=mid midi rmi \0
Indeo Video file=ivf \0
AIFF Format Sound=aif aifc aiff \0
AU Format Sound=au snd \0
Ogg Media file=ogm ogv \0
Ogg Vorbis Audio file=ogg oga \0
CD Audio Track=cda \0
FLIC file=fli flc flic \0
DVD2AVI Project file=d2v \0
MPEG4 file=mp4 m4v mp4v mpv4 hdmov 3gp 3gpp \0
MPEG4 Audio file=m4a m4b aac \2
Matroska Media file=mkv \0
Matroska Audio file=mka \0
Smacker/Bink Media file=smk bik \0
RatDVD file=ratdvd \0
RoQ Media file=roq \0
Real Media file=rm ram rpm rmm \0
Real Audio file=ra \0
Real Script file=rt rp smi smil \0
Dirac Video file=drc \0
DirectShow Media file=dsm dsv dsa dss \0
Musepack file=mpc \0
FLAC Audio file=flac \0
WavPack Audio file=wv \0
ALAC Audio file=alac \0
OptimFrog Audio file=ofr ofs \0
Monkey's Audio file=ape apl \0
True Audio file=tta \0
AMR Audio file=amr \0
Flash Video file=flv iflv f4v \0
Shockwave Flash file=swf \3
QuickTime file=mov 3g2 3gp2 \0
Playlist file=asx m3u pls wvx wax wmx mpcpl \0
Blu-ray playlist file=mpls bdmv \0
Other=divx vp6 rmvb amv \0
[Shaders]
Initialized=1
Combine=
CombineScreenSpace=
0=sharpen complex 2|ps_2_a|/* Sharpen complex v2 (requires ps >= 2a) */\n\nsampler s0 : register(s0);\nfloat4 p0 : register(c0);\nfloat4 p1 : register(c1);\n\n#define width (p0[0])\n#define height (p0[1])\n\n// "largeur" d'un pixel\n#define px (p1[0])\n#define py (p1[1])\n\n/* Parameters */\n\n// pour le calcul du flou\n#define moyenne 0.6\n#define dx (moyenne*px)\n#define dy (moyenne*py)\n\n#define CoefFlou 2\n#define CoefOri (1+ CoefFlou)\n\n// pour le sharpen\n#define SharpenEdge 0.2\n#define Sharpen_val0 2\n#define Sharpen_val1 ((Sharpen_val0-1) / 8.0)\n\nfloat4 main( float2 tex : TEXCOORD0 ) : COLOR\n{\n\t// recup du pixel original\n\tfloat4 ori = tex2D(s0, tex); ;\n\n\t// calcul image floue (filtre gaussien)\n\tfloat4 c1 = tex2D(s0, tex + float2(-dx,-dy));\n\tfloat4 c2 = tex2D(s0, tex + float2(0,-dy));\n\tfloat4 c3 = tex2D(s0, tex + float2(dx,-dy));\n\tfloat4 c4 = tex2D(s0, tex + float2(-dx,0));\n\tfloat4 c5 = tex2D(s0, tex + float2(dx,0));\n\tfloat4 c6 = tex2D(s0, tex + float2(-dx,dy));\n\tfloat4 c7 = tex2D(s0, tex + float2(0,dy));\n\tfloat4 c8 = tex2D(s0, tex + float2(dx,dy));\n\n\t// filtre gaussien\n\t// [ 1, 2 , 1 ]\n\t// [ 2, 4 , 2 ]\n\t// [ 1, 2 , 1 ]\n\t// pour normaliser les valeurs, il faut diviser par la somme des coef\n\t// 1 / (1+2+1+2+4+2+1+2+1) = 1 / 16 = .0625\n\tfloat4 flou = (c1+c3+c6+c8 + 2*(c2+c4+c5+c7)+ 4*ori)*0.0625;\n\n\t// soustraction de l'image flou а l'image originale\n\tfloat4 cori = CoefOri*ori - CoefFlou*flou;\n\n\t// dйtection des contours\n // rйcuppйration des 9 voisins\n // [ c1, c2 , c3 ]\n // [ c4,ori , c5 ]\n // [ c6, c7 , c8 ]\n\tc1 = tex2D(s0, tex + float2(-px,-py));\n\tc2 = tex2D(s0, tex + float2(0,-py));\n\tc3 = tex2D(s0, tex + float2(px,-py));\n\tc4 = tex2D(s0, tex + float2(-px,0));\n\tc5 = tex2D(s0, tex + float2(px,0));\n\tc6 = tex2D(s0, tex + float2(-px,py));\n\tc7 = tex2D(s0, tex + float2(0,py));\n\tc8 = tex2D(s0, tex + float2(px,py));\n\n\t// par filtre de sobel\n\t// Gradient horizontal\n\t// [ -1, 0 ,1 ]\n\t// [ -2, 0, 2 ]\n\t// [ -1, 0 ,1 ]\n\tfloat delta1 = (c3 + 2*c5 + c8)-(c1 + 2*c4 + c6);\n\n\t// Gradient vertical\n\t// [ -1,- 2,-1 ]\n\t// [ 0, 0, 0 ]\n\t// [ 1, 2, 1 ]\n\tfloat delta2 = (c6 + 2*c7 + c8)-(c1 + 2*c2 + c3);\n\n\t// calcul\n\tif( sqrt( mul(delta1,delta1) + mul(delta2,delta2) ) >SharpenEdge ) {\n\t\t// si contour, sharpen\n\t\t//return float4(1,0,0,0);\n\t\treturn ori*Sharpen_val0 - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * Sharpen_val1 ;\n\t} else {\n\t\t// sinon, image corrigйe\n\t\treturn cori;\n\t}\n}
1=16-235 -> 0-255 [SD][HD]|ps_2_0|sampler s0 : register(s0);\n\n#define const_1 (16.0/255.0)\n#define const_2 (255.0/219.0)\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\t// original pixel\n\tfloat4 c0 = tex2D(s0,tex);\n\n\treturn((c0 - const_1) * const_2);\n}\n
2=YV12 Chroma Upsampling|ps_2_0|/*\nYV12 chroma upsampling fixer\nby Kurt Bernhard 'Leak' Pruenner\n\nUse with YV12 output if the half-resolution chroma \ngets upsampled in hardware by doubling the values\ninstead of interpolating between them.\n\n(i.e. if you're getting blocky red edges on dark \nbackgrounds...)\n*/\n\nsampler s0 : register(s0);\nfloat4 p0 : register(c0);\nfloat4 p1 : register(c1);\n\n#define width (p0[0])\n#define height (p0[1])\n\nfloat4 getPixel(float2 tex, float dx, float dy)\n{\n\ttex.x+=dx;\n\ttex.y+=dy;\n\t\n\treturn tex2D(s0, tex);\n}\n\nfloat4 rgb2yuv(float4 rgb)\n{\n\tfloat4x4 coeffs=\n\t\t{\n\t\t\t 0.299, 0.587, 0.114, 0.000,\n\t\t\t-0.147,-0.289, 0.436, 0.000,\n\t\t\t 0.615,-0.515,-0.100, 0.000,\n\t\t\t 0.000, 0.000, 0.000, 0.000\n\t\t};\n\t\t\n\treturn mul(coeffs,rgb);\n}\n\nfloat4 yuv2rgb(float4 yuv)\n{\n\tfloat4x4 coeffs=\n\t\t{\n\t\t\t 1.000, 0.000, 1.140, 0.000,\n\t\t\t 1.000,-0.395,-0.581, 0.000,\n\t\t\t 1.000, 2.032, 0.000, 0.000,\n\t\t\t 0.000, 0.000, 0.000, 0.000\n\t\t};\n\t\n\treturn mul(coeffs,yuv);\n}\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat dx=1/width;\n\tfloat dy=1/height;\n\t\n\tfloat4 yuv00=rgb2yuv(getPixel(tex,-dx,-dy));\n\tfloat4 yuv01=rgb2yuv(getPixel(tex,-dx, 0));\n\tfloat4 yuv02=rgb2yuv(getPixel(tex,-dx, dy));\n\tfloat4 yuv10=rgb2yuv(getPixel(tex, 0,-dy));\n\tfloat4 yuv11=rgb2yuv(getPixel(tex, 0, 0));\n\tfloat4 yuv12=rgb2yuv(getPixel(tex, 0, dy));\n\tfloat4 yuv20=rgb2yuv(getPixel(tex, dx,-dy));\n\tfloat4 yuv21=rgb2yuv(getPixel(tex, dx, 0));\n\tfloat4 yuv22=rgb2yuv(getPixel(tex, dx, dy));\n\n\tfloat4 yuv=\n\t\t(yuv00*1+yuv01*2+yuv02*1+\n\t\t yuv10*2+yuv11*4+yuv12*2+\n\t\t yuv20*1+yuv21*2+yuv22*1)/16;\n\t\n\tyuv.r=yuv11.r;\n\n\treturn yuv2rgb(yuv);\n}
3=sharpen complex|ps_2_0|sampler s0 : register(s0);\nfloat4 p1 : register(c1);\n\n#define dx (p1[0])\n#define dy (p1[1])\n\nfloat4 main( float2 tex : TEXCOORD0 ) : COLOR\n{\n\t// definition des pixels : original, floutй, corigй, final\n\tfloat4 ori;\n\tfloat4 flou;\n\tfloat4 cori;\n\tfloat4 final;\n\n\t// rйcuppйration de la matrice de 9 points\n\t// [ 1, 2 , 3 ]\n\t// [ 4,ori, 5 ]\n\t// [ 6, 7 , 8 ]\n\n\tori = tex2D(s0, tex);\n\tfloat4 c1 = tex2D(s0, tex + float2(-dx,-dy));\n\tfloat4 c2 = tex2D(s0, tex + float2(0,-dy));\n\tfloat4 c3 = tex2D(s0, tex + float2(dx,-dy));\n\tfloat4 c4 = tex2D(s0, tex + float2(-dx,0));\n\tfloat4 c5 = tex2D(s0, tex + float2(dx,0));\n\tfloat4 c6 = tex2D(s0, tex + float2(-dx,dy));\n\tfloat4 c7 = tex2D(s0, tex + float2(0,dy));\n\tfloat4 c8 = tex2D(s0, tex + float2(dx,dy));\n\n\t// calcul image floue (filtre gaussien)\n\t// pour normaliser les valeurs, il faut diviser par la somme des coef\n\t// 1/(1+2+1+2+4+2+1+2+1) = 1/ 16 = .0625\n\tflou = (c1+c3+c6+c8 + 2*(c2+c4+c5+c7)+ 4*ori)*0.0625;\n\n\t// soustraction de l'image flou а l'image originale\n\tcori = 2*ori - flou;\n\n\t// dйtection des contours\n\tfloat delta1;\n\tfloat delta2;\n\tfloat value;\n\n\t// par filtre de sobel\n\t// Gradient horizontal\n\t// [ -1, 0 ,1 ]\n\t// [ -2, 0, 2 ]\n\t// [ -1, 0 ,1 ]\n\tdelta1 = (c3 + 2*c5 + c8)-(c1 + 2*c4 + c6);\n\n\t// Gradient vertical\n\t// [ -1,- 2,-1 ]\n\t// [ 0, 0, 0 ]\n\t// [ 1, 2, 1 ]\n\tdelta2 = (c6 + 2*c7 + c8)-(c1 + 2*c2 + c3);\n\n\t// calcul\n\tvalue = sqrt( mul(delta1,delta1) + mul(delta2,delta2) ) ;\n\n\tif( value >.3 ) {\n\t\t// si contour, sharpen\n\t\t#define Sharpen_val0 2.0\n\t\t#define Sharpen_val1 0.125\n\t\tfinal = ori*2 - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * 0.125 ;\n\t\t//final= float4(1,0,0,0);\n\t\treturn final;\n\t}\n\n\t// sinon, image corrigйe\n\treturn cori;\n}
4=16-235 -> 0-255 [SD]|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define height (p0[1])\n#define width (p0[0])\n\n#define const_1 (16.0/255.0)\n#define const_2 (255.0/219.0)\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\t// original pixel\n\tfloat4 c0 = tex2D(s0,tex);\n\n\t/* ATI driver only looks at the height */\n\tif(height >= 720 ) {\n\t\treturn c0;\n\t} else {\n\t\treturn((c0 - const_1) * const_2);\n\t}\n}
5=emboss|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define width (p0[0])\n#define height (p0[1])\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat dx = 1/width;\n\tfloat dy = 1/height;\n\t\n\tfloat4 c1 = tex2D(s0, tex + float2(-dx,-dy));\n\tfloat4 c2 = tex2D(s0, tex + float2(0,-dy));\n\tfloat4 c4 = tex2D(s0, tex + float2(-dx,0));\n\tfloat4 c6 = tex2D(s0, tex + float2(dx,0));\n\tfloat4 c8 = tex2D(s0, tex + float2(0,dy));\n\tfloat4 c9 = tex2D(s0, tex + float2(dx,dy));\n\t\n\tfloat4 c0 = (-c1-c2-c4+c6+c8+c9);\n\tc0 = (c0.r+c0.g+c0.b)/3 + 0.5;\n\t\n\treturn c0;\n}\n
6=spotlight|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define width (p0[0])\n#define height (p0[1])\n#define clock (p0[3])\n\n#define PI acos(-1)\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat4 c0 = tex2D(s0, tex);\n\tfloat3 lightsrc = float3(sin(clock*PI/1.5)/2+0.5,cos(clock*PI)/2+0.5,1);\n\tfloat3 light = normalize(lightsrc - float3(tex.x,tex.y,0));\n\tc0 *= pow(dot(light, float3(0,0,1)), 50);\n\t\n\treturn c0;\n}\n
7=BT.601 -> BT.709|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define height (p0[1])\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\t// original pixel\n\tfloat4 c0 = tex2D(s0,tex);\n\n\t// uncomment to activate for HD only\n\t/*\n\tif(height > 719)\n\t{\n\t\treturn c0;\n\t}\n\t*/\n\n\t// r=c0[0], g=c0[1], b=c0[2]\n\t// RGB [16,235] to YUV: 601 mode (128 is not added to Cb and Cr)\n\tfloat y=0.299*c0[0] + 0.587*c0[1] + 0.114*c0[2];\n\tfloat Cb=-0.172*c0[0] -0.339*c0[1] +0.511*c0[2];\n\tfloat Cr=0.511*c0[0] -0.428*c0[1] -0.083*c0[2];\n\n\t// YUV to RGB [16,235]: 709 mode (Cb and Cr are 128 less)\n\tfloat r=y+1.540*Cr;\n\tfloat g=y-0.459*Cr-0.183*Cb;\n\tfloat b=y+1.816*Cb;\n\n\treturn float4(r,g,b,0);\n}\n
8=deinterlace (blend)|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define width (p0[0])\n#define height (p0[1])\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat4 c0 = tex2D(s0, tex);\n\t\n\tfloat2 h = float2(0, 1/height);\n\tfloat4 c1 = tex2D(s0, tex-h);\n\tfloat4 c2 = tex2D(s0, tex+h);\n\tc0 = (c0*2+c1+c2)/4;\n\t\n\treturn c0;\n}
9=denoise|ps_3_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define width (p0[0])\n#define height (p0[1])\n\n#define val0 (1.0)\n#define val1 (0.125) \n\n#define effect_width (0.1)\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\t\n\tfloat dx = 0.0f;\n\tfloat dy = 0.0f;\n \tfloat fTap = effect_width;\n\n\tfloat4 cAccum = tex2D(s0, tex) * val0;\n\n\tfor ( int iDx = 0 ; iDx < 16; ++iDx )\n\t{\n\t\tdx = fTap /width; \n\t dy = fTap /height; \n\n\t\tcAccum += tex2D(s0, tex + float2(-dx,-dy)) * val1;\n\t\tcAccum += tex2D(s0, tex + float2(0,-dy)) * val1;\n\t\tcAccum += tex2D(s0, tex + float2(-dx,0)) * val1;\n\t\tcAccum += tex2D(s0, tex + float2(dx,0)) * val1;\n\t\tcAccum += tex2D(s0, tex + float2(0,dy)) * val1;\n\t\tcAccum += tex2D(s0, tex + float2(dx,dy)) * val1;\n\t\tcAccum += tex2D(s0, tex + float2(-dx,+dy)) * val1;\n\t\tcAccum += tex2D(s0, tex + float2(+dx,-dy)) * val1;\n \n\t\tfTap += 0.1f;\n\t}\n\t\n\treturn(cAccum/16.0f);\n}
10=invert|ps_2_0|sampler s0 : register(s0);\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat4 c0 = float4(1, 1, 1, 1) - tex2D(s0, tex);\n\t\n\treturn c0;\n}
11=procamp|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\nfloat4 p1 : register(c1);\n\n#define width (p0[0])\n#define height (p0[1])\n#define counter (p0[2])\n#define clock (p0[3])\n#define one_over_width (p1[0])\n#define one_over_height (p1[1])\n\n#define PI acos(-1)\n\nstatic float4x4 r2y =\n{\n\t0.299, 0.587, 0.114, 0,\n\t-0.147, -0.289, 0.437, 0,\n\t0.615, -0.515, -0.100, 0,\n\t0, 0, 0, 0\n};\n\nstatic float4x4 y2r =\n{\n\t1.0, 0.0, 1.140, 0, \n\t1.0, -0.394, -0.581, 0,\n\t1.0, 2.028, 0.0, 0, \n\t0, 0, 0, 0\n};\n\n#define ymin (16.0/255)\n#define ymax (235.0/255)\n\n// Brightness: -1.0 to 1.0, default 0.0\n// Contrast: 0.0 to 10.0, default 1.0\n// Hue: -180.0 to +180.0, default 0.0\n// Saturation: 0.0 to 10.0, default 1.0\n\n#define Brightness 0.0\n#define Contrast 1.0\n#define Hue 0.0\n#define Saturation 1.0\n\n// tv -> pc scale\n// #define Brightness (-ymin)\n// #define Contrast (1.0/(ymax-ymin))\n\nstatic float2x2 HueMatrix =\n{\n\tcos(Hue * PI / 180), sin(Hue * PI / 180),\n\t-sin(Hue * PI / 180), cos(Hue * PI / 180)\n};\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat4 c0 = tex2D(s0, tex);\n\tc0 = mul(r2y, c0);\n\tc0.r = Contrast * (c0.r - ymin) + ymin + Brightness;\n\tc0.gb = mul(HueMatrix, c0.gb) * Saturation;\n\tc0 = mul(y2r, c0);\n\treturn c0; \n}\n
12=contour|ps_3_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define width (p0[0])\n#define height (p0[1])\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat dx = 4/width;\n\tfloat dy = 4/height;\n\t\n\tfloat4 c2 = tex2D(s0, tex + float2(0,-dy));\n\tfloat4 c4 = tex2D(s0, tex + float2(-dx,0));\n\tfloat4 c5 = tex2D(s0, tex + float2(0,0));\n\tfloat4 c6 = tex2D(s0, tex + float2(dx,0));\n\tfloat4 c8 = tex2D(s0, tex + float2(0,dy));\n\t\n\tfloat4 c0 = (-c2-c4+c5*4-c6-c8);\n\tif(length(c0) < 1.0) c0 = float4(0,0,0,0);\n\telse c0 = float4(1,1,1,0);\n\t\n\treturn c0;\n}
13=letterbox|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define width (p0[0])\n#define height (p0[1])\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat4 c0 = 0;\n\t\n\tfloat2 ar = float2(16, 9);\n\tfloat h = (1 - width/height * ar.y/ar.x) / 2;\n\t\n\tif(tex.y >= h && tex.y <= 1-h)\n\t\tc0 = tex2D(s0, tex);\n\t\n\treturn c0;\n}
14=0-255 -> 16-235|ps_2_0|sampler s0 : register(s0);\n\n#define const_1 (16.0/255.0)\n#define const_2 (219.0/255.0)\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\t// original pixel\n\tfloat4 c0 = tex2D(s0,tex);\n\n\treturn (c0 * const_2) + const_1;\n}\n
15=nightvision|ps_2_0|sampler s0 : register(s0);\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat c = dot(tex2D(s0, tex), float4(0.2, 0.6, 0.1, 0.1));\n\treturn float4(0,c,0,0);\n}\n
16=wave|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define width (p0[0])\n#define height (p0[1])\n#define clock (p0[3])\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat4 c0 = 0;\n\t\n\ttex.x += sin(tex.x+clock/0.3)/20;\n\ttex.y += sin(tex.x+clock/0.3)/20;\n\t\n\tif(tex.x >= 0 && tex.x <= 1 && tex.y >= 0 && tex.y <= 1)\n\t{\n\t\tc0 = tex2D(s0, tex);\n\t}\n\t\n\treturn c0;\n}\n
17=sharpen|ps_2_0|sampler s0 : register(s0); \nfloat4 p0 : register(c0); \nfloat4 p1 : register(c1); \n\n#define width (p0[0]) \n#define height (p0[1]) \n \n#define effect_width (1.6) \n#define val0 (2.0) \n#define val1 (-0.125) \n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR \n{ \n\tfloat dx = effect_width/width; \n\tfloat dy = effect_width/height; \n \n\tfloat4 c1 = tex2D(s0, tex + float2(-dx,-dy)) * val1; \n\tfloat4 c2 = tex2D(s0, tex + float2(0,-dy)) * val1; \n\tfloat4 c3 = tex2D(s0, tex + float2(-dx,0)) * val1; \n\tfloat4 c4 = tex2D(s0, tex + float2(dx,0)) * val1; \n\tfloat4 c5 = tex2D(s0, tex + float2(0,dy)) * val1; \n\tfloat4 c6 = tex2D(s0, tex + float2(dx,dy)) * val1; \n\tfloat4 c7 = tex2D(s0, tex + float2(-dx,+dy)) * val1; \n\tfloat4 c8 = tex2D(s0, tex + float2(+dx,-dy)) * val1; \n\tfloat4 c9 = tex2D(s0, tex) * val0; \n\t\n\tfloat4 c0 = (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9); \n\t\n\treturn c0; \n}
18=sphere|ps_2_0|sampler s0 : register(s0);\nfloat4 p0 : register(c0);\n\n#define clock (p0[3])\n\n#define PI acos(-1)\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\t// - this is a very simple raytracer, one sphere only\n\t// - no reflection or refraction, yet (my ati 9800 has a 64 + 32 instruction limit...)\n\t\n\tfloat3 pl = float3(3,-3,-4); // light pos\n\tfloat4 cl = 0.4; // light color\n\t\n\tfloat3 pc = float3(0,0,-1); // cam pos\n\tfloat3 ps = float3(0,0,0.5); // sphere pos\n\tfloat r = 0.65; // sphere radius\n\t\n\tfloat3 pd = normalize(float3(tex.x-0.5, tex.y-0.5, 0) - pc);\n\t\n\tfloat A = 1;\n\tfloat B = 2*dot(pd, pc - ps);\n\tfloat C = dot(pc - ps, pc - ps) - r*r;\n\tfloat D = B*B - 4*A*C;\n\t\n\tfloat4 c0 = 0;\n\t\n\tif(D >= 0)\n\t{\n\t\t// t2 is the smaller, obviously...\n\t\t// float t1 = (-B + sqrt(D)) / (2*A);\n\t\t// float t2 = (-B - sqrt(D)) / (2*A);\n\t\t// float t = min(t1, t2); \n\t\t\n\t\tfloat t = (-B - sqrt(D)) / (2*A);\n\t\t\n\t\t// intersection data\n\t\tfloat3 p = pc + pd*t;\n\t\tfloat3 n = normalize(p - ps);\n\t\tfloat3 l = normalize(pl - p);\n\t\t\n\t\t// mapping the image onto the sphere\n\t\ttex = acos(-n)/PI; \n\t\t\n\t\t// rotate it\n\t\ttex.x = frac(tex.x + frac(clock/10));\n\t\t\n\t\t// diffuse + specular\n\t\tc0 = tex2D(s0, tex) * dot(n, l) + cl * pow(max(dot(l, reflect(pd, n)), 0), 50);\n\t}\n\t\n\treturn c0;\n}\n
19=grayscale|ps_2_0|sampler s0 : register(s0);\n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR\n{\n\tfloat c0 = dot(tex2D(s0, tex), float4(0.299, 0.587, 0.114, 0));\n\t\n\treturn c0;\n}\n
20=edge sharpen|ps_2_0|sampler s0 : register(s0); \nfloat4 p0 : register(c0); \n\n#define width (p0[0]) \n#define height (p0[1]) \n\n#define NbPixel 1 \n\n#define Edge_threshold 0.2 \n\n#define Sharpen_val0 2.0 \n#define Sharpen_val1 0.125 \n\nfloat4 main(float2 tex : TEXCOORD0) : COLOR \n{ \n// taille de NbPixel pixels \nfloat dx = NbPixel/width; \nfloat dy = NbPixel/height; \nfloat4 Res = 0; \n\n// Dйtection de contour par Prewitt \n // rйcuppйration des 9 points \n // [ 1, 2, 3 ] \n // [ 4, 0, 5 ] \n // [ 6, 7, 8 ] \n float4 c0 = tex2D(s0, tex); \n float4 c1 = tex2D(s0, tex + float2(-dx,-dy)); \n float4 c2 = tex2D(s0, tex + float2(0,-dy)); \n float4 c3 = tex2D(s0, tex + float2(dx,-dy)); \n float4 c4 = tex2D(s0, tex + float2(-dx,0)); \n float4 c5 = tex2D(s0, tex + float2(dx,0)); \n float4 c6 = tex2D(s0, tex + float2(-dx,dy)); \n float4 c7 = tex2D(s0, tex + float2(0,dy)); \n float4 c8 = tex2D(s0, tex + float2(dx,dy)); \n\n // Calcul des 3 vecteurs dйrivй (hor,vert, diag1, diag2) \n float4 delta1 = (c6+c4+c1-c3-c5-c8); \n float4 delta2 = (c4+c1+c2-c5-c8-c7); \n float4 delta3 = (c1+c2+c3-c8-c7-c6); \n float4 delta4 = (c2+c3+c5-c7-c6-c4); \n\n // calcul du Prewitt \n float value = length(abs(delta1) + abs(delta2) + abs(delta3) + abs(delta4))/6; \n\n// Si c'est un contour (vector lenght > Edge_threshold) => filtre de sharpen \n if(value > Edge_threshold ) \n { \n Res = c0 * Sharpen_val0 - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * Sharpen_val1 ; \n // Pour voir les contour en rouge ... \n //Res = float4( 1.0, 0.0, 0.0, 0.0 ); \n\n return Res; \n } \n else \n return c0; \n}
[Recent File List]
[/more]