View Full Version : Better to resize Up to 720x576 than down to 352x288 - At The Same Bitrate!
video_magic
1st August 2005, 08:43
Hey guys, I had a great experience encoding to mpeg2 recently, and thought I would share this opinion with you, we are all concerned with having nice looking encodes and preserving details right? :)
My source files for my compilation were XViD at resolutions 576 x 432. The clips looked pretty sharp. I wanted to fit around 4 and 1/2 hours of video footage onto a 4.37GB DVD plus ac3 audio and a motion menu, and so I estimated I was looking at an Mpeg2 bitrate of around 1800.
In my input avs I had kind of automatically decided I had better resize down to 352x288 for this bitrate - I was caught in the mentality that this was the thing to do :sly:
Anyway, I wasn't happy with the result, neither with bilinearresize nor lanczosresize.
It suddenly occurred to me, why not resize Up I don't know why, but I had thought it would give me bigger files and I suddenly had like a revelation that of course it wouldn't if I was used the same bitrate! :B :stupid:
So I used Lanczosresize at 720x576 and encode to mpeg2 also at ~1800. Result - much better looking encodes - very close to the original with much of the detail still apparant. Sure some blockiness but so much more satisfying and enjoyable to watch.
I'll never downsize again to 352x288 when I can use the same space and resize up to 720x576 and get a much better picture (at these quite low bitrates). I hope this helps someone that also had just assumed that downsizing was the way to go :)
Amnon82
2nd August 2005, 23:59
I encoded some TV-Series-Episodes with the resolution 640x360. It was a NTSC-Source so I resized it to 720x480. Also almost the same result. The AVG BitRate was ~2010 KB/s.
Paulcat
3rd August 2005, 14:40
This may be completely irrelevant, but my uncle (a photographer) has a plug-in for photoshop which uses Mandelbrot's mathematics for enlarging. He can take a 4x6 picture up to poster size with no loss of picture quality. I wonder if anyone has tried to use this process in a video application?
Delphin
3rd August 2005, 23:13
This may be completely irrelevant, but my uncle (a photographer) has a plug-in for photoshop which uses Mandelbrot's mathematics for enlarging. He can take a 4x6 picture up to poster size with no loss of picture quality. I wonder if anyone has tried to use this process in a video application?
MeeSoft's Image analyzer software has a plugin with a fractal resizer if anyone wants to experiment with this technique.
http://meesoft.logicnet.dk/
If you want to experiment with fractal resizing Video with the above program you could probably tinker togeather a AVIsynth script to use Meesoft's fractal resize filter in 'batch mode' to process a series of single frame stills previously created from the Video by AVIsynth, then pass the still frames back through the AVIsynth script to recreate the video.
There is also a good 'deconvolution' based sharpen filter in this program.
I have done image processing on astronomical images and it is truly amazing what you can do with deconvolution based filters (like Richardson-Lucy deconvolution, which was used to fix the blurred Hubble Space Telescope images BEFORE the optical correction lenses were installed)
I think one reason some of these things have not been ported to Virtual Dub or AVIsynth is that these tricks are VERY CPU INTENSIVE.
It can take anywhere from several seconds to SEVERAL MINUTES to do the required magic to do a fractal resize or deconvolution sharpen on a reasonable size image.
On the other hand, a simple deconvolution filter optimized for SSE/MMX would probably be just barely practical for video, and could achieve TRUELY AMAZING results in sharpening (see the Deconvolution sharpen example on Meesoft's "Image Analyzer" page).
dragongodz
4th August 2005, 05:32
video_magic - try half D1 some time, 352x576.
video_magic
4th August 2005, 08:13
Cool guys.
I will do that Dragongodz, a quick question, is this 'half resolution' okay (within spec) to use for DVD? Thanks
Mug Funky
4th August 2005, 09:50
half-d1 is DVD compliant, but it may expose some non DVD compliant players :)
you'll be fine so long as you don't use subtitles, as these could come out a number of different ways. try it on a DVD-RW and see if your player can handle it. generally you'll very rarely (if not never) see half-d1 on commercial DVDs... though it was used on the R4 "the corporation" extras disc for some parts, as there are 7 hours of footage on that disc (mostly talking heads, but 7 hours is a huge amount, and the audio is all at 224 IIRC).
Delphin
4th August 2005, 10:36
Thanks to Dragongodz for getting this thread back on topic . . .
Cool guys.
I will do that Dragongodz, a quick question, is this 'half resolution' okay (within spec) to use for DVD? Thanks
YES Half D1 support is required under the DVD spec . . .
Although it is supported under the DVD spec, "Half D1" is actually a bit of a goofy resolution in that we are encoding for a 4:3 screen (which is obviously wider than it is high), but the encoded resolution in the vertical direction is higher, giving pixels about half the height of their width.
This was pushed by broadcasters worried about encoding interlaced material.
If you need to save some bandwidth and want to encode pure interlace or mixed Telecined material HALF D1 is the way to go.
On the other hand I have found that with good encoding settings, SIF resolution at 352x288 PAL (or 352x240 NTSC) isn't so bad . . .
Remember 352x288 (352x240 NTSC) was designed to approximate the resolution of a VHS video tape, and with optimum encoding I have found that this can be acheved.
For material like old TV shows, which are encoded to be viewed on a 27 inch or smaller screen from across the room, this resolution is perfectly acceptable.
Remember that we can encode 352x288 PAL (or 352x240 NTSC) as a MPEG2 VBR stream not just a MPEG1 CBR SIF stream.
I find that this makes a big difference.
Here are the settings I use . . .
1. Starting from clean D1 720x480 material I just crop 8 pixels off the left and right side using Crop() in AVIsynth
2. Then do a ReduceBy2() in AVIsynth
3. Encode with the HC MPEG2 encoder with these settings
- DCT resolution set to 8 bits
- Custom 'JAWOR1CD' matrix.
- Peak bitrate= 2000kbs
- Average bitrate = 750kbs to 1000kbs depending on source material.
This gives outstanding 352x240 encodes which really do look like a good quality video tape (should also work for 25fps 352x288 PAL encodes).
As noted above, with some sources I can get clean block free encodes with these settings with video bit rates as low as only 750kbs ! ! !
So if you are looking for REALLY LOW bitrates give this a try.
On the other hand if you have the bandwidth to spare, HALF D1 will look a bit better as dragongodz suggested, so you might want to give that a try.
Note:
Even though both the lower 'SIF' and 'Half D1' resolutions are technically supported under the DVD spec, you could find that some marginally compatible players give you problems, so do a few tests before you encode a huge amount of material.
dragongodz
4th August 2005, 13:43
Although it is supported under the DVD spec, "Half D1" is actually a bit of a goofy resolution in that we are encoding for a 4:3 screen (which is obviously wider than it is high), but the encoded resolution in the vertical direction is higher, giving pixels about half the height of their width.
the same could be easily said of anamorphic widescreen of course since its still uses the same 720x576(480) source. ;)
lithoc
5th August 2005, 02:21
I still remember I encoded one movie in 1 CD(about 100+ minutes).
I use MPEG2 VBR 352x480(letterboxed) + 160kbps Mpeg Layer 2 audio @ 48khz.
Author it as SVCD to get full 800mb space.
It's watchable with my 21" TV.
Edited : BTW, I use QuEnc and for ultra low bitrate. My personal oppinion, at bitrate < 1Mbps QuEnc is better than HC.
Delphin
5th August 2005, 16:03
the same could be easily said of anamorphic widescreen of course since its still uses the same 720x576(480) source. ;)
LOL
Yep, that's absolutely true.
When I am pushing up against bit rate limits, I will drop anamorphic encoding for widescreen sources and go with 'letterboxed' encoding.
Of course according to the conventional wisdom this is sacrilege.
Imagine wasting all those pixels!
The fact is that If the image gets displayed on a 4:3 monitor they get wasted anyway when the image is letterboxed by the DVD player for 4:3 display.
And even on a 16:9 screen we just end up with something closer to square pixels, and although there is some slight vertical loss of sharpness verses anamorphic, I find that this is preferable to the artifacts that would otherwise show up for longer titles which I am trying to squeeze onto a DVD5.
Delphin
6th August 2005, 01:44
I still remember I encoded one movie in 1 CD(about 100+ minutes).
I use MPEG2 VBR 352x480(letterboxed) + 160kbps Mpeg Layer 2 audio @ 48khz.
Author it as SVCD to get full 800mb space.
It's watchable with my 21" TV.
Edited : BTW, I use QuEnc and for ultra low bitrate. My personal oppinion, at bitrate < 1Mbps QuEnc is better than HC.
As far as QuEnc vs. HC goes . . .
If you are talking about < 1 MB for 352x480 I would have to agree with you that QuEnc might be a better choice than HC because QuEnc seems to hold togeather a little better at very low bit rates and degrade a more gracefully when it does start to loose it.
I think at mid to higher bitrates, with good clean source material, HC slightly edges out QuEnc, producing MPEG2 output so clean it rivals comercially encoded material.
One issue that can make SIF resolution look bad on a PC is that many software MPEG players don't do very good up-scaling, so the images look grainy when viewed closeup because the larger pixels show.
On stand-alone DVD players this is not the case, because they do a better job of hideing the pixels, but, with the upscaling of a SIF image up to full screen, we have to make absolutly sure that the encode is CLEAN because macroblocks will look HUGE at this resolution.
That's why I don't like to push things too far as far as the bit rates go.
For the example I gave . . .
- SIF resolution (352x240 NTSC or 352x288 PAL)
- DCT resolution set to 8 bits
- Custom 'JAWOR1CD' matrix.
- Peak bitrate= 2000kbs
- Average bitrate = 750kbs to 1000kbs depending on source material.
You will notice that above bit rates of 750kb to 1000kb for 352x240 SIF resolution are equivalent to about 3000kbs to 4000kbs at full 720x480 D1 resolution.
At these bit rates, for the lower SIF resolution, HC is still in the range where it can produce nice clean output (especially with 2 pass VBR encoding, the 8 bit DCT setting, and the JAWOR1CD matrix).
This gives a good clean encode that let's the lower 352x240 or 352x288 SIF resolutions finally start to live up to the original 'good as VHS tape' claim that was made for them.
Here’s the simple AVIsynth test script I used for testing . . .
# MPEG 2 VOB translated by DGindex
MPEG2Source("myvob.d2v")
# Crop 8 pixels from left and right to get to 704 horizontal resolution
Crop( 8, 0, -8, 0)
#High quality ReduceBy2 to 352x240 (or 352x288 if source is PAL)
ReduceBy2()
With NTSC film we also see the added advantage that we can encode at 23.976 with pulldown to 29.97 which reduces the number of frames to be encoded.
With PAL there is more vertical resolution at 352x288, and film encodes are normally sped up to 25fps, so we should probably bump the bit rate up to the higher end of the 1000kb range I gave above (or maybe even a little higher).
So, if you try a quick test with the HC MPEG2 encoder and AVIsynth using a nice clean D1 (720 horizontal resolution) DVD video source with the above settings, I think you will see what I am talking about.
ronnylov
16th August 2005, 17:50
VHS has full vertical resolution (otherwise you would not be able to record interlaced on VHS). Half D1 (PAL 352x576) is much closer to VHS resolution than 352x288 which is more like half VHS resolution (at least for luminance). The PAL VHS resolution is something like 320x576.
With an average bitrate of 1800 kbit/s I would have choosen half-D1 (352x576) and VBR encoding.
Delphin
17th August 2005, 07:35
VHS has full vertical resolution (otherwise you would not be able to record interlaced on VHS) . . .
I agree with your point about Half-D1 being closer to an exact match for the VHS spec, but your comment about VHS not being able to support interlaced video otherwise was exactly the point I was trying to make.
The design for BOTH VHS tape and Half-D1 MPEG2 were constrained by the need to support interlaced video (which requires a full vertical scan line resolution of 576 PAL or 480 NTSC).
I am not trying to imply that the extra vertical resolution is worthless, just that it may not be worth doubling the encoding rate unless we want to encode interlaced material.
The area where Half-D1 really shines is with INTERLACED material that you want to keep interlaced during the MPEG2 encode (like DV camcorder video or anything else 'shot on video').
To match a true '4:3' ratio for the 352 horizontal pixels in SIF requires only 264 vertical pixels (to maintain more or less optimal 'square' pixels), but PAL SIF has 288 vertical pixels and therefore is already a little 'heavy' on vertical resolution, before we even talk about DOUBLING that number for 'Half-D1'.
Conversely, NTSC SIF has only 240 vertical pixels and is therefore a little light on vertical resolution and so could benefit a little more.
There is one other important area where 'Half-D1' may have an important advantage for NTSC encodes.
When film is encoded to MPEG2 we usually just encode the 'real' frame rate of 24 fps into the MPEG stream, then pad the stream to the 29.97 fps NTSC framerate, using a special mechanism built into the MPEG2 standard which lets us selectively repeat individual 'fields' from the stream.
This is done using the TFF (Top Field First) and RFF (Repeat First Field) flags.
Repeating only single fields rather than full frames is preferred because fields run at twice the rate (almost 60 fps for NTSC), giving a smaller time jitter to the padded stream, which helps keep the padding from being noticeable.
But what if we only have 1 field as is the case for SIF? (which just duplicates the Top field to get the bottom field)
On my Phillips Stand-alone DVD player, the pulldown flag processing works flawlessly even with SIF video (which technically doesn't have two fields), because the player is smart enough to map all requests for ‘field repeats’ to the ONE FIELD that the SIF resolution MPEG2 stream does have.
This isn't rocket science, it's just the way it is supposed to work.
This said, I have found at least one player which doesn't seem to be smart enough to do the simple field mapping required to do pulldown with SIF (The player just freaks out and rejects the stream completely with a kind of "What do you mean 'Top Field First'? Dis is SIF, there ain't no fields" attitude). This player will only accept NTSC SIF resolution MPEG2 at exactly 29.97 fps with NO pulldown like the old VCD standard. :(
Because Half-D1 does have two fields (just like it's cousin Full-D1), it should be a lot less likely that a marginally compliant DVD player will reject the stream because it can't properly process the TFF/RFF flags.
This point's out a SAD FACT, which is basically that, as soon as you step away from very simple FULL D1 encoding, you can run into compatibility problems with some marginal players.
With an average bitrate of 1800 kbit/s I would have choosen half-D1 (352x576) and VBR encoding.
For NTSC, I would agree due to the issues I mentioned above.
Even for PAL, I still basically agree that more resolution is better if it will encode cleanly, so, as you suggested, if the video will encode at Half-D1 cleanly without blocking at 1800kbits/sec, I would say 'go for it' (which should be the case with good VBR encoding 90% of the time).
On the other hand, if there is a lot of action or noise in the source (too much entropy), then the video may become blocky at 1800kbits/sec and we may want to try for a perfectly clean SIF encode at the same bitrate.
For me, perfectly clean SIF looks better than blocky Half-D1 or Full-D1 (though I certainly respect the right of the original poster on this thread to prefer it the other way around). :)
shirohamada
17th August 2005, 18:00
you can use 480x480 NTSC which is svcd res, but its not dvd compliant. and you need to patch it with dvdpatcher. take a look at doom9's svcd to dvd guide.
Delphin
17th August 2005, 20:44
you can use 480x480 NTSC which is svcd res, but its not dvd compliant. and you need to patch it with dvdpatcher. take a look at doom9's svcd to dvd guide.
I have seen this hack before, but as you said it creates a DVD which is not compliant with the DVD standard and may not play on most players.
I have a Phillips DVP642 which is pretty forgiving about almost any MPEG2 resolution as long as it's simply written to an ISO file system.
The Phillips is a little fussier about things when I try to actually author a DVD with menus, so if I want to produce anything other than a fully compliant DVD, I usually just forgo 'authoring' and simply write a MPEG4 DivX or Xvid file to the DVD in ISO file system mode which this player supports quite well.
I figure that if I am going to go with something that will only play on a PC and a few standalone players anyway due to compatibility issues, I might as well go with DivX or Xvid which gives better quality at a lower bitrate.
mic
18th August 2005, 22:00
Delphin, thought you might appreciate this reading your posts -- just general info & personal experience really, thrown out there is hopes it might cause a :D
I've read a bit where the reason for the SVCD spec (480 width) was that tests showed the average home set-up loses close to 240 width anyway just transporting the signal.
If/When using IVT captured video, some stand-alone players do a better job of adding fields/frames with 480 rather then 720 width.
The practice of using 320 x 240 (& PAL equiv) used to be common years ago -- the 240 height = lines of data for 1 field as you've noted. I have come across DVD video from time to time that actually looked better at half height, I assume depending on how it was originally encoded -- interlaced doesn't handle fine or sharp horizontal edges/lines that well, & on these videos, it appeared as a lot of shimmering edges at full size.
The 2 things I've used often to fight blockiness (besides bandwith) are adding a small emount of noise, and increasing minimum bitrate. The latter is self explanatory, the 1st usually raises eyebrows, but think about how the encoder works. :D
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.