View Full Version : RoBa: Binary search for Q or Newton's Method?


r6d2
26th August 2003, 15:05
Hi,

I've done some research on finding a suitable Q for a RoBa 2 pass encoding with DVD2SVCD.

(Outlined in http://forum.doom9.org/showthread.php?s=&postid=361071#post361071)

As you may be aware, Tylo's plugin (D2Sroba) uses the binary search approach to find the best Q for both a single pass (OPV) and multipass (VBR).

Tylo's tool offers to calculate several Qs for as many CDs the movie will fit in keeping at least the expected quality. Binary search needs 6 or 7 sample tries to find the optimum Q for each category, depending on the range you defined for the search. Tylo has optimized his tool to skip some searches and guess the result. This actually can lead to significant differences with real data, since the slope of the curve is not known.

Alternatively, I implemented two variatons of Newton's Method to find the Q, as well as Binary search. I used Excel to have side by side comparison of the three methods. The final spreadsheet also contains sample data (sample sizes of a movie for all Qs).

I found that the Newton's standard version outsmarts Binary search in about half of situations. The improved Newton version is found to outsmart Binary in most cases (actually, outsmarts the standard too). A suitable Q for 2 pass RoBa can be found in 2 or 3 tries!

Please feel free to download the sheet file from:

http://www.angelfire.com/droid/r6d2/

and play with the sample data. The sheet is self-documented so you should have no trouble using it. Also, it documents RoBa method and you can get a clear understanding of how it works when quality and edge-filled CDs is what it's all about. The sample data will also give you a glipmse of how the Q function behaves like on a typical source.

Also, the magic of the improved method is based on a magic number. If through experimentation you find another magic number which converges even faster, please share the knowledge. It's likely DVD2SVCD will implement this feature in a future version, so we need all the help we can get.

Regards,

r6d2
27th August 2003, 16:27
Hi,

I just uploaded a new improved version of the spreadsheet. Change log follows:

Version Comments
1.1 Added spec abiding BR limits and suggested video BR max
Added "other stuff" which takes up space on the CD to get a more precise target BR
Added normalized audio BR by lookup table
1.0 Initial release


Download from: http://www.angelfire.com/droid/r6d2/

Holomatrix
27th August 2003, 19:05
That's some great looking stuff there :) Can't wait to see your "The Complete Idiot's Guide to a Good DVD Conversion (work in progress)" I would like to see options for 1CD SVCD, 2CD SVCD and DVDr. (I'm doing transcoding right now but still hear that encoding still prevails)
Thanks

r6d2
27th August 2003, 19:35
Originally posted by Holomatrix
I'm doing transcoding right now but still hear that encoding still prevails
Well, that is sort of a religious discussion, as CCE vs. TMPGEnc, CVD vs. SVCD, whether matrices matter of not, Constant Quality vs. Multipass, etc. The guide does not take dogmatic positions but attempts to cover them all.

Holomatrix
27th August 2003, 19:43
True, and I was refuring to DVD2DVDr by the way, since I got my first DVD burner the other day :) Pioneer A05/105 4X DVD-R for $159.00 CDN :) Very happy with it. Sorry, getting off topic :)

tylo
28th August 2003, 07:51
I just uploaded a new improved version of the spreadsheet.
Awesome. Very detailed analysis, indeed. Thanks.
I hope to put it in the plugin at some point, but I think we'll manage OK with the smart binary search at this time. I normally only get 4 tests, sometimes 5.

As a note for DVD2DVDr encoding. The next release of DVD2SVCD which should not be so far away, will include much more support for this. Hopefully, the plugin will still work, without too much adjustments.

A new version of the plugin is around the corner: It uses purely DVD2SVCD's bitrate computation, as suggested :), also D2S internal RoBa support is added :), and more...

r6d2
31st August 2003, 02:32
Hi, I just uploaded a new very improved version of the spreadsheet. Change log follows:
Version Comments
1.2 Added limited support for TMPGEnc CQ mode (Docs/variables still refer to Q. You have to do the analogy.)
Added determination of reduced CD Size for equally sized images when CDs would otherwise not be filled.
Added muxing overhead and fixed spare size. Now precision is better that 0.5% compared to FitCD.
Added support for higher video BRs (known as X(S)VCDs)
Audio/Video size embarrasing bug fixed
Added more documentation
1.1 Added spec abiding BR limits and suggested video BR max
Added "other stuff" which takes up space on the CD to get a more precise target BR
Added normalized audio BR by lookup table
1.0 Initial release
Download from: http://www.angelfire.com/droid/r6d2/