PDA

View Full Version : RV9-EHQ with fast 1st pass


karl_lillevold
3rd December 2003, 20:06
Here is another much requested improvement: speed up RV9-EHQ encoding. I have been saying it already is as fast as possible without any sacrifices to quality. However, this is when doing the actual encoding, and this change only affects the 1st pass of a 2-pass encode.

erv4_xVBR_x1stPass_120203.zip (http://www.lillevold.com/files/erv4_xVBR_x1stPass_120203.zip)

The above DLL allows the 1st pass of a 2-pass RV9-EHQ encode to be run at any complexity. Specifically, I recommend running it at 65, i.e. medium complexity. Since the output of the 1st pass is a list of recommended QP values to use for the 2nd pass, in this encoder these are automatically adjusted to accommodate the higher compression efficiency in the 2nd pass. The QP adjustment is just an estimate, but since having the exact value is not very critical, this appears to work very well, generally with less than 0.05 dB loss in average PSNR.

This encoder DLL is also completely compiled with the Intel Compiler 7.1, increasing the DLL size a little, but gains up to 5% overall encoding speed on top of the 1st pass speed-up. All CPU intensive modules are already fully ASM optimized, so this improvement is the result of better inlining and some loop unrolling by the Intel Compiler. It also includes Prescott optimized code from Intel, but no Prescott CPUs are yet available.

How to enable
1 ) Replace erv4.dll in producer's codecs directory. Milestone 7 is recommended.
2a) Enter this registry key (http://www.lillevold.com/files/RV9-firstPassComplexity.reg)

===>8===
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\RealNetworks\RV9]
"firstPassComplexity"=dword:00000041
===>8===

or

2b) use this option in the codecProperties section of the audience.

<codecProperties type="bag">
<firstPassComplexity type="uint">65</firstPassComplexity>
</codecProperties>


That's it. If your 2-pass encodes took 24 hours before, they will now be 12 + (12/4) = 15 hours [AMD example *)]. On a 2.8 GHz P4, a previous 12 hour encode will now take 6 + (6/3) = 8 hours.

*) on an AMD without SSE2, EHQ is around 4X slower than medium complexity. On a P4 with SSE2, EHQ is ~3X slower than medium.

Sirber
3rd December 2003, 20:20
going to add it to RealAnime :D

ookzDVD
4th December 2003, 02:04
@karl,

Thank you for your great job :)
RV9 is still the best codec in my heart! at least for me :)

karl_lillevold
4th December 2003, 02:13
two questions that were asked elsewhere:

The firstPassComplexity parameter affects only the 1st pass in a 2-pass encode. It does not affect 1-pass encodes, for instance 1-pass Constant Quality.

The default setting is still to encode both passes with the selected encoding complexity. The codecProperties or the reg key method are needed to enable faster 1st pass. This may change though, as I am considering making 65 the default 1st pass speed.

@ookzDVD : thanks!

Sirber
4th December 2003, 03:23
stop considering and do it :mad: :D

On my 2000+, the first pass @ 65 gives me between 15 and 21 FPS in FFDshow. :cool:

[edit]

15-30 FPS

tiki4
4th December 2003, 13:01
Would this dll also work with AutoRV9 bundled producer M6? I used the published xVBR version with it and had no problems so far.

Thanks for this great codec.

tiki4

off-topic:

Got it, the magical 666 posts :D

Sirber
4th December 2003, 14:07
you'll have to stop posting now ;)

[edit]

I've got quality drop with animes at VLB. At 300kbps (including 32kbps voice), I get more buring. I'll post screens.

[edit2]

Sorry, the bluring was caused by the bad squary MPEG4 source. :devil:

karl_lillevold
4th December 2003, 19:05
Originally posted by tiki4
Would this dll also work with AutoRV9 bundled producer M6? I used the published xVBR version with it and had no problems so far.
Yes, just replace the DLL the same way, and use the reg key to set firstPassComplexity, since AutoRV9 does not yet support this setting in the audience file. Producer Milestone 6 works just as well as 7.

slavickas
4th December 2003, 21:45
Originally posted by karl_lillevold
Yes, just replace the DLL the same way, and use the reg key to set firstPassComplexity, since AutoRV9 does not yet support this setting in the audience file. Producer Milestone 6 works just as well as 7.

Karl, have u fixed "bug" when first pass file is not specified it's not deleted anyway, so doing normal 2pass i get bunch of files with "interesting" :p names

Sirber
4th December 2003, 23:37
I still get them. It's good reading before going to sleep ;)

karl_lillevold
5th December 2003, 00:31
i am sorry, i never considered this a bug, but rather a research and development feature. If I had known it was a problem, I would have taken it out. It will be removed in whatever is the next update.

Until then, if you are running so many encodes these files are filling up your hard-drive, please feel free to run the following script nightly , or at the end of every batch encode:

find . -name "ENC*.rva" -print | xargs rm -f

:D

Sirber
5th December 2003, 00:45
is "find" a linux command? :eek:

ookzDVD
5th December 2003, 02:41
@karl,

Is there anyway to force the Producer (Milestone >5)
while use the 2-pass always use 2-pass-ehq,
with the fast first pass and second pass always ehq=80 ?
and ignore all the audience setting for the ehq ?

thank you.

karl_lillevold
5th December 2003, 03:23
@ookzDVD: I am not quite sure I understand the question.. The reg keys will always over-ride whatever anything else specifies, incl. the audience files. So with encoderComplexity and firstPassComplexity reg keys you can set the complexities to whatever you would like, for both passes. For example, to use 65 for 1st pass and 80 for 2nd pass, in a 2-pass encode, the following keys are needed. If you want to use 80 for both passes, you can set both keys to 80 (decimal).

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\RealNetworks\RV9]
"firstPassComplexity"=dword:00000041
"encoderComplexity"=dword:00000050

ookzDVD
5th December 2003, 03:31
@karl,

thank you for your reply.

ps, which milestone your recommend to use (with autorv9) ?

thank you.

karl_lillevold
5th December 2003, 03:39
for file-to-file encoding I don't think much changed from Milestone 6 to 7, so either of these should be fine. Then just drop in my latest encoder DLL (first post).

tiki4
5th December 2003, 10:24
Thanks Karl. I'll have to test it now.

tiki4