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

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th December 2008, 23:58   #1  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
HCenc 024

Update 10-sep-2010
For the final HC024: http://hank315.nl

----------------------------------------------------

A beta of HCenc 024 can be downloaded here

For now it's the encoder only so you have to edit the hc.ini file manually.
New features:

*1PASS
This command enables 1 pass VBR encoding.
1 pass can be used for clips > 1000 frames, smaller clips are done using 2 pass.

*CHROMAFORMAT 420
*CHROMAFORMAT 422
Output can be 420 (default) or 422 color space,
for 422 color space YUY2 input is required, for 420 input can be YV12 or YUY2

*INTRAVLC 0
*INTRAVLC 1
Chooses the VLC table for intra blocks: 0 = table14, 1 = table15. (non-intra blocks are always table14)
Default is *INTRAVLC 0.
In general *INTRAVLC 0 is better for low bitrates, *INTRAVLC 1 for high bitrates.


Notes:
- The 1 pass is really *very* beta.
- HCenc now accepts YUY2 input, for 420 output the chroma is sub-sampled progressively, in the final release it can also be done interlaced.
- Some bugs are solved, probably some new introduced...

Many thanks to manolito and Darksoul71 for the 1 pass code discussion/testing
__________________
HCenc at: http://hank315.nl

Last edited by hank315; 10th September 2010 at 20:31. Reason: additional info
hank315 is offline   Reply With Quote
Old 30th December 2008, 00:29   #2  |  Link
Video Dude
Senior Member
 
Join Date: Apr 2004
Posts: 1,053


One pass and YUY2 input are great new features.
Video Dude is offline   Reply With Quote
Old 30th December 2008, 03:21   #3  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,699
Yes, indeed. Thanks a lot for your hard work there Hank!
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 30th December 2008, 13:46   #4  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
Thanks for this new beta. As I said you during my preliminary testing some weeks ago, 1-pass VBR is really impressive: accurate and high quality. My only concern was the "small" predictive routine timings: faster than a standard 1st pass but slower than a 10% OPV (constant quantization).

Another question: when you say In general *INTRAVLC 0 is better for low bitrates, *INTRAVLC 1 for high bitrates what is the limit between high and low bitrates? I mean, high bitrates for DVD-MPEG2 could be considered low bitrates for BD-MPEG2...

Thanks again for your hard and great work.



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 30th December 2008, 21:29   #5  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Also thanks very much for this version. This one-pass mode is so good, I have already abandoned 2-pass VBR altogether...

The only issues I found are the same as in the older beta: A slight stability issue when exiting the encoder during the second stage of the sampling phase (sometimes HC just freezes), and the command line parameters "-1pass" and "-2pass" are not implemented yet.

Quote:
Originally Posted by MrC View Post
My only concern was the "small" predictive routine timings: faster than a standard 1st pass but slower than a 10% OPV (constant quantization).
I cannot confirm these findings on my machine (single core CPU). My last encode was a 2 hour movie. Sampling took a little under 12 minutes, and the actual encode took 8 hours and 10 minutes. This translates to about 2.5% for the sampling phase which is excellent in my book. Remember that for the normal prediction phase you need at least 4 to 5 sample passes to get a useable result.

I did notice a slight speed difference between the two beta versions. Generally the older beta was a little faster than the current one. Not only during the sample phase, the main difference was during the actual encode where the current beta was about 10% slower than the older one.

A happy new year to everyone,

Cheers
manolito
manolito is offline   Reply With Quote
Old 31st December 2008, 08:45   #6  |  Link
blutach
Country Member
 
blutach's Avatar
 
Join Date: Sep 2004
Location: is everything!
Posts: 6,499
Thanks Hank and Happy New Year!

Regards
__________________
Les

Only use genuine Verbatim or Taiyo Yuden media.
blutach is offline   Reply With Quote
Old 31st December 2008, 14:17   #7  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Here's a feature suggestion: make an "auto" intraVLC option (like direct auto in x264) that simply tries both during the first pass and then chooses the best for the second.

If that costs too much speed, just take a random sampling of intra blocks (maybe 1% of them) during the first pass to try both on.
Dark Shikari is offline   Reply With Quote
Old 31st December 2008, 15:15   #8  |  Link
MrC
AVStoDVD Dev
 
MrC's Avatar
 
Join Date: Apr 2006
Location: Italy
Posts: 1,302
These were my testings in early december, comparing current AVStoDVD 1-pass OPV routine (5% CQ prediction) with new HCenc 1-pass VBR (CPU used is a good old fashioned AMD Athlon XP 1800+):

Sample 1 (short time and bad quality clip):
Code:
Video: E:\Movies\Test\video.flv
Info: Sorenson H263 - 328 kbps - 320x152 - DAR 2.105 - 24 fps -  - 2:29 minutes - 3585 frames
Code:
*MAXBITRATE 9000
*BITRATE 4199
*1PASS
*PROFILE BEST
*ASPECT 16:9
*PROGRESSIVE
*BIAS 40
*DC_PREC 9
*MATRIX MPEG
*AQ 1
*LUMGAIN 0
OPV oversize: +31%
OPV tot encoding time: 242 s
VBR oversize: +17%
VBR tot encoding time: 243 s

