Log in

View Full Version : MPEG2Dec3 v1.10


Pages : 1 2 3 4 [5] 6 7

trbarry
12th June 2003, 14:48
@cuisinart: Thats because im going straight from yv12 to RGB. I could make it so you can set it either to do interlaced chroma upsampling or not. Or go from yv12 to YUY2 (or 4:4:4) and then goto RGB. Ill look into that for you.

As mentioned, the code upsampling in MPEG2DEC2 seems already to be correct. It's not really a user option but determined by the flags, prog frames, etc.

- Tom

WarpEnterprises
12th June 2003, 21:44
I'm too strongly voting for integrated D2V creation:
- There are MANY "bug-reports" coming from version incompatibilities only.
- I can't understand how you can use an inaccurate framecount input
- even without the other goodies (CSS, audio,...) we would have an up-to-date reference mpeg2 decoder.
- maybe you can summarize in the docu the pros and cons of the many many iDCTs

Thanks for your work!


[EDIT]: "Bug Reports" like "it's not working, why? What version of DVD2AVI? Took the wrong one...

framecount: how can you use a source in avisynth if the framecount is not reliable (esp. if the actual count is less than predicted)? Are black frames outputted?

Nic
12th June 2003, 21:59
"MANY "bug-reports" coming from version incompatibilities only" What bug reports are you referring to?
" can't understand how you can use an inaccurate framecount input" ? What does that one mean too ?

I do need to rewrite the docs, or at least part of them. I explain the pros and cons of the iDCT's. But its reasonably simple. Use 2 if your non-p4 and 5 if you have a p4. Unless you want the slightly (& it is only slight "not magnitudes" as Isibaar puts it ;) ) more accurate idct i.e. SimpleIDCT, which is 7. All others should probably be ignored.

-Nic

bond
12th June 2003, 22:06
Originally posted by Nic
Use 2 if your non-p4 and 5 if you have a p4.what will be used if i dont define any idct?

Nic
12th June 2003, 22:12
It does it automatically. 2 if your non-p4 and 5 if you are using a p4.

-Nic

symonjfox
12th June 2003, 22:14
The DEFAULT ... =2
Else you can edit your defaults so you won't need any more to write the entire string.

V-tec
13th June 2003, 00:01
I have made a comparison between different version of Mpeg2dec3 from 1.00 to 1.08 and Mpegdecoder-YV12

My config is:

Athlon Xp 1800+, 512Mb DDR 2100 cas 2b MB Asus A7V266-E etc...
Vdubmod 1.5.1a + debug view, Xvid Koepi 14.05.03 quant 2
Mpeg2dec3 1.0x

The Avisynt scripts,

for mpeg2dec 1.0x:

# SOURCE
mpeg2source("C:\driven\driven.d2v", idct=X)
# CROPPING
crop(14,74,690,424)
# SELEZIONE
trim(5000,7999)
# RESIZING
BicubicResize(608,256,0,0.5)

for MpegDecoder-YV12

# SOURCE
mpegsource("C:\driven\driven.d2v")
# CROPPING
crop(14,74,690,424)
# SELEZIONE
trim(5345,8344)
# RESIZING
BicubicResize(608,256,0,0.5)


and the results:

mpeg2dec3 1.00

idct1=_________34.21fps_______87.68s_____30.217Ko
idct2=_________34.54fps_______86.86s_____30.217Ko
idct3=_________29.68fps_______101.06s____30.269ko
idct4=_________28.53fps_______105.09s____30.353ko
idct5=_________28.67fps_______104.63s____236.900Ko


mpeg2dec3 1.01

idct1=_________34.25fps_______87.59s_____30.217Ko
idct2=_________34.46fps_______87.03s_____30.217Ko
idct3=_________29.56fps_______101.46s____30.267ko
idct4=_________28.53fps_______105.15s____30.241ko
idct5=_________28.61fps_______104.93s____236.900Ko


mpeg2dec3 1.02

idct1=_________34.25fps_______87.59s_____30.217Ko
idct2=_________34.20fps_______87.70s_____30.217Ko
idct3=_________29.67fps_______101.11s____30.267ko
idct4=_________28.45fps_______105.46s____30.241ko
idct5=_________28.70fps_______104.54s____236.900Ko


