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 > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th September 2003, 00:19   #1  |  Link
karl_lillevold
Moderator
 
karl_lillevold's Avatar
 
Join Date: Oct 2002
Location: Seattle
Posts: 1,584
Undocumented RV9 tweaks

These new codecProperties are available in Producer Milestone 6, unless someone broke them since I added them a while back.

patternAdaptivity: 0, 1, or 3 (2 does not work correctly). Default adaptive, when property is not present.

This parameter sets the number of discardable frames to be encoded in between each non-discardable (P or I) frame.

scalingFactor: 0 - 199. Default adaptive, when property is not present.

This parameter sets the quantization scaling factor for the discardable frames, compared to the P/I frames. 0 means same quantization.

example usage (just like the encoderComplexity for EHQ). Include the following in the <videoStream> section of the audience:
Code:
<codecProperties type="bag">
	<patternAdaptivity type="uint">1</patternAdaptivity>
	<scalingFactor type="uint">50</scalingFactor>
</codecProperties>
Verify how they work with the calcPSNR feature and its resulting rv9log.txt file. No warranties and no support, except what I find time to reply to here.

When these properties are not present, the encoder chooses these parameters adaptively while encoding. This adaptive mode is the recommended mode, but as always, adaptivity may not be perfect for all content and everyone's preferences. If you find that you like a fixed setting, over the default adaptivitiy, please let us know.

There are corresponding reg key over-rides as well, just like for EHQ:

--->8---

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\RealNetworks\RV9]
"patternAdaptivity"=dword:00000001
"scalingFactor"=dword:00000032

--->8---
__________________
This information is provided "AS IS" with no warranties, grants no rights, and reflects my personal opinion.

Last edited by karl_lillevold; 30th October 2003 at 00:21.
karl_lillevold is offline   Reply With Quote
Old 4th September 2003, 01:57   #2  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
can you explain them a little more?

thanks
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 5th September 2003, 19:24   #3  |  Link
karl_lillevold
Moderator
 
karl_lillevold's Avatar
 
Join Date: Oct 2002
Location: Seattle
Posts: 1,584
@sirber: done. see first post. I had hoped someone else would have figured it out by now
__________________
This information is provided "AS IS" with no warranties, grants no rights, and reflects my personal opinion.
karl_lillevold is offline   Reply With Quote
Old 5th September 2003, 20:04   #4  |  Link
slavickas
I'm Shpongled
 
slavickas's Avatar
 
Join Date: Nov 2001
Location: Lithuania
Posts: 303
is it simply b frames parameters? or my english very adaptively discardable (tm) ??
slavickas is offline   Reply With Quote
Old 5th September 2003, 20:04   #5  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
patternAdaptivity and scalingFactor configure bframe ... !!?
__________________
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 5th September 2003, 22:27   #6  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
I think discardable frames are b-frames. You can't go beyon 3 coz it's useless, but I think the encoder can take it if karl codes well

[edit]

Yes, it's about B-Frames.
__________________
Detritus Software

Last edited by Sirber; 5th September 2003 at 22:45.
Sirber is offline   Reply With Quote
Old 7th September 2003, 14:19   #7  |  Link
ChristianHJW
Matroska Team
 
ChristianHJW's Avatar
 
Join Date: Nov 2002
Location: Bavaria - Germany
Posts: 1,341
Karl, would this require to update the matrix trailer sample i received from you, to present the latest RV9 quality ? We dont wnat to be behind actual technology when finally launching them ( hopefully soon, have to talk to Cruncher about this, i was away more or less 4 weeks now ) ...
ChristianHJW is offline   Reply With Quote
Old 8th September 2003, 00:28   #8  |  Link
karl_lillevold
Moderator
 
karl_lillevold's Avatar
 
Join Date: Oct 2002
Location: Seattle
Posts: 1,584
These features have been in use since the launch of RV9, they have always been adaptive. I just now made it possible to set the parameters manually. There would not be much improvement for the trailer encoding, I think. (However, I still would like to re-encode with the motion adaptive pre-filter that Sagittaire used to encode the great Confidence trailer a while back).

I do not really have any advice to provide how to set these parameters to increase video quality. The only case I know of where adaptive does not work all that great is for animation content with duplicated frames (with or without the dup frame dropper). For such content, I have seen PSNR increase of 0.5 dB or more from setting the patternAdaptivity (number of 'discardable' frames) to 1. So that's my only advice for now:
use patternAdaptivity=1 (or perhaps even 0) for animation content with less than full framerate.

Other recommendations to be found and posted by you
__________________
This information is provided "AS IS" with no warranties, grants no rights, and reflects my personal opinion.
karl_lillevold is offline   Reply With Quote
Old 8th September 2003, 00:50   #9  |  Link
Sagittaire
Testeur de codecs
 
Sagittaire's Avatar
 
Join Date: May 2003
Location: France
Posts: 2,484
Here is a very high quality anamorphic demo in RV9/RA8/MKV in 850x360 ...
http://jfl1974.free.fr/Video/MatrixII.rar

