Log in

View Full Version : What is the better HD dimension switch


StainlessS
17th October 2013, 19:53
Prompted by several posts in other threads

StainlessS:
M53, is there any reason you chose height >= 600 as rec709 switch as opposed to eg height > 576 ?

It is better than using RT_Stats default Width>720, shall change RT to same as yours.


Martin53:
I copied the 600 threshold for the matrix somewhere, don't remember where. The future version on my HD is already mxRec = clp.width<=720?"Rec601":"Rec709". I agree that it is of advantage to be in line.

Firesledge (aka Cretindesalpes) in dither.html:

:confused:
For me, width>720 is a reasonable distinguishing mark for HD. I paid homage to Cretindesalpes' greater experience.

Stainlesss:
Also note, I think we got crossed wires somewhere, I said I would alter RT_ 709 switch to be same as yours, based on height >= 600,
have now made that change in RT_Stats (also done but not released in RoboCrop, MYStats and one or two other places).
You have now changed yours to match my previous RT_stats, ie switched on width > 720.
ALL CHANGE PLEASE.
I shall keep same as you previously had it based on height >= 600, if its good enough for FireSledge (Cretindesalpes) its good
enough for me.

Why not use width >= 900 to detect HD(which is what I personally use in some of my scripts)?
I don't have any concrete example in mind, but with some anamorphic 720p movies, I'm fairly certain that the height could drop below 600px, but the width should never drop much below 960px(4:3) for any HD sources and SD ones shouldn't be much over 854px(resized 16:9).

I mostly work with NTSC sources so maybe PAL ones would make my reasoning wrong though.

I think it to be an important question, so am posting in its own thread.
The question relates to which default conversion Matrix to use based on frame size.

Groucho2004
17th October 2013, 21:38
I think I'm missing some context here. The color space is a source property. If I resize a 1080p movie down to 400 x 300, it's still rec 709, isn't it?
Where is this decision about color space supposed to take place?

StainlessS
17th October 2013, 22:36
OOOps, of course you are correct, for rec709 read High Definition.
The question relates to which default conversion Matrix to use based on frame size.

jmartinr
17th October 2013, 23:24
My vote goes to the SamKook option. Although for PAL-country you should put the boundary at 1024.

Reel.Deel
17th October 2013, 23:40
ffdshow (http://forum.doom9.org/showpost.php?p=1246237&postcount=901):
We talked (http://forum.doom9.org/showthread.php?p=1245010#post1245010)about auto detection of BT.601 or 709, and decided to use
width > 1024 or height >=600: BT.709
width <=1024 and height < 600: BT.601
I suggested that ffdshow should be compatible with Haali's video renderer when width == 1024, but people say there is a good reason to use BT.601 for 1024.


MadVR (http://forum.doom9.org/showpost.php?p=1506420&postcount=8107):
There is some auto detection, but it's really simple:

If the source width > 1024 or if the source height > 576 then I'm using BT.709 primaries. If the source height is exactly 576 I'm using EBU primaries. Otherwise I'm using SMPTE-C primaries.


LAV Filters (http://forum.doom9.org/showpost.php?p=1533577&postcount=6413) and MSDN (http://msdn.microsoft.com/en-us/library/windows/desktop/ms698715%28v=vs.85%29.aspx):
Only content >=720 pixels high or >=1280 pixel wide is considered HD by LAV, so a 1024x576 would still be perfectly fine SD content.

if (matrix == DXVA2_VideoTransferMatrix_Unknown) {
matrix = (swsHeight >= 720 || swsWidth >= 1280) ? DXVA2_VideoTransferMatrix_BT709 : DXVA2_VideoTransferMatrix_BT601;
}

I just read that the MSDN defines it differently as well, so i may change it.
DXVA2_VideoTransferMatrix_Unknown
Unknown. For standard-definition content, treat as DXVA2_VideoTransferMatrix_BT601. For high-definition content, treat as DXVA2_VideoTransferMatrix_BT709. (High-definition content is defined for this purpose as anything with a source height greater than 576 lines.)
Anything > 576 in height or > 1024 in width is usually considered "HD", and gets the 709 matrix.

-------------------------------------------------


I think it to be an important question, so am posting in its own thread.
Indeed, hopefully we'll have a conclusive answer. :)

SamKook
18th October 2013, 01:33
My vote goes to the SamKook option. Although for PAL-country you should put the boundary at 1024.

You can't put it at 1024 since it won't detect 4:3 HD stuff which could be only 960px wide so my option wouldn't work for PAL.



I would say that ffdshow, madshi and nevcairiel(not in LAV though since if someone were to crop 2px from the width and height it could be considered SD) got it right with:
width > 1024 or height > 576(600 is just a rounded up number and would work fine too, especially if someone decided to add a few vertical px for some reason to his encode which is the same reason I went with >=900 instead of >854. I've seen encodes with screwed up ratio go up to something like 894 in width for NTSC).

A width of more than 1024 will necessarily mean a HD source since it's the absolute maximum width for SD and it's the same thing for the height since SD shouldn't be more than 576 so that also means an HD source.

An anamorphic HD source will have a width bigger than 1024 even if its height is below 576 and a 4:3 HD source with a width below 1024 will necessarily have an height of over 576 to keep the ratio(unless it's letterboxed and drops below it after removing the black bars, but that would be an exceptionally rare case and not really HD anymore).

TheSkiller
18th October 2013, 18:30
A width of more than 1024 will necessarily mean a HD source since it's the absolute maximum width for SD
Not if you create anamorphic assets (DVD menus, rendered stuff...) targeted at 720x576 with ITU compliant scaling – in that case you create in 1048x576 or 1050x576 (1050 is the BBC recommendation for example).

SamKook
19th October 2013, 01:12
You learn new things every day.

So would rounding up to the following catch all less known/unusual case without adverse effect: width > 1100 or height > 600

It's still low enough not to miss any HD stuff as far as I can think and gives enough room over the biggest SD stuff I can think of.