View Full Version : Question concerning AQ at High Quality Bitrate and Anamorphic Encoding
Splashdriver
11th July 2004, 17:25
@SeeMoreDigital
Yes, I completely understand what you're saying but that still leaves a little bit of the black borders on both sides of the picture. I'll post a screenshot later
@Gircobain
How can you tell that from a screenshot?
SeeMoreDigital
11th July 2004, 17:34
Originally posted by Splashdriver
@Gircobain
How can you tell that from a screenshot? He can't ;)
Especially as it's a screenshot of the Mpeg2 source and not the Mpeg4 encode!
Cheers
gircobain
11th July 2004, 17:43
Originally posted by SeeMoreDigital
He can't ;)
Especially as it's a screenshot of the Mpeg2 source and not the Mpeg4 encode!
Cheers
I don't get your point
Cropping is done prior to encoding - avisynth decodes the frame, crops then pass it to xvid/divx to encode
imagereader("c:\PDVD_000.png")
crop(0,72,720,432)
That shows that, at least for that frame, there are black borders left at the top and at the bottom if you crop to 720x432
Anyways, if you want to keep the correct aspect ratio for anamorphic (1.666), you gotta crop left and right too. Or bear with a little deviation in the aspect ratio
Stux
11th July 2004, 17:46
You guys are still way over-complicating this
Like I said, there is no step 3
Just crop, then encode with the right PAR preset. PAR stands for Pixel Aspect Ratio.
There are only 4 PAR presets related to DVD
2 for NTSC and 2 for PAL
So, for NTSC 16:9, pick the NTSC 16:9 PAR preset.
Just crop, then encode. There is no scaling, and you don't have to "aim for 720" or "crop to 432" or any of that nonsense
crop, then encode. You do *need* to crop to multiples of 2 though, and you may want to crop to multiples of 8 (or even 16 if you're using a buggy encoder :-P)
That's it.
no step 3 ;)
SeeMoreDigital
11th July 2004, 18:04
Originally posted by Stux
That's it.
no step 3 ;) I think I'll stick with MPEGmediator for a bit longer... I can crop and resize anything with it to any shape!
Easy peesie, lemon squeezie
SeeMoreDigital
11th July 2004, 18:15
No black borders here when cropping to 720x432. Smack on the money!
http://img44.exs.cx/img44/8859/SMD_169_2351_cropped_image.jpg
Cheers
Zhnujm
11th July 2004, 19:14
Maybe im completely missing the point, but you cannot crop the left+right borders and then go back to 720 pixel WITHOUT resizing.
:confused:
There are only 2 solutions:
Leave the resolution at 720 and let the black bars in or crop the bars and leave the resolution whereever it is after cropping.
Both should give a perfect file as Stux already said.
gircobain
11th July 2004, 19:27
Originally posted by SeeMoreDigital
No black borders here when cropping to 720x432. Smack on the money!
There's a difference between cropping that png to 720x432 and cropping all black borders and resizing it to 720x432. That I can do also.
gircobain
11th July 2004, 19:30
Originally posted by Zhnujm There are only 2 solutions:
Leave the resolution at 720 and let the black bars in or crop the bars and leave the resolution whereever it is after cropping.
Both should give a perfect file as Stux already said. [/B]
Another solution is to crop to 704x424 for instance (thus preserving 1.666 AR) since MPEG-4 is far less restrictive when it comes to frame size than MPEG-2
Splashdriver
11th July 2004, 19:34
Here's a example of an image cropped to 720x432 (crop 0,72,720,432):
(Note that resizing has been disabled in the avisynth script, since they say that enabling resizing in your avisynth script for anamorphic encoding would completely defeat the purpose).
http://img25.exs.cx/img25/7124/LOTR_720x432_Example1.png
[EDIT]Guess the bitrate (3026 kBit/s) is high enough, so it wouldn't make a big difference....right??
SeeMoreDigital
11th July 2004, 19:39
Originally posted by Zhnujm
Maybe im completely missing the point, but you cannot crop the left+right borders and then go back to 720 pixel WITHOUT resizing.
:confused:
There are only 2 solutions:
Leave the resolution at 720 and let the black bars in or crop the bars and leave the resolution whereever it is after cropping.
Both should give a perfect file as Stux already said. Agreed :D
And, you can see from Splashdriver's Mpeg2 still capture that there arn't any vertical black boarders anyway!
---------------------------------------------------------------------
So, with regard to how to calculate the correct quantity of image pixels within an PAL DVD's 720x576 "anamorphic pixel frame". First you have to assume that you are going to convert to an "true 16:9 pixel frame". Which means you would end up with 1024x576 pixels.
OK, now we've established that the true width of the frame should be 1024, we can move on to calculating the image pixel heights of the most common movies aspect ratios. Which are as follows: -
1024 divided by 1.77 = 576.0 - Which is no suprise
1024 divided by 1.85 = 553.5 - Or 560 to the nearest 16th pixel
1024 divided by 2.35 = 435.7 - Or 432 to the nearest 16th pixel
1024 divided by 2.40 = 426.6 - Or 432 to the nearest 16th pixel
---------------------------------------------------------------------
So there you go.... Yes, a small bit of matte is remaining with a 2.35:1 cropped image (less than 2 rows of pixels top and bottom) but given that many DVD's images are off centre, this is not such a big problem
Cheers
Splashdriver
11th July 2004, 19:54
Thanks SeeMoreDigital......Think I finally got it...really like your way of explaining...it's been surely a very usefull thread to me with many useful information.....well, time to encode...thank you very much for the valuable knowledge.
Peace,
Splashdriver
SeeMoreDigital
11th July 2004, 20:07
Just for a laugh :D
Here's the worst example of an Film to PAL DVD transfer I have ever seen (it's also the same for the NTSC version).
If I had telecined this I would have been fired. And they call this the 'Directors Cut'... I bet Ridley Scott has never even seen it!
http://img31.exs.cx/img31/9312/SMD_BladeRunner.jpg
It total pants... isn't it?
Cheers
Stux
12th July 2004, 08:57
Originally posted by SeeMoreDigital
Just for a laugh :D
Here's the worst example of an Film to PAL DVD transfer I have ever seen (it's also the same for the NTSC version).
If I had telecined this I would have been fired. And they call this the 'Directors Cut'... I bet Ridley Scott has never even seen it!
http://img31.exs.cx/img31/9312/SMD_BladeRunner.jpg
It total pants... isn't it?
Cheers
Yes, bladerunner is the worst dvd transfer I know of :)
BUT to be fair, it was also one of the first 4 dvds ;) (i believe)
SeeMoreDigital
12th July 2004, 13:27
Originally posted by Stux
Yes, bladerunner is the worst dvd transfer I know of :)
BUT to be fair, it was also one of the first 4 dvds ;) (i believe) Yes, from what I remember it was one of the first PAL (single layered) releases and maybe even one of the first NTSC releases.
I think Waterworld was one of the first dual layered disc's!
Despite this though, there really was no excuse to do such a bad job of mounting and centring the image correctly in the frame. This was basic 'need-to-know' stuff even in 1998/9.
The BladeRunner transfer is so bad you only get around 662 horizontal pixels out of a possible 720 (704 would have been ok). However, when the pixel 'width' is proportionally scaled to 720, the pixel 'height' goes way beyond the maximum 436 pixels.
Thank goodness this was easy to correct when converting to Mpeg4. The image size below is much easier on the eye to watch for the movies 112 minutes: -
http://img26.exs.cx/img26/4475/720x576_720x432.jpg
Cheers
Splashdriver
12th July 2004, 22:45
Originally posted by SeeMoreDigital
1024 divided by 1.77 = 576.0 - Which is no suprise
1024 divided by 1.85 = 553.5 - Or 560 to the nearest 16th pixel
1024 divided by 2.35 = 435.7 - Or 432 to the nearest 16th pixel
1024 divided by 2.40 = 426.6 - Or 432 to the nearest 16th pixel
Cheers
I was just rechecking your calculations, when I think I encountered a miscalculation. Shouldn't the first calculation be 1024/177=578 ? According to my calculator it is (578.531073 to be exact).
Greetings,
Splashdriver
EDIT:a serious typo corrected
gircobain
12th July 2004, 23:23
It is actually 1.7777... = 16:9
1024:(16:9) = 576
Splashdriver
13th July 2004, 00:39
Originally posted by gircobain
It is actually 1.7777... = 16:9
1024: (16:9) = 576
Clear now!
Greetings,
Splashdriver
SeeMoreDigital
13th July 2004, 09:24
Well this is great stuff. You guys are beginning to get the hang of this :)
Yes, 16 divided by 9 is indeed 1.77777 (with as many sevens as you want to shove on the end).
I've had a quick look around but I can't find that all important little dot (.) to put above recurring numbers :(
Cheers
Splashdriver
13th July 2004, 10:21
Hi,
I've just finished my LOTR_The return of the king (720x432) encoding and have a little question (not sure if this question even belongs here)....
When I try to mux with my favourite (mkvtoolnix 0.9.2) muxer, I encountered the following: When letting mmg extract the aspect ratio information from the MPEG-4 data, it sets the display dimension to 1046/432. To my understanding, selecting the PAR in Xvid, should generate some sort of signal (setting the Width to 1024, right?) so that other applications capable of understanding this signal could extract the PAR information. Why is it set to 1046 and not 1024? If I'm understanding this right, aspect ratio is now 1046/432=2.421296
Greetings,
Splashdriver
SeeMoreDigital
13th July 2004, 10:54
Personally I don't know why this happens!
The problem is not exclusive to MK though.
If you generate a 3ivx 16:9PAL cropped AVI encode and play it using Windows Media Player. When you go to - File | Properties, the encodes 'Video Size' will be reported as being 1047x432.
The same happens with XviD and 3ivX 16:9PAL cropped encodes after they've been muxed into the MP4 container and played using 3ivx's DSdec filter....
It's a mystery!
SeeMoreDigital
14th July 2004, 17:25
Following on from my post above.....
There is something you can do so that all your players, third party applications and muxers etc, report less confusing and more logical information.
For a while now, I've been using the following 'custom' PAR settings: -
For 4:3PAL use 16:15
For 16:9PAL use 64:45
For 4:3NTSC use 16:18
For 16:9NTSC use 64:54
You should also find the mattes and the video appears in exactly the same place as the source, when viewed on either a CRT of LCD/Plasma monitor or TV screen.
Anyway, this is what I do when encoding from Mpeg2/DVD or Mpeg2/DVB sources.
Cheers
lordreign
17th July 2004, 17:00
Just a quick question to add to this post... The majority of my DVD's are pal but a have the occasional NTSC one. Obviously the height is different with each (576 and 480). Now I know PAL (576) dvd's are meant to stretch to around 1024 pixels, but I just need clarification on NTSC ones. Because they have a smaller vertical resolution (480), they are meant to be stretched to a lesser resolution horizontally, say around mid 900's or so. This would therefore imply that PAL dvd's allow for slightly more clarity because of the extra pixels. Is this a correct description or is it flawed? If it is flawed would you mind pointing out where.
Cheers Guys
SeeMoreDigital
17th July 2004, 17:19
Hi lordreign,
An 1.7777:1 (16:9) NTSC image with 480 vertical pixels will create a horizontal pixel quantity of 853.3333 (ie: a pixel frame size of 853.3333 x 480)
Technically an PAL DVD with it's 720x576 (414,740 total) pixels frame should offer superior image quality to an NTSC DVD with it's 720x480 (345,600 total) pixels frame. Around 20% more resolution in fact. However an NTSC DVD offers 20% more frames per second than PAL... so the end result is virtually identical.
The above is a very simplified explanation because it does not take into account what happens to an moving image when it's converted to analogue, prior to viewing on a TV screen.
Cheers
Lagoon
17th July 2004, 17:29
Hum NTSC DVDs are actually not offering 20% more frame than PAL, except for non-film. With pulldown it's only displaying 23.976fps.
Sharktooth
17th July 2004, 17:34
Originally posted by SeeMoreDigital
However an NTSC DVD offers 20% more frames per second than PAL... so the end result is virtually identical.
SeeMoreDigital
17th July 2004, 17:38
Originally posted by Lagoon
Hum NTSC DVDs are actually not offering 20% more frame than PAL, except for non-film. With pulldown it's only displaying 23.976fps. Obviously with pulldown the effect is different... but the frames are still all in there... are they not!
EDIT: Jeez, there are not many of us on the forum today! According to Doom9's stats the highest number of users was 861 on 23rd May 2002 at 16:56. I wonder what the lowest number was and for how long?
stephanV
17th July 2004, 17:43
not really... the frames are always constructed via pulldown, which is in principle a reversible proces. so a 23.976 movie carries just as much information as its 29.97 telecined counterpart.
Lagoon
17th July 2004, 17:47
Originally posted by SeeMoreDigital
Obviously with pulldown the effect is different... but the frames are still all in there... are they not!
EDIT: Jeez, there are not many of us on the forum today! According to Doom9's stats the highest number of users was 861 on 23rd May 2002 at 16:56. I wonder what the lowest number was and for how long?
They are, but they aren't displayed AFAIK. It may also that some frames are displayed twice to achieve it. In all case it's not more "fluid" than PAL.
SeeMoreDigital
17th July 2004, 18:01
Originally posted by Lagoon
They are, but they aren't displayed AFAIK. It may also that some frames are displayed twice to achieve it. In all case it's not more "fluid" than PAL. Well, speaking as a PAL land 'liver-inner' I much prefer PAL for films/movies.
Any encoded moving image that requires less telecine work (frame shuffling) has got to be better in the end.
Cheers
manono
17th July 2004, 19:07
Hi-
I don't know if I can add anything or not to this.
In all case it's not more "fluid" than PAL.
Well, yes and no. I'd say that's true if you're comparing 29.97fps .vs 25fps viewed on standard interlaced TV sets. For NTSC people, if you're fortunate enough to have a progressive scan DVD player, and a progressive display set for 48 or 72 Hz, then, as stephanV says, the process is reversed to display 24fps (each frame shown either 2 or 3 times depending). I'm not sure if you're claiming that 25fps is also more fluid than 24fps, but the difference is minute, I would think.
This assumes progressive encoding, with 24fps actually stored on the DVD, with the pulldown and the slowdown applied by the player. If it's film encoded as Interlaced, then some DVD players, and some displays (those with a Faroudja chipset-don't know about others) can perform an "IVTC" on-the-fly, to give you back your 24fps.
But before all you Euro guys get too pleased with yourselves for your higher resolution DVDs, just remember that if the movie was filmed at 24fps, then to convert it to 25fps, the audio (as well as the video) has been speeded up, and as a result you have higher pitched audio, about half a tone higher. This drives some people up a wall.
And if 24fps film was converted to PAL to keep it the same length, then although the audio is OK, the video gets badly screwed up. Depending how the conversion was done, it's either filled with blends, giving you a soft and blurry picture, or a frame has been added every second, in the form of a field every half a second, and there goes your fluid motion. I know there are quite a few DVDs of both types in PAL land.
Splashdriver-
aspect ratio is now 1046/432=2.421296
Open the .d2v in GKnot. Crop away all the black. What's left? I'd bet it's not 2.35:1. It's probably much closer to 2.42:1. Lots of so-called 2.35:1 movies these days are much "narrower" than that. And in fact, for example, 656x272 (non-anamorphic encoded) would be much closer to the true AR, without requiring nearly as much cropping into the video to achieve low Aspect Error, than is 640x272.
SMD-
It's a mystery!
Not a mystery at all. :)
SeeMoreDigital
17th July 2004, 19:33
Originally posted by manono
SMD-
It's a mystery!
Not a mystery at all. :) This is true... it's not! Which is why I decided to detail the PAR settings I use in the next post ;)
If Splashdriver, or anybody else, generated their anamorphic encodes with my settings instead of the current 3ivx or XviD ones. They will find that they'll be greeted with the correct horizontal pixel figures (ie: 1024 instead of 1046/1047) in apps like Matroska's mkvtoolnix 0.9.2 muxer.
And the image will be exactly where it should be.
Cheers
Splashdriver
18th July 2004, 09:17
Cropping away all the black borders left me with an aspect ratio of 1.710 (according to Gordian Knot).
656/272=2.411765
640/272=2.352941
Right??
@SeeMoreDigital
I haven't tried the other PAR settings you posted previously yet. I've allready finished my LOTR encode (finally), but I thinking about redoing it (1 b-frame or maybe no b-frames at all, disabling GMC (seems to cpu-intensive on my PIII 1Ghz) and disabling Trellis (Guess it's good for low-bitrates, but probably not much of a benefit when using a 3000+ bitrate).
I can encode short test-files, using the Custom PAR'S and see how it works out.
Greetings,
Splashdriver
manono
18th July 2004, 11:10
Right??
Wrong. I don't have Return Of The King (waiting for the EE), but I broke out my R1 Two Towers EE and did it and after cropping, it shows as 2.417:1. If you're PAL, then make sure you have PAL anamorphic 16:9 ticked under Input Pixel Aspect Ratio. If NTSC, then tick NTSC anamorphic 16:9.
Look in the upper right, inside the big Crop box, to the right of Aspect Ratio, and to the left of WidthxHeight, to get the correct figure. That encodes nicely for 656x272 (non-anamorphic, if you don't mind Mod 16 resolutions) with an Aspect Error of 0.2% (using the ITU etc. Standard (from the Options Tab)).
Splashdriver
18th July 2004, 11:39
Originally posted by manono
Right??
Wrong. I don't have Return Of The King (waiting for the EE), but I broke out my R1 Two Towers EE and did it and after cropping, it shows as 2.417:1. If you're PAL, then make sure you have PAL anamorphic 16:9 ticked under Input Pixel Aspect Ratio. If NTSC, then tick NTSC anamorphic 16:9.
Look in the upper right, inside the big Crop box, to the right of Aspect Ratio, and to the left of WidthxHeight, to get the correct figure. That encodes nicely for 656x272 (non-anamorphic, if you don't mind Mod 16 resolutions) with an Aspect Error of 0.2% (using the ITU etc. Standard (from the Options Tab)).
I had 1:1 ticked since I'm doing anamorpic encoding (I'm a newbe to this). Source is PAL indeed. Now, when I crop the black bars of (having PAL anamorphic ticked 16:9 ticked under Input Pixel Aspect Ratio) and do a Smart Crop Left-Right for a 656x272 (mod 16) resolution it gave me 2.412 aspect ratio to right of WidthxHeight and an aspect error of 0.3%. I never had the ITU Standard disabled. I guess that's nice, but the goal was to do an anamorphic encoding.
Greetings,
Splashdriver
SeeMoreDigital
18th July 2004, 12:16
Originally posted by Splashdriver
... I guess that's nice, but the goal was to do an anamorphic encoding. If it's your intention to start encoding using such low vertical pixel sizes (such as 272) it's not really advisable or necessary to generate anamorphic encodes, as the total pixel count does not warrant the exercise!
Cheers
Splashdriver
18th July 2004, 13:03
Naah, I did mention before that I'm aiming at 720x432 (Í thought we've discussed this earlier). I've already finished an anamorphic encode (720x432-->1046x432), but I'm going to redo it, this time using different Xvid settings. I've never said that I'm going to use such low vertical pixel sizes (such as 272). I'm just croppping the source picture to 720x432.
Greetings,
Splashdriver
manono
18th July 2004, 19:18
Hi-
I guess that's nice, but the goal was to do an anamorphic encoding.
Sure, encode anyway you want. But my point in having you go through that was to show that when you said earlier "aspect ratio is now 1046/432=2.421296", that it was correct, because LOTR (and many other movies) are wider than 2.35:1, and some few movies, such as the 1959 Panavision Ben-Hur, go up to about 2.75:1 .
SeeMoreDigital
18th July 2004, 19:37
Originally posted by manono
Sure, encode anyway you want. But my point in having you go through that was to show that when you said earlier "aspect ratio is now 1046/432=2.421296", that it was correct, because LOTR (and many other movies) are wider than 2.35:1, and some few movies, such as the 1959 Panavision Ben-Hur, go up to about 2.75:1 . Absolutely... and a point which cannot be said enough!
Splashdriver, I reckon you've got the gist of anamorphic encoding now and a better understanding of the subject!
I think just about everything that can be said has been said in this thread.
Cheers
Splashdriver
18th July 2004, 20:05
@SeeMoreDigital
I've learned so much more thanks to your information (and all the othera ofcourse who have contributed to this thread:cool: )
It's not so easy to get a thorough understanding on the subject, but I've found some useful links which I think might also come in handy for other people besides myself:
http://hkfanatic.com/widescreen/anamorphic/anamorphic.php
http://www.mir.com/DMG/aspect.html
http://gregl.net/videophile/anamorphic.htm
http://forum.doom9.org/showthread.php?threadid=72707&highlight=anamorphic+encoding
http://forum.doom9.org/showthread.php?s=&threadid=54677
Cheers
bond
18th July 2004, 21:06
coming back to the topic, someone recently told me that theora seems to be very smart on the psychovisual side. maybe one of the xvid devs want to have a look at it, as i think that AQ is a nice goodie and could be also useful on high bitrates
On topic again, what's the consensus on enabling AQ for constant Q=2 (GMC, Trellis, MPEG matrix, otherwise default) encodes? (non-underwater, of course). Dealing specifically with old (relatively noise-free, but generally have some grain) B/W movies, I've found (with full encodes) that AQ usually gives a bitrate saving of 7-12%. Differences are noticeable using 2X zoom and subtract on still frames, but otherwise the encodes look good generally. FYI, the movies are enocded as 640x480, and with AQ the avg bitrate is usually between 1800-2500 kbps.
Does AQ affect moving edges, or restrict itself to relatively flat shaded areas?
SiXXGuNNZ
18th August 2004, 23:47
wow, the new Goodfellas disc, this is the very first time ever I have seen a 1.85:1 anamorphic that has no black bars at all. take a look, maybe you guys have ran into discs before like this, but I haven't, and I have encoded about 500-600.
http://home.comcast.net/~sixxy01/Goodfellas_Special_Edition_720x480.png
edit: wow, I actually understand this all now, the frame above 854/480=1.78, I read alot of articles before, but seemoredigital has done what none of the articles have been able to do, make me understand what it all means, thanks mate :D
SeeMoreDigital
19th August 2004, 09:02
Why thanks SiXXGuNNZ,
I guess there will be quite a few DVD's of TV series that were shot in 16:9, and will therefor fill a true 1.77777:1 anamorphic frame. Unlike many film to DVD releases which are 1.85:1.
You've sparked an interest for me now... I'll have to keep a look out for some...
Cheers
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.