mpeg2dec3 1.03

idct1=_________34.37fps_______87.28______30.217Ko
idct2=_________34.53fps_______86.88s_____30.217Ko
idct3=_________29.71fps_______100.97s____30.267ko
idct4=_________28.64fps_______104.73s____30.241ko
idct5=_________28.75fps_______104.34s____236.900Ko


mpeg2dec3 1.04

idct1=_________33.72fps_______88.97s_____30.217Ko
idct2=_________33.77fps_______88.84s_____30.217Ko
idct3=_________29.39fps_______102.08s____30.240ko
idct4=_________27.15fps_______110.49s____30.241ko
idct5=_________28.49fps_______105.29s____236.900Ko


mpeg2dec3 1.06

idct1=_________34.98fps_______85.77s_____30.217Ko
idct2=_________35.34fps_______84.90s_____30.217Ko
idct3=_________30.28fps_______99.07s_____30.269ko
idct4=_________29.14fps_______102.94s____30.353ko
idct5=_________35.28fps_______85.02s_____30.217ko
idct6=_________35.46fps_______84.60s_____30.330Ko
idct7=_________32.96fps_______91.30s_____30.245ko


mpeg2dec3 1.07

idct1=_________35.07fps_______85.52s_____30.217Ko
idct2=_________35.29fps_______84.98s_____30.217Ko
idct3=_________30.24fps_______99.20s_____30.269ko
idct4=_________29.14fps_______102.93s____30.353ko
idct5=_________35.28fps_______85.04s_____30.217ko
idct6=_________35.33fps_______84.89s_____30.330Ko
idct7=_________32.84fps_______91.34s_____30.245ko


mpeg2dec3 1.08

idct1=_________35.08fps_______85.51s_____30.217Ko
idct2=_________35.33fps_______84.91s_____30.217Ko
idct3=_________30.23fps_______99.22s_____30.269ko
idct4=_________29.13fps_______102.99s____30.353ko
idct5=_________35.32fps_______84.91s_____30.217ko
idct6=_________35.40fps_______84.74s_____30.330Ko
idct7=_________35.61fps_______84.23s_____30.245ko


mpegdecoder YV12

idct2(?)=______37.87fps_______79.21s_____30.216ko

trbarry
13th June 2003, 01:48
Very interesting results above. It looks like:

1) Prior to release 1.06 idct=5 was busted on Athlons. It should have defaulted to 2.

2) It also looks like Athlon speed for idct=7 is now (v1.08) actually faster than idct=2 or the others. Nifty. ;)

- Tom

JohnMK
13th June 2003, 01:53
Tom I'd love to see if idct=5 is actually faster on P4's. I'd run a benchmark if I knew how to isolate it down to two decimal places like he does.

Nic
13th June 2003, 08:53
@Tom:
"It also looks like Athlon speed for idct=7 is now (v1.08) actually faster than idct=2 or the others. Nifty"
It looked that way in my tests too, but I didn't want to say anything until I was sure (because I said the skal iDCT was the fastest...which obviously isn't correct ;) )
(Very nice work :), Oh and I looked into that MPEG2Dec3 parity thing, and couldnt find the problem. Let me know if you can look into it for me (& I hope you enjoyed the film))

@V-tec: Thanks for all those results :) That must have taken some work and time, so thanks a lot. And it shows that we have made it faster, even if its only fractional. (You were correct in saying MPEGDecoder does use almost exactly the same as iDCT=2)

@John: Im pretty definite that idct=5 is faster on P4s. But anyone that knows different please let me know.

-Nic

trbarry
13th June 2003, 16:26
Im pretty definite that idct=5 is faster on P4s. But anyone that knows different please let me know.

Cruncher posted some results back on page 3 that suggest 5 would still be faster on P4's.

- Tom

Th3-S4int
14th June 2003, 18:24
Hi Iam new here and come from Germany, but i hope you will understand what i mean:
1. Which idct is the best for a Athlon Thunderbird (1.2GHZ)? Until now i used standard, but i hope there are some faster! And what is the different form standard (0) to the optimal setting (exp. 7) (i mean is it faster or something else?)
2.For what is Post Processing? does it help to have better compressiblity? Increase it the Picture quality?
I hope someone helps me, Thx!