Here is a LOTRII demo with WMV9/WMA9/SSA/MKV with WMA9 5.1 132 Kbps ...
http://jfl1974.free.fr/Video/Matroska-WM9.rar
__________________
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 8th September 2003, 08:26   #10  |  Link
Kaiousama
Italian Doom9 Staff
 
Kaiousama's Avatar
 
Join Date: Apr 2002
Location: Italy
Posts: 219
Quote:
Other recommendations to be found and posted by you
Tested last evening:

patternAdaptivity = 1 gives also to me around 0.5 db of average psnr gaining!!
(readed from rv9log.txt, tested on Animatrix - World Record)

patternAdaptivity = 0 or 3 results in a psnr loss compared to standard adaptive method
I'll test on other clips (this one was a very clean source) to see if this gaining is really generalized or if it was an exception (karl: what/how was your test's source clip?).

I'd like to point out a strange behaviour: from my last evening tests i've obtained lesser psnr values for 2pass encodings than for 1 pass encodings (if you need i can attach all the logs, let me know), is it possible that 2 pass gives a worser result or maybe psnr is not the right metrics to judge the 2pass encoding improvements?
__________________
"All that we see or seem is but a dream within a dream" E.A.Poe

Last edited by Kaiousama; 8th September 2003 at 08:43.
Kaiousama is offline   Reply With Quote
Old 8th September 2003, 15:51   #11  |  Link
karl_lillevold
Moderator
 
karl_lillevold's Avatar
 
Join Date: Oct 2002
Location: Seattle
Posts: 1,584
@Kaiousama: The source for my animation test (+0.5 dB) with patternAdaptivity=1, was also very clean. The main reason for this behavior is that the adaptivity is somewhat based on the amount of motion. Duplicated frames have no motion, and patternAdaptivity usually ends up being 3. However, our 'discardable' frames are not perfectly optimized for duplicated frames in-between non-dupes (very non-linear motion), which is also why the dup frame dropper gives an improvement.

1-pass can result in higher PSNR than 2-pass, in fact for short clips, where it does not run out of MSL buffer space, rather dramatically higher quality. In most cases this is because it has spent too many bits, resulting in an oversized file.
__________________
This information is provided "AS IS" with no warranties, grants no rights, and reflects my personal opinion.
karl_lillevold is offline   Reply With Quote
Old 8th September 2003, 18:18   #12  |  Link
deXtoRious
Registered User
 
Join Date: Feb 2003
Location: Riga, Latvia
Posts: 192
Sagittaire

I'm sorry for the offtopic question, but how much free webspace do you get on free.fr?
deXtoRious is offline   Reply With Quote
Old 8th September 2003, 18:29   #13  |  Link
iwod
Registered User
 
Join Date: Apr 2002
Posts: 756
Quote:
Originally posted by karl_lillevold
@Kaiousama: The source for my animation test (+0.5 dB) with patternAdaptivity=1, was also very clean. The main reason for this behavior is that the adaptivity is somewhat based on the amount of motion. Duplicated frames have no motion, and patternAdaptivity usually ends up being 3. However, our 'discardable' frames are not perfectly optimized for duplicated frames in-between non-dupes (very non-linear motion), which is also why the dup frame dropper gives an improvement.

1-pass can result in higher PSNR than 2-pass, in fact for short clips, where it does not run out of MSL buffer space, rather dramatically higher quality. In most cases this is because it has spent too many bits, resulting in an oversized file.
will the improved 2 pass VBR improve current situation??

