Log in

View Full Version : DVD-RB: Better Half-D1 (352x576) script


frank
21st June 2004, 15:38
For some DVDs (long and low picture quality) it's better to use Half-D1 conversion (PAL 352x576, NTSC 352x480).

The Avisynth script used by DVD-RB v0.53 is very SLOW, and produces an ASPECT RATIO ERROR because of an absent Crop from 720 to 704.

Instead of BilinearResize(352,576) it's much better to use

PAL:Crop(8,0,704,576).HorizontalReduceBy2NTSC:Crop(8,0,704,480).HorizontalReduceBy2Avisynth makes this job in high quality, and the encoding speed doubles!

The eDealer
21st June 2004, 19:12
Hy,
that's great, I will test it.
Thanks. :)

Lagoon
21st June 2004, 23:04
Not really about topic but does anyone know how to avoid half-D1 being so aliased on edges ? It really disturbs me so I never use it, any filters ?

JDay
21st June 2004, 23:53
@Lagoon
You might try adding "blur(1)" (or "blur(1).blur(1)", "blur(2)" doesn't work) to the avs. This should reduce the sharpness and might make the "jagginess" less noticeable (and increase compressibility, too).

@frank
I could be wrong, but I believe that the original method did not skew the AR (and it was plenty fast for me), but your method does. What you might want to try is:
HorizontalReduceBy2.Crop(4,0,352,X)
Edit: Oops, that script is wrong, nevermind.
I don't like the idea of losing those pixels, though.

jdobbs
22nd June 2004, 10:19
Originally posted by frank
For some DVDs (long and low picture quality) it's better to use Half-D1 conversion (PAL 352x576, NTSC 352x480).

The Avisynth script used by DVD-RB v0.53 is very SLOW, and produces an ASPECT RATIO ERROR because of an absent Crop from 720 to 704.

Instead of BilinearResize(352,576) it's much better to use

PAL:Crop(8,0,704,576).HorizontalReduceBy2NTSC:Crop(8,0,704,480).HorizontalReduceBy2Avisynth makes this job in high quality, and the encoding speed doubles! Just a warning, the quality can drop significantly when using ReduceBy2 rather than a resizing algorithm. The other resizers better calculate a mix of the two pixels that will be replaced by one.

Kika
22nd June 2004, 11:03
@JDay

For Half-D1 you have to crop to 704x576 (704x480) first to prevent skewing the AR.

@All
I suggest not to use HorizontalReduceBy2, like jdobbs, wrote: it can drop down the quality.

I think this is the better way:

Crop(8,0,704,576).BilinearResize(352,576) # or BicubicResize(352,576,0,0.5)

jntaylor63
22nd June 2004, 18:32
jdobbs,

any chance of adding the crop whenever DVD-RB is set to half D1? I have just started using this tool and its great!

Kika,

how do you add the crop script? I thought that AVS scripts were created by project. Yes, I am a newbie.

frank
22nd June 2004, 18:35
When using Half-D1 you have almost a quality or bitrate problem with the source!!
There is no picture quality reduction like blockiness or aliases, there is only a reduction of horizontal resolution.

The Avisynth developers made this instruction for a good reason (VCD conversion).
From the Avisynth Doc:
The filter kernel used is (1/4,1/2,1/4), which is the same as in VirtualDub's "2:1 reduction (high quality)" filter. This avoids the aliasing problems that occur with a (1/2,1/2) kernel. VirtualDub's "resize" filter uses a third, fancier kernel for 2:1 reduction, but I experimented with it and found that it actually produced slightly worse-looking MPEG files--presumably because it sharpens edges slightly, and most codecs don't like sharp edges.You see there IS a very useful pixel averaging applied.

Most graphic cards have no good upsampling of 352 horizontal pixels! Watch the encoded streams on TV, and you'll see the lines are smooth. To the quality: Think of that 352 is even not 704!!
Tested.

The eDealer
22nd June 2004, 19:13
@frank
I agree with you.
In the case i use the 1/2D1 reduction (with reduced bitrate !!) for the Extras, i only exept a good, not a perfect quality and a fast speed.

@jntaylor63
You can use the tools
- Keeper or
- RB Opt.
to make the modifikation of the AVS after the preparation phase.
Look here (http://forum.doom9.org/showthread.php?threadid=74361)

Kika
22nd June 2004, 22:18
OK, i tried it by myself (the Script only, i don't use DVD-RB).
I couldn't belive it, but HorizontalReduceBy2 is better than the BilinearResize but the best Way is to use BicubicResize(352,576,0,0.5).

@Frank
I often heard from people "um, Half-D1? I got always terrible aliasing effekts". I think, you are right, it's a bug of some graphics card drivers.

I do use Half-D1 for Anime only or if i want to put a Movie to one CD (that's something i do sometimes as Hobby ;) ).

jdobbs
23rd June 2004, 01:56
Originally posted by frank
For some DVDs (long and low picture quality) it's better to use Half-D1 conversion (PAL 352x576, NTSC 352x480).

The Avisynth script used by DVD-RB v0.53 is very SLOW, and produces an ASPECT RATIO ERROR because of an absent Crop from 720 to 704.

Instead of BilinearResize(352,576) it's much better to use

PAL:Crop(8,0,704,576).HorizontalReduceBy2NTSC:Crop(8,0,704,480).HorizontalReduceBy2Avisynth makes this job in high quality, and the encoding speed doubles! I'd like to point out that the statement "produces an ASPECT RATIO ERROR" is incorrect. If a picture is 4:3 OR 16:9 and is resized but again displayed as the same aspect ratio -- it is correctly done. You only have to reduce the size to 704xNNN if you plan to use the ReduceBy2 option. Also note that you will be removing 16 horizontal lines of data from the picture if you decide to do it the way you've noted, and you haven't truly reproduced the original picture... That's fine if the original has overscan areas, but not all originals do.

So if you are planning to use Bilinear, Bicubic, or Lanczos resizing do not use the crop() function or you actually will produce an incorrect aspect ratio.

jntaylor63
23rd June 2004, 04:38
@jdobbs,

Ok, one last question from the newbie.

What type of resizing does DVD-RB do? (Bilinear, Bicubic, or Lanczos)
If use one of the above, I don't need to worry about the cropping issue.

The eDealer
23rd June 2004, 06:21
RB uses the resize command "BilinearResize(352,576)" with the 1/2D1 option and no resize for the rest.

@jdobbs
Also note that you will be removing 16 horizontal lines of data from the picture if you decide to do it the way you've noted, and you haven't truly reproduced the original picture... That's fine if the original has overscan areas, but not all originals do.
I understand that, but every TV has an overscan, so i though it the best way to cut what i didn't see anyway?!

JDay
23rd June 2004, 07:54
You may just be cutting overscan, but if you do that, more of what you would normally see, will be overscanned.

Kika
23rd June 2004, 08:43
@JDay

Not on a correct adjusted TV. They will never show you a bigger part of the Picture if you have a higher Resolution (720 instead of 704 or 352).
The "Timing-Window" of a PAL TV is always 52 us, no matter, what the resolution of the Video is.
Maybe the Pic will be shifted a bit mor to the left or the right, but the number of shown "Pixels" is always the same.
PC-Monitors or LCD-/Plasma-TVs are an other story.

frank
23rd June 2004, 11:02
Kika has right!

Back to the roots. The aspect ratio discussions we had in 2001 are over. Jackei (DVD2AVI) explained it and lost his hairs about that... There are standards we have to respect, especially ITU-R BT.601. Read carefully this link please, and learn.
A Quick Guide to Digital Video Resolution and Aspect Ratio Conversions (http://www.iki.fi/znark/video/conversion/)

Only 704 horizontal pixels are the relevant picture pixels in our case. But why 720? Here an interesting quote from this source:
4.1 Isn't 720 the real width of a 4:3 image? If not, then why are 720 pixels sampled instead of 711 or 702 (or whatever)?
720 pixels are sampled to allow for little deviation from the ideal timing values for blanking and active line lenght in analog signal. In practice, analog video signal - especially if coming from a wobbly home video tape recorder - can never be that precise in timing. It is useful to have a little headroom for digitizing all of the signal even if it is of a bit shoddy quality or otherwise non-standard.

720 pixels are also sampled to make it sure that the signal-to-be-digitized has had the time to slope back to blanking level at the both ends. (This is to avoid nasty overshooting or ringing effects, comparable to the clicks and pops you can hear at the start and end of an audio sample.)

Last but not least, 720 pixels are sampled because a common sampling rate (13.5 MHz) and amount of samples per line (720) makes it easier for the hardware manufactures to design multi-standard digital video equipment.And to the unbelievers:
...I am pretty sure there is a mistake in your calculations. It says everywhere that 720×576 or 720×480 really is 4:3. Please stop propagating this misinformation!
I admit that the figures presented on this web site are not very well-known facts even amongst professional videographers, not to mention hobbyists. Aspect ratio is one of the most misunderstood "black magic" issue in digital video. That is precisely why I constructed the web site in the first place - to share the knowledge.
As for my calculations; feel free to prove them wrong. For starters, you might want to read the documents in the Related Links section.
FitCD, the best tool for resizing calculations, shows the following line for DVD to 1/2 DVD conversion(including cropping):
BilinearResize(352,576,8,0,704,576)

Last but not least: Half-D1 352 means half of 704 pixels, not 720!:cool:

Rombaldi
23rd June 2004, 19:24
Wonder if this is why the PANASONIC DVD Recorders record their MPEG2 stream at 704x480 (hi jdobbs!!)

jdobbs
23rd June 2004, 22:49
Originally posted by Rombaldi
Wonder if this is why the PANASONIC DVD Recorders record their MPEG2 stream at 704x480 (hi jdobbs!!) It's because 704x480 is a perfectly legitimate DVD resolution. So is 720x480. 352x480, and 352x240. But my mathmatics background tells me that 720 is not equal to 704. You have to subtract 16.

jdobbs
24th June 2004, 22:47
Just a quick suggestion for anyone who really wishes to see what is the correct method for converting from 720xNNN to Half-D1.

1. Create a video that has a fixed square in the center of the screen.

2. Use a DVD-RW and create a 720x480 video.

3. Play it back and measure (using a ruler on your screen) the horizontal size of the original. Let's say it measures 10"

4. Do each of the suggested methods for Half-D1 conversion and put them (authored) as two choices on the same disc.

5. Run each and measure with a ruler. You'll find that the 10" measurement has been stretched to a little under 10.25" on an incorrectly converted video.

Now -- quite honestly -- you'd have to be an anal SOB with the eye of an eagle to be able to tell the difference when you're watching a movie, so I don't think it really matters... but it might be fun for someone with an inquiring mind and a little time on his/her hands who really wants to know.

JDay
25th June 2004, 03:25
I tried the test that jdobbs posted above, and he's absolutely correct. I tested this on two different players (actually three, but one doesn't do half-D1 right). The original and the resized half-D1 (no crop) looked exactly the same, the only way you could tell they were different was the title indicator on the LCD. It noticably stretched out when it reached the third clip with the "cropped" half-D1. Beforehand, it measured at about 51cm, on the third clip, it measured just under 53cm (horizontally).

ChickenMan
25th June 2004, 07:54
Some years back when I made VCD's of my DVD's, I did much the same testing myself. For those not aware, a VCD has a width of 352 (with also 1/2 the height of dvd). A DVD movie that has the moon shown in it and the VCD made from it are identical size and shape on playback on my TV.

k-c-ksum
25th June 2004, 10:42
Originally posted by JDay
You may just be cutting overscan, but if you do that, more of what you would normally see, will be overscanned.

crop - overscan active pixels
add borders - replace with black

jdobbs
25th June 2004, 14:40
The picture is going to overscan whether you crop it or not. If you crop and then resize you will just be taking previously displayed portions of the picture and putting them in the overscan area. It is true that you could fix the incorrect aspect ratio caused by the crop and get the piece of video back by inserting black bars after the crop... but doesn't it make more sense to just not remove the overscanned video to begin with?

It's kind of like digging a hole and refilling it...

hobyho
26th June 2004, 01:42
Well by doing so does aid in better compression, as you are eliminating what you cannot see on the tv (the overscan) with black bars.

Sir Didymus
26th June 2004, 09:12
@hobyho:

Cutting the black bars in the source will reduce its size [the number of pixels]. That's (obviously) true.

If this makes the stream easier to compress is much more questionable.

I did not perform specific tests on the matter, but I feel it is true the contrary: there is by sure no decrease in the bitrate, and it seems to me the black bars help the encoder to perform better some parts of the MPEG2 compression algorithm (i.e., motion vector estimation)...

frank
26th June 2004, 19:26
Some tests on TV Thomson (72 cm, 16:9, PAL)
Good test streams for calibration you find on DVD Pink Floyd, The Wall.

DVD player SEG Hollywood II (Omega chipset)
The following pictures resized due to the standard ITU-R BT.601/CCIR 601 (cropped overscan) showed exactly the same sizes(!):
1. 720x576 - D1 with overscan
2. 704x576 - D1
3. 352x576 - Half-D1

Power DVD 5.0 on 17" LCD monitor
AR error in first case because of showing the 16 pixels overscan,
1. 720x576 - horizontal squeezed 2.2 %.
2. 704x576
3. 352x576

If you get results like jdobbs than your hardware doesn't care about aspect ratio. The error is 16/704 = 2.2 % and not visible.:cool:...720 pixels are sampled because a common sampling rate (13.5 MHz) and amount of samples per line (720) makes it easier for the hardware manufactures to design multi-standard digital video equipment.

sw00p
5th July 2004, 22:33
Originally posted by jdobbs
Just a quick suggestion for anyone who really wishes to see what is the correct method for converting from 720xNNN to Half-D1.

1. Create a video that has a fixed square in the center of the screen.

2. Use a DVD-RW and create a 720x480 video.

3. Play it back and measure (using a ruler on your screen) the horizontal size of the original. Let's say it measures 10"

4. Do each of the suggested methods for Half-D1 conversion and put them (authored) as two choices on the same disc.

5. Run each and measure with a ruler. You'll find that the 10" measurement has been stretched to a little under 10.25" on an incorrectly converted video.

Now -- quite honestly -- you'd have to be an anal SOB with the eye of an eagle to be able to tell the difference when you're watching a movie, so I don't think it really matters... but it might be fun for someone with an inquiring mind and a little time on his/her hands who really wants to know.
jdobbs (or anyone else):
I'm affraid i just fell from the moon, but can you tell me whether Half D1 option actually causes incorrect aspect ratio or not? My concern is how it will look on PAL TV screen. Lot of things were said, but I somehow miss the conclusion.
:confused: Thanx in advance. -swoop-

jdobbs
5th July 2004, 22:34
Originally posted by sw00p
jdobbs (or anyone else):
I'm affraid i just fell from the moon, but can you tell me whether Half D1 option actually causes incorrect aspect ratio or not? My concern is how it will look on PAL TV screen. Lot of things were said, but I somehow miss the conclusion.
:confused: Thanx in advance. -swoop- It is correct as implemented. It will create the correct aspect ratio.

sw00p
5th July 2004, 22:38
jdobbs:
That was deadly fast, man. Ufff, can't believe it. :devil: THANX & RESPECT!
-swoop-