Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th October 2013, 19:53   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
What is the better HD dimension switch

Prompted by several posts in other threads

StainlessS:
Quote:
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:
Quote:
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.
Quote:
Originally Posted by martin53 View Post
Firesledge (aka Cretindesalpes) in dither.html:


For me, width>720 is a reasonable distinguishing mark for HD. I paid homage to Cretindesalpes' greater experience.
Stainlesss:
Quote:
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.
Quote:
Originally Posted by SamKook View Post
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.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 19th October 2013 at 11:50.
StainlessS is offline   Reply With Quote
Old 17th October 2013, 21:38   #2  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
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?
Groucho2004 is offline   Reply With Quote
Old 17th October 2013, 22:36   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
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.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 17th October 2013, 23:24   #4  |  Link
jmartinr
Registered User
 
jmartinr's Avatar
 
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
My vote goes to the SamKook option. Although for PAL-country you should put the boundary at 1024.
__________________
Roelofs Coaching
jmartinr is offline   Reply With Quote
Old 17th October 2013, 23:40   #5  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
ffdshow:
Quote:
Originally Posted by haruhiko_yamagata View Post
We talked about auto detection of BT.601 or 709, and decided to use
Quote:
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:
Quote:
Originally Posted by madshi View Post
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 and MSDN:
Quote:
Originally Posted by nevcairiel View Post
Only content >=720 pixels high or >=1280 pixel wide is considered HD by LAV, so a 1024x576 would still be perfectly fine SD content.

Code:
    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.
Quote:
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.)
Quote:
Originally Posted by nevcairiel View Post
Anything > 576 in height or > 1024 in width is usually considered "HD", and gets the 709 matrix.
-------------------------------------------------


Quote:
Originally Posted by StainlessS View Post
I think it to be an important question, so am posting in its own thread.
Indeed, hopefully we'll have a conclusive answer.
Reel.Deel is offline   Reply With Quote
Old 18th October 2013, 01:33   #6  |  Link
SamKook
Registered User
 
Join Date: Mar 2011
Posts: 216
Quote:
Originally Posted by jmartinr View Post
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).
__________________
AMD Ryzen 9 5950X and EVGA RTX 3080 with G.skill 64Gb 3600 (2 16x2 kit) on Asrock X570 Taichi with Samsung 980 Pro 500Gb NVMe SSD running Win10 x64 on LG 34GN850-B 34.0" 3440 x 1440 160 Hz

Last edited by SamKook; 18th October 2013 at 01:50.
SamKook is offline   Reply With Quote
Old 18th October 2013, 18:30   #7  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 632
Quote:
Originally Posted by SamKook View Post
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).
TheSkiller is offline   Reply With Quote
Old 19th October 2013, 01:12   #8  |  Link
SamKook
Registered User
 
Join Date: Mar 2011
Posts: 216
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.
__________________
AMD Ryzen 9 5950X and EVGA RTX 3080 with G.skill 64Gb 3600 (2 16x2 kit) on Asrock X570 Taichi with Samsung 980 Pro 500Gb NVMe SSD running Win10 x64 on LG 34GN850-B 34.0" 3440 x 1440 160 Hz
SamKook is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:16.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.