Hello guest, if you like this forum, why don't you register? https://fanrestore.com/member.php?action=register (December 14, 2021) x


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PAR, SAR, DAR... pfwoar! (or: How I Learned to Stop Worrying and Love the Rec.601)
#21
Alternating black/white lines at 720x480
[Image: qjcPEweH_o.png]

720 straight to 640
[Image: 1mu0kyCa_o.png]

cropped to 704 and resized to 640
[Image: GHQBPPvx_o.png]

Count the amount of fluctuations and you might have an answer?

Tho it might also vary depending on the resizing algorithm and whatnot.
Reply
Thanks given by:
#22
I don't think I'm following your logic any longer @TomArrow hahah. I'm also at work though so I'll need to come back to it when I'm not concentrating on other things.

I've edited my previous post a few times so perhaps I should put this in a separate post.

So you can see what difference this makes to an actual LD cap, I'll put the corresponding images from my top post here that relate to this particular element of what I'm trying to work out.

Here's what happens to an LD cap if I crop off 16 px of horizontal blanking (720 cropped to 704) then frame the whole 486-line height to 4:3 (i.e. resizing 704 x 486 to 648 x 486):

[Image: Brides-Of-Dracula-LD-052832-486in4x3.png]

Same frame but with the 486 lines cropped to 480 before framing for 4:3 (720 x 486 cropped to 704 x 480 then resized to 640 x 480):

[Image: Brides-Of-Dracula-LD-052832-480in4x3-sho...andpad.png]

Note: I've highlighted the 6 removed lines in red by adding them back in as red border in the 480-line version, and I've also added a 4-pixel black border at the sides to align it with the 648 x 486 version that has all 486 lines framed at 4:3. I'd be removing these in practice from both so they'd both be cropped down to 640 x 480, which would remove actual picture from the first one but only remove the red and black borders from the second. I'm treating that crop as being more or less analogous to overscan rather than worrying about it removing picture that is important to keep in the frame; the more important aspect to me is getting the geometry of the picture correct.

Here's a framecompare version so you can flip back and forward: http://www.framecompare.com/screenshotco...n/FE1MFNNU

I think flipping back and forth between those two images I posted in the above comparison, subjectively, the "skinnier" one does look more correct to my eyes, in which case that would confirm that it is indeed correct to crop off the 6 lines *before* framing the image to the 4:3 DAR (i.e. crop 720 x 486 to 704 x 480 then scale to 640 x 480 or 1280 x 960 or whatever 4:3 res you wanted). But that wasn't an especially carefully chosen frame, I'd be better doing it with something like a pattern from a test LaserDisc or something methinks!


Same thing with another couple of frames from the same LD (BRIDES OF DRACULA, incidentally @The Aluminum Falcon). First one in each comparison is the 720 x 486 cropped to 704 x 480 and then resized to 640 x 480 (i.e. excluding the 6 lines), second one in each is the 720 x 486 only cropped horizontally to 704 x 486 then scaled to 4:3 (648 x 486). Again, it would then be cropped down to 640 x 480 after that to avoid encoding a video with a dumb frame size. I could of course encode the 704 x 480 (and possibly the uncropped 720 x 480) version as-is with non-square pixels and SAR explicitly set to 10:11, which would be desirable, but I wouldn't be able to do that for the 704 x 486 version without figuring out a different sequence.

[Image: Brides-Of-Dracula-LD-028908-480in4x3-sho...andpad.png]
[Image: Brides-Of-Dracula-LD-028908-486in4x3.png]

Notice with that last one you can actually see what I was talking about re. horizontal blanking: there's more black border on the left than in the frame I was using for the comparisons before. It's from the same disc.

[Image: Brides-Of-Dracula-LD-117821-480in4x3-sho...andpad.png]
[Image: Brides-Of-Dracula-LD-117821-486in4x3.png]

