2015-04-04, 09:12
Sorry, but all those width/height tests so far are no good. E.g. anamorphic PAL after stretching ends up as 1024x576. That is still PAL SD.
The better solution (used by XySubFilter, mpv and XySubFilter) is to take both width and height into account. Here's what madVR does:
madVR only needs to differ between SD and HD, to switch to the correct decoding matrix etc. Of course you can add detection for 720p and 1080p and 2160p etc. But always keep in mind that custom encodes often remove the black bars. So e.g. 2.35:1 720p ends up as 1280x540. And 4:3 720p becomes 960x720. Both are still considered HD content, because the original source was 720p. Compare that to anamorphic PAL which is 1024x576. So anamorphic PAL is wider than cropped 4:3 720p, and it has more height than cropped 2.35:1 720p. So you can see that looking at either the height or width alone is no good. You always need to check both. And please do make sure that you don't confuse cropped 720p content with anamorphic PAL.
If I may suggest, consider anamorphic PAL as SD content, and consider 720p sources (even when cropped) as 720p.
The better solution (used by XySubFilter, mpv and XySubFilter) is to take both width and height into account. Here's what madVR does:
Code:
if (width > 1050 || height > 576)
res = HD;
else
res = SD;
madVR only needs to differ between SD and HD, to switch to the correct decoding matrix etc. Of course you can add detection for 720p and 1080p and 2160p etc. But always keep in mind that custom encodes often remove the black bars. So e.g. 2.35:1 720p ends up as 1280x540. And 4:3 720p becomes 960x720. Both are still considered HD content, because the original source was 720p. Compare that to anamorphic PAL which is 1024x576. So anamorphic PAL is wider than cropped 4:3 720p, and it has more height than cropped 2.35:1 720p. So you can see that looking at either the height or width alone is no good. You always need to check both. And please do make sure that you don't confuse cropped 720p content with anamorphic PAL.
If I may suggest, consider anamorphic PAL as SD content, and consider 720p sources (even when cropped) as 720p.