Log in

View Full Version : Downscaling an upscaled HD source to SD


raisinberry777
3rd September 2009, 22:51
Here's a slight mouthful!

Basically, my source is a 1440*1080i MPEG2 DVB-T PAL video recorded from my PVR. The source is clearly upscaled, so I'm trying to downscale it again to MPEG2.

I'm a newbie when it comes to Avisynth, so I don't really know a whole lot about what I'm doing and admittedly I'm just trying to go with whatever I can find on the internet.

Theoretically it should look pretty much eactly the same, right? I've encoded it back to SD using RipBot264 and it looks fine, but feed the same script into CCE (since I want to convert to MPEG2) and the output looks terrible compared to the original source, and bitrate starvation isn't a problem with my conversions (multipass VBR, 5000 kbps avg).

Source is here:
http://www.mediafire.com/download.php?hnmyknyywgh

Here are some of the Avisynth scripts I have tried so far:

LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\SmoothDeinterlacer.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\ColorMatrix.dll")
LoadPlugin("D:\Documents and Settings\xxxx\My Documents\Downloads\RipBot264v1.14.2\Tools\dgindex\DGDecode.dll")
MPEG2Source("C:\Recordings\job1.d2v")
ColorMatrix()
SmoothDeinterlace(lacethresh=10, tff=true, doublerate=true)
Spline36Resize(720,576).Sharpen(0.2)
Trim(1,0)
SeparateFields
SelectEvery(4,0,3)
Weave

LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\SmoothDeinterlacer.dll")
LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\ColorMatrix.dll")
LoadPlugin("D:\Documents and Settings\xxxx\My Documents\Downloads\RipBot264v1.14.2\Tools\dgindex\DGDecode.dll")
MPEG2Source("C:\Recordings\job1.d2v")
ColorMatrix()
SmoothDeinterlace(lacethresh=10, tff=true, doublerate=true)
MSharpen()
LanczosResize(720,576)
Trim(1,0)
SeparateFields
SelectEvery(4,0,3)
Weave

LoadPlugin("D:\Documents and Settings\xxxx\My Documents\Downloads\RipBot264v1.14.2\Tools\dgindex\DGDecode.dll")
MPEG2Source("C:\Recordings\job1.d2v")
AssumeTFF
Separatefields
MSharpen()
LanczosResize(720,288)
Weave
ConverttoYUY2(interlaced=true)

Does anyone have suggestions to offer?

thewebchat
4th September 2009, 00:35
There is no reason why the same script should inherently look worse when fed to CCE (bitrate aside), so you should probably clarify on what kind of issues you have with the CCE output.

midnightsun
4th September 2009, 00:58
does smoothdeinterlace reverse field dominance? Trim(1,0) will throw away the first field leaving you with such a clip so unless smoothdeinterlace also reverses field dominance (which I find hard to believe) then you may have a problem there if you encode to tff MPEG2. Isn't it that perhaps those scripts were made for bff DV to tff DVD conversion?

raisinberry777
4th September 2009, 01:48
Not exactly the same frame, but hopefully close enough to see my point which is mainly in the crispness that is lost on the onscreen graphics:

x264, 720x576 @ ~2300kbps
http://img31.imagevenue.com/loc547/th_25617_snapshot20090904104457_122_547lo.jpg (http://img31.imagevenue.com/img.php?image=25617_snapshot20090904104457_122_547lo.jpg)

MPEG2 (CCE), 720x576 @ VBR 5000kbps 3pass
http://img20.imagevenue.com/loc167/th_25618_snapshot20090904104125_122_167lo.jpg (http://img20.imagevenue.com/img.php?image=25618_snapshot20090904104125_122_167lo.jpg)

Source MPEG2
http://img241.imagevenue.com/loc40/th_25620_snapshot20090904104156_122_40lo.jpg (http://img241.imagevenue.com/img.php?image=25620_snapshot20090904104156_122_40lo.jpg)

This time for both re-encodes I used:

LoadPlugin("D:\Documents and Settings\xxxx\My Documents\Downloads\RipBot264v1.14.2\Tools\dgindex\DGDecode.dll")
MPEG2Source("G:\temp\RipBot264temp\job1\job1.d2v")
Spline36Resize(720,576).Sharpen(0.2)

Which is the script that RipBot264 gave me.

thewebchat
4th September 2009, 02:38
Considering how the graphics seem to have shifted a few lines in the CCE image, I am inclined to believe that this is a field order problem. In your earlier script examples, you were using a deinterlacer, but your screenshot of the source seems to be progressive. AFAIK, progressive content is always TFF, so perhaps you need to change your CCE settings (sorry, not familiar with CCE)?

poisondeathray
4th September 2009, 02:47
It's possible CCE encoding settings contributed: Did you forget to disable the low pass filter in CCE? (it's on by default)

The line shift needs to be set to 0 as thewebchat indicated.

Run it through HCenc and see if you get as poor results

Dark Shikari
4th September 2009, 02:49
Erm, those don't even look like the same frames...

raisinberry777
4th September 2009, 03:22
Erm, those don't even look like the same frames...

As my post says, they're not, but the point still stands.

Thanks thewebchat and poisondeathray, those settings seem to have fixed my problem. Cheers!

manono
4th September 2009, 03:30
As my post says, they're not, but the point still stands.

No it doesn't, as one could be an I-Frame and the other a B-Frame. And maybe you don't know how to set up CCE properly. Nothing beats comparing video samples.