(Incidentally, these are all from BRIDES OF DRACULA @The Aluminum Falcon - I only haven't encoded this yet because I'd ideally like to make sure I'm doing it in the right AR!)
Reply
Thanks given by:
#23
(2021-02-25, 02:04 PM)pipefan413 Wrote: (Incidentally, these are all from BRIDES OF DRACULA @The Aluminum Falcon - I only haven't encoded this yet because I'd ideally like to make sure I'm doing it in the right AR!)

Off topic, I love that movie. Probably my favorite Hammer.
Reply
Thanks given by: pipefan413
#24
(2021-02-25, 02:04 PM)pipefan413 Wrote: I don't think I'm following your logic any longer @TomArrow hahah. I'm also at work though so I'll need to come back to it when I'm not concentrating on other things.

Different scaling ratios will result in a different aliasing frequency. So either counting the amount of fluctuations or measuring the size in pixels of each fluctuation should give an indication of what's happening. Tho with CRTs, a physical pixel is not identical to a pixel on the display, so counting the fluctuations is likely more useful.

At least that's what I think is happening there.
Reply
Thanks given by: pipefan413
#25
Somebody elsewhere linked me to a really excellent resource that includes a couple of comments about related issues and that was enough for me to pretty definitively answer the 480 vs 486 lines question, so I'll document that here.

To phrase this in a slightly different way to how I've been describing it until now, what I was really trying to ascertain when it comes to the 486 line thing was whether the Rec.601-based logic of starting with 720 x 486 and scaling it to arrive at a square pixel aspect ratio by applying a horizontal scale to "fix" the picture geometry no a square pixel display was something that you were supposed to do before or after cropping out the horizontal blanking. If you were to crop the blanking first (chopping 720 px down to 704 px), but leave the height at 486, then scaling it to a 4:3 display aspect ratio would result in a more horizontally stretched image compared to cropping both the blanking *and* the additional 6 scanlines before scaling to 4:3 DAR (by applying a horizontal scale of x 10/11).

The site I'm about to reference here uses terminology that I'd never heard previously to differentiate between the full 720 x 486 px analogue-to-digital capture and the equivalent of the 704 x 480 part of it that you usually actually see on something like a DVD. 720 x 486 is "production aperture", and the 704 x 480 bit is "clear aperture". The thing is, it doesn't seem to actually explicitly clarify that clear aperture specifically has 480 lines of height in it, so I take it that there must be some instances (however rare) of clear aperture being 704 x 486 (non-square) or 640 x 486 (square). Here's how the author defines clear aperture:

Chris Pirazzi Wrote:The clean aperture, which is co-centric with the production aperture and the picture center, and contained within the production aperture, is that sub-rectangle of the video which has the system's standard picture aspect ratio (e.g. 4:3 for standard def).
(https://lurkertech.com/lg/video-systems/#aperture)

... But it doesn't appear to actually define the dimensions of clear aperture or how they're reached (so it's still not clear from that if it might be correct to incorporate those extra 6 scanlines into the final 4:3 DAR). I'll get to that though.

In the section discussing the specifications of non-square pixel production aperture, there is an interesting comment:

Chris Pirazzi Wrote:Heuristic: if you encounter 720x480 instead of 720x486, it likely, though not necessarily, begins on line 283 as the 720x486 aperture does in the diagram below (and is therefore not centered about the picture center).
(https://lurkertech.com/lg/video-systems/...q_sampling)

This seems to suggest that there is a version of production aperture which simply drops the bottom 6 lines, rather than working at 720 x 486 and cutting it down afterwards.

The site repeatedly sticks to the non-square to square pixel transformation being done at a 10:11 ratio, regardless of which aperture it's talking about. But here's the key piece of info that I've been needing, the thing that truly puts the whole 486 vs 480 line framing thing to bed, assuming the site is correct of course. The way it describes moving from non-square to square pixels is to start with production aperture (full, uncropped 720 x 486) and scale that by the 10:11 PAR/SAR (pixel/sample aspect ratio) and only crop down to 640 x 486 after that. That obviously doesn't give you a 4:3 picture, so you'd then have to crop the remaining 6 lines off. But of course, scaling by 10:11 and then cutting both the horizontal blanking and the 6 lines out gives you the same result as cutting the horizontal blanking and the 6 lines first and then scaling by the same factor, which answers my question about how to scale those 6 lines!

Chris Pirazzi Wrote:Here is how to convert a 720-wide non-square image into a 640- or 768-wide square image:

720 x 486
-> scale horizontally by 10/11 -> 654 6/11 x 486
-> crop to 640
-> 640 x 486
(https://lurkertech.com/lg/pixelaspect/#s...sq_convert)

What he's doing here is scaling the width by 10:11: 720 x 10/11 = 654 6/11.

To illustrate this visually, I'll apply my hypothetical "consider the 486 lines part of the 4:3 box" scaling method to a frame from BRIDES OF DRACULA and then apply the two other scaling methods to the same frame, and compare them. One thing to note about this is that obviously I can't crop by sub-pixel increments (which I'd have to to achieve a horizontal resolution of 654.5454... pixels). So for the purposes of the following comparison, I'll be scaling the production aperture to 654 (rounded down from 654 6/11). Yeah it would be slightly more accurate to instead round it up to 655 but that makes alignment with the other two images more awkward since I have to crop 1 extra pixel off one side or the other. And as you'll see, it ends up being inconsequential in practice.

From top to bottom...

  1. 720 x 486 cropped horizontally to 704 px to remove blanking, scaled to 4:3 (648 x 486), then cropped to 640 x 480
  2. 720 x 486 cropped to 704 x 480 to remove both horizontal blanking and extra 6 scanlines of height, then scaled by 10/11 to 640 x 480
  3. 720 x 486 scaled horizontally by 10/11 first then centre-cropped to 640 x 480

[Image: Brides-Of-Dracula-LD-28908-486in4x3.png]
[Image: Brides-Of-Dracula-LD-28908-480in4x3.png]
[Image: Brides-Of-Dracula-LD-28908-scaledfirst.png]

Evidently, the 6 extra lines are to be excised in the same was as the horizontal blanking rather than them being intended to be accounted for when framing for 4:3, because when it is taken into account (top image above) the geometry of the image is stretched horizontally compared with scaling the full production aperture frame by 10:11. The other two images are functionally identical apart from the small rounding error I mentioned in the "scale first" method.

Here they are on framecompare so you can see it even more clearly: http://www.framecompare.com/image-compar...n/KGY6PNNX

Conclusion: the extra 6 lines in a 720 x 486 analogue video capture should be removed up front, cropping to 480 lines (ideally with a centre crop but I've found 4 off the top and 2 off the bottom to usually be about right).

The thing that remains to be determined however is whether encoding the same video as 720 x 480 and 704 x 480 will result in the image being played back with the same 4:3 display aspect ratio on something like a DVD player. Technically the correct sample aspect ratio (a.k.a. pixel aspect ratio) for the 720 x 480 version would be 8:9 which would result in a wider-than-4:3 frame with the horizontal blanking hanging off the edges, but a lot of what I've read on the subject seems to suggest that DVD players routinely remove the horizontal blanking before scaling, in which case the correct SAR (or PAR) would be the appropriate Rec.601 expectation of 10:11, which applies to the 704 x 480 active picture area rather than the whole 720 x 480 image.
Reply
Thanks given by:
#26
So I've finally just realised the key piece of info that I've been missing the whole time (which I'm blaming on me reading about this stuff in the middle of the night and then not pulling the thread back out far enough in the daytime to realise what it was that I was missing).

You know how I keep saying that the thing I still don't get is how it could be possible for both 704 x 480 and 720 x 480 to somehow achieve a 4:3 DAR with the same 10:11 PAR (a.k.a. sample aspect ratio)?

Here's why I was saying that, first, so you can see the flaw in my train of thought:

display aspect ratio = storage aspect ratio x pixel (a.k.a. sample) aspect ratio
so
DAR for DVD/BD-compliant NTSC res of 720 x 480 = 720/480 x 10/11 = 7200/5280 = 1 4/11 which is about 1.36:1
DAR for "production aperture" NTSC res of 720 x 486 = 720/486 x 10/11 = 7200/5346 = 1 103/297 which is about 1.34:1
DAR for DVD NTSC with horizontal blanking cropped out = 704/480 x 10/11 = 7040/5280 = 1 1/3 = 4/3 (about 1.33:1)

Clearly, they're all different. Right? Well uh... yes and no.

Because they all have different stuff around the edges, but in the middle, *they all have the exact same 4:3 frame*. Obviously! That's all I was missing. And the really dumb thing is I KNEW THAT. I just forgot how it worked. I used to work with PAR and DAR stuff years ago when I was doing things with video game consoles. Hell, over the last few days I've even been writing a thing (article? blog? idk) about game consoles and how they differ from standard NTSC/PAL conventions. I suppose that didn't click though because the thing I'm writing only really touches on aspect ratios; it's really more about speeds/rates, such as how each systems master clock rate (whatever that is for the given system, e.g. Game Boy CPU clock cycle rate, NTSC/PAL chroma subcarrier/colour burst frequency as generated by its oscillator) is used to extrapolate every other frequency that the system uses.

But yeah: the reason 720 x 486 ends up at a DAR that lies in between 704 x 480 and 720 x 480 is that 704 x 480 is the actual 4:3 picture as it's meant to be shown, 720 x 480 has the horizontal blanking left in at the sides (which hang over the outside edge of the 4:3 frame, which is the only reason the DAR is wider than 4:3), and the 720 x 486 has both the horizontal blanking and the extra 6 scanlines left in the vertical resolution (which means that they too overhang the 4:3 box, if left in, but I don't know why you would do that in practice).

So really, it doesn't matter hugely if I encode at 720 x 480 or 704 x 480. Both methods have some valid reasons behind them.

704 x 480 is DVD compliant and will give a tidier result (and you don't waste a tiny-to-the-point-of-being-inconsequential amount of bitrate encoding thin black bars that don't need to be there).

720 x 480 on the other hand is, I believe, more Blu-ray Disc compliant. So it might be good to be able to encode multiple x264 LaserDisc transfers to a single BD-25 or something and make a wee menu structure to pick from them.


Anyway. I'll update the top post to reflect this simple but fundamental detail so I don't potentially confuse others (the point of this was me trying to help others while improving my own understanding, so I don't want to inadvertently baffle somebody else).
Reply
Thanks given by:
#27
So you've got this sorted now, yes?
Reply
Thanks given by:
#28
(2021-02-26, 03:32 PM)zoidberg Wrote: So you've got this sorted now, yes?


Yep. To take it point by point:


Question 1: Should horizontal blanking be included or excluded from the 4:3 display frame?

Answer: Clearly not. I never really thought that it should be in-frame, but due to a fundamental detail that I was missing about PAR/SAR, I for some reason had myself convinced that encoding a 720x480 video with "SAR" (as x264 calls it) set to 10/11 would give incorrect results because it looked different in MPC-HC etc. But actually I think MPC-HC is just handling it correctly; the actual active picture is still only the 704 x 480 part, and the sliver of horizontal blanking is left in but overhangs outwith the 4:3 part of the frame. So if it was playing on a 4:3 display it'd theoretically be in the overscan (correctly) but because I was testing on a 16:9 monitor it is obviously visible. So what I was really trying to determine here was whether I had to use a different "SAR" when encoding 720 x 480 vs encoding 704 x 480.


Question 2: If the pixel aspect ratio is left non-square (and flagged accordingly in the encoded video), what will the playback device do with it?

Answer: A bit less clear-cut to be fair but I at least know what it SHOULD do and I'm *reasonably* confident that at least in theory most players should get it right. The "pixel" or "sample" aspect ratio should consistently always be 10:11 really when it comes to NTSC SD content, certainly it is with all of my analogue LD caps, so there's no need to fart about with changing it depending on the cropping or whatever (as I explained in previous post with calculations).


Question 3: Should the 6 "extra" scanlines from analogue SD captures be included or excluded from the 4:3 display?

Answer: This one I really wasn't sure about, but it was again clarified by the "penny dropping" on the fundamental truth that PAR/SAR is essentially independent of DAR. This was really only clarified when I found something that stated unambiguously that the correct way to convert from non-square to square pixel aspect was to apply the 10:11 conversion to the full "production aperture" 720 x 486 frame (i.e. with both the horizontal blanking and 6 "extra" lines included) and only crop *after* that (if you want to remove horizontal blanking, crop to 640 width, and if you also want to remove the 6 extra lines, crop those too). If you crop off both the hblank and 6 lines you're left with 4:3, if you leave the 6 lines in you've got something slightly taller than 4:3 which is obviously "wrong" (some of those lines are other non-picture data like closed captions and the rest would just drop into overscan).

To explain that numerically I'll just go back to the numbers I calculated above...

CONVERT ANAMORPHIC FULL PRODUCTION APERTURE TO SQUARE PIXELS:
DAR for "production aperture" NTSC res of 720 x 486 = 720/486 x 10/11 = 7200/5346 = 1 103/297 which is about 1.34:1
(so this is a little bit wider than 4:3 because of the horizontal blanking hanging off the sides, and still has the 6 extra lines left in vertically)

CONVERT VERTICALLY CROPPED / ALTERNATIVE 480-LINE PRODUCTION APERTURE TO SQUARE PIXELS:
DAR for DVD/BD-compliant NTSC res of 720 x 480 = 720/480 x 10/11 = 7200/5280 = 1 4/11 which is about 1.36:1

CONVERT ONLY THE "CLEAR APERTURE" (FINAL ACTIVE PICTURE AREA) TO SQUARE PIXELS:
DAR for DVD NTSC with horizontal blanking cropped out = 704/480 x 10/11 = 7040/5280 = 1 1/3 = 4/3 (about 1.33:1)

Ergo it does not make a damn bit of difference if I were to encode any of these three with a 10:11 "SAR" (which is the same thing as PAR) because all of them would have the exact same 4:3 box in the middle, it's just that the ones that haven't been cropped will have extra stuff hanging off the edges of that 4:3 box.
Reply
Thanks given by:
#29
My head hurts LOL. Is this thing why some conversions from DVD display a slighty distorted squeezed image (almost impossible to notice unless you know the movie well) ?
Reply
Thanks given by:


Forum Jump:


Users browsing this thread: 1 Guest(s)