PDA

View Full Version : @Tylo: Question related to RoBa and Newton Raphson


Darksoul71
11th June 2005, 15:21
Hi Tylo,

not quite shure if my question is really right in this forum but as it is somewhat DSRoBa-related, Iīve decided to post it here:
Q: How many iterations (or should I better say CCE encodings) are required in worst case until DSRoBa hits the "right" CQ value via Newton Raphson ?

TIA,
D$

ChickenMan
13th June 2005, 12:19
I generaly find it takes 2 to 3 passes to find the right Q value, but I've seen it do up to 8 on the odd occasion.

tylo
13th June 2005, 21:23
I'm sorry I'm not visiting this forum very often anymore. Yes in theory it could take up to 8 encodings to find the best Q value. However, with the algorithm I use in ccefront, which is only slightly different from in the D2SRoBa plugin, it only rarely uses more than 2. When the target bitrate is close to the max bitrate (not recommended), it is difficult to find the correct Q, so it may use more iterations.

You can find ccefront in the CCE forum. If anyone want its source code for a good reason, PM me.

Darksoul71
14th June 2005, 08:56
@ChickenMan:
I generaly find it takes 2 to 3 passes to find the right Q value, but I've seen it do up to 8 on the odd occasion.
Thanks for your reply ! I guess 2-3 passes are most common to the "target Q".

@tylo:

I'm sorry I'm not visiting this forum very often anymore. Yes in theory it could take up to 8 encodings to find the best Q value. However, with the algorithm I use in ccefront, which is only slightly different from in the D2SRoBa plugin, it only rarely uses more than 2. When the target bitrate is close to the max bitrate (not recommended), it is difficult to find the correct Q, so it may use more iterations.

No need to excuse ! If I was that in hurry I could have PMed you. :)

I was just asking this questions as I did a Q-search functionality for my AVI2DVD tool. I used the bisection method to search for the "right" Q. In my approach I let the user select a start Q value (e.g. 40). This value serves additionally as quality border -> if the first pass delivers a bigger Q-Value than the selected one, it stops encoding. Otherwise the Q-search continues. This made pretty much sense to me for two reasons:
1) We all have some sort of "GO / NO-GO"-quality level, e.g. I know that my movie will look bad if I encode below Q-value XYZ. Using Q-value XYZ as "quality border" provides some sort of "quality-o-meter". In other words: When the movie you want to encode at a certain bitrate has a Q-value bigger than the one you choose, you might want to change target resolution, increase target bitrate, use stronger filters, etc.
2) The interval of Q=1 to XYZ is much when you choose a low Q-Value compared to a Q-interval of 1 to 300.
Iīve now implemented a "condensed" form of Newton which I found in an old discussion thread related to DVD Rebuilder and the implementation of DSRoBa:
Q(n+1) = Q(n)*(Estimated bitrate(n) / targeted bitrate)

Compared to bisection with a start Q-value of 40, Newton has shown to be a good percentage better but without additional intense testing (for which I donīt have the time :)) they can at least "compete".
My short tests have mosty shown 4-6 passes for Q search in average for bisection and mostly 2-4 passes for Q search with the simplified formula described above. Iīve seen the formula modified by a factor (f =1.33) but this hasnīt prooven to stabilize / converge really earlier.


You can find ccefront in the CCE forum. If anyone want its source code for a good reason, PM me.

Tylo, all I can say is: WOW ! :D
If I had known before that a tool like ccefront existed, I might not developed my own Q-search algorithm. And Tylo, you have PM :)

Thanks for all,
D$