Sample 2 (medium time and good quality clip):
Code:
Video: E:\Movies\video.avi
Info: XviD - 2000 kbps - 720x576 - DAR 1.25 - 25 fps - PPF - 12:11 minutes - 18283 frames
Code:
*MAXBITRATE 9000
*BITRATE 4398
*1PASS
*PROFILE BEST
*ASPECT 4:3
*PROGRESSIVE
*BIAS 40
*DC_PREC 9
*MATRIX MPEG
*AQ 1
*LUMGAIN 0
OPV downsize: -4%
OPV tot encoding time: 1427 s
VBR downsize: 0%
VBR tot encoding time: 1800 s

Surely encoding time depends from a lot of factors (source clip type, CQ prediction passes number, etc.), but I was surprised that new HCenc sampling pass has been a little "long" in sample #2.

I have to admit that I did not make any further tests with more recent betas. I will do.

BTW, I repeat, 1-pass is really impressive for both quality and size accuracy. When hank will be confident enough about it, I will surely adopt it into AVStoDVD.



Bye
__________________
MrC

AVStoDVD Homepage
AVStoDVD @ Doom9 Forum
MrC is offline   Reply With Quote
Old 31st December 2008, 21:36   #9  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
Quote:
Originally Posted by MrC
My only concern was the "small" predictive routine timings: faster than a standard 1st pass but slower than a 10% OPV (constant quantization).
The prediction stage isn't multi-threaded ATM, in the final release it will be multi-threaded so higher speeds can be expected.

Quote:
Originally Posted by manolito
The only issues I found are the same as in the older beta: A slight stability issue when exiting the encoder during the second stage of the sampling phase (sometimes HC just freezes), and the command line parameters "-1pass" and "-2pass" are not implemented yet.
ATM the whole 1pass VBR prediction is only one thread with minimal error handling, still beta
Command Line parameters -1pass and -2pass are implemented but I never tested it...

Quote:
Originally Posted by Dark Shikari
Here's a feature suggestion: make an "auto" intraVLC option (like direct auto in x264) that simply tries both during the first pass and then chooses the best for the second.

If that costs too much speed, just take a random sampling of intra blocks (maybe 1% of them) during the first pass to try both on.
I also think it's needed to do both because there's no way to predict which VLC is optimal, a complete frame has to be done twice to see which table produces the smallest code.
But probably it's better to do it in the final pass only because the optimum highly depends on the fill rate (runs/levels) of the intra 8x8 blocks.
The first pass is always done with Q=4, Q in the last pass depends on chosen bitrate etc. so there can be a large difference in the nr of runs for pass1 vs pass2.


For those interested, some technical info:
MPEG2 has 2 options for VLC (Variable Length Coding) of intra blocks, it can use 2 tables for coding the DCT coefficients
If the fill rate per block is high, VLC using table15 is more efficient but the overhead is larger because the EOB (EndOfBlock) code is 4 bits for table15 and only 2 bits for table14.
An optimal encode can be done because the VLC table can be changed every frame, it's marked by a flag in the picture extension header.
__________________
HCenc at: http://hank315.nl
hank315 is offline   Reply With Quote
Old 31st December 2008, 21:39   #10  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by hank315 View Post
I also think it's needed to do both because there's no way to predict which VLC is optimal, a complete frame has to be done twice to see which table produces the smallest code.
But probably it's better to do it in the final pass only because the optimum highly depends on the fill rate (runs/levels) of the intra 8x8 blocks.
The first pass is always done with Q=4, Q in the last pass depends on chosen bitrate etc. so there can be a large difference in the nr of runs for pass1 vs pass2.
Then fix your first pass to be target-bitrate as well. It should give ratecontrol benefits in the second pass to have a first pass relatively near the bitrate of the second pass anyways, especially for lower bitrate encodes.
Quote:
Originally Posted by hank315 View Post
For those interested, some technical info:
MPEG2 has 2 options for VLC (Variable Length Coding) of intra blocks, it can use 2 tables for coding the DCT coefficients
If the fill rate per block is high, VLC using table15 is more efficient but the overhead is larger because the EOB (EndOfBlock) code is 4 bits for table15 and only 2 bits for table14.
An optimal encode can be done because the VLC table can be changed every frame, it's marked by a flag in the picture extension header.
In which case this really is exactly like --direct auto in x264, as direct mode is a flag that can be changed per-frame as well.

You could borrow x264's method of doing it in 1pass--simply keep a moving average of the mode scores and pick whatever one has been best in recent frames. For intra VLC, this should be even more accurate than for direct auto in x264.

Last edited by Dark Shikari; 31st December 2008 at 21:41.
Dark Shikari is offline   Reply With Quote
Old 1st January 2009, 01:13   #11  |  Link
Smetvid
Registered User
 
Join Date: May 2006
Posts: 18
WOW! thanks a lot for the 4:2:2 encoding. I used to use Main Concept for 4:2:2 material for editing masters and recently I started using FFMPEG but that was kind of a pain. For me HCenc has been an awesome encoder but I was always missing the option of encoding 4:2:2 material. I encode a lot of 150 mbit 4:2:2 I frame only material for HD editing systems.