off topic..... what are you currently working on Karl in the helix project.........?? And how are you?? ( as i have notice you don't seems to be online as often... )
iwod is offline   Reply With Quote
Old 8th September 2003, 19:43   #14  |  Link
Kaiousama
Italian Doom9 Staff
 
Kaiousama's Avatar
 
Join Date: Apr 2002
Location: Italy
Posts: 219
@Karl:
I've tested it on another clip (a noised 24 minutes source this time) with the result of a 0.56 boost in psnr
It seems that patternAdaptivity = 1 is a very good choice for anime! thanks for this new useful parameter.
I also have two feature requests and an idea for you:

Feature requests:

- It would be very useful if the user may optionally specify (like in Nandub's SBC or Xvid) the initial and/or ending credits interval in order to apply them a lower bitrate.

- What about exposing to the user a parameter to control how much the bitrate will be assigned to slow motion sequences and how much to fast motion ones?

Idea (for anime material):

One of the differences between animation and live films is that an animation frame is not as well complex as the reality, there are less particulars and bigger color-uniform parts; but most of all the animation frame is well delimited by huge edges compared to the reality.

That produces the fact that whatching an anime frame the eye pay more attention to the few important edges, where in a live film's frame the eye has to elaborate too many edges to extract the essential ones (that's also because reality is not drawn with bigger edges for important things like in anime )

To properly handle this situation it would be useful if the encoder applies an edge detection mask to the frame before compressing it; and when it's time to apply the compression quantitizer for each block, the encoder could check if the block belongs to an edge detected by the mask and in positive case apply more bitrate on that block. This will results in a compressed clip where bitrate is not assigned only by motion amount but also by edge presence (even in static sequences)

I don't know if producer actually works in this way, please tell me what do you think about.
__________________
"All that we see or seem is but a dream within a dream" E.A.Poe

Last edited by Kaiousama; 8th September 2003 at 20:53.
Kaiousama is offline   Reply With Quote
Old 8th September 2003, 20:07   #15  |  Link
RadicalEd
Registered User
 
Join Date: Dec 2001
Posts: 987
Quote:
Originally posted by Kaiousama
It would be very useful if the user may optionally specify (like in Nandub's SBC or Xvid) the initial and/or ending credits interval in order to apply them a lower bitrate.
Alternatively, it wouldn't be too hard to implement that into a gui by using different encoding sessions and joining the files with rmeditor.
RadicalEd is offline   Reply With Quote
Old 9th September 2003, 01:39   #16  |  Link
Kurosu
Registered User
 
Join Date: Sep 2002
Location: France
Posts: 432
Quote:
Originally posted by deXtoRious
Sagittaire

I'm sorry for the offtopic question, but how much free webspace do you get on free.fr?
5x100MB maximum, for free. But I wonder how they handle sites with high bandwidth use and unregular content (like video sequences, audio files). You have PHP4 on it AFAIK.

Still AFAIK (), you have to be french to get a webspace or have a french person giving out one (child) account.
Kurosu is offline   Reply With Quote
Old 9th September 2003, 06:04   #17  |  Link
karl_lillevold
Moderator
 
karl_lillevold's Avatar
 
Join Date: Oct 2002
Location: Seattle
Posts: 1,584
@Kaiousama: Glad to hear the custom parameter is working so well for animation.

Thanks for your suggestions and ideas. Regarding your feature request about different bitrates for different parts of an encode. This is a really useful feature, and I have seen it used with success in AutoRV9. It belongs either in a GUI or Producer, but I don't really know where it fits best in Producer, cmd line or job file, and either does not fit really well. RadicalEd is right about how it fits nicely in a GUI where you can set up encoding sessions.

A parameter to float bits between high and low motion areas would be a suitable codec parameter though. I will add it to the list of improvements to look into.

Regarding edge encoding; RV9 already does it pretty well, does it not, but your suggestion is a sound one. However, smooth gradients also need their fair share of attention
__________________
This information is provided "AS IS" with no warranties, grants no rights, and reflects my personal opinion.
karl_lillevold is offline   Reply With Quote
Old 9th September 2003, 08:18   #18  |  Link
Kaiousama
Italian Doom9 Staff
 
Kaiousama's Avatar
 
Join Date: Apr 2002
Location: Italy
Posts: 219
Quote:
Regarding your feature request about different bitrates for different parts of an encode. This is a really useful feature, and I have seen it used with success in AutoRV9. It belongs either in a GUI or Producer, but I don't really know where it fits best in Producer, cmd line or job file, and either does not fit really well.
I think job file would be good to place this option, in a way like this:

Code:
<input xsi:type="avFileInput"> 
	<filename type="string">D:\Hack_Liminality\Hack_01.avs</filename> 
	<StartCredits>
		<Begin Type="unit">0</Begin>
		<End Type="unit">1560</End>
		<Bitrate Type="unit">400000</Bitrate>
	</StartCredits>
	<EndCredits>
		<Begin Type="unit">23500</Begin>
		<End Type="unit">24900</End>
		<Bitrate Type="unit">400000</Bitrate>
	</EndCredists>
</input>
I think doing that from the encoder is the smartest way (even because in this way i can always reproduce the encoding session with the job file backup only), but if not possible the gui solution is still usable.
__________________
"All that we see or seem is but a dream within a dream" E.A.Poe

Last edited by Kaiousama; 9th September 2003 at 09:47.
Kaiousama is offline   Reply With Quote
Old 9th September 2003, 12:25   #19  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
I admit that way it would be easyer then create 2 RMVB and remux them later using wierd and undocumented commandline options
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 9th September 2003, 20:49   #20  |  Link
karl_lillevold
Moderator
 
karl_lillevold's Avatar
 
Join Date: Oct 2002
Location: Seattle
Posts: 1,584
@Kaiousama: that's a nice starting point. The problem is bitrate is defined in the audience, and the audience applies to each output, not the input. I am sure it's possible to work something out, but it's a rather significant change from the current thinking, where Producer is intended for both Live and File-To-File. Maybe a feature for Producer 9.3. If you would like to get feedback directly from the Producer team, please enter a feature request here:
https://helix-dna.helixcommunity.org...e_type=FEATURE
Feel free to include your sample XML code as an example.
__________________
This information is provided "AS IS" with no warranties, grants no rights, and reflects my personal opinion.
karl_lillevold 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 11:39.


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