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-4 ASP

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st August 2002, 21:56   #1  |  Link
Psymaster
Registered User
 
Join Date: Jul 2002
Location: Greece
Posts: 84
RC averaging period

I was browsing the divx.com forums and I came upon this .

What do you people say about the rc averaging period? Gej suggests putting it at half the size of the movie. But is it important? Why is the default so low? These people seem to consider it very important. Has anyone tried it?

And why half of the vid's length?
Psymaster is offline   Reply With Quote
Old 1st September 2002, 03:54   #2  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,119
Hi-

It seems to say how many frames ahead the encoder can look to figure out how best to average out the overflows. Doom9 has this to say about it:
Quote:
Rate control averaging period: How many frames the codec will look at the determine the bitrate of the frame to encode. If previous frames have used much bitrate the codec has to average that by giving upcoming frames less bitrate so it can keep the bitrate you set. The default 2000 seems a pretty reasonable value, but you can experiment with higher setting and you may find that they give better results. Setting it higher will decrease the ability of the encoder to adapt to low/fast motion scene changes and you may not get a predictable size anymore.
I've been leaving it at default, but based on what I've been reading, I think setting it for half the movie may result in slightly better quality. I expect it will slow down the encoding a bit though. But maybe there are some people around here that have experimented with it and can chime in.
manono is offline   Reply With Quote
Old 1st September 2002, 08:12   #3  |  Link
Psymaster
Registered User
 
Join Date: Jul 2002
Location: Greece
Posts: 84
Quote:
But maybe there are some people around here that have experimented with it and can chime in.
That's what we're waiting for!

My main concern is that setting it to half the movie's frames is way higher than 2000.
Psymaster is offline   Reply With Quote
Old 1st September 2002, 10:36   #4  |  Link
drizztcanrender
Registered User
 
drizztcanrender's Avatar
 
Join Date: Aug 2002
Location: Athens,Greece
Posts: 33
I tried it once...but nothing changed.The quality was tha same and speed didn't seem to change either.I don't think it will affect the quality that much,but you can still expirement.
drizztcanrender is offline   Reply With Quote
Old 1st September 2002, 20:40   #5  |  Link
Psymaster
Registered User
 
Join Date: Jul 2002
Location: Greece
Posts: 84
Quote:
Originally posted by drizztcanrender
I tried it once...but nothing changed.The quality was tha same and speed didn't seem to change either.I don't think it will affect the quality that much,but you can still expirement.
I tried it wih a short clip and didn't find any differences too... One question is, why should it be set @ 1/2 the movies length and not all of it?
Psymaster is offline   Reply With Quote
Old 15th September 2002, 07:03   #6  |  Link
JohnMK
Registered User
 
Join Date: Sep 2002
Location: Seattle
Posts: 551
Very good question.

^bump^
JohnMK is offline   Reply With Quote
Old 15th September 2002, 22:24   #7  |  Link
drizztcanrender
Registered User
 
drizztcanrender's Avatar
 
Join Date: Aug 2002
Location: Athens,Greece
Posts: 33
Well maybe because of this...

Quote:
Setting it higher will decrease the ability of the encoder to adapt to low/fast motion scene changes and you may not get a predictable size anymore
What i'm thinking is that half the frames is the maximum number the encoder can have so he can see how much quality is being given to previous frames and then lowering the quality in frames after that.So if you put it in half of the frames of the encode(i.e. most of the time bigger than 2000) it will have a better average and it will also have less frames to lower .That's why if you increase too much it will increase the quality of the movie,theoretically,but also might get off from the predicted filesize.

Well i could be full'o s**t so, don't listen to me
drizztcanrender is offline   Reply With Quote
Old 18th September 2002, 23:31   #8  |  Link
UGAthecat
slacker - lurker
 
Join Date: Jun 2002
Location: at the corner of procrastination and indecision
Posts: 80
I've encoded several movies using the RC averaging period equal to the total number of frames and had no problems. In fact, some videos looked considerably better doing this, but I guess as with all encoding stuff, your mileage may vary.
UGAthecat is offline   Reply With Quote
Old 24th December 2002, 21:27   #9  |  Link
bkam
Registered User
 
bkam's Avatar
 
Join Date: Nov 2002
Location: London
Posts: 115
I was wondering if anyone had updated information on RC Averaging. I've read in many places that it increases quality and makes file size actually more predictable because it distributes the bitrate better over the scenes.

Quote:
Originally posted by drizztcanrender
That's why if you increase too much it will increase the quality of the movie,theoretically,but also might get off from the predicted filesize.
The interesting thing is I read under the sticky post about undersize that it helps him to more closely get filesize, but you could still be right if he's only talking about undersized files.

Hoping someone can clarify what this does.

Also I've heard that setting it to half will make the codec much more (not less) responsive to changes in high motion and low motion scenes, unlike what Doom9 said, but I have no experience.
bkam is offline   Reply With Quote
Old 25th December 2002, 16:43   #10  |  Link
?¿öM¿?
Delphi Guru
 
Join Date: Nov 2002
Location: Narnia
Posts: 62
Hi, i am glad this thread has reemerged.
I did a few tests with the various DivX/pro settings over a few complete movies, to see how all the various things mixed with eachother.

I increased the RC averaging period to be equal to half the frames in the movies (60,000+) and on high bitrate encodes it came up with better results on the most part than the default but seemed to encode at an average of half the FPS.

On low bitrates it was easier to see the RCa at work. At 60,000+RCa on low motion scenes, the results were rather terrible but excellent on the fast motion scenes. At 4000RCa I got the best results on the fst motion movies I encoded as a good mixture between the few low and many fast motion scenes was struck, but there were edge artifacts. For mostly low motion movies I got the best results using a 1000RCa where the scenes with little panning and movement came up crisp and artifact free. However, panning for more than 5secs made ugly macro blocks appear that got worse as the panning continued to the point where it was unrecognizable after 20secs. Where a background was stationary, but objects moved around in the picture, edge artifacts appeared around the moving objects. File size also became unpredictable.

This is only the jist of what I uncovered. I did the tests at 1pass (with vDub) only as it seemed logical that the RC options would play a significantly larger part. I'm on holidays and away from my home pc for the next month or so, but if you would like, when I get back I can put together some proper notation and screen shots, maybe do some 2pass tests aswell(only did them while playing with the pro options).
__________________
A computer is a device for rapidly creating highly accurate errors.
?¿öM¿? is offline   Reply With Quote
Old 25th December 2002, 18:34   #11  |  Link
bkam
Registered User
 
bkam's Avatar
 
Join Date: Nov 2002
Location: London
Posts: 115
Thanks for those results. I am currently trying Fear and Loathing in Las Vegas with an RC Averaging Period of 85000 (for 170000 frame movie), 2 pass 2cd encode. Only B-frames are enabled, lanczos to 704, pretty barebones. Bitrate 1520, so pretty high (by my standards?). I'll let you know how it comes out.

EDIT: Okay, I did this last night. It came out beautifully, with an average quantizer somewhere in the neighborhood of 2.6. This is probably the highest quality DivX I have ever encoded, but that may be more due to the fact of a 75% compressibility test, 1500+ bitrate, and lanczosresizing. No filters, just B-Frames, I'm not sure if the RC Averaging had anything to do with it. I suppose I should have tested it by encoding the entire movie at 2000, but I was in a hurry to get the VOBs off the drive.

Last edited by bkam; 26th December 2002 at 09:56.
bkam is offline   Reply With Quote
Old 27th December 2002, 17:08   #12  |  Link
BoNz1
Registered User
 
BoNz1's Avatar
 
Join Date: Dec 2002
Location: Great White North
Posts: 522
@ drizztcanrender, you are quite right, that is exactly what rc averaging does. Say if your max min quantizers are at 2 and 12 and you have rc averaging set at 2000 it does not allow for much variation, it is like putting the codec in a straight jacket and it will not be able to compensate for it as you would like. It will have to average the quantizers between 2-12 in every 2000 frames. If it is set to half the number of frames then it will be able to average the quantizers better and get a much more accurate result. Of course, you do not have to set the rc averaging to half the frames, it is just a safe estimate. Larger values should give better quality to high motion scenes and lower values to low motion scenes. So if your movie had a lot of low motion scenes you could set the rc averaging to somewhat less than half and vice versa for a movie with a lot of high motion. This may explain why some people have different results if they set it to be much higher or much lower than 1/2.
@ ?¿öM¿? I am interested to see your results if it were a 2-pass encode. The rc averaging is needed for both passes so testing it with only one pass it may be harder to see the difference that it can make although your results definitely support what I have just said. What you have done is like a smart-1-pass encode instead of the usual 1-pass encode which is completely blind and usually gives unpredictable results.
I did The World Is Not Enough about a year ago with rc averaging set at 2000, using a bitate of about 1500, using b-frames and gmc and doing a 2-pass encode. The result was awful, it looks disguisting especially high bitrate scenes which had blocking everywhere. I was a bit of a n00b at the time so I don't think I really noticed too much. But since then, I have always set it to half and have been quite happy with that, high and low bitrate scenes look much better, and filesize predictability seems to have gotten a lot better. I would really like to encode that movie again though once with it set at 2000, then 1/2, and then maybe even try a 1/4 or even 3/4 just to see what it looks like.

Last edited by BoNz1; 27th December 2002 at 17:13.
BoNz1 is offline   Reply With Quote
Old 28th December 2002, 10:14   #13  |  Link
?¿öM¿?
Delphi Guru
 
Join Date: Nov 2002
Location: Narnia
Posts: 62
Hmm, I am getting really interested in this topic again and am going to do some comprehensive research.

I always use 1/2 frame count for my RCa on 2pass encoding. It gives me the best distribution of bits. I think that i'll write a prog for comparing the motion values versus bits from the divx log file and analyse.log from 2 encodes of the same movie of different RCa and let the computer do my thinking for me.

To explain:
I take 2 DivX movies, and their respective log files.
I will take the motion values from the 2 DivX log files that were created in first pass and if they are not the same(haven't checked that) I will average them out to another file(motion.txt).
Next I will compare the number of bits that is shown in analyse.log on a frame by frame basis with the corrisponding motion value for that frame. I will do this for both encodes. It will require a bit of research to decided what to say is optimal bits for motion value versus given (average)bitrate, but I will come up with something.
Then the prog outputs into a textfile the difference(+ or -) between the optimal bits and the actual bits.
The two resulting textfiles are then compared and the results are outputed into a final textfile that tells which encode was better at each frame and which is the best over all.

The parametres:
Same average bitrate given to the codec.
BiDirectional encoding disabled. Reason being, the 2 encodes will probably have I,P and B frames everywhere. I don't want to check different frame types against eachother.
If from one encode, a frame is an I-frame and from the other it is a P-frame, the frame will be dismissed.
No GMC or q-pel.
Quantizer set on 2-12.
2passes.
The actual program will take bitrate given to the codec and directories where the DivX encodes and logfiles are located. I say 2 encodes the whole way through, but I will design it so many more can be included and all compared against eachother.
As the encodes will have the same given resizing methods and no filtering and the DivX log file records are from an all intra frame 1pass, it is safe to assume things like the detail from the input(my.avs) to the codec is the same, so I shouldn't need to compensate for the texture value.

I made all this up as I went along, so I haven't thought this through yet and I will begin to do so. Can't begin it yet(when back from holidays). I would like some feedback as to possible adjustments and the feasibility of such a program. If anyone thinks this is a really silly thing to do, please tell me and why you think so, don't let me go ahead and waste my time.
__________________
A computer is a device for rapidly creating highly accurate errors.
?¿öM¿? is offline   Reply With Quote
Old 28th December 2002, 21:37   #14  |  Link
bkam
Registered User
 
bkam's Avatar
 
Join Date: Nov 2002
Location: London
Posts: 115
I'm not a programmer so I'm not sure whether I can help you with feasibility or anything like that but I can tell you that this is a subject that also definitely interests me. I've been trying for a long time to get hard information on this subject, everyone has a "do your own tests" mentality and I agree that that is the best way to make up your own mind on a subject, but sometimes it's tough to do repeated tests especially when the idea is doing a bunch of 2-passes on different movies. With my limited processor and harddrive space it's not easy for me. Also I'm a newbie so interpreting the results of analyse.log isn't exactly easy.

Your test results would be of great interest to me, and if you are planning to release the program i will definitely make an effort to help test it and post results. I definitely support this research.
bkam is offline   Reply With Quote
Old 4th January 2003, 14:11   #15  |  Link
theReal
Piper at theGates of Dawn
 
theReal's Avatar
 
Join Date: Nov 2001
Location: Earth
Posts: 2,138
I'm not sure about the quality improvement, but I have experienced some serious undersizing when I set the RC a.p. to the full amount of frames. The DVD I'm talking about was the Futurama season 1 DVD set where single episodes came out with 165MB instead of the 175MB that I was aiming for.
With the RC a.p. at half of the total amount of frames I have only had minor undersizing (like 695MB instead of 700MB), but mostly it was pretty accurate.
__________________
"Under a government which imprisons unjustly, the true place for a just man is also a prison"
Henry David Thoreau, On the duty of civil disobedience, 1849
theReal is offline   Reply With Quote
Old 6th January 2003, 18:25   #16  |  Link
leadman584
Registered User
 
Join Date: Nov 2002
Location: USA
Posts: 88
Hi

I've been playing with averaging period for a couple of weeks now, just to see if there was indeed any difference. By and large I have gotten slightly better results increasing from the default 2000 avg. Basically the default will average bit allocation over a span between 67 and 83.4 seconds depending on your framerate. I just did xxx a couple of days ago and I can assure you that to put it on 1 cd (not a real good idea, just too much high speed action) the default setting of 2000 produced incredibly bad looking high motion scenes, most vastly exceed 84 seconds. low motion scenes were ok, not great, but ok. I tried it again with averaging set much higher, 70000 I believe. Anyway the improvement was very noticeable, though low motion scenes showed signs of background pixelation. Tried one last time with latest stable build of Xvid, all stock settings. the results were by far the best of a single cd attempts. In the end I used Xvid 2cd for archive copy, and the results are stunning. It helped that I could increase the sound quality by going 2 cd.

I think by and large setting the RC averaging to a higher level for high action movies is very helpful. Perhaps others have gotten different results, but when you really push it with relatively low bitrates the difference becomes apparent. I have posted in the suggestions section at Divx that the default averaging period be set to 60000 or higher for the next release of Divx. If you have better ideas for this please post at Divx.
leadman584 is offline   Reply With Quote
Old 6th January 2003, 19:08   #17  |  Link
yingx2
Registered User
 
Join Date: Mar 2002
Posts: 96
So I guess that I am the only one who cannot see any difference introduced by this RC averaging period.

I did many tests too
yingx2 is offline   Reply With Quote
Old 6th January 2003, 23:24   #18  |  Link
bkam
Registered User
 
bkam's Avatar
 
Join Date: Nov 2002
Location: London
Posts: 115
Quote:
Originally posted by yingx2
So I guess that I am the only one who cannot see any difference introduced by this RC averaging period.
I haven't done extensive tests but I can't see much of a difference either. My laptop isn't exactly state-of-the-art, though, so maybe I just don't have the hardware to tell.
bkam is offline   Reply With Quote
Old 10th January 2003, 06:47   #19  |  Link
dTb
LFS Addict
 
dTb's Avatar
 
Join Date: Jun 2002
Location: Darwin Australia mate
Posts: 148
I haven't really done any comparison tests myself but I always set the rc averaging period to 1/2 the # of frames.
No one has confirmed it for me but my opinion of setting it to half is so that you can retain utmost filesize predictability, eg. the rc averaging period ends on or very close to the end frame. By this reasoning you could set it to one third or one quarter etc.
If you were to set it at three quarters for example the video would finish part way through the averaging period, potentially messing with the filesize predictability.
dTb is offline   Reply With Quote
Old 10th January 2003, 22:14   #20  |  Link
bkam
Registered User
 
bkam's Avatar
 
Join Date: Nov 2002
Location: London
Posts: 115
Quote:
Originally posted by dTb
I haven't really done any comparison tests myself but I always set the rc averaging period to 1/2 the # of frames.
No one has confirmed it for me but my opinion of setting it to half is so that you can retain utmost filesize predictability, eg. the rc averaging period ends on or very close to the end frame.
I'd never heard it explained this way, it may well be true but I don't know. It sounds reasonable to me. I have noticed like you have that my files come out exactly perfect size this way. Out of curiosity, if you are correct about how this works, why not set the RC averaging to exactly the number of credits? Wouldn't this also do the same thing? Say, for example, a movie has high motion for the first half and low motion for the second half. If you had RC at half, even though it distributes bits well in each half, the second should get less overall... Or am I misunderstanding what the period does?

Last edited by bkam; 10th January 2003 at 22:16.
bkam 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:08.


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