Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-2 Encoding
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th August 2005, 15:40   #1  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
[Challenge Low Bitrate] Best MPEG2 Encoder for objectives tests

~ Movie Metric Benchmark Challenge ~

You think that your MPEG2 coder is the best : prove that ... !!?


A - Introduction

The purpose of this challenge is to determine which is the best codec for the metrics and only for the metrics : this test will not speak about subjective visual quality. If you want subjective visual comparison download sample and compare yourself ...



B - Rules

Rule 1 : Source

You must use this source for the test : Harry Potter II trailer, 720*576 MPEG2 MP@ML 4.5 Mbps
HPII Part1 winrar, HPII Part2 winrar, HPII Part3 winrar, HPII Part4 winrar & HPII Part5 winrar


Rule 2 : Pre-process and encoding

You must use DGindex with 32-bit SSE/MMX iDCT algorithm for .d2v project and DGDecode.dll for MPEG2 decoding in avisynth scipt. You must use MPEG2 with DVD standard MPEG2 MP@ML Pal DAR 4/3 PAR 12:11 profil. You must use this avisynth script for make encoding:
Code:
source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)
Return(source)



Rule 3 : Bitrate

You must use these bitrate/size for encoding:

The first round use is very low bitrate for MPEG2 : Average bitrate is 1800 Kbps for mini-DVD profil encoding.
Mini-DVD: Average 1800 Kbps for Video Elementary Stream or 28125 Ko for m2v file.


Rule 4 : Metric Tests

SSIM (YV12): IMO the best metric. it uses some HVS properties but not all ...
PDF description for VSSIM

Overall PSNR (YV12): Very good metric test, particullary for Rate Control Quality test ...
MSE = Sum t = 1 -> NFrame Sum x = 1 -> width Sum y = 1 -> height (F'(x,y,t)-F(x,y,t))² / (NFrame*width*height)
Overall PSNR = 10 * Log ( 255² / MSE)


Average PSNR (YV12):The worse metric test but Frame PSNR graph is very good to compare RC strategy ...
MSE = Sum x = 1 -> width Sum y = 1 -> height (F'(x,y,t)-F(x,y,t))² / (width*height)
Average PSNR = Sum t = 1 -> NFrame 10 * Log ( 255² / MSE) / Nframe



SSIM vs PSNR

"For a given reference video and a given compressed video, it is meant to compute a quality metric, based on perceived visual distortion. Unlike the well-known PSNR measure, it's not purely mathematical, and should correlate much better with human vision."

"A higher MSE (and so lower PSNR) should mean that the compressed clip is a worse image but MSE and PSNR are flawed in this respect as numerous tests have shown. However with SSIM, according to tests carried out on the VQEG dataset, a higher Q (SSIM value) has a much better relation to the visual quality of the compressed clip. Despite this, bear in mind the SSIM metric still isn't perfect."

Here last AviSynth plugin for VSSIM in YV12


Average PSNR vs Overall PSNR

It's easy to increase artificially Average PSNR with Rate Control tweak. In certain case CBR (0% for variability) will be better than real VBR (100% for variability or constant quant). It's generaly not possible with Overall PSNR. Overall PSNR is very good to test Rate Control quality. If difference between Average PSNR and Overall PSNR is very high, "local quality difference" (difference between Pframe or Bframe for exemple) or "scene quality difference" (difference between low motion and high motion for exemple) will be too high and Rate Control for this codec not very good.

Here last AviSynth plugin for Overall PSNR in YV12


Open your avs metric script with VirtualDub. Select file > preview input for run the test. Select file > close video file for obtain final result in log metric files. You must use these AviSynth type script for metric test:
Code:
# --> Video Opening <--

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)

video=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\qwaerty.d2v",idct=2)

# --> PSNR analysis <--
compareYV12(video,source,"YUV","PSNR-MPEG2.log")


Code:
# --> Video Opening <--

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)

video=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\qwaerty.d2v",idct=2)

# --> SSIM analysis <--
SSIM(source,video,"results.csv","SSIM-MPEG2.log",lumimask=2)



C - Results

At this time here the best result ... but done better if you can ...
Code:
|-----------------|---------|---------|---------|---------|
| Codec           | Bitrate |   Size  |  OPSNR  |  SSIM 2 |
|-----------------|---------|---------|---------|---------|
| TMPGEnc         |  1803   |  28130  |  45.26  |  80.67  |
| CCE             |  1800   |  28179  |  45.83  |  78.76  |
| Canopus         |  1793   |  27956  |  46.49  |  82.49  |
| Mainconcept     |  1800   |  28200  |  45.21  |  80.54  |
| HC              |  1801   |  28252  |  46.24  |  81.53  |
| QuEnc (lavc)    |  1800   |  28210  |  46.94  |  83.00  |
| mencoder (lavc) |  1801   |  28207  |  47.47  |  84.79  |
| AQMatEnc (lavc) |  1800   |  28244  |  46.72  |  82.97  |
|-----------------|---------|---------|---------|---------|
SSIM 0: Lumimask Off
SSIM 2: Lumimask On (One2Tech Patch)

MPEG2 MP@ML : TMPGEnc encoding by Sagittaire
File: Not available

MPEG2 MP@ML : QEnc encoding by hank315
File: Not available

MPEG2 MP@ML : Mencoder encoding by Sagittaire
File: Not available

MPEG2 MP@ML : FFDShow encoding by Sagittaire
File: Not available

MPEG2 MP@ML : HC015 encoding by Audionut
File: Not available

MPEG2 MP@ML : AutoQMatEnc encoding by SAPSTAR
File: Not available

MPEG2 MP@ML : Mainconcept encoding by ronnylov
File: Not available

MPEG2 MP@ML : Canopus Procoder encoding by ronnylov
File: Not available


D - Conclusion

At this time for this trailer

The best is Mencoder encoding by Sagittaire

IF YOU DON'T AGREE WITH THAT, TRY TO MAKE BETTER WITH YOUR FAVORITE ENCODER ... !!!


Annexe - Update

11.03.06 : Sagittaire with Mencoder
04.09.05 : ronnylov with ProCoder
27.08.05 : Sagittaire with Mencoder
27.08.05 : Ronnylov with Mainconcept
18.08.05 : SAPSTAR with AutoQMatEnc
16.08.05 : Ronnylov with Mainconcept and ProCoder
14.08.05 : Sagittaire with QEnc, Mencoder and FFDShow
14.08.05 : hank315 with HC015
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9

Last edited by Sagittaire; 11th March 2006 at 14:52.
Sagittaire is offline   Reply With Quote
Old 13th August 2005, 21:43   #2  |  Link
IgorC
Registered User
 
Join Date: Apr 2004
Posts: 1,315
There is TMPGEnc 2.521.63.181 version in offcicial site. it shouldn't be a big difference.
IgorC is offline   Reply With Quote
Old 13th August 2005, 23:17   #3  |  Link
Fishman0919
FishmanMod Android Dev
 
Fishman0919's Avatar
 
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
What about AutoQMatEnc....
__________________
"Cinderella story, out of nowhere,
former greenskeeper, now about
to become the Masters champion.
It looks like a mirac- it's in the hole!"
Fishman0919 is offline   Reply With Quote
Old 13th August 2005, 23:31   #4  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Quote:
There is TMPGEnc 2.521.63.181 version in offcicial site. it shouldn't be a big difference.
I don't know ... ???
Make encoding and post your best result if you want ...
My encoding is just the first for start challenge ...


Quote:
What about AutoQMatEnc....
It's a challenge ... if you think that AutoQMatEnc can be better make encoding and post it ...
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 14th August 2005, 00:07   #5  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
Code:
|--------------|---------|---------|---------|---------|
| Codec        | Bitrate |   Size  |  OPSNR  |  SSIM 2 |
|--------------|---------|---------|---------|---------|
| TMPGEnc      |  1787   |  27934  |  45.45  |  80.81  |
| CCE          |  ....   |  .....  |  .....  |  .....  |
| Canopus      |  ....   |  .....  |  .....  |  .....  |
| QEnc         |  ....   |  .....  |  .....  |  .....  |
| HC015        |  1793   |  28117  |  46.50  |  .....  |
|--------------|---------|---------|---------|---------|
Couldn't get the SSIM2 value, got an error running the script.

Settings used:
- Constant Quant at 6.55
- best profile

Other settings same as in the TMPG file (matrix, dc prec. etc.)
hank315 is offline   Reply With Quote
Old 14th August 2005, 00:19   #6  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
try this new script:
Code:
# --> Video Opening <--

source=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\azerty.d2v",idct=2)
source=Crop(source,4,76,-4,-76)
source=LanczosResize(source,720,320)
source=addborders(source,0,128,0,128)
source=trim(source,0,3210)

video=Mpeg2Source("D:\Mes dossiers\B.A\Harry Potter\qwaerty.d2v",idct=2)
video=trim(video,0,3210)

# --> SSIM analysis <--
SSIM(source,video,"results.csv","D:\Mes dossiers\B.A\Harry Potter\SSIM-MPEG2.log",lumimask=2)

#return video
http://multimediacom.free.fr/Download/CompareYV12.zip
http://multimediacom.free.fr/Download/SSIM-0.24.rar
length problem -> trim last black frame (it's not important with SSIM because lumimasking ponderation)
log problem -> complete directory for log files


and if possible post your m2v file ...
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9

Last edited by Sagittaire; 14th August 2005 at 00:23.
Sagittaire is offline   Reply With Quote
Old 14th August 2005, 00:38   #7  |  Link
SAPSTAR
QMatOP/AutoQMatEnc Author
 
SAPSTAR's Avatar
 
Join Date: Mar 2004
Location: Exiled french guy living in Canada
Posts: 401
Interesting concept but :
- Why only Harry Potter II ?!? Some encoders are good at interlaced movies others no....Some are good at low bitrates others no.....and so on
- You should have proposed several kind of movies, plus several ranges of bitrates.

This test will only give which encoder is the best at encoding some scenes of Harry Potter II at a specific bitrate....
Personnally, I think the test driven by FishMan was really more interesting, he encoded several clips of different movies, then he showed this encoded clips at his customers in his video shop...those persons didn't even know the concept of encoding, and they had to choose which pictures they preferred.

You're saying that it's not based on perceptual results, you should know that the MPEG2 compression is fully based on the human visual perception error....

Anyway, if I have enough time for it, I'll give a try to this test.....

P.S. : Don't say that I'm anti-french...I'm from France too ! (but living in Canada now)
__________________
--- Carpe Diem ---
Quantization Matrices are like life..a mystery for me :)
www.autoqmatenc.com
For Donations : https://www.paypal.com/cgi-bin/websc...harset=UTF%2d8
SAPSTAR is offline   Reply With Quote
Old 14th August 2005, 02:09   #8  |  Link
Kika
Registered User
 
Join Date: Jul 2002
Location: Germany
Posts: 819
@hank315
Do you remember our conversation by PM?
Your Encoder is just great, but it can be better if you implement a compression mode without constand quantization. HCenc is very close to TMPGEnc, and i guess, your routines are able to do much more.
Kika is offline   Reply With Quote
Old 14th August 2005, 02:18   #9  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
dont expect QuEnc to be so great at the moment because of the work being done with ratecontrol. then again its been proved before that metrics are not always reliable but Sagittaire already knows this but they are all he really seems interested in.

http://forum.doom9.org/showthread.php?t=90784
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)
dragongodz is offline   Reply With Quote
Old 14th August 2005, 11:00   #10  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Quote:
Originally Posted by dragongodz
dont expect QuEnc to be so great at the moment because of the work being done with ratecontrol. then again its been proved before that metrics are not always reliable but Sagittaire already knows this but they are all he really seems interested in.

All video codec developper in the world think the opposite ...

Quote:
Originally Posted by Babayaga (Nero/Ateme developper MPEG4 AVC)

PSNR at constant quantizer gives a good idea of the raw efficiency since this is what core encoder try to optimize most of the time.
MPSNR/OPSNR add some hints about rate-control and SSIM (JND metrics or whatever) add clues about adaptive quantization.

A codec which is inferior is those 3 metrics will almost surely be seen as subjectively inferior.

Besides, subjective testing is also very difficult to do and is not always reliable.

Find me only one exemple with this situation:
codec A visualy very better than codec B
Codec B very better for metric than codec A


but anyway this is not the challenge objective : The purpose of this challenge is to determine which is the best codec for the metrics and only for the metrics : this test will not speak about subjective visual quality. If you want subjective visual comparison download sample and compare yourself ...
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9

Last edited by Sagittaire; 14th August 2005 at 11:10.
Sagittaire is offline   Reply With Quote
Old 14th August 2005, 11:15   #11  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,285
Lets not get into a discussion over whether metric tests are valid or not. That's been discussed to death on these forums.

Lets keep this thread on topic as i'm sure people realise that metric tests are not 100% accurate on which codec creates the best output for an individual. The only way for an individual to ascertain that is to test themselves.

Good luck with your tests Sagittaire, Glad to see Hank's encoder doing so well. Maybe this can help us tune QuEnc in the future....

-Nic
Nic is offline   Reply With Quote
Old 14th August 2005, 11:25   #12  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Quote:
Originally Posted by Kika
@hank315
Do you remember our conversation by PM?
Your Encoder is just great, but it can be better if you implement a compression mode without constand quantization. HCenc is very close to TMPGEnc, and i guess, your routines are able to do much more.
multipass is better for target bitrate and quality but make constant quant for MPEG2 is not a bad choice (not the best but not bad): perhabs bframe with light ratio/offest (1.25/1.00) could be a good idea ...
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 14th August 2005, 14:12   #13  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
1) Update with libabcodec core class codec ...

2) Libavcodec done very excellent result. QEnc seem don't use the best possible setting for libavcodec ... perhabs "insame mode" could be good idea for low bitrate. With my setting mencoder done 10 fps on my sempron 3000+.

3) Adaptative quantisation (with or without psy masking) are MPEG2 DVD compliant ? because if I use Adaptative quantisation with mencoder result can be still better.

4) Volonters for CCE and Canopus ... ???
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9

Last edited by Sagittaire; 14th August 2005 at 14:38.
Sagittaire is offline   Reply With Quote
Old 15th August 2005, 00:18   #14  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
Quote:
Lets not get into a discussion over whether metric tests are valid or not. That's been discussed to death on these forums.
sorry Nic, it wasnt meant to be a debate just a warning to the newer members i see posting, and there are quite a few i have seen lately. so this is the last post i will say anyhing about it because as you say it has been talked about many times before.

Quote:
All video codec developper in the world think the opposite
now that is a big call if i ever heard one. lets get Babayaga's meaning correct first.
Quote:
MPSNR/OPSNR add some hints about rate-control and SSIM (JND metrics or whatever) add clues about adaptive quantization.
what this means is they can be useful in development and trying to spot any major problems. it does not mean they will tell you what looks better to everybody. there is a BIG difference.

Quote:
Find me only one exemple with this situation:
i am pretty sure i mentioned in the past major PSNR failure thats mentioned in the massive Rejig thread. that is Makira made some changes to the requant engine and increased PSNR, problem was it also turned the output blocky and bad. so there is a real life example for you. i wont bother to mention all the times people have said they prefer different clips/examples on here. there is so many that people should be able to find them for themselves.
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)
dragongodz is offline   Reply With Quote
Old 15th August 2005, 00:24   #15  |  Link
dragongodz
....
 
dragongodz's Avatar
 
Join Date: May 2002
Location: Australia
Posts: 2,797
Quote:
QEnc seem don't use the best possible setting for libavcodec ... perhabs "insame mode" could be good idea for low bitrate.
QuEnc does have an insane setting. also note that the latest versions of QuEnc dont use libavcodecs ratecontrol for 2 pass because of its bitrate spiking etc.
as i already said, ratecontrol is being worked on in QuEnc.

Quote:
HC015 (lavc?)
HC != lavc.
__________________
Narrator: And of course, with the birth of the artist came the inevitable afterbirth - the critic. (History of the World part 1)
dragongodz is offline   Reply With Quote
Old 16th August 2005, 14:37   #16  |  Link
SAPSTAR
QMatOP/AutoQMatEnc Author
 
SAPSTAR's Avatar
 
Join Date: Mar 2004
Location: Exiled french guy living in Canada
Posts: 401
Results with AQE 0.29.0.5 (to be released this week)

Size : 28242
SSIM : 81.11472561
PSNR : 46.2581

These results were obtained without any tweaking....just by using a regular ECL script leaving everything "standard". I used ECLCreate to generate the ECL file, and I left AQE calculating the matrix by itself.
I can send the mpv file on request.

[EDIT] I forgot to mention, it's a 2 passes encode....

FYI the generated matrix was :
8 14 16 19 22 35 52 62
14 14 19 20 22 33 57 58
16 19 22 22 34 53 60 64
19 19 22 44 52 60 64 67
19 22 37 54 59 63 67 73
22 38 49 59 63 67 73 80
22 54 58 62 65 71 79 88
43 58 63 65 71 79 89 100

16 18 19 21 24 31 39 45
18 19 21 23 25 31 39 43
19 21 24 27 32 38 43 48
21 23 27 37 42 44 48 51
24 25 32 43 48 49 51 52
29 32 39 44 49 51 52 54
35 39 43 49 51 52 56 56
42 43 48 51 52 54 56 58
__________________
--- Carpe Diem ---
Quantization Matrices are like life..a mystery for me :)
www.autoqmatenc.com
For Donations : https://www.paypal.com/cgi-bin/websc...harset=UTF%2d8

Last edited by SAPSTAR; 16th August 2005 at 15:10.
SAPSTAR is offline   Reply With Quote
Old 11th March 2006, 14:50   #17  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
update with mencoder 22.02.06

- add new adaptative bframe strategy
- add new bframe refine
- add RC tweak

mencoder progress always ...
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 16th August 2005, 04:42   #18  |  Link
Audionut
Registered User
 
Join Date: Nov 2003
Posts: 1,281
HC enc 015A beta

bitrate=1801
size=28252
psnr=46.244
ssim2=81.538

profile=best
dc precision=9
Custom Matrix
Audionut is offline   Reply With Quote
Old 16th August 2005, 08:26   #19  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
@ Audionut

worst PSNR but better SSIM ... SSIM is IMO the best metric.

anybody for CCE and Canopus Pro Codec ... ???
__________________
Le Sagittaire ... ;-)

1- Ateme AVC or x264
2- VP7 or RV10 only for anime
3- XviD, DivX or WMV9
Sagittaire is offline   Reply With Quote
Old 16th August 2005, 09:09   #20  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,285
@Sagittaire: No you're right it probably won't change the hierarchy. But it still makes no sense to me why were doing it that way.
Nic is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.