JohnMK
14th June 2003, 19:40
1: idct=7 on your particular CPU.

sapient
15th June 2003, 00:41
I am a recent convert to the intel CPU's. My limited experience so far with a celeron @ 1.7 and a p4 @ 2.8 w/ HT has shown me that the speed difference between iDCT 2 and 5 is inconcequential. I can't think of a way to test them in an accurate way though. I just try to look at virtualdub's fps count @ a specific time. Obviously this "method" isn't exactly dependable. Does anyone have a simple and accurate method to standardise such a mesurement?

sapient

Nic
15th June 2003, 00:47
Well idct=2 & idct=5 produces exactly the same output, so if you've got a p4 id still say use idct=5 over 2. Just because he can't do any harm and won't be slower.

-Nic

Blight
15th June 2003, 11:01
Nic:
As someone who wrote a directshow source filter, is there any chance you'd port this effort into a directshow MPEG2 decoder filter, making it the first (and I believe only) freely available such filter?

Not to mention it could be a boon for HDTV decoding as transport support is really bad under directshow at the moment.

Nic
15th June 2003, 11:29
I tried it once with libmpeg2. It worked...almost (not quite ;) Cant remember why not though). Yes I'd forgotten about that. Ill look into that again soon :)

-Nic

colin.findlay
16th June 2003, 12:44
Excuse me if this has already been asked a million times before (Although I couldn't find it on a search). The old v1 of MpegDecoder used to support decryping VOB's on the fly. As far as I can tell, the new version & MPEG2Dec3 don't support this. (Probably because it's based on DVD2Avi now?)
Are there any plans on putting it back in? It really was the core reason I used to use MPEGDecoder/AviSynth, and I loved it, although the speed increase is nice :-)

Regards
C

PS: Yes I know working from the DVD is slower and would probably negate months of processor optimiations - but I like the disk space it saves :-)

Wilbert
16th June 2003, 12:46
MpegDecoder <> Mpeg2dec3

mpeg2dec/mpeg2dec3 was never able to import vob files. Why don't you continue with using mpegdecoder?

Nic
16th June 2003, 13:10
Hmmmm, ill add D2VCreation support into MPEG2Dec3 into the next release, and reactivate OpenDVD.DLL support (and release my version of OpenDVD.DLL, the original is based on VobDec which I never liked)

So my planned changes for 1.09 are:

Compile with MSVC .net 2K3 (I tested it over the weekend and it improved the speed)

Add D2V Creation and release a new OpenDVD.DLL, this will keep MPEG2Dec3 still legal as all the DeCSS stuff will be in OpenDVD.

Try and make it so that using mpeg2dec3's internal colorspace functions (YV12toYUY2, etc) it will hopefully be able to call avisynth's colorspace routines instead and detect if its interlaced or not without the user having to specify.

Make it so that GetParity works ok, trbarry reports that it might not (in the TomsMoComp readme.txt). If anyone can test to see if its working or not that would be a great help :)


Sound ok? (This might take a while, due to me being busy and not being around next week)

-Nic

colin.findlay
16th June 2003, 13:28
Nic, you're an absolute star!
I'll buy you a pint if I ever meet you.

Thanks
C.

Sigmatador
16th June 2003, 13:54
"Compile with MSVC .net 2K3 (I tested it over the weekend and it improved the speed" better than ICL 7.1 ? :)

Nic
16th June 2003, 14:08
@sigmatador: Ive got both, but only one at home. Ill test ICL 7.1 on it too and see which is faster. And compile it with that. I was just so surprised MS had actually improved their compiler ;) (Shame the interface really does suck hard most of the time)

-Nic

Cyberia
16th June 2003, 14:56
Nic, is mpeg-1 (video) decoding on the list, even if it won't be this release?

Nic
16th June 2003, 14:59
@Cyberia: Probably not, it would probably be quicker and easier for me to re-write MPEGDecoder than it would be to implement MPEG-1 :(
But maybe it will be easier than I think, ill have a look at it again
(Or maybe I could add libmpeg-2 into mpeg2dec3 just for MPEG-1 support ;) But I think that might make it a little bloated)

-Nic

Cyberia
16th June 2003, 17:56
If I understand right, mpeg-1 is a subset of mpeg-2 so any mpeg-2 decoder can, in theory, decode mpeg-1 streams as well right?

I think you mentioned mpeg-1 being frame-based not field-based as mpeg2dec3 is expecting. Is that the problem? Are all mpeg-2 decoders field-based? (and if so, how do they handle mpeg-1?) Can't you just convert frame based to field based? I would think that could be done fast and losslessly.

EDIT:

DVD2AVI can open mpeg-1 files and that gives me another idea... Could you treat an mpg like a vob and create a d2v file for it? Or does that ultimately lead back to the same problem?

Nic
16th June 2003, 20:20
"DVD2AVI can open mpeg-1 files???" Is that true? I don't really have any MPEG-1 files, but I didn't that was the case. Im sure Ive tried it and it didn't work. If it does work then it should be easy to make MPEG2Dec3 open MPEG-1 files.

-Nic

Leolo
16th June 2003, 22:18
Hi,

I've tried to open many MPEG-1 files with DVD2AVI 1.77.3 but it didn't work with any of them.

Nic:

Not long ago libmpeg2 added support for PVA files, would you mind enabling it in your MPEGDecoder plugin?

That would make a lot of DVB-s users very happy! And, also, could you enable PVA support in your upcoming MPEG2 directshow filter?

Thank you very much.
Kind regards.

Nic
16th June 2003, 23:22
Hi, I didnt think dvd2avi could open mpeg-1. There is PVA demux code in the libmpeg-2 cvs (not actually in libmpeg-2). I have never seen or played with a PVA file, but one day ill find the time to look into it :)

-Nic

Cyberia
17th June 2003, 02:43
Oopsie. You are all correct, DVD2AVI cannot open mpeg1 files. I'm sorry. This morning I was COMPLETELY CERTAIN that I had done this before. Apparently, I have not.

I have NO idea where I came up with that either. My bad.

Nic
17th June 2003, 09:55
http://nic.dnsalias.com/EvilMPASource.zip

As if this thread wasn't big enough, Id thought Id release something else. WarpEnterprise's great MPASource has now been made Evil by me, because now it supports MPEG input. For Example:
LoadPlugin("EvilMPASource.DLL")
LoadPlugin("MPEG2Dec3.DLL")
aud = EvilMPASource("D:\My_SVCD.MPG")
vid = MPEGSource("D:\My_SVCD.D2V")
AudioDub(vid,aud)

Might be of no use to anyone, but its useful to me. Im not going to support it. So thats it Version 1.0 (unless there's a huge obvious bug). I have a version that doesn't scan the file to begin with (i.e. use DirectShow to find the length of the file before hand...but that was too evil :devil: )

Cheers,
-Nic

ps
Oh yeah, just thought id add:
you can do EvilMPASource("1.mpg+2.mpg") To concatenate two vobs together. And for those who deal with Transport Streams with Layer 2 audio, just change in the sourcecode to read:
m_pMPEGReader = new CMPEGReader(true, nPIDNumber)
instead, where nPIDNumber is the PID you want to decode...

symonjfox
17th June 2003, 12:33
So great news :D
Thank you very much.

WarpEnterprises
17th June 2003, 15:11
Great work, after looking a little into it, it seems understandable to me, so I will try to take your version under support :)

Nic
17th June 2003, 15:16
Cool :) Ill write Marc FD and see if I can get AC3Source sourcecode off him. Not releasing it is against GPL, and the classes I added to MPASource make adding MPEG stream support very easy to any filter.

-Nic

WarpEnterprises
17th June 2003, 15:32
2 more questions:
Where is the demux code from? (possible bugfixes,...)
What happens with a demuxed input?

Nic
17th June 2003, 16:09
The Demux code is a C++ & modified version of the libmpeg2 demux code.
Demuxed input will cause it too fail at present.

Dont worry, ill support it if anything weird goes wrong :)

Cheers,
-Nic

WarpEnterprises
18th June 2003, 11:47
What happens to an mux audio delay? Is there a way to get it?

Cyberia
20th June 2003, 17:30
Nic, I found a tiny doc mistake with MPEG2Dec3. The help file gives an example for the usage of the cpu2 parameter. The example is wrong (unless I am reading it wrong, but I don't think so).

CURRENT
example :
"oxoxox" <----this is wrong
123456
would enable chroma only PP


SUGGESTED
example:
"ooxxox" <---- fixed
123456
would enable chroma only PP


Also, the doc mentions that MarcFD was planning on removing Vlad's FastMC in the 'next' release (which would have been ~1.0) Was it removed? And do you intend to?

N_F
21st June 2003, 04:54
As long as we're talking about small error in the document...

At one place (I don't have the doc in front of me) it mentions something like "these 5 idct's", while listing 7 (of course the additional *skal-thingy* and the *simple-thingy*).

Prettz
29th June 2003, 21:34
I don't even know how useful this would be, but would it be possible to have 2 pairs of post-processing strength variables, one pair for luma and one pair for chroma (like moderate_lh/moderate_lv and moderate_ch/moderate_cv)? Or would marcFD have to be called up to make those kind of changes?

sh0dan
30th June 2003, 09:09
They are already present "moderate_h" and "moderate_v" settings should be useable on both MPEG2Source and BlindPP.

Prettz
30th June 2003, 15:07
Originally posted by sh0dan
They are already present "moderate_h" and "moderate_v" settings should be useable on both MPEG2Source and BlindPP.
No, I meant 4 seperate variables, a moderate_h/moderate_v for luma, and a seperate moderate_h/moderate_v for chroma.

I was just thinking about this because I'm having a lot of trouble trying to remove noise (from flat areas as well as mosquito noise from around detailed edges) without destroying detail, and it's proving exceedingly difficult because my source is extremely soft and dull but at the same time highly detailed. I was thinking it would be nice to be able to experiment with seperate thresholds for luma and chroma, but really it's by no means crucial.
Also, if you made it have 4 threshold variables, it would be extremely cumbersome and tedious for the majority of cases where you want to use the same values for luma and chroma. You would probably want to include some kind of way to be able to use the old moderate_h/moderate_v, so that you can just give the 2 values and use them for both luma and chroma, instead of having to give 4 values even when you don't want to use seperate luma/chroma thresholds.

Cyberia
30th June 2003, 22:28
Did Nic go on vacation?

Guest
30th June 2003, 22:39
Originally posted by Cyberia
Did Nic go on vacation? He returned yesterday.

skal
3rd July 2003, 09:26
Hi all,

just a quick note: if you're building MPEG2dec3 from
source code, you may try to use the "sparse" version
of idct=6, by adding in global.h an:

extern "C" void Skl_IDct16_Sparse_SSE(short *block);

and changing line 194 of vfapidec.cpp to:

idctFunc = Skl_IDct16_Sparse_SSE

(note that there are MMX-only versions, too)

Should work ok. I'd be curious about the speed, then...

bye

Nic
3rd July 2003, 10:14
Sorry skal, I forget to email you back about that. I read the email while I was away and didn't get time to reply and then it got lost in all the spam I get sent.

Ill definitely add the sparse version in the next release, which ill try to do over the weekend. Im everso short on time recently :(

Thanks :)

-Nic

ps
@all: What are the disadvantages of using DirectShowSource for MPEG-1? Speed? Why would a MPEG1Source filter be better? (Ive never used DirectShowSource for MPEG-1)

sh0dan
3rd July 2003, 12:30
@Nic: DirectShow cannot do random access which makes it very painful to use in any setup. Beside that, forward seeking can be very slow.

I have tried my best to get Directshow to perform better, but API stuff is very cryptic to me. I guess a random access, audio capable DirectshowSource would solve tons of problems.

Cyberia
3rd July 2003, 23:53
@nic:

DirectShowSource does not always provide the correct framecount for MPG1 files.

Also, I'm hoping that the de-blocking and de-ringing routines in MPEG2DEC3 will work better if the file is opened natively than if you use BlindPP and DirectShow.

Cyberia
5th July 2003, 20:06
Oh yes, one more thing: DS *often* fails to determine the framerate of mpg1 material Then you have to set it manually with the FPS= parameter, which means opening the file in vdub and find the real FPS and adding it to the script. Not a huge issue, but it is a pain in the butt.

Nic
6th July 2003, 14:32
I was hoping to work on it this weekend, but unfortunatly ive had to do "real" work all weekend :( I may be real busy for quite some time :(

-Nic