I will try it out this weekend but I'm sure HCenc will now be able to do everything I ever wanted in a encoder.
Smetvid is offline   Reply With Quote
Old 1st January 2009, 01:35   #12  |  Link
Chumbo
Registered User
 
Chumbo's Avatar
 
Join Date: Feb 2005
Posts: 585
I tested the issue reported in the HCEnc 023 thread and it still crashes. The issue I'm referring to is referenced here, here and here.
__________________
Chumbo

Last edited by Chumbo; 1st January 2009 at 05:11. Reason: removed full quotes and replaced with reference links
Chumbo is offline   Reply With Quote
Old 1st January 2009, 02:18   #13  |  Link
Trahald
Wewkiee
 
Trahald's Avatar
 
Join Date: Feb 2002
Location: kashyyyk
Posts: 2,269
@Chumbo
You cant delete them since people have replied to it so there would be a confusing gap. You should edit your post above to only have the links to the original posts. not full quotes.
__________________
...yeah...but...why on earth would I compare apples with apples?
Trahald is offline   Reply With Quote
Old 1st January 2009, 03:07   #14  |  Link
Gromozeka
Registered User
 
Join Date: Jan 2007
Posts: 151
hank315
Its the great coder
May be you add trellis quantization and GOP>36?
Gromozeka is offline   Reply With Quote
Old 1st January 2009, 05:12   #15  |  Link
Chumbo
Registered User
 
Chumbo's Avatar
 
Join Date: Feb 2005
Posts: 585
Quote:
Originally Posted by Trahald View Post
@Chumbo
You cant delete them since people have replied to it so there would be a confusing gap. You should edit your post above to only have the links to the original posts. not full quotes.
Thank you. I updated the post above.
__________________
Chumbo
Chumbo is offline   Reply With Quote
Old 1st January 2009, 17:08   #16  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Command Line parameters -1pass and -2pass are implemented but I never tested it...
Just retested both beta versions I have - these command line parameters are ignored...

Cheers
manolito
manolito is offline   Reply With Quote
Old 3rd January 2009, 21:53   #17  |  Link
hank315
HCenc author
 
Join Date: Nov 2003
Location: Netherlands
Posts: 570
@manolito
OK, will check it out, will be fixed in the final 024 release.
Thanks for the report...
__________________
HCenc at: http://hank315.nl
hank315 is offline   Reply With Quote
Old 9th January 2009, 14:07   #18  |  Link
fjhdavid
Registered User
 
Join Date: Nov 2002
Posts: 220
Dear Hank, (I already post this message in the HC encoder thread, but I think it is better here)

as you maybe read in the DVD-RB forum, I found that DVD-RB with HC-encoder scaled better with dualcore than with quadcore (my dualcore is around 20% speeder than my quadcore, both having same frequency and I am using multiple encoder (2) and (4) setting in DVD-RB)

is it possible to improve HC encoder in this way? (but maybe it is inherent to the processor architecture)?

Last edited by fjhdavid; 9th January 2009 at 14:10.
fjhdavid is offline   Reply With Quote
Old 10th January 2009, 23:35   #19  |  Link
Fishman0919
FishmanMod Android Dev
 
Fishman0919's Avatar
 
Join Date: Apr 2004
Location: Somewhere else, maybe Arizona Bay
Posts: 1,143
Quote:
Originally Posted by fjhdavid View Post
Dear Hank, (I already post this message in the HC encoder thread, but I think it is better here)

as you maybe read in the DVD-RB forum, I found that DVD-RB with HC-encoder scaled better with dualcore than with quadcore (my dualcore is around 20% speeder than my quadcore, both having same frequency and I am using multiple encoder (2) and (4) setting in DVD-RB)

is it possible to improve HC encoder in this way? (but maybe it is inherent to the processor architecture)?

My quadcore is much faster then my dualcore with HC and DVD-RB.

My AMD Athlon 64 X2 5400+ 2.8GHz dualcore takes about 50-55 mins to encode The Hulk DVD Full disc.

My AMD Phenom 9950 BLACK EDITION 2.6GHz takes about 30 min's.
__________________
"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 12th January 2009, 18:26   #20  |  Link
fjhdavid
Registered User
 
Join Date: Nov 2002
Posts: 220
my laptop is an intel dual core2 duo 2.1Ghz (45nm) and typical speed with my script is : 11fps (multiple encoder(2))
my PC is an intel quad core2 duo 2.5Ghz (45nm) and typical speed with my script is : 8.5fps (multiple encoder(4))

as you can see and if you take into account speed processor, it is nearly 35% less for my quadcore !

and if I use only 2 core with my quad, I still have 8.5fps !

and seems that my quad is waiting something ...both computers are under window Vista and have 4GB RAM with big hardrive and no other software like antispy...

I use also "lossless file" and "best" settings for HC encoder 0.23

PS: I tested HC encoder 0.24 beta and it is the same results and problem

Last edited by fjhdavid; 12th January 2009 at 18:28.
fjhdavid is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:35.


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