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 > (HD) DVD, Blu-ray & (S)VCD > One click suites for DVD backup and DVD creation

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd September 2004, 09:52   #1  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
Question@Tylo: How is the CQ value in D2SRoBa calculated ?

Hi Tylo,

Iīve got a question on calculatthe CQ value

Iīm aware that D2SRoBa uses Newton Raphson (http://www.sosmath.com/calculus/diff/der07/der07.html) to estimate the Q-Value for CCE which is needed to hit a certain file size.

What is following now, is just my understanding of the method I think you used. So I ask you to tell me if I understood it correctly.

Newton-Raphson is used to find the zeros for an equation y = f(x). Now lets say y equals the bitrate and x represents the CQ value. f(x) is the "function" which represents the overall compressibility of the movie which to my understanding basically just means: Each movie will give you different quality depending on the bitrate you use. As "f(x)" is not linear, we have to interpolate the function to get the CQ value for the choosen movie and targeted filesize (-> CBR). As Newton-Raphson can only be used to find the value where f(x) equals zero, we have to generate an equation that results in a zero for the CQ value we look for.

x is the CQ value we look for in order to get the targeted file size which equals to a certain average bitrate (repesented by "b" in the equation)
Something like this: 0 = b - f(x)

http://www.sosmath.com/calculus/diff/der07/Image01.gif

So in reference to this diagram we are looking for "r".

Now letīs look at the equation that it used to aproximate "r":

http://www.sosmath.com/calculus/diff/der07/img11.gif

We need to determine f'(x) which can be replaced by the tangent equation. So eg. we need the tangent equation for CQ value of 40, we could use a CQ value of 41 combined with the CBR bitrate values of both CQ value, correct ?

Is it possible to have a look into the D2SRoba sources how the CQ value is calculated ?
This would be very helpful to me.

Background of all my questions:
I use my PC mainly as PVR and do a lot of captures I want to archive to DVD. As Iīm using a WinTV PVR USB2, all/most of my captures are in DVD compliant MPEG2 format. I demux them and do my cutting using Cuttermaran.

Normally I either master multiple episodes to on DVD-R or one complete movie per DVD. For the "multiple episode" stuff Ulead Movie Factory 2.0 does a fine job for me but for 1 movie per DVD stuff needs way to much work in Movie Factory: Load movie, add chapters and generate ISO to burn DVD. My idea was a "one click and go" solution. Iīve now done a small Delphi app that does the following: Generating a chapterlist for Ifoedit, calls ifoedit via a small AutoIt app (ifoedit_cli), masters the DVD and generates an ISO using mkisofs. All this works quite fine. Now and then I have an "oversized" video stream which I "squeeze" down using rejig. As I donīt like those "compressed domain transcoder", the integration of an external MPEG encoder came to my mind. In order to generate the "chapters.txt" for IfoEdit, I generate an AVS-file using DGIndex. So a "source file" for any sort of MPEG2 encoder would be available. QEnc would do the job quite fine I think but CCE is a faster solution. Calling CCE via CLI using EclCCE is no big deal. The only thing I need to do HiQuality video automized in a small time period would be the implementation of the RoBa method which is currently integrated in D2SRoBa

Further plans are to support AVS / AVI Input in my GUI. Audioencoding would be done seperate using
VirtualDub and BeSweet (as I already do in VCF2AVS). I know that DVD2SVCD supports AVI input but itīs way too overloaded (donīt misunderstand me) for my needs. I just want to cut my captures, choose Audio/video files in a frontend and hit the "Go"-button. Afterwards I expect a complete DVD compliant ISO ready for burning.

TIA,
-D$

Last edited by Darksoul71; 23rd September 2004 at 09:55.
Darksoul71 is offline   Reply With Quote
Old 23rd September 2004, 14:33   #2  |  Link
jsoto
Just a Member
 
Join Date: Nov 2002
Location: Spain
Posts: 2,067
Quote:
Is it possible to have a look into the D2SRoba sources how the CQ value is calculated ?
You should have a file called D2SRoBa_src.zip in Tylo folder after installation.
jsoto
__________________
Web sites with my tools
http://download.videohelp.com/jsoto
http://jsoto.posunplugged.com/
jsoto is offline   Reply With Quote
Old 23rd September 2004, 14:46   #3  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
@jsoto:
Oops, seems to me that I should have had a closer look to the D2SRoba directory

Thnx,
-D$
Darksoul71 is offline   Reply With Quote
Old 23rd September 2004, 22:23   #4  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Also, you might want to search for the thread in the DVD-rb forum where Tylo showed jdobbs how to do it properly.

Last edited by DDogg; 23rd September 2004 at 22:29.
DDogg is offline   Reply With Quote
Old 24th September 2004, 06:37   #5  |  Link
tylo
Author of D2SRoBa
 
tylo's Avatar
 
Join Date: Mar 2003
Posts: 483
@Darksoul, yes, you describe the method quite well.
Quote:
We need to determine f'(x) which can be replaced by the tangent equation. So eg. we need the tangent equation for CQ value of 40, we could use a CQ value of 41 combined with the CBR bitrate values of both CQ value, correct ?
Correct. But it is the average BR, not CBR. The tangent equation works well for DVD encoding because f(x) forms a simple curve that bends one way only. For SVCD, the max bitrate constraint makes the curve suddenly bend the other direction (S-shape) which makes it harder. The code first does a simple guess on a CQ based on media size/target frame size. The second guess is based only on the first result, then the subsequent guesses on CQ uses the method you describe. D2SRoBa also may decide to switch to binary search when it sees that the tangent equation is way off (e.g. when target bitrate is near max bitrate).
Good luck with you app.
tylo is offline   Reply With Quote
Old 24th September 2004, 19:29   #6  |  Link
Darksoul71
Can you blush ?
 
Darksoul71's Avatar
 
Join Date: Oct 2001
Location: Northern Europe
Posts: 696
@DDogg: Thank you for the hint ! It was (as always) very useful.

@Tylo: Thank you for answering my question. Yes, you are correct. I was meaning ABR and not CBR.

BTW: D2SRoBa really rocks. It enables us to do High Quality DVD Backups in the same time you normally only can do with compressed domain transcoder.

Regards & have a nice weekend,
-D$
Darksoul71 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 Off
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:26.


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