Log in

View Full Version : YAP (Yet Another Player) v0.9.5


Pages : 1 2 [3] 4 5

Orf
26th December 2014, 17:17
Shiandow, thank you very much, this is really helps.
I just wonder again what funny thing life is. The bunch of scripts on a first unenlightened glance hides a really big story beneath them.And I have to admit also you've got really impressing way to express your thoughts. Sometimes I've even remember long forgotten fillings when I was a student on a professors lections :)

Need some time to think it all over, and if you don't mind may be I'll ask you more later...

Orf
27th December 2014, 12:47
YAP 7.3 is out. Bug-fixing release mostly. The renderer was switched from D3D 10.1 to D3D 11 in this version because of upcoming shaders support. Please report if you have any problems in UI/video display areas

foxyshadis,
is this thread splitting thing was really necessary ? I think first two messages in new thread belongs to YAP thread as well as some other stuff there. And IMHO this new thread is starting from nowhere anyway (and probably will ends there too)...

foxyshadis
30th December 2014, 01:54
Well, it's your thread, I'll leave it then.

Orf
30th December 2014, 05:30
foxyshadis, thanks, I prefer it to stay here, 'cause it easier for me to analyze it this way

Orf
30th December 2014, 06:29
Shiandow, is following script syntax looks OK to you ?

; NEDI image doubler
; Copyright by Shiandow
Image1 = NEDI-I(InputImage, InputWidth, InputHeight);
Image2 = NEDI-HInterleave(InputImage, Image1, 2 * InputWidth, InputHeight);
Image3 = NEDI-II(Image2, 2 * InputWidth, InputHeight);
Image4 = NEDI-VInterleave(Image2, Image3, 2 * InputWidth, 2 * InputHeight);
OutputImage = Resize(Image4, OutputWidth, OutputHeight);

Shiandow
30th December 2014, 15:25
Yeah, that looks pretty good. It's pretty similar to how I wrote it with MPDN's Renderscript system, but somewhat more compact.

Orf
9th January 2015, 12:20
Shiandow, I think I've managed the way to support it. But other thing still bothers me. As far as I understand both MPDN and MPC-HC use built-in resizer shaders to do final resizing. YAP currently can do only linear filtering resizing. Will it ruin the output of NEDI image doubler or not ? And if so, what should I use instead ? I see your SuperRes pack includes Lanczos hlsl's. Can it be modified to do a general type resizing (not 2x) ?

p/s the general idea is not to use any hardcoded resize shaders, but to allow adding any resizer shaders via YAP interface as well as any other shader packs

Shiandow
9th January 2015, 13:20
Well, using bilinear resizing after using NEDI would be a bit of a shame, it would still be better than only using bilinear resizing but for optimal quality you should use a better resizer. There's no reason those resizers have to be hardcoded though, although it's pretty convenient if you don't have to write your own rescalers every time you need one.

Anyway, if you have some system that can support the operations needed to get NEDI to work, then that should also be enough to write scalers. You could adapt those shaders I included with SuperRes, but I think I've also have some other shaders lying around that could more easily be adapted into general upscalers. No downscalers though, I still haven't got round to making one; they require slightly more work.

Orf
9th January 2015, 13:59
>>Well, using bilinear resizing after using NEDI would be a bit of a shame

That's what I was afraid of

>>There's no reason those resizers have to be hardcoded though, although it's pretty convenient if you don't have to write your own rescalers every time you need one

May be it is, cause MPDN stores it resize shaders inside password protected zip archive for some reason. Don't know it is a sources or compiled ones

>> if you have some system that can support the operations needed to get NEDI to work

I do not have one. Currently I'm just trying to design and implement one

>>I think I've also have some other shaders lying around that could more easily be adapted into general upscalers

If you can give some example of such an general upscaler it will be very helpful on my current stage

Shiandow
9th January 2015, 15:24
Well here's two somewhat general upscalers. The first one scales the input by a factor of 1.5 horizontally and the second does so vertically. It first calculates the position 'pos' in pixels, and then interpolates the value at that position. Since it does horizontal and vertical scaling separately you can only change one coordinate of pos, you can however change that value to whatever you want. For fun try uncommenting "pos.x = pos.x*scale + 10*sin((tex.y + p0[2]/21)*2*acos(-1));" and "pos.y = pos.y*scale + 10*sin((tex.y + p0[2]/34)*2*acos(-1));"

You can make other upscalers by changing the definition of the "Weight" and "taps". I think MPDN and MadVR use precalculated weights, which might be faster if the weights are hard to calculate (like with Jinc), but could be slower if they are easy to calculate (as with Lanczos).


// -- Settings --
#define scaling lanczos

// -- Misc --
sampler s0 : register(s0);
float4 p0 : register(c0);
float2 p1 : register(c1);

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

#define px (p1[0])
#define py (p1[1])

// -- Scaling --
#define scale 1.5

#define bicubic 1
#define MN(B,C,x) (x <= 1.0 ? ((2-1.5*B-C)*x + (-3+2*B+C))*x*x + (1-B/3.) : (((-B/6.-C)*x + (B+5*C))*x + (-2*B-8*C))*x+((4./3.)*B+4*C))
#define MitchellNetravalli(x) (MN(1./3.,1./3.,abs(x)))

#define lanczos 2
#define pi (acos(-1))
#define sinc(x) (x == 0 ? 1 : sin(x)/(x))
#define Lanczos(x) (sinc(pi*abs(x))*sinc(pi*abs(x)/taps))

#if scaling == bicubic
#define taps 2
#define Weight MitchellNetravalli
#elif scaling == lanczos
#define taps 3
#define Weight Lanczos
#endif

// -- Input processing --
#define Get(x,y) (tex2D(s0,float2(px,py)*(pos + float2(x,y) + 0.5)))

// -- Main code --
float4 main(float2 tex : TEXCOORD0) : COLOR {
// Calculate position
float2 pos = (tex*p0.xy - 0.5);
pos.x /= scale;
// pos.x = pos.x*scale + 10*sin((tex.y + p0[2]/21)*2*acos(-1));

// Calculate offset
float offset = frac(pos.x);
pos.x -= offset;

//Scale image horizontally
float4 avg = 0;
float W = 0;
for (int x = -taps+1; x<=taps; x++)
{
float w = Weight(x-offset);
avg += Get(x,0)*w;
W += w;
}

return avg/W;
}



// -- Settings --
#define scaling lanczos

// -- Misc --
sampler s0 : register(s0);
float4 p0 : register(c0);
float2 p1 : register(c1);

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

#define px (p1[0])
#define py (p1[1])

// -- Scaling --
#define scale 1.5

#define bicubic 1
#define MN(B,C,x) (x <= 1.0 ? ((2-1.5*B-C)*x + (-3+2*B+C))*x*x + (1-B/3.) : (((-B/6.-C)*x + (B+5*C))*x + (-2*B-8*C))*x+((4./3.)*B+4*C))
#define MitchellNetravalli(x) (MN(1./3.,1./3.,abs(x)))

#define lanczos 2
#define pi (acos(-1))
#define sinc(x) (x == 0 ? 1 : sin(x)/(x))
#define Lanczos(x) (sinc(pi*abs(x))*sinc(pi*abs(x)/taps))

#if scaling == bicubic
#define taps 2
#define Weight MitchellNetravalli
#elif scaling == lanczos
#define taps 3
#define Weight Lanczos
#endif

// -- Input processing --
#define Get(x,y) (tex2D(s0,float2(px,py)*(pos + float2(x,y) + 0.5)))

// -- Main code --
float4 main(float2 tex : TEXCOORD0) : COLOR {
// Calculate position
float2 pos = (tex*p0.xy - 0.5);
pos.y /= scale;
// pos.y = pos.y*scale + 10*sin((tex.y + p0[2]/34)*2*acos(-1));

// Calculate offset
float offset = frac(pos.y);
pos.y -= offset;

//Scale image vertically
float4 avg = 0;
float W = 0;
for (int y = -taps+1; y<=taps; y++)
{
float w = Weight(y-offset);
avg += Get(0,y)*w;
W += w;
}

return avg/W;
}

Orf
9th January 2015, 18:17
Thanks, will give them a try tomorrow. But after the first look, a few questions, silly maybe. Based on what I've seen in your and JanWillem32 code.
1) Why width and height scaling should be doing as separate passes (steps) ?
2) I should change "define scale" to DstWidth/SrcWidth or DstHeight/SrcHeight respectively ? This will require to recompile the shader each time. Can we avoid this by defining constant buffer where I will pass DstWidth and DstHeight so shader can use them ? The same goes for bicubic vs lanczos setting
3) "You can make other upscalers by changing the definition of the "Weight" and "taps" ". This phrase is simply goes out of my understanding, sorry

Shiandow
9th January 2015, 20:53
1) It isn't necessary to do width and height scaling separately but it's faster. You could do it in one go, which would make the main loop look something like the following:

for (int X = -taps+1; X<=taps; X++)
for (int Y = -taps+1; Y<=taps; Y++) {
int2 XY = {X,Y};
Avg += Get(X,Y)*Weight(XY-offset);
W += Weight(XY-offset);
}

but this way you'll need to read (2*taps)*(2*taps) pixels, instead of (2*taps) + (2*taps), so doing it in 2 steps will generally be faster. However it isn't always possible to do it in two steps, the most important example is "Jinc" which can't be done in 2 steps, this is the reason that using Jinc in MadVR is so much slower than using Lanczos with the same number of taps.

2) You should indeed change "scale" to DstWidth/SrcWidth for the first shader and DstHeight/SrcHeight for the second one, and it is probably a good idea to use a constant buffer for this. Or you could put the dimensions of the textures in a constant buffer, and calculate "scale" from that. I'm not sure if it is a good idea to use a constant buffer to switch between lanczos and bicubic, if you're not careful the compiler will decide to calculate both and pick the correct one at the end, and to allow the optimizer to do it's job better it's probably a good idea to compile separate versions for lanczos and bicubic.

3) Perhaps this page (http://svn.int64.org/viewvc/int64/resamplehq/doc/kernels.html) will help, the thing I call "Weight" is what they call "sample weight" in their plot and "taps" is the maximal "sample distance" for which the "sample weight" isn't 0. For instance, bilinear is 0 when the sample distance is larger than 1 so the number of taps is 1. And the sample weight decreases linearly from 1 to 0 as the sample distance goes from 0 to 1, so the weight is given by: 1 - abs(x). You could then make a bilinear upscaler by taking the shaders I posted and redefining "Weight" and "taps" as follows:

#define Weight(x) 1 - abs(x)
#define taps 1

Orf
10th January 2015, 13:44
Shiandow, thanks again, and you was right, all seems to feet surprisingly well in the following scheme:

Shader pack definition file (Lanczos.spk):
; Lanczos resizer shader pack by Shiandow
#define PackType Resizer
Image1 = LanczosW(InputImage, OutputWidth, InputHeight);
OutputImage = LanczosH(Image1, OutputWidth, OutputHeight);


LanczosW.hlsl
// -- Misc --
sampler s0 : register(s0);
float4 p0 : register(c0);
float4 p1 : register(c1);
float4 p2 : register(c2);

#define SrcWidth (p0[0])
#define SrcHeight (p0[1])

#define px (p1[0])
#define py (p1[1])

#define DstWidth (p2[0])
#define DstHeight (p2[1])

// -- Scaling --
#define scale DstWidth / SrcWidth

#define pi (acos(-1))
#define sinc(x) (x == 0 ? 1 : sin(x)/(x))
#define Lanczos(x) (sinc(pi*abs(x))*sinc(pi*abs(x)/taps))

#define taps 3
#define Weight Lanczos

// -- Input processing --
#define Get(x,y) (tex2D(s0,float2(px,py)*(pos + float2(x,y) + 0.5)))

// -- Main code --
float4 main(float2 tex : TEXCOORD0) : COLOR {
// Calculate position
float2 pos = (tex*p0.xy - 0.5);
pos.x /= scale;
// pos.x = pos.x*scale + 10*sin((tex.y + p0[2]/21)*2*acos(-1));

// Calculate offset
float offset = frac(pos.x);
pos.x -= offset;

//Scale image horizontally
float4 avg = 0;
float W = 0;
for (int x = -taps+1; x<=taps; x++)
{
float w = Weight(x-offset);
avg += Get(x,0)*w;
W += w;
}

return avg/W;
}

LanczosH.hlsl
Omitted. The same principals used as in LanczosW.hlsl

P/S Need to do a lot of code changes and testing to give more feedback... Can take some time...

Orf
14th January 2015, 07:52
Shiandow, about this upscalers vs downscalers thing. Did you meant that lanczos is no good for downscaling at all ? Or you meant there's better algorithms for that, but it can be used too ? If image processing chain should have abilities to use different shader packs for upscaling/downscaling/pre resizing/post resizing, this will result in pretty complex scheme that user will have to setup in the end. How do you think, is this setup can be simplified to use fixed upscale=pre resize, downscale=post resize shader pack applying scheme ?

Shiandow
14th January 2015, 16:01
No I just find downscalers slightly more annoying because you're no longer summing a fixed number of pixels. Anyway, you can use lanczos for downscaling, although most people seem to prefer mitchell-netravalli or bicubic. I agree that you can get quite a complicated scheme if you need to configure every processing step, but I don't really know a good way around that, having good defaults will probably help.

Orf
15th January 2015, 07:01
Since I'm kind of out of tune on the theme myself, I can only try to make some constructor for adding custom shaders or shader packs. Defaults, when it seems most everyone have different preferences ? I simply don't know them... May it will be better if I'll make some preview version that shows my vision on how that constructor should look like, care to take a look, try to add some shader code may be, and discuss it then ?

Shiandow
15th January 2015, 15:26
If you have an idea for what it should look then of course I could have a look at it. Picking sensible defaults is probably not that difficult, I think it will be harder to allow people to do understand how to do anything that isn't the default. MPDN's renderscripts have a similar problem, it's very hard to make clear how and when to use which processing.

Orf
16th January 2015, 04:48
Yes, and I hope this interface will be ready soon. And before it will be released, just want you too look at it critically, may be I've missed something important, may be it can be improved to be more clear from end user point of view. And yes, I've tried to look on how it is done in MPDN, and can't even get a clear picture on how it supposed to work...

Anima123
17th January 2015, 02:30
I'd say putting Siandow's diagram as part of the setting interface would be great.

Orf
22nd January 2015, 10:08
Anima123, why do you want this ? I think diagram is not a part of shader setting process from user perspective. Its only might be interesting for shader pack developers

Orf
24th January 2015, 09:18
Shiandow, I think the 0.7.4 is ready for preview , PM'ed you the details

Orf
7th July 2016, 10:15
Finally YAP 0.8 is out. The changes is mostly about adding image processing support, but not limited to it

leeperry
8th July 2016, 00:09
Great, spasibo!

Long story short it can now dsplay pictures and upscale them with NNEDI3?

Orf
8th July 2016, 07:38
Both pictures and video, yes.
Default image processing config for pictures:
nnedi3(64 neurons for luma and chroma)(if needed) + Super-XBR(if needed) + (lanczos3 for upscale or Catmull-Rom for downscale) + Adaptive sharpen
Default image processing config for video:
nnedi3(64 neurons for luma, lanczos3 for chroma)(if needed) + (lanczos3 for upscale or Catmull-Rom for downscale) + Adaptive sharpen

Anima123
8th July 2016, 18:43
Orf, since YAP has it's unique configuration interface different from others, would you please share with me how to configure YAP to use madVR as renderer and how to bring madVR's configure window?

And when using madVR, how's the image processing will be applied?

Orf
9th July 2016, 09:32
May be it looks confusing at first sight, but options are divided in two parts. One part resides in Options item of Main menu navigator (F8). Main menu is also mirrored in right click popup menu. This is done this way, cause this part is available in full screen mode.
More complex options resides is in advanced options window (Alt+O) and not available in navigator

So, you can switch renderers in Main menu/options/DirectShow/Video renderer. You can even assign a shortcut for this action in Advanced options/Hotkeys and switch renderers via keyboard

All directshow filters (including madVR), that appears in current graph listed in Main menu/DirectShow filters. This is where you can activate their option dialogs (property pages)

You can configure all image processing settings in Advanced options/Image processing. You should choose madVR in Source combo box in your case. But do not expect much, cause it is limited comparing to other sources

leeperry
26th July 2016, 13:03
w00t, sounds like a plan thanks!
but when I open it on my x86 W7SP1 + HD7850(13.12 drivers) I get http://thumbnails115.imagebam.com/49688/d3f57e496873117.jpg (http://www.imagebam.com/image/d3f57e496873117)

and the x86 version gets a bunch of false positive on www.virustotal.com

Orf
27th July 2016, 10:03
leeperry, I've never tried it with Amd cards, and unfortunately I do not have one right now, so it is hard to say exactly what this error is about. Can you try x64 version or with Nvidia card ?

About false positives, both x86 and x64 exes are packed. But there's no sense to scan packed data. Look like some AVs simply can't unpack exe and instead of simply say so start to make a 'guesses'. Funny thing that all three 'guesses' are different

leeperry
27th July 2016, 13:12
Thanks for the reply but no can do as I run x86 W7SP1. That's too bad coz I really wanted to try the NNEDI3 picture viewer :(

AMD would appear to run 25% of users machines on STEAM and nvidia only 56% (http://store.steampowered.com/hwsurvey) so maybe it would make sense that you would get YAP to work on AMD too if any possible please? :o

What are those commands that were not supported anyway? Do I need something like C# runtimes or something?

Orf
27th July 2016, 14:53
Of course I'll try to make it work and thanks for the report. I'm just saying it may take some time. YAP is not written in C#. It do not required any runtimes at all, C++, C# or others. But since image processing was added it required DX11 to function properly. What missing in your case is not even the whole DX11 runtime but one of its interfaces. Ms docs didn't say a word about it is video driver dependent, but it looks like it does...

huhn
27th July 2016, 17:15
it is working fine on my R9 270

leeperry
27th July 2016, 17:25
it is working fine on my R9 270

13.12 drivers? w10?

huhn
27th July 2016, 20:00
windows 10 14xxx and 16.7.x

leeperry
27th July 2016, 20:28
I wasn't able to have kb2670838 installed so maybe that's my problem =/

Orf
28th July 2016, 06:39
Thanks huhn, it is good to know it works with Amd too, like it should in theory

leeperry, so this is DX11 issue, installing platform update may help with it. Why you can't do it ?

leeperry
28th July 2016, 12:55
not sure, same story as this guy and I've tried everything I could think of: http://superuser.com/questions/1055827/why-am-i-not-able-to-apply-the-update-kb2670838-to-my-computer

oh well, NNEDI3 picture viewer be gone then :o

Orf
28th July 2016, 16:20
Don't give up too soon, I'll try to put in workaround for this issue anyway. But since you've reported it a bit later (after 8.1 was started) you'll have to wait for 8.1 release to test it

Orf
3rd March 2017, 11:08
YAP 0.8.5 released. Brief list of changes


New options dialog
Navigator text attributes
Per-display options and UI scaling
madVR fullscreen exclusive mode support
Support for bluray menus and DsLibBluray filter
Support for YouTube links and 3DYD Youtube Source filter
Various changes and bugfixes

madshi
3rd March 2017, 11:16
Support for bluray menus and DsLibBluray filter
Very cool!

I was already wondering why none of the current media players supported that yet...

hubblec4
3rd March 2017, 12:25
Hi Orf

I want try out your player, but after a doublick on the exe (32 or 64 bit) nothing happens. Only a transparent window(only the frame) is shown.
The player window can be moved but you see nothing. In the taskbar is YAP shown and with mouse-right click I have access to the options.
But nothing will work.

(Win7 64 bit ClassicMode)

hubble

nevcairiel
3rd March 2017, 12:28
Very cool!

I was already wondering why none of the current media players supported that yet...

Because its relatively high amount of work to do it perfectly just to view forced trailers and commercials before the movie. :p

madshi
3rd March 2017, 12:38
Well, yes. But many users still want it. It can be useful for series, or for watching extras in an organized manner. I know I want it.

And when using libBluRay, of course nothing is "forced", anymore, but everything can be skipped.

hubblec4
3rd March 2017, 13:02
There are other players with good/full support of BD/DVD menu...

Well, yes. But many users still want it. It can be useful for series, or for watching extras in an organized manner. I know I want it.

Commercial menus are sometimes horrible. Prohibited user options, not skippable trailers or another useless stuff.

Have a look to VLC: it supports Matroska-DVD menu and Matroska Native menu

Orf
3rd March 2017, 14:55
@hubblec4
Did ClassicMode means desktop composition (Aero) is disabled ?

Orf
3rd March 2017, 15:03
Very cool!
I was already wondering why none of the current media players supported that yet...
It is a bit raw, have some issues and there's no 64 version of filter, but I agree, still sometimes interesting to glance on how BD menu look likes

Orf
3rd March 2017, 15:12
Well, yes. But many users still want it. It can be useful for series, or for watching extras in an organized manner. I know I want it.
Actually YAP have it own BDMV parser, and you can switch all available BD playlists after import. So libBluRay is never activated until you execute 'Disc menu' command (Alt+M)

hubblec4
3rd March 2017, 16:20
@hubblec4
Did ClassicMode means desktop composition (Aero) is disabled ?

Yes, Aero id disabled.

Orf
3rd March 2017, 18:33
@hubblec4
Enabling Aero makes a difference ?

hubblec4
3rd March 2017, 19:21
Mmh, sorry I don't want change my desktop settings, cause many settings have to reset after changing.

I would tested it on my VM Win8, but YAP crashes befor starting.

Orf
4th March 2017, 10:03
Mmh, sorry I don't want change my desktop settings, cause many settings have to reset after changing.

I would tested it on my VM Win8, but YAP crashes befor starting.
Thanks for the reports. I think I've found a fix for Win7 issue, but anyway YAP requires desktop composition (Aero) to be enabled to display video correctly. And imho enabling Aero did not change any of your desktop settings, only visual look

About VM Win8, can your post link to screenshot on some external server ? (Picture approval may last long here)