diff --git a/Effects/ACNet.hlsl b/Effects/ACNet.hlsl index 1d2a3b3c3..edb22b68d 100644 --- a/Effects/ACNet.hlsl +++ b/Effects/ACNet.hlsl @@ -1,5 +1,5 @@ // ACNet -// 移植自 https://github.com/TianZerL/ACNetGLSL/blob/master/glsl/ACNet.glsl +// 移植自 https://github.com/TianZerL/ACNetGLSL/blob/f20a6b6b7327f4caf588b06c6b21f18e40dae1ce/glsl/ACNet.glsl //!MAGPIE EFFECT @@ -7,6 +7,7 @@ //!OUTPUT_WIDTH INPUT_WIDTH * 2 //!OUTPUT_HEIGHT INPUT_HEIGHT * 2 + //!TEXTURE Texture2D INPUT; @@ -39,6 +40,10 @@ Texture2D tex4; //!FILTER POINT SamplerState sam; +//!SAMPLER +//!FILTER LINEAR +SamplerState sam1; + //!COMMON @@ -150,7 +155,7 @@ void Pass1(uint2 blockStart, uint3 threadId) { src[i - 1][j - 1] * kernelsL1A[3 * 9 + 0] + src[i][j - 1] * kernelsL1A[3 * 9 + 1] + src[i + 1][j - 1] * kernelsL1A[3 * 9 + 2] + src[i - 1][j] * kernelsL1A[3 * 9 + 3] + src[i][j] * kernelsL1A[3 * 9 + 4] + src[i + 1][j] * kernelsL1A[3 * 9 + 5] + src[i + 1][j + 1] * kernelsL1A[3 * 9 + 6] + src[i][j + 1] * kernelsL1A[3 * 9 + 7] + src[i + 1][j + 1] * kernelsL1A[3 * 9 + 8] + biasL1A.w - )); + )); float4 target2 = RELU(float4( src[i - 1][j - 1] * kernelsL1B[0 * 9 + 0] + src[i][j - 1] * kernelsL1B[0 * 9 + 1] + src[i + 1][j - 1] * kernelsL1B[0 * 9 + 2] + @@ -168,7 +173,7 @@ void Pass1(uint2 blockStart, uint3 threadId) { src[i - 1][j - 1] * kernelsL1B[3 * 9 + 0] + src[i][j - 1] * kernelsL1B[3 * 9 + 1] + src[i + 1][j - 1] * kernelsL1B[3 * 9 + 2] + src[i - 1][j] * kernelsL1B[3 * 9 + 3] + src[i][j] * kernelsL1B[3 * 9 + 4] + src[i + 1][j] * kernelsL1B[3 * 9 + 5] + src[i - 1][j + 1] * kernelsL1B[3 * 9 + 6] + src[i][j + 1] * kernelsL1B[3 * 9 + 7] + src[i + 1][j + 1] * kernelsL1B[3 * 9 + 8] + biasL1B.w - )); + )); tex1[destPos] = target1; tex2[destPos] = target2; @@ -3596,7 +3601,7 @@ void Pass8(uint2 blockStart, uint3 threadId) { tl2.w * kernelsLA[3 * 72 + 7 * 9 + 0] + tc2.w * kernelsLA[3 * 72 + 7 * 9 + 1] + tr2.w * kernelsLA[3 * 72 + 7 * 9 + 2] + ml2.w * kernelsLA[3 * 72 + 7 * 9 + 3] + mc2.w * kernelsLA[3 * 72 + 7 * 9 + 4] + mr2.w * kernelsLA[3 * 72 + 7 * 9 + 5] + bl2.w * kernelsLA[3 * 72 + 7 * 9 + 6] + bc2.w * kernelsLA[3 * 72 + 7 * 9 + 7] + br2.w * kernelsLA[3 * 72 + 7 * 9 + 8] + biasLA.w - )); + )); float4 target2 = RELU(float4( tl1.x * kernelsLB[0 * 72 + 0 * 9 + 0] + tc1.x * kernelsLB[0 * 72 + 0 * 9 + 1] + tr1.x * kernelsLB[0 * 72 + 0 * 9 + 2] + @@ -4266,8 +4271,6 @@ void Pass9(uint2 blockStart, uint3 threadId) { bl2.w * kernelsLB[3 * 72 + 7 * 9 + 6] + bc2.w * kernelsLB[3 * 72 + 7 * 9 + 7] + br2.w * kernelsLB[3 * 72 + 7 * 9 + 8] + biasLB.w )); - float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam, pos, 0).rgb); - [unroll] for (uint i = 0; i <= 1; ++i) { [unroll] @@ -4291,6 +4294,7 @@ void Pass9(uint2 blockStart, uint3 threadId) { target2.z * kernelsL10[24 + index] + target2.w * kernelsL10[28 + index], 0.0f, 1.0f); + float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(luma, originUV))); } } diff --git a/Effects/FSRCNNX.hlsl b/Effects/FSRCNNX.hlsl index 5aea4fc6f..d83cc280e 100644 --- a/Effects/FSRCNNX.hlsl +++ b/Effects/FSRCNNX.hlsl @@ -52,6 +52,10 @@ Texture2D tex4; //!FILTER POINT SamplerState sam; +//!SAMPLER +//!FILTER LINEAR +SamplerState sam1; + //!PASS 1 //!DESC feature map @@ -228,7 +232,7 @@ void Pass2(uint2 blockStart, uint3 threadId) { target1 += mul(br2, float4x4(0.6999920010566711, 0.0839441940188408, 0.0815469548106194, -0.1509176045656204, -0.0690853074193001, -0.3200871348381042, 0.0780162736773491, -0.1449639797210693, 0.2868815064430237, 0.3962450027465820, -0.3439113497734070, 0.2657423913478851, 0.0988137871026993, 0.3471299111843109, -0.2186402678489685, -0.0648017078638077)); target1 = max(target1, 0) + float4(1.0311057567596436, 0.1051208898425102, 0.1158760935068130, 0.0466635078191757) * min(target1, 0); - float4 target2 = float4(0.0713458731770515,-0.1403961777687073,-0.0019562745001167,0.0153338573873043); + float4 target2 = float4(0.0713458731770515, -0.1403961777687073, -0.0019562745001167, 0.0153338573873043); target2 += mul(tl1, float4x4(-0.0950641855597496, -0.1496641039848328, -0.0653550028800964, 0.0655386000871658, -0.0118882004171610, 0.2012491524219513, -0.2844599783420563, -0.4794720113277435, 0.1128025799989700, -0.0173030979931355, -0.0558849945664406, -0.2957552075386047, 0.0128202112391591, 0.0199047476053238, -0.0091027505695820, -0.0789640173316002)); target2 += mul(tl2, float4x4(0.1597457975149155, -0.0476507246494293, 0.1466529071331024, 0.0859163030982018, 0.0797316282987595, -0.3380981683731079, 0.2370245009660721, -0.1145931258797646, -0.0352988094091415, -0.0444888733327389, -0.2100716233253479, 0.1305520236492157, -0.1359029710292816, 0.1097442805767059, 0.0449938289821148, -0.1155664771795273)); target2 += mul(ml1, float4x4(-0.0333916284143925, 0.2415594160556793, 0.0520512908697128, 0.1228107511997223, -0.0491011217236519, 0.4408806562423706, 0.4631956815719604, 0.2014560103416443, -0.3688595592975616, 0.0367180295288563, 0.2484581321477890, -0.1113442853093147, 0.1283355057239532, 0.0418004281818867, -0.0171243026852608, -0.1231943219900131)); @@ -294,7 +298,7 @@ void Pass3(uint2 blockStart, uint3 threadId) { float4 mr2 = tex2.SampleLevel(sam, pos + float2(inputPt.x, 0), 0); float4 br2 = tex2.SampleLevel(sam, pos + inputPt, 0); - float4 target1 = float4(0.0203563515096903,0.1902436912059784,-0.0757935121655464,0.0393617525696754); + float4 target1 = float4(0.0203563515096903, 0.1902436912059784, -0.0757935121655464, 0.0393617525696754); target1 += mul(tl1, float4x4(-0.1080558672547340, -0.0400269515812397, 0.1042881682515144, -0.1994346678256989, 0.0172465778887272, -0.0829331055283546, -0.1278677284717560, -0.0762506872415543, -0.0593080408871174, -0.0305212251842022, 0.1326192617416382, -0.3380933105945587, -0.0722763314843178, -0.1975518912076950, -0.0223602931946516, 0.2251029163599014)); target1 += mul(tl2, float4x4(0.1747678220272064, 0.0297168865799904, 0.1054855734109879, 0.0803295820951462, -0.0338115766644478, -0.3885377943515778, -0.3540246784687042, -0.0719623491168022, -0.0656022280454636, -0.0469004511833191, 0.1379419565200806, 0.0319863893091679, 0.0799935683608055, -0.0099127553403378, 0.1698455959558487, -0.0108015276491642)); target1 += mul(ml1, float4x4(0.1587898135185242, 0.3995443880558014, -0.0333226583898067, 0.2373267263174057, -0.1616930961608887, 0.0659186244010925, 0.0141129801049829, -0.0541022196412086, -0.5743742585182190, 0.1121487766504288, 0.4259817600250244, 0.0280795227736235, -0.3721714317798615, -0.3496374189853668, 0.0997273251414299, -0.0079920450225472)); @@ -315,7 +319,7 @@ void Pass3(uint2 blockStart, uint3 threadId) { target1 += mul(br2, float4x4(0.0732532218098640, 0.1516859829425812, 0.0580205544829369, 0.1968977004289627, -0.0066619524732232, -0.1597842127084732, -0.0990600511431694, -0.1059188917279243, 0.0718481168150902, -0.2222738713026047, -0.1675696671009064, -0.1500017195940018, -0.0568779110908508, -0.0582777932286263, -0.0844587534666061, -0.0263266414403915)); target1 = max(target1, 0) + float4(-0.2459529191255569, 0.7563464641571045, -0.0705636814236641, -0.0094820559024811) * min(target1, 0); - float4 target2 = float4(-0.0448397286236286,-0.1649267971515656,-0.1192543581128120,-0.0061073559336364); + float4 target2 = float4(-0.0448397286236286, -0.1649267971515656, -0.1192543581128120, -0.0061073559336364); target2 += mul(tl1, float4x4(0.0724840760231018, -0.0480341166257858, -0.1082391515374184, -0.1447021961212158, 0.0723197236657143, 0.0481830574572086, 0.0009448126656935, 0.0353565886616707, -0.0653375908732414, 0.0029647622723132, -0.0016588598955423, -0.2075651884078979, 0.0403469167649746, 0.3929971158504486, 0.0342363268136978, 0.1427230089902878)); target2 += mul(tl2, float4x4(-0.0743464827537537, 0.1844420731067657, 0.0256296340376139, -0.2808582782745361, 0.0351609662175179, 0.3277008235454559, -0.0205841138958931, -0.5355809330940247, 0.0681906566023827, 0.2058052271604538, -0.0479847639799118, -0.3735262751579285, -0.0261550359427929, -0.1148884072899818, -0.2329017966985703, 0.0728458985686302)); target2 += mul(ml1, float4x4(-0.1236097738146782, 0.1251334398984909, -0.1339431256055832, 0.0198749266564846, -0.1325920224189758, -2.2431972026824951, -0.0680834427475929, -0.5671764612197876, -0.3431925177574158, -0.0983135104179382, -0.2207138091325760, -0.2374879121780396, 0.0127309206873178, 1.3076044321060181, 0.0848151743412018, -0.1928595900535583)); @@ -381,7 +385,7 @@ void Pass4(uint2 blockStart, uint3 threadId) { float4 mr2 = tex4.SampleLevel(sam, pos + float2(inputPt.x, 0), 0); float4 br2 = tex4.SampleLevel(sam, pos + inputPt, 0); - float4 target1 = float4(-0.0410279631614685,-0.1111723631620407,-0.0406232848763466,-0.0939496159553528); + float4 target1 = float4(-0.0410279631614685, -0.1111723631620407, -0.0406232848763466, -0.0939496159553528); target1 += mul(tl1, float4x4(0.1221675798296928, 0.0083215842023492, -0.0162804014980793, 0.0316714197397232, -0.2205813378095627, 0.1500435769557953, 0.2109555304050446, 0.2741867899894714, 0.0956874340772629, -0.0896854698657990, -0.1657065600156784, -0.1349759399890900, 0.0601499564945698, -0.1523845940828323, -0.1828087568283081, -0.2727653682231903)); target1 += mul(tl2, float4x4(-0.0918163508176804, 0.1564485579729080, 0.1133174449205399, 0.2215953171253204, -0.0623677000403404, -0.0497728772461414, -0.0372809022665024, -0.0258478187024593, -0.1364922970533371, 0.1053884625434875, 0.3292874991893768, 0.2693256139755249, -0.0347631797194481, -0.1470523178577423, 0.0096792401745915, -0.0542853325605392)); target1 += mul(ml1, float4x4(0.1331177949905396, -0.0964357852935791, -0.0706946700811386, 0.1593225002288818, -0.4815943241119385, 0.1224092170596123, -0.0870430991053581, 0.0005010276800022, -0.0242684502154589, -0.2256436049938202, 0.1367238312959671, 0.0474774017930031, 0.6886650323867798, -0.0065326127223670, 0.1841574758291245, -0.1354993879795074)); @@ -402,7 +406,7 @@ void Pass4(uint2 blockStart, uint3 threadId) { target1 += mul(br2, float4x4(-0.1835366338491440, 0.0978360474109650, -0.1111819595098495, 0.2109299153089523, 0.0509372949600220, -0.1992686837911606, 0.0677929744124413, -0.0870024710893631, -0.0412262082099915, -0.0697719156742096, -0.0967373847961426, 0.0137308547273278, 0.0195730421692133, 0.0410240143537521, 0.1157210171222687, 0.2283479571342468)); target1 = max(target1, 0) + float4(0.1991519331932068, -0.1275756657123566, -0.0622864030301571, 0.1586369574069977) * min(target1, 0); - float4 target2 = float4(-0.0089084329083562,-0.0336172059178352,0.0177190825343132,0.0529975406825542); + float4 target2 = float4(-0.0089084329083562, -0.0336172059178352, 0.0177190825343132, 0.0529975406825542); target2 += mul(tl1, float4x4(-0.0275970958173275, 0.0141968233510852, 0.1181544512510300, -0.0572245270013809, 0.1161347925662994, -0.1156444773077965, -0.2549640238285065, 0.0882879272103310, -0.0715355500578880, 0.0151285668835044, 0.1079384386539459, 0.0650847703218460, -0.1597152203321457, 0.0669793561100960, 0.2084401696920395, -0.0951152443885803)); target2 += mul(tl2, float4x4(0.0404323227703571, -0.0206144321709871, -0.1080420613288879, -0.2038477361202240, 0.0248847268521786, -0.0064681121148169, 0.0389525443315506, 0.0011026862775907, 0.0885242074728012, 0.0295896343886852, -0.3323790132999420, 0.1935138553380966, -0.0466548874974251, 0.1023886054754257, 0.1257870644330978, -0.1541756242513657)); target2 += mul(ml1, float4x4(-0.0076520540751517, 0.0361139886081219, 0.1749804913997650, -0.2051989138126373, 0.0022692133206874, -0.0282937753945589, -0.2039019316434860, -0.2343468815088272, -0.0357327871024609, -0.0570764988660812, 0.2925858795642853, -0.1988349705934525, -0.0584560707211494, -0.0341510921716690, 0.1300961822271347, 0.5184492468833923)); @@ -598,8 +602,6 @@ void Pass6(uint2 blockStart, uint3 threadId) { result += mul(mr2, float4x4(-0.0106181986629963, 0.0084018819034100, 0.0131329754367471, -0.0198754761368036, 0.1117177084088326, 0.0990846082568169, -0.0732304081320763, 0.0163581725209951, -0.0648830309510231, -0.0451613292098045, 0.0206844564527273, 0.0031441387254745, -0.0106161693111062, -0.0567689687013626, 0.0782861113548279, -0.0306094046682119)); result += mul(br1, float4x4(0.0012452082009986, -0.0026056850329041, -0.0096226977184415, -0.0037850935477763, -0.0190967041999102, 0.0534373670816422, 0.1599360853433609, 0.0834670960903168, -0.0070255175232887, 0.0012873009545729, 0.0030876772943884, -0.0093916896730661, -0.0033529615029693, 0.0043485122732818, 0.0089034689590335, -0.0067489291541278)); result += mul(br2, float4x4(0.0004713654634543, -0.0034161377698183, -0.0026913962792605, 0.0053522582165897, -0.0040974905714393, 0.0273330621421337, -0.0333138220012188, -0.0701237097382545, 0.0082997502759099, -0.0183656588196754, -0.0122841577976942, -0.0052855615504086, -0.0023795007728040, -0.0438593104481697, -0.1101513057947159, -0.0182559806853533)); - - float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam, pos, 0).rgb); [unroll] for (uint i = 0; i <= 1; ++i) { @@ -613,6 +615,7 @@ void Pass6(uint2 blockStart, uint3 threadId) { } } + float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); const uint index = i * 2 + j; WriteToOutput(destPos, mul(yuv2rgb, float3(result[index], originUV))); } diff --git a/Effects/FSRCNNX_LineArt.hlsl b/Effects/FSRCNNX_LineArt.hlsl index de981ef6a..bdc30b0b8 100644 --- a/Effects/FSRCNNX_LineArt.hlsl +++ b/Effects/FSRCNNX_LineArt.hlsl @@ -46,11 +46,13 @@ Texture2D tex3; //!FORMAT R16G16B16A16_FLOAT Texture2D tex4; - //!SAMPLER //!FILTER POINT SamplerState sam; +//!SAMPLER +//!FILTER LINEAR +SamplerState sam1; //!PASS 1 //!DESC feature map @@ -597,8 +599,6 @@ void Pass6(uint2 blockStart, uint3 threadId) { result += mul(mr2, float4x4(-0.0089390166103840, -0.0105021111667156, -0.0130960196256638, -0.0257005076855421, 0.0099271116778255, -0.0267942640930414, 0.0677764937281609, 0.0239320658147335, -0.0469516664743423, -0.0230019800364971, -0.0446235798299313, -0.0338921397924423, -0.0061601125635207, 0.0139691382646561, -0.0029954034835100, -0.0108477231115103)); result += mul(br1, float4x4(-0.0002513871586416, 0.0017334159929305, -0.0072467559948564, -0.0149013847112656, -0.0091025009751320, -0.0054195052944124, -0.0053499941714108, 0.0118143679574132, -0.0134334927424788, 0.0106377983465791, -0.0072384304367006, 0.0483081750571728, -0.0011459409724921, -0.0010465533705428, 0.0040362793952227, -0.0004637696838472)); result += mul(br2, float4x4(0.0037248437292874, 0.0041816406883299, -0.0139264371246099, 0.0035959482192993, -0.0390684641897678, -0.0257617402821779, -0.0298785082995892, -0.0066674682311714, -0.0151000469923019, -0.0176323894411325, 0.0045121158473194, 0.0077007445506752, 0.0051746177487075, 0.0075236861594021, 0.0008582049049437, 0.0010294843232259)); - - float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam, pos, 0).rgb); [unroll] for (uint i = 0; i <= 1; ++i) { @@ -612,6 +612,7 @@ void Pass6(uint2 blockStart, uint3 threadId) { } } + float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); const uint index = i * 2 + j; WriteToOutput(destPos, mul(yuv2rgb, float3(result[index], originUV))); } diff --git a/Effects/NNEDI3_nns16_win8x4.hlsl b/Effects/NNEDI3_nns16_win8x4.hlsl index 5380e95e2..d9c99f4bd 100644 --- a/Effects/NNEDI3_nns16_win8x4.hlsl +++ b/Effects/NNEDI3_nns16_win8x4.hlsl @@ -1,5 +1,5 @@ // nnedi3-nns16-win8x4 -// 移植自 https://github.com/bjin/mpv-prescalers/blob/master/compute/nnedi3-nns16-win8x4.hook +// 移植自 https://github.com/bjin/mpv-prescalers/blob/cc02ed95c1fe05b72bc21d41257c4c085e6e409b/compute/nnedi3-nns16-win8x4.hook // 有半像素的偏移 //!MAGPIE EFFECT @@ -15,6 +15,10 @@ Texture2D INPUT; //!FILTER POINT SamplerState sam; +//!SAMPLER +//!FILTER LINEAR +SamplerState sam1; + //!TEXTURE //!WIDTH INPUT_WIDTH //!HEIGHT INPUT_HEIGHT * 2 @@ -162,6 +166,7 @@ groupshared float inp[525]; void Pass2(uint2 blockStart, uint3 threadId) { const float2 inputPt = GetInputPt(); + const float2 outputPt = GetOutputPt(); const uint2 group_base = uint2(blockStart.x >> 1, blockStart.y); for (int id = threadId.x * MP_NUM_THREADS_Y + threadId.y; id < 525; id += MP_NUM_THREADS_X * MP_NUM_THREADS_Y) { @@ -187,9 +192,8 @@ void Pass2(uint2 blockStart, uint3 threadId) { samples[i][j] = inp[local_pos + (i / 2) * 15 + (i % 2) * 4 + j]; } } - - float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam, inputPt * (destPos / 2 + 0.5f), 0).rgb); + float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(samples[2][3], originUV))); ++destPos.x; @@ -197,5 +201,6 @@ void Pass2(uint2 blockStart, uint3 threadId) { return; } + originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(nnedi3(samples), originUV))); } diff --git a/Effects/NNEDI3_nns64_win8x6.hlsl b/Effects/NNEDI3_nns64_win8x6.hlsl index ec12c5679..40cd56d4a 100644 --- a/Effects/NNEDI3_nns64_win8x6.hlsl +++ b/Effects/NNEDI3_nns64_win8x6.hlsl @@ -1,5 +1,5 @@ // nnedi3-nns64-win8x6 -// 移植自 https://github.com/bjin/mpv-prescalers/blob/master/compute/nnedi3-nns64-win8x6.hook +// 移植自 https://github.com/bjin/mpv-prescalers/blob/cc02ed95c1fe05b72bc21d41257c4c085e6e409b/compute/nnedi3-nns64-win8x6.hook // 有半像素的偏移 //!MAGPIE EFFECT @@ -15,6 +15,10 @@ Texture2D INPUT; //!FILTER POINT SamplerState sam; +//!SAMPLER +//!FILTER LINEAR +SamplerState sam1; + //!TEXTURE //!WIDTH INPUT_WIDTH //!HEIGHT INPUT_HEIGHT * 2 @@ -299,6 +303,7 @@ groupshared float inp[555]; void Pass2(uint2 blockStart, uint3 threadId) { const float2 inputPt = GetInputPt(); + const float2 outputPt = GetOutputPt(); const uint2 group_base = uint2(blockStart.x >> 1, blockStart.y); for (int id = threadId.x * MP_NUM_THREADS_Y + threadId.y; id < 555; id += MP_NUM_THREADS_X * MP_NUM_THREADS_Y) { @@ -365,9 +370,8 @@ void Pass2(uint2 blockStart, uint3 threadId) { samples[11][1] = inp[local_pos + 80]; samples[11][2] = inp[local_pos + 81]; samples[11][3] = inp[local_pos + 82]; - - float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam, inputPt * (destPos / 2 + 0.5f), 0).rgb); + float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, outputPt * (destPos + 0.5f), 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(samples[4][3], originUV))); ++destPos.x; @@ -375,5 +379,6 @@ void Pass2(uint2 blockStart, uint3 threadId) { return; } + originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, outputPt * (destPos + 0.5f), 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(nnedi3(samples), originUV))); } diff --git a/Effects/RAVU_Lite_R3.hlsl b/Effects/RAVU_Lite_R3.hlsl index bc521accf..a5e4c511c 100644 --- a/Effects/RAVU_Lite_R3.hlsl +++ b/Effects/RAVU_Lite_R3.hlsl @@ -1,5 +1,5 @@ // ravu-lite-r3 -// 移植自 https://github.com/bjin/mpv-prescalers/blob/master/ravu-lite-r3.hook +// 移植自 https://github.com/bjin/mpv-prescalers/blob/cc02ed95c1fe05b72bc21d41257c4c085e6e409b/ravu-lite-r3.hook //!MAGPIE EFFECT //!VERSION 2 @@ -19,6 +19,9 @@ Texture2D ravu_lite_lut3; //!FILTER POINT SamplerState sam; +//!SAMPLER +//!FILTER LINEAR +SamplerState sam1; //!PASS 1 //!IN INPUT, ravu_lite_lut3 @@ -147,21 +150,25 @@ void Pass1(uint2 blockStart, uint3 threadId) { res += src[2][2] * w; res = saturate(res); - float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam, inputPt * (destPos / 2 + 0.5f), 0).rgb); + const float2 outputPt = GetOutputPt(); + float2 originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(res.x, originUV))); ++destPos.y; if (CheckViewport(destPos)) { + originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(res.y, originUV))); } ++destPos.x; if (CheckViewport(destPos)) { + originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(res.w, originUV))); } --destPos.y; if (CheckViewport(destPos)) { + originUV = mul(rgb2uv, INPUT.SampleLevel(sam1, (destPos + 0.5f) * outputPt, 0).rgb); WriteToOutput(destPos, mul(yuv2rgb, float3(res.z, originUV))); } }