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 15th August 2003, 04:08   #101  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Tylo, I have always wondered why you do not offer an option to do a AvBR VBR pass at the end of your process as a conditional based upon user selected criteria. I know my thoughts could not be original so I assume you have it in your mind.

When CCE ends you know, or could know easily, how big the final video encode is as well as the size of the audio and a close estimate of the muxing overhead, so it follows that you know whether the final product is going to be under/oversized and by how much.

It seems then that offering an option based upon a preset error threshold set by the user would be useful. One additional pass would then make the size exact, and in fact would then be the most efficient hybrid RoBa process as it would only be invoked when needed.

Repeating myself, if the prediction was accurate, the sizing pass would not be invoked. If the size is off by XX%, then the time of the one additional run is much less than a complete redo with all the predictive passes and would be part of the same automated process.

Pardon me if this has been brought up directly before. My eyes are about shot, I am afraid.
DDogg is offline   Reply With Quote
Old 15th August 2003, 07:41   #102  |  Link
tylo
Author of D2SRoBa
 
tylo's Avatar
 
Join Date: Mar 2003
Posts: 483
Quote:
Tylo, I have always wondered why you do not offer an option to do a AvBR VBR pass at the end of your process as a conditional based upon user selected criteria. I know my thoughts could not be original so I assume you have it in your mind.
Indeed I had, but it slipped my mind again. I've only thought about this beeing useful when the video gets oversized, but surely it's useful when it undersizes too.

Actually, this idea fits nicely in with r6d2's request for making support for the internal DVD2SVCD RoBa feature. For that, I thought of changing the 'Normal Multipass' mode to 'RoBa Mode', or something.

BTW: Would a name change from '1-pass VBR RoBa' To '1-pass Bach' be more appropriate? If you wish, please elaborate more on how you imagine the GUI for all this (naming and boxes).

Now I just need to find the time to do some programming too!
tylo is offline   Reply With Quote
Old 15th August 2003, 15:18   #103  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Well, I have not thought it out very well at all. Just off the top of my head you could change the normal to "Final Sizing Pass" then add a drop down with "On Oversize Only", "Always","Never", and 1,2,3,4,5,6,7,8,9,10 as a percent. I would probably type in 2.5 if that was allowed.

Nothing wrong with 1-Pass RoBa in my mind. Also, I think it would be cleaner for you to do the extra final pass as you do the others instead of invoking any D2S pass.

Last edited by DDogg; 15th August 2003 at 15:21.
DDogg is offline   Reply With Quote
Old 15th August 2003, 18:36   #104  |  Link
kru
Registered User
 
Join Date: Jun 2003
Location: Norway
Posts: 28
Thank you for a great program Tylo

Here is some suggestions:

-What about encode the audio after the video?
(If there are space left on the CD, the audiobitrate will be greater)

-And a "auto choose bitrate" for the audiobitrate??? (That is about 10 % of the audiobitrate)

-And what about if the videosize is n % less or greater of the calculated filesize, D2SRoBa will encode again, and try too make a better prediction???

Last edited by kru; 15th August 2003 at 18:41.
kru is offline   Reply With Quote
Old 16th August 2003, 16:53   #105  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Tylo, some of my index thoughts have started to crystallize while thinking about the feedback I received and while making my reply to Barker here: http://forum.doom9.org/showthread.ph...256#post359256 which shows the bitrate has little to do with the quality of the final encode whereas the compressibility has everything to do with it.

I now think the AI thing I was looking for in your file-size methods could be easily achieved if you would put some special test settings in the INI which basically allowed:

AISKIP_TESTMODE_ON=TRUE
AISKIP 1CD Q-32PassKB > xxxx
AISKIP 2CD Q-32PassKB > xxxxx

Just to be clear, If the Q32 pass was bigger than xxxx then you would instantly negate any more predictive Q passes and increment target media by 1 (meaning 2 becomes the target), if bigger than xxxxx then you would increment target media by 2 (meaning 3 becomes the target). Hmmm, am I getting fuzzy again?

This would save a ton of predictive passes for the file size based methods for the advanced user. Actually, eventually if this pans out, I guess I am asking for an "AI" mode to go along with the AUTO and the "?". For testing purposes, we could just do this in the INI and set the GUI to "1" so as not to cause you a lot of work. What are your thoughts?

[Add] Hmmm, the sample size is a slight bit of sand in the oil. I guess people using this method would understand they would always have to use the same sample size for this to work, or unless you think it viable to extrapolate from a 1% in the INI to whatever sample size they used. I would think that would have a bigger error margin though.[/Add]

Last edited by DDogg; 16th August 2003 at 20:10.
DDogg is offline   Reply With Quote
Old 17th August 2003, 18:49   #106  |  Link
tylo
Author of D2SRoBa
 
tylo's Avatar
 
Join Date: Mar 2003
Posts: 483
Quote:
I now think the AI thing I was looking for in your file-size methods could be easily achieved if you would put some special test settings in the INI which basically allowed:

AISKIP_TESTMODE_ON=TRUE
AISKIP 1CD Q-32PassKB > xxxx
AISKIP 2CD Q-32PassKB > xxxxx

Just to be clear, If the Q32 pass was bigger than xxxx then you would instantly negate any more predictive Q passes and increment target media by 1 (meaning 2 becomes the target), if bigger than xxxxx then you would increment target media by 2 (meaning 3 becomes the target). Hmmm, am I getting fuzzy again?
No, this is pretty clear to me, and very good idea! In fact it's so easy to put in that i'll do that right away!

Quote:
This would save a ton of predictive passes for the file size based methods for the advanced user. Actually, eventually if this pans out, I guess I am asking for an "AI" mode to go along with the AUTO and the "?". For testing purposes, we could just do this in the INI and set the GUI to "1" so as not to cause you a lot of work. What are your thoughts?
I don't see how it can be used for the AUTO mode - only the "?". The AUTO mode computes the num CDs directly from the WorstQ-PassKB size - it doesn't test each num CDs...

Quote:
Hmmm, the sample size is a slight bit of sand in the oil. I guess people using this method would understand they would always have to use the same sample size for this to work, or unless you think it viable to extrapolate from a 1% in the INI to whatever sample size they used. I would think that would have a bigger error margin though.
You are talking about the sample percentage I assume? Yes I think it is viable to just divide the size of the actual percentage used (like normalizing) before testing. It will actually have a lesser error margin (e.g a 2% sample test size / 2 is a more accurate 1% sample pass size, that a true 1% sample pass produces...)

BTW: I am just about to release a new intermediate version now. It has a much improved "?" function already. Adds an extra CD if oversizing before mux and cut (much requested). Also reduces and equals out image sizes if it cannot fill CDs completely.
tylo is offline   Reply With Quote
Old 18th August 2003, 02:36   #107  |  Link
r6d2
Graphite mod
 
r6d2's Avatar
 
Join Date: May 2003
Location: Away
Posts: 2,022
Quote:
Originally posted by tylo
No, this is pretty clear to me, and very good idea! In fact it's so easy to put in that i'll do that right away!
@Tylo
It is easier than you think, I guess. It is already implemented (sorta). I PMed you on this on Aug.13. I post it here now for if there is anyone who whises to try.

Quote:
My other idea is this. You set your desired Q as worst_q. In my case, 30. You set your really_worst_q on 44, in my case.

When conducting a binary search in auto mode, you start by searching with target=30 (30 is the maximum of your binary search).

When in range mode, or in "?" mode, you only search on the [1, 44] range.

With really_worst_q enforced like this, you just have to put max and min to the spec values [300, 2530], and you'll find the Q faster. More important: the Q will always be adequate to your taste and the outcome BR is just a result you'll have to trust even if it is ridiculous! The max and min parameters can still be used, but this approach completely confines them to spec values.
__________________
MPEG4 quality with MPEG2? - Try the Poor Man's DVD.
FACAR - As seen on TV! - The Complete Idiot's Guide to a good DVD Conversion.
Time is money. Try D2Sroba for DVD2SVCD (FAQ) and save both. All electricity bills supported!
Do you know how much overscan and which resolution your TV has? Find out if NTSC.
Moderator: 1: one who arbitrates 2: one who presides over an assembly, meeting, or discussion
3: a substance (as graphite) used for slowing down neutrons in a nuclear reactor (Webster)
r6d2 is offline   Reply With Quote
Old 18th August 2003, 18:50   #108  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Quote:
It is easier than you think, I guess. It is already implemented (sorta).
Yes, I see what you mean. Also, if one wanted to accept the programs choice of the number of CDs they would be using the Automode anyway. While I still think the technique I mentioned above has merit, I don't think it belongs in Tylo's plug-in, certainly not in sizing mode!

r6d2, changing the subject slightly, do you agree that the second conditional sizing pass is highly desirable? If so, I hope it is implemented as soon as it can be.
DDogg is offline   Reply With Quote
Old 18th August 2003, 19:37   #109  |  Link
r6d2
Graphite mod
 
r6d2's Avatar
 
Join Date: May 2003
Location: Away
Posts: 2,022
Quote:
Originally posted by DDogg
r6d2, changing the subject slightly, do you agree that the second conditional sizing pass is highly desirable?
Absolutely. I had suggested some weeks ago to go for a second OPV pass, conditionally:
Quote:
Quoting myself
You might even improve the method by using the current binary search for a first OPV pass, and then correct with the real Q for the whole movie and obtained BR, using a simple proportion.

Then you do a second OPV with much more precision, and filling the CDs to the edge or getting really, really close (it would be a 100% sample, so to speak ).
But probably it would be better to stick Multipass, as you suggest. It is 0% risk of odd-sizing and with comparable quality if you reuse the VAF.
__________________
MPEG4 quality with MPEG2? - Try the Poor Man's DVD.
FACAR - As seen on TV! - The Complete Idiot's Guide to a good DVD Conversion.
Time is money. Try D2Sroba for DVD2SVCD (FAQ) and save both. All electricity bills supported!
Do you know how much overscan and which resolution your TV has? Find out if NTSC.
Moderator: 1: one who arbitrates 2: one who presides over an assembly, meeting, or discussion
3: a substance (as graphite) used for slowing down neutrons in a nuclear reactor (Webster)
r6d2 is offline   Reply With Quote
Old 18th August 2003, 23:07   #110  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Yeah, I remember trying to figure out what you meant when you posted that, but stopped when my eyes started crossing

Like you said, I think the standard BR based pass for the second pass is really the easiest way to get where we want to go.
DDogg is offline   Reply With Quote
Old 19th August 2003, 07:48   #111  |  Link
tylo
Author of D2SRoBa
 
tylo's Avatar
 
Join Date: Mar 2003
Posts: 483
Ok, I actually started to implement the AISKIP thing, but I suddenly realized that I was wasting my time. (I should have learned by now not to jump on things too fast). Setting such limits translates to the same thing as setting a really_worst_q ultimately - just as r6d2 saw.

I must confess I didn't take the time I should have to understand r6d2 suggestions. The Aug.13. post is the sensible way to implement the "?" functionality. As you (r6d2) suggested in another post (I think), we can start a test with the really_worst_q, and use the size found as sort of AISKIP limits. This is basically what is done with worst_q in Auto mode, but here we go for the optimal (realistic) number of CDs directly, giving no user choices.

- On the other subject, I was thinking of supporting an optional second-pass (multipass), reusing the vaf file, as you mentioned.
- Then support for the internal RoBa method (but finding a good initial Q by binary search).
- Third. If I'm not fed up with the plugin, I may put audio encoding after the video encoding. We can adjust the audio bitrate in various ways, depending on the size of the video created.

New subject: I am thinking about removing the 'Bitrate Tweaking' fuctionality. It doesn't really belong here, and I don't think many is using it. As I have said before, cutting credits with frame selection (or chapters) is often a better alternative. Couldn't the tweaking also be done by an Avisynth script? E.g: Add a filter that make the bitrate drop after a certain number of frames?
I need feedback on this one.
tylo is offline   Reply With Quote
Old 19th August 2003, 14:38   #112  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Quote:
- On the other subject, I was thinking of supporting an optional second-pass (multipass), reusing the vaf file, as you mentioned.
That adds a lot of bang for the buck as, I think, it would only take a small amount of effort? With the conditional, it turns the plug-in into a true RoBa process, but one that is hybridized as the pass is only done if needed.
Quote:
- Then support for the internal RoBa method (but finding a good initial Q by binary search).
I think this calls for some thought and discussion. First, I would suggest we forget the plug-in for a moment and concentrate discussion on any weaknesses of the Internal RoBa process of D2S. In other words, is it broken and do you need to fix it? If it is broken in any way, who can best fix it, D2S or an external Plug-in?

Isn't it true that the only weakness of the D2S internal process is if the equivalent bitrate of the initial Q for the OPV pass is over 50% off from the bitrate actually needed? Yes, I am not very clear on that. If that is so, I would think if D2S did just one short measurement pass that would no longer be an issue. [edit] Here is the quote from Bach on that subject
Quote:
-- Decision: Calculate video average bitrate (CAVG) necessary in order to fit 2 CDs.
c) do multipass reusing vaf from first pass and using CAVG.
WEAKNESS OF ROBA: if CAVG > 2*(1st_pass_mpv_size/time_length) or CAVG < 0.5*(1st_pass_mpv_size/time_length), you MUST recreate the vaf file in order to do the multipass encoding.
[Add:] This brings up a question. For discussions sake, let's say an encode is correctly sized with a OPV Q of 48. Let's also say we have set the first Q pass in D2S internal RoBA to 32. The second bitrate based pass will size it correctly for us and the bitrate will be equivalent to the Q 48 pass. The question then is: would we gain anything if we had used the Q 48 as the Q of the first pass in the internal D2S RoBA process. My understanding is we would not, and in fact may lose quality although it may be the same. Anybody got any comments on this?

Quote:
- Third. If I'm not fed up with the plug-in, I may put audio encoding after the video encoding. We can adjust the audio bitrate in various ways, depending on the size of the video created.
No comment except to suggest you may be opening a can of worms for yourself and you might end up losing all your hair (assuming you have any ).
Quote:
I am thinking about removing the 'Bitrate Tweaking' functionality.
Maybe some folks use it. With the D2S frame selection so easy to use, I certainly don't and can't imagine doing so. I do understand your inferred suggestion that some users might not like to cut any of the credits and might prefer to just use a lower bitrate on them. Sounds good, but would it really be worth the effort and would anybody actually use it? Dunno.

What the bitrate tweak section does do is use up a lot of valuable "real estate" on your interface. That space might be better used to more fully differentiate between the two radically different methods available in your plug-in (Quality based and Sizing based). I know that caused me a lot of confusion and I am sure many others.

Last edited by DDogg; 19th August 2003 at 16:25.
DDogg is offline   Reply With Quote
Old 19th August 2003, 17:55   #113  |  Link
r6d2
Graphite mod
 
r6d2's Avatar
 
Join Date: May 2003
Location: Away
Posts: 2,022
Quote:
Originally posted by DDogg
This brings up a question. For discussions sake, let's say an encode is correctly sized with a OPV Q of 48. Let's also say we have set the first Q pass in D2S internal RoBA to 32. The second bitrate based pass will size it correctly for us and the bitrate will be equivalent to the Q 48 pass. The question then is: would we gain anything if we had used the Q 48 as the Q of the first pass in the internal D2S RoBA process. My understanding is we would not, and in fact may lose quality although it may be the same. Anybody got any comments on this?
What OPV does, attempting to quote a Bach post which unfortunately was not recovered, is this:

1. Encode a frame with desired Q.
2. If resulting BR > MAX, forget Q and BR and adjust to MAX.
3. If resulting BR < MIN, forget Q and BR and adjust to MIN.
4. Repeat from 1.

I tend to think from the above that using the correct Q, or a nearly correct Q from the start will give you a better encoding, since there would be less "forget Q" frames.

Again, I may be terribly wrong. But I invite anyone to rip apart this logic to continue for the search of the Holy Truth

Quote:
What the bitrate tweak section does do is use up a lot of valuable "real estate" on your interface. That space might be better used [...]
@Tylo, I think (IMHO) the credits stuff adds generality to the tool. If you are concerned about keeping the GUI clean, you might want to implement an "Advanced" button, or even better: follow D2S's equivalent parameter.

Don't worry about using a bigger window either to accomodate for more optios and modes. DDogg and I will give the users, sooner than later, a good guide for no brainers, whose only requisite is being able to understand what you read.

Besides, even though frame selection does the job, it requires you to wait for DVD2AVI to finish, and that is not ideal for multiple batch encoding.
__________________
MPEG4 quality with MPEG2? - Try the Poor Man's DVD.
FACAR - As seen on TV! - The Complete Idiot's Guide to a good DVD Conversion.
Time is money. Try D2Sroba for DVD2SVCD (FAQ) and save both. All electricity bills supported!
Do you know how much overscan and which resolution your TV has? Find out if NTSC.
Moderator: 1: one who arbitrates 2: one who presides over an assembly, meeting, or discussion
3: a substance (as graphite) used for slowing down neutrons in a nuclear reactor (Webster)
r6d2 is offline   Reply With Quote
Old 19th August 2003, 18:16   #114  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Quote:
I tend to think from the above that using the correct Q, or a nearly correct Q from the start will give you a better encoding, since there would be less "forget Q" frames.
This then becomes the pregnant question that we have to get the right answer to. I sent off a PM. Maybe I can get an answer and/or opinion.
Quote:
Don't worry about using a bigger window either to accomodate for more optios and modes. DDogg and I will give the users, sooner than later, a good guide for no brainers, whose only requisite is being able to understand what you read.
Disagree . Docs have to be read. An interface should be intuitive and not require reading to understand basic functionality, in this case that is defined as two completely different methods combined in such a way as to not be clearly differentiated.

Last edited by DDogg; 19th August 2003 at 18:24.
DDogg is offline   Reply With Quote
Old 19th August 2003, 18:48   #115  |  Link
r6d2
Graphite mod
 
r6d2's Avatar
 
Join Date: May 2003
Location: Away
Posts: 2,022
Quote:
Originally posted by DDogg
[B]This then becomes the pregnant question that we have to get the right answer to. I sent off a PM. Maybe I can get an answer and/or opinion.
Send my warmest regards to God when you see him

Quote:
Docs have to be read. An interface should be intuitive and not require reading to understand basic functionality, in this case that is defined as two completely different methods combined in such a way as to not be clearly differentiated.
Disagree . For instance, D2S interface is not intuitive. You must read a guide to learn to tweak the tool. On the other side, D2S (him) managed to set it up in such a way that if you know nothing, dislike to read the docs and even have a hard time with readmes, the default values will do a great job anyway.

Software Engineering must balance usability with powerness. The KISS concept is crucial for starters, but you must also take into account power users and the evolution of your tool. An approach with Advanced mode seems to me the best deal, just like D2S (him) chose to do.
__________________
MPEG4 quality with MPEG2? - Try the Poor Man's DVD.
FACAR - As seen on TV! - The Complete Idiot's Guide to a good DVD Conversion.
Time is money. Try D2Sroba for DVD2SVCD (FAQ) and save both. All electricity bills supported!
Do you know how much overscan and which resolution your TV has? Find out if NTSC.
Moderator: 1: one who arbitrates 2: one who presides over an assembly, meeting, or discussion
3: a substance (as graphite) used for slowing down neutrons in a nuclear reactor (Webster)
r6d2 is offline   Reply With Quote
Old 19th August 2003, 19:56   #116  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
Quote:
Software Engineering must balance usability with powerness. The KISS concept is crucial for starters, but you must also take into account power users and the evolution of your tool. An approach with Advanced mode seems to me the best deal, just like D2S (him) chose to do.
I don't disagree with that at all and the advanced tab is a good option if Tylo feels like messing with it. However, you said it yourself. "...Kiss is crucial for starters". When you have two completely opposite methods (Quality based and Sizing based) mixed together "without notice", so to speak, you do not even remotely adhere to the KISS GUI system that basically says 60-75% of the functionality should be readily apparent, usable and understandable within 5-8 minutes of first use. Anyway, Tylo can take the suggestions or leave them, so let's not beat it to death and get too off topic

Last edited by DDogg; 19th August 2003 at 19:59.
DDogg is offline   Reply With Quote
Old 19th August 2003, 20:17   #117  |  Link
r6d2
Graphite mod
 
r6d2's Avatar
 
Join Date: May 2003
Location: Away
Posts: 2,022
Quote:
Originally posted by DDogg
When you have two completely opposite methods (Quality based and Sizing based) mixed together "without notice"
I agree with you here on the different methods stuff, they are for different audiences. I tend to think that starters are quality oriented (you are just too affraid to screw up your encoding). Then, when you get more confident, you get also mode daredevil and begin to be cheap with CDs.

If Tylo would like to take this approach, I'd default to quality based mode in the eventual new GUI.
__________________
MPEG4 quality with MPEG2? - Try the Poor Man's DVD.
FACAR - As seen on TV! - The Complete Idiot's Guide to a good DVD Conversion.
Time is money. Try D2Sroba for DVD2SVCD (FAQ) and save both. All electricity bills supported!
Do you know how much overscan and which resolution your TV has? Find out if NTSC.
Moderator: 1: one who arbitrates 2: one who presides over an assembly, meeting, or discussion
3: a substance (as graphite) used for slowing down neutrons in a nuclear reactor (Webster)
r6d2 is offline   Reply With Quote
Old 19th August 2003, 21:27   #118  |  Link
tylo
Author of D2SRoBa
 
tylo's Avatar
 
Join Date: Mar 2003
Posts: 483
I'll respond later. Here's a new beta release.
http://home.no.net/tylo/setup_D2SRoBa248beta.exe

/Edited:
Nothing new in the GUI, or second-pass stuff yet, but:

- creates extra image for the oversized part (often only credits)
- if bitrate > max: equals out images sizes, shows fillrate.
- "?" mode: uses 'really_worst_q' to estimate lowest numCDs to test.
- auto mode: searches only within 0 .. Worst Q
- removed N-M ranges (replaced by "?")
- removed special high/low bitrates limits for "?" => uses D2S min/max
- default really_worst_q=128 now (maybe too high)

Not well tested, so beta - please test.

Last edited by tylo; 20th August 2003 at 07:11.
tylo is offline   Reply With Quote
Old 19th August 2003, 22:54   #119  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
r6d2, here is the answer from god (slightly edited)

Quote:
The quote [from r6d2] is correct. I have tested your hypothesis at the time I formulated the nowadays so called 1pass-Bach method. My conclusion was that the quality of the encoding increases when I do the first pass of (internal) RoBa method using the Q value closer to the correct one. The difference is not high, though. It is most noticeable when you have a lengthy still scene.
The reason? Well, I think only the CCE coders themselves could explain with 100% of sureness (is there such word in english?), but r6d2's guess (the "less forget Q" thing) is a good guess.

Anyway, CCE's manual gives us a hint: "if you change the average bitrate of a given encode by twice or half of its previous value, it is mandatory to create a new .vaf file".

In your example, lets suppose the calculated bitrate for Q=32 is 1.5 times bigger than the target bitrate (the one which you achieve with Q=48). You are not in the region which CCE's claims you should discard the vaf file. However, since there is a previous_bitrate/target_bitrate ratio (<0.5 or >2.0) for which the already created .vaf is simply useless, this means that the farther you get from the previous_bitrate/target_bitrate ratio=1 , the worse the re-usage of your .vaf is. [edited sentence structure - hope I got it right]

This most probably is not a linear correlation, so that if ratio is something between, say, 0.9(?) and 1.1(?) it is not possible to realize any loss.
DDogg is offline   Reply With Quote
Old 20th August 2003, 22:07   #120  |  Link
r6d2
Graphite mod
 
r6d2's Avatar
 
Join Date: May 2003
Location: Away
Posts: 2,022
Newton's method instead of Binary Search

@Tylo,

Your safe zone stuff made me start thinking about the application of Newton's method to find roots for an equation and its possible use to D2Sroba finding of Q. Here you are.

We have bitrate as a function of Q, BR(Q), a function which is unknown to us, but we suspect it to be linear in some range and curve in others. What is clear is that it is a continuos function and with a negative slope.

Let's define

f(Q) = BR(Q) - Target_BR

Our goal is to find Q for which f(Q) = 0. Let's define x = Q.

Newton's method states that you can find a root by iterations with the following formula:
Code:
x(n+1) = x(n) - f(x(n)) / f'(x(n))
where f'() is the derivative of f(). Since we don't know f(), we cannot calculate f'(). However, f'() can be aproximated by:
Code:
           f(x(n)) - f(x(n-1))
f'(x(n)) = -------------------
              x(n) - x(n-1)
If we replace the above formula in Newton's, we have that:
Code:
                   x(n) - x(n-1)
x(n+1) = x(n) - -------------------  * f(x(n))
                f(x(n)) - f(x(n-1))
This method requires you to do 2 blind searches before iterating (for instance, n=1 with Worst_Q and n=2 with Really_Worst_Q). Then you stop when the error, calculated as |f(x(n))| < E, is adequate. E can be set to 1% or any value you choose.

It converges very fast. I did some tests using as seeds x(1)=Worst_Q and x(2)=Really_Worst_Q, and the results are incredible. I found the target Q in 4 tries, no matter what seeds I fed in.

I hope this is not too technical, you might want to try it yourself and hopefully implement it instead of binary search. If you have questions please don't hesitate to ask.
__________________
MPEG4 quality with MPEG2? - Try the Poor Man's DVD.
FACAR - As seen on TV! - The Complete Idiot's Guide to a good DVD Conversion.
Time is money. Try D2Sroba for DVD2SVCD (FAQ) and save both. All electricity bills supported!
Do you know how much overscan and which resolution your TV has? Find out if NTSC.
Moderator: 1: one who arbitrates 2: one who presides over an assembly, meeting, or discussion
3: a substance (as graphite) used for slowing down neutrons in a nuclear reactor (Webster)

Last edited by r6d2; 20th August 2003 at 22:13.
r6d2 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 19:32.


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