digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Ping-pong prediction vs Long-short prediction (http://www.digitalfaq.com/archives/avisynth/6832-ping-pong-prediction.html)

incredible 04-03-2004 08:49 AM

But please keep in mind to keep the credits in the function as I did wrote it in the beginning of this thread where the fuction is quoted ... there you can also add yourself in the credits mentioning your additions :wink:
Thanks

Prodater64 04-03-2004 10:05 AM

Quote:

Originally Posted by incredible
But please keep in mind to keep the credits in the function as I did wrote it in the beginning of this thread where the fuction is quoted ... there you can also add yourself in the credits mentioning your additions :wink:
Thanks

Don't take it bad but you don't own the equations. You are method's owner and, of course, method's credits 100 %, but not own the script since it only has, maybe, 10 % of your code. In any case, I don't want include any credit line, as I don't like unnecesary text lines.

In addition, if you allow me it, it is a triviality, since that who copy the script, first that will do will be to erase the credits. :D

incredible 04-03-2004 11:16 AM

Quote:

Originally Posted by Prodater64
Don't take it bad but you don't own the equations. You are method's owner ..... In any case, I don't want include any credit line, as I don't like unnecesary text lines.

In addition, if you allow me it, it is a triviality, since that who copy the script, first that will do will be to erase the credits. :D

My friend thats what I saw and interpreted therefore right :!:

The slicer() function DOES exactly base on MY week-filling developemend/testing and your further developement (which I do apriciate) does EXACTLY enjoy primary the purpose of the slicer() function and its idea and purpose to give a combination of a GOP based + %based + offset prediction + encoder independence.
Every addition like more Subs or the CDsize stuff from the other functions of the other Prediction thread are nice, do make it mor comfortable BUT the purpose of the script DOES base on the main core.

You can't take sources/Ideas from other people ... give them some adds (which is good) and then just kill the credits of the origin by using the argument "avoid text lines" as they don't make processing slower.
Thats also the main problem of the purpose of "OpenSource" like Kwag explained some time ago.

What do you think would "mf" from doom9 do if I take his "mf_toon.avsi"... adding some nice parts and do offer that one without pointing to the creator of the core?? That would cause ver much misunderstandings.

We're her to develope, and therefore to provide our developings.

And no matter if users do delete something afterwards or not ... here we are talking about the source condition for providing!
Some time ago I just offered GripFit_YV12.dll on my mirror and for shure I got a mail from the owner that I have to provide the FULL package, means also the license/credits text file.

So I tell you seriosly do add again these remarks as they where and do add your lines about your additions and whats about your additions! :!:

Im very sensible on this, so you have to understand friendly as in the past I learned much from situations where things like these are not CLEARLY spoken out ;-) . Even Avalon keeped the credits when he integrated slicer() in his mencoder GUI for prediction (well he didn asked me, but for shure there is nor reason to ask as he keeped the credits ad as Slicer() is free for every user)

kwag 04-03-2004 11:27 AM

@Prodater64,

Please put ALL original credits back on the top of the script :!:

-kwag

Prodater64 04-03-2004 11:46 AM

Quote:

Originally Posted by kwag
@Prodater64,

Please put ALL original credits back on the top of the script :!:

-kwag

That is done.
Can you now, please, delete this and 3 previous posts.
I don't want somebody think about me that I'm like this people like Inc mentioned.
BTW, nobody needs to be so imperative with me.

incredible 04-03-2004 12:02 PM

Nobody thinks that you could be like people I mentioned ..... ;-) cause now you understand.

It was just a very clear "hint" (not imperative at all) that your posting before showed a "little" attitude as a reaction of my little advice before and that was the subject of the last few postings .... and now clearyfied.

Con saludos a palma
Inc.

Prodater64 04-03-2004 12:29 PM

Thanks Inc.
:D

And now, most important, do you like it? :?:

Zyphon 04-29-2004 10:13 AM

Quote:

Originally Posted by Prodater64
################################################## #

#mpeg2source("C:\Your Path\Your Project.d2v")

AVISource("C:\Your Path\Your.avi",false)
######################################### Here Your script ################################################## ##
#ConvertToYV12()
#AddBorders(0,0,x,y)
BlindPP(cpu=4)
Blockbuster(method="noise",detail_min=1,detail_max =3,variance=0.1,seed=1)
Convolution3D(1, 6, 12, 6, 8, 2.8, 0)

BicubicResize(704, 320, 0, 0.6, 0, 0, 640, 272)
AddBorders(8, 128, 8, 128)

Undot()
TemporalSoften(2,7,7,3,2)
DCTFilter(1,1,1,1,1,1,0.5,0)
#Blockbuster(method="noise",detail_min=1,detail_ma x=10,variance=0.3,seed=5623)

#ConvertToYUY2()

#########################################

Hi Prodater64 I have a quick question about the above lines in the script:


Code:

#mpeg2source("C:\Your Path\Your Project.d2v")

AVISource("C:\Your Path\Your.avi",false)

the script beneath that is that the MA opt script?

If so would you need to change it for a DivX source?

Thanks in advance for you help. :)

incredible 04-29-2004 10:58 AM

@ Zyphon

That part is the optimal AVI script V4

The "little" Problem is .... Prodater64 did "split" the function into 2 fragments:

1. Variables and Encoding Script

2. The function

Better would be (as it was orig. before)...
... just an .avsi function including the varaibles and everything for slicing which can be put in the avs plugins directory. So you just can take every encoding script you want and just add below slicer() incl. its arguments.

Before it was more flexible in its settings .... but Prodater64 did add some calculation techniques as you can read above so noobs can just enter cd size and so on.

And thats also my answer to you Prodater64 ... sorry for responding that late! :)
I did try it but .... and thats only IMHO ... I stay with my version as I am more flexible and so I can use the more "risc"(reduced) ;-) based function also to do much more other things .... like the case we are discussing in the latest "Crazy Idea got into my mind"-thread from Kwag, where future predictions "could" be done not with only a ping and pong, but also with multiple randomly offsets.

:wink:

Prodater64 04-29-2004 11:34 AM

Quote:

Originally Posted by incredible
And thats also my answer to you Prodater64 ... sorry for responding that late! :)
I did try it but .... and thats only IMHO ... I stay with my version as I am more flexible and so I can use the more "risc"(reduced) ;-) based function also to do much more other things .... like the case we are discussing in the latest "Crazy Idea got into my mind"-thread from Kwag, where future predictions "could" be done not with only a ping and pong, but also with multiple randomly offsets.

:wink:

This is is great Inc.
My mod is only intended for not automatic calculation, offering a little bit more information than your slicer original function.

Quote:

Better would be (as it was orig. before)...
... just an .avsi function including the varaibles and everything for slicing which can be put in the avs plugins directory. So you just can take every encoding script you want and just add below slicer() incl. its arguments.
This is your personal opinion. If both functions throw similar results the users have to decide which to use.

incredible 04-29-2004 12:58 PM

Quote:

Originally Posted by Prodater64
This is your personal opinion. If both functions throw similar results the users have to decide which to use.

Sorry if I do seem now upset but your last opinion/sentence makes me writing the following....

To me it seems that you still dont understand all this whole princip of COOPERATION on other peoples developement roots/cores :!:
I thought we have been through this. And I dont know why its getting that complicated now as the postings above did explain everything.

If you want help developing the function named Slicer() and its state, we can work together, and I do apreciate that very much!
BUT I want to keep "Slicer()" easy to use and compact and not to be provided in two parts.

An easy explanation example (as I see its necessary):Go an get the function 60ito24p.avsi from Sharfis_Brain ... do change things where the author does not totally agree with as it gets more confusing in his eyes and release it under the same name .... you know what will be happen if you say to him "let the users decide which to choose".
I dont know why I have to explain that to you. BEACUSE there wont be the conclusion ... let the users decide :!: (and exactly that is your opinion which makes me writing these lines)

Inc.

Prodater64 04-29-2004 03:00 PM

Quote:

Originally Posted by incredible
Quote:

Originally Posted by Prodater64
This is your personal opinion. If both functions throw similar results the users have to decide which to use.

To me it seems that you still dont understand all this whole princip of COOPERATION on other peoples developement roots/cores :!:

Your seem is wrong.
Quote:

Originally Posted by incredible
I thought we have been through this. And I dont know why its getting that complicated...

You make it complicated.
Quote:

Originally Posted by incredible
... now as the postings above did explain everything.

It didn't explain exactly. First, Zyphon question was for me (Prodater64). Second, if you say
Quote:

The "little" Problem is .... Prodater64 did "split" the function into 2 fragments:
1. Variables and Encoding Script
2. The function
...
The problem is for you. All other people can like, or better love it.
I repeat, it is only your personal opinion.
Quote:

Originally Posted by incredible
If you want help developing the function named Slicer() and its state, we can work together, and I do apreciate that very much!
BUT I want to keep "Slicer()" easy to use and compact and not to be provided in two parts.

I don't want specially help slicer() developement. Just I saw the function and I though enhace it. And I think it was enhanced in some sense. You think that no. Well, is not our problem. People will decide what use of both.
Quote:

Originally Posted by incredible
... do change things where the author does not totally agree with as it gets more confusing in his eyes...

But not agreement with my mod is only your problem. More confusing in your eyes, who know in other people eyes?
Quote:

Originally Posted by incredible
... and release it under the same name ...

Want you that I change the function name? Not problem. But the function is yours (it is only tweaked for me), but the mod is mine, and I only want that people test it, but I don't go on saying,
Quote:

The "little" Problem is .... Incredible did release the function into 1 fragments, with a lack of information, without ping/pong conditional selection, neither sample/full encode easy to use control.
Quote:

Originally Posted by incredible
I dont know why I have to explain that to you.

I also don't know it. I don't needed any explanation about it.
The function is yours, the mod is mine.
I know it clearly and I don't need further explanations.

Quote:

Originally Posted by incredible
(and exactly that is your opinion which makes me "ojo")

You don't need "ojo", maybe "ojos cerrados" (closed eyes). I mean you can calm sleep, I'm not a thief.

incredible 04-29-2004 03:28 PM

Quote:

I don't want specially help slicer() developement. Just I saw the function and I though enhace it. And I think it was enhanced in some sense. You think that no. Well, is not our problem.
I did explain that by the case of avsi's from MF or the 60ito24p.avsi function. Didnt you read these lines, wherent they understandable and reasonable????? Maybe not as you didnt quote that one but all other lines :!: ... but they where the most important.

The problem is not! basically that someone does a mod, its your way of handling the approach .... first deleting credits and argumenting "why" (some postings above, you remeber?).... and continued by your last point of views.

Zyphon 04-29-2004 04:27 PM

@Incredible

Thanks for the info buddy it is much appreciated.

Also im sorry that my question has caused an argument between Incredible and Prodater64 that was not my intention I just wanted to simply understand Prodater64 script as well as Incredible's one.

For Prodater64 script is I use DVD source do I then replace that opt script with the MA then?

kwag 04-29-2004 04:35 PM

Because it's Incredible's script, why don't people make suggestions to him, for improvements, and let HIM (Incredible) decide what goes in and out :idea:
It is Incredible's original idea. Isn't it :?:

-kwag

Zyphon 04-29-2004 05:47 PM

Quote:

Originally Posted by kwag
Because it's Incredible's script, why don't people make suggestions to him, for improvements, and let HIM (Incredible) decide what goes in and out :idea:
It is Incredible's original idea. Isn't it :?:

-kwag

I agree, its Incredible's baby after all. :)

Nice work with Slicer btw Inc. :)

Prodater64 04-29-2004 06:14 PM

Quote:

Originally Posted by kwag
Because it's Incredible's script, why don't people make suggestions to him, for improvements, and let HIM (Incredible) decide what goes in and out :idea:
It is Incredible's original idea. Isn't it :?:

-kwag

@Kwag, sometimes you (like inc) have a closed mind. Sometimes you are a little partial. (Inc is your friend and me less than him, or not at all, I don't kow it).
I had enhanced slicer() function (is my opinion). You like it, use it, you don't like it, don't use it, is very, very easy, isn'nt it? The Ziphon question was about my mod, nor about slicer() function. He wanted to test it and compare with slicer() function. It is what must to concern to people. People uses quenc, other mencodeme, other mencoder.exe, other ffvfw. All this software uses libavcodec. People choice up to they and not problem isn'it?
What happend, Is it, that I had stole a closed source?
Please!!!

@Inc: Don't carry here credits problems again, I was wrong and I repair my mistake. I have right of take anything here and enhance, use or no use, since it is public. And I still keeping your credits and never wanted take your credits.
Can you understadn that?

Better dedícate to useful things and not to waste the time with trivialities.
If you reply this post, I will not reply you again. I do not waste my time in trivialities. (Although surely you will think that it is not a trivialitie, but we all can think what we want).

kwag 04-29-2004 08:45 PM

Hey Prodater64,

Cool down :lol:
It's just that Inc. originally did the script (and the logic behind it), so it would be nice to "submit" your enhancements to him, and let him decide what goes in and what goes out.
However, if you want to re-write everything, where your script is substantially different than Inc's script, then by all means, go ahead :!:
(Just make sure that Inc's code left is less than 10% :mrgreen:)
And as for Inc. being my friend, and you less that him :!:
Why would you say that :?:
Slow down on the "Vino Tinto" :twisted:

:lol:

-kwag

Prodater64 04-29-2004 08:50 PM

Quote:

Originally Posted by kwag
Slow down on the "Vino Tinto" :twisted:
-kwag

But it is so good, maybe two bottles is so much! :lol: :lol:

kwag 04-29-2004 09:04 PM

Quote:

Originally Posted by Prodater64
But it is so good, maybe two bottles is so much! :lol: :lol:

ONE bottle is enough to put me to sleep, of course, after eating half pound of "Jamon Serrano" (Prosciutto) ;) :lol:
TWO bottles, will put me to :puke: :puke: :puke: :puke: :mrgreen:

-kwag

Bchteam 11-28-2004 09:18 AM

One question:

I have encoded a sample with this "ping/Pong" stuff. When I play the sample with the Media Player, there's a message in grey letters that says:

"Offset set to: 0 sec. (Offset intervall should be: 0 sec. / 49 sec.)"

Is that OK, or this an error ?

Prodater64 11-28-2004 09:54 AM

Quote:

Originally Posted by Bchteam
One question:

I have encoded a sample with this "ping/Pong" stuff. When I play the sample with the Media Player, there's a message in grey letters that says:

"Offset set to: 0 sec. (Offset intervall should be: 0 sec. / 49 sec.)"

Is that OK, or this an error ?

You need to read the second post of thread again.
49 sec is the offset for a "pong" pass.
When you go to encode, you must unable slicer function first, and no message will sowed.

incredible 05-24-2005 04:44 AM

Slicer has been updated ...

look here for the new Version:
http://www.kvcd.net/forum/viewtopic....15775&start=16

rds_correia 05-24-2005 07:59 AM

Hi Andrej :D,
Thanks for updating the original thread (as per my request :)).
I have already tested it at home and I gotta tell you: I love it.
BTW, has it gotten any faster than the older release based on sampler()?
I'm saying this because I did a small test with (1,15,3,"ping") and it was ~15 seconds faster than the older one with the same parameters.
Or maybe it has something to do with the older version having the subtitling feature?
I had "subs on" when I encoded the sampler() based sample.
I was using HC Encoder v0.14beta with a simple Mpeg2Source() and your function.
Have you done any speed testings yourself between both versions?
Cheers pal

Zyphon 05-24-2005 09:13 AM

Thanks Inc for updating your excelllent Ping-Pong prediction tool, I use this in my scripts when I do manual conversions and have had great results I like to look of the new version and no need to have sampler any more, I can't wait to run some tests with it. :)

incredible 05-24-2005 12:00 PM

The new one does use the avisynth's internal SelectrangeEvery() command. Maybe thats the reason why a little speedup occures :) ... as the external call to sampler.dll is not more done. So it seems that SelectrangeEvery() is faster than Sampler().

The subtitles aren't needed anymore. In the old version it showed you how the offset has to be set manually, but now this will be done automatically when the script recognises the "pong" string in the slicer() command.
So no more Subs needed.

I got an extended slicer() Version of the latest release where ALL specs are shown in subtitles for testing, like OrigFramecount, SlicedFramecount, PercentOfMovie, Ping or Pong ... etc .... but who cares.
:lol:

Zyphon 05-24-2005 12:46 PM

We care. :D

rds_correia 05-24-2005 02:55 PM

Quote:

Originally Posted by incredible
The new one does use the avisynth's internal SelectrangeEvery() command. Maybe thats the reason why a little speedup occures :) ... as the external call to sampler.dll is not more done. So it seems that SelectrangeEvery() is faster than Sampler().

Could be, but I'll do some more thorough tests to proove it.
I'm guessing it could be the subtitle() too but I'll tell you later.
Quote:

The subtitles aren't needed anymore. In the old version it showed you how the offset has to be set manually, but now this will be done automatically when the script recognises the "pong" string in the slicer() command.
So no more Subs needed.
Having the option for the subs was cool, though.
Quote:

I got an extended slicer() Version of the latest release where ALL specs are shown in subtitles for testing, like OrigFramecount, SlicedFramecount, PercentOfMovie, Ping or Pong ... etc .... but who cares.
:lol:
Andrej if you have such an enhancement could you share it with us?
We do care.
It could be very usefull to store ilustrated test runs with different settings.
That way we could easily recall the basic settings we used on a test run.
Cheers

incredible 05-24-2005 03:59 PM

Here it is .... but this is a subtitled one and it's NOT configurable, means I used it for testing and to proof that 2% in the command got real 2% of the framerate for example. So Subtitles will be forced :!: :!: :!: NOT to be used for prediction :!:

So its not an enhancement ... its just a testing/proofing function. For prediction purposes do use the one in the link above!

Code:

function slicerTesting(clip input, int percent, int Goplenght, int Gopmulti, string "ping")
{
frames=framecount(input)

PercCount = (Framecount(input)/100)*percent
period    = int(Framecount(input)/PercCount)*(Goplenght*Gopmulti)
input=(ping == "pong") ? input.trim((period/2),Framecount(input)).subtitle("  !!!Pong active at: "+string(int(period/2))+" Frames (auto calculated Offset)",10,100,font="courier new"):input.subtitle("        Ping active",10,100,font="courier new")
selectrangeevery(input, period, (Goplenght*Gopmulti))
minutes    = float((Framecount(last)/framerate(last))/60)
intminutes = int(minutes)
seconds    = int(60*(float(minutes-intminutes)))
subtitle("    Orig Framecount: "+string(frames),10,20,font="courier new")
subtitle("No of sampled Frames: "+string(Framecount()),10,40,font="courier new")
Subtitle("  % of Movie sampled: "+string((100/float(frames))*float(framecount))+" %",10,60,font="courier new")
subtitle("    Sampled Movietime: "+string(int(minutes))+"m:"+string(seconds)+"s",10,80,font="courier new")


}


Zyphon 05-25-2005 03:07 AM

Thanks for sharing Inc :D we appreciate all your hard work with this excellent slicer() tool. :)

Prodater64 06-09-2005 05:48 PM

@Inc: I was thinking about you new function and I would like to know what do you think about:

Suppose you want to predict an encoding task and select 2% prediction sample size. So You do calculations and a script as following.

Quote:

a=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v").slicer(1,15,1,"ping")
b=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v").slicer(1,15,1,"pong")
return a++b


Crop, resize and filters.


function slicer(clip input,int percent,int Goplenght,int Gopmulti,string "ping")
{
PercCount=(Framecount(input)/100)*percent
period=int(Framecount(input)/PercCount)*(Goplenght*Gopmulti)
input=(ping=="pong")?input.trim((period/2),Framecount(input)):input
selectrangeevery(input,period,(Goplenght*Gopmulti) )
}
I think that in only one pass, you will obtain your predicted size.
Ping-pong in only one pass. Please notice that slicer calls (ping and pong) just asks for 1 % (half your prediction sample lenght). I mean that it is really only an 1% ping-pong prediction.

If it is true, with encoders that supports command line, is is quite easy to do a loop until matching sample prediction size.

What do you think?

incredible 06-10-2005 02:32 AM

Code:

a=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v").slicer(1,15,1,"ping")
b=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v").slicer(1,15,1,"pong")
return a++b

By loading two times the same source your script needs more memory!

Better would be:
Video=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v")
ping = Video.slicer(1,15,1,"ping")
pong= Video.slicer(1,15,1,"pong")
last = ping++pong

If you set return at the end no other following routins will be included.

Also ....

ping = Video.slicer(1,15,1,"ping")
pong= Video.slicer(1,15,1,"pong")
last = ping+pong

is the same as ...

last = Video.slicer(2,15,1,"ping")

as by just 2% theoretically the amount of slices is doubled, means one more slice between the slices of 1% (wich means a pong is included).
IF Im not wrong ...... Please check that :)

Ping pog is not purposed to do ...

ping
pong
ping
pong
ping
.....

Its more like this

ping
pong
ping
ping
ping
ping
pong
- encode

Prodater64 06-10-2005 11:59 AM

Quote:

Originally Posted by incredible
Code:

a=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v").slicer(1,15,1,"ping")
b=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v").slicer(1,15,1,"pong")
return a++b

By loading two times the same source your script needs more memory!

Better would be:
Video=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v")
ping = Video.slicer(1,15,1,"ping")
pong= Video.slicer(1,15,1,"pong")
last = ping++pong

If you set return at the end no other following routins will be included.

It is too hard to me to explain this (not even understand it, :lol: ) so be patient please.
Thanks for show me difference between return and last.
Did you mean that with return, not resize neither filtering would be applied in my previous script?

Quote:

Also ....

ping = Video.slicer(1,15,1,"ping")
pong= Video.slicer(1,15,1,"pong")
last = ping+pong

is the same as ...

last = Video.slicer(2,15,1,"ping")

as by just 2% theoretically the amount of slices is doubled, means one more slice between the slices of 1% (wich means a pong is included).
IF Im not wrong ...... Please check that :)

If your function behaviour is:
Ping 1% = 1xxx1xxx1xxx1xxx1xxx1
Pong 1%= x1xxx1xxx1xxx1xxx1xxx1
Ping 2% = 11xx11xx11xx11xx11xx11

I agree that:

ping = Video.slicer(1,15,1,"ping")
pong= Video.slicer(1,15,1,"pong")
last = ping+pong

is the same as ...

last = Video.slicer(2,15,1,"ping")

but if your function behaviour is:
Ping 1% = 1xxx1xxx1xxx1xxx1xxx1
Pong 1%= xx1xxx1xxx1xxx1xxx1xx
Ping 2% = 11xx11xx11xx11xx11xx11

your previous affirmation is not true.
Could you say me how really works your function.

Quote:

Ping pog is not purposed to do ...

ping
pong
ping
pong
ping
.....

Its more like this

ping
pong
ping
ping
ping
ping
pong
- encode
Now the harder part:

When you do a 2% ping pong we have:

2 % ping
2 % pong
2 % ping
2 % ping
2 % ping
2 % ping
2 % pong

You "suppose" that ping-pong differences will be equal than first one, bur really it isn't as you can view in the screenshot:

http://www.digitalfaq.com/archives/error.gif

CQ 69 diff = 1172
CQ 70.5 diff = 1175
CQ 69.9 diff = 1176
CQ 70.2 diff = 1181

Small differences but differences. Is for this reason that you need to evaluate last pong, to see if prediction is enough close of target filesize.
I think if you do prediction as You corrected me before, as ping pong differences are inherent, you don't need last pong pass.
In other words, when you do:

Target size 30000 KB

1: 2 % ping 20000 KB
2: 2 % pong 25000 KB
3: 2 % ping 22000 KB
4: 2 % ping 24000 KB
5: 2 % ping 26000 KB
6: 2 % last ping 27500 KB
7: 2 % last pong 32000 KB

As pp diff is not the same at different CQ values, you target would be (27500+32000)/2=29950 KB at last CQ.
But you can continue doing pings until obtain exact match.

I do:
1: 2 % ping-pong (1% ping + 1% pong)
2: 2 % ping-pong
3: 2 % ping-pong
4: 2 % ping-pong
5: 2 % ping-pong

As pp diff is inherent, my target would be (13865.55+16134,45)=30000 KB
It will need less passes than usual ping-pong to obtain same exact match.
Not final pong is necessary.

All this stuff is just a theory, I had not have time to test it.

incredible 06-10-2005 12:37 PM

Ähhhhm ... thats a lot of stuff!

I see you want it to integrate in your Pred-Tool. Nice!
As I also intented to write a HYBRID Predictioner for HC/CCE/TmpEnc/Nuenc ... but Im so much in other PureBasic Avisynth Stuff so Ill explain you how to do it.
(Avalon also integrated Slicer in his AutoQ's but Im shure he even doesnt know how the idea is ;) )

Quote:

Did you mean that with return, not resize neither filtering would be applied in my previous script?
The return command defines WHAT will be send from the Return on to your decoder. Means IF you set other routines or filters after the "Return" Line, these will be ignored as yo define with Return WHAT will be returned exactly ;)

Quote:

If your function behaviour is:
Ping 1% = 1xxx1xxx1xxx1xxx1xxx1
Pong 1%= x1xxx1xxx1xxx1xxx1xxx1
Ping 2% = 11xx11xx11xx11xx11xx11
Nope, .... well it shouldn't.

Ping 1% = 1xxx1xxx1xxx1xxx1xxx1
Pong 1%= xx1xxx1xxx1xxx1xxx1xx

...ok ...

Ping 2% = 11xx11xx11xx11xx11xx11

... but here u show the doubling of the Gop lenght including! the increase of %frames in total ;)

"11" means for example (2*15frames), means a Gop multi of 2!
When increasing the "%" Value that wont enlarge the slices(means the count of the FOLLOWING frames) but enlarges the count of the slices theirselves.

Example (5% of the movie):
Ping = 1xxxxxxxxxxxxx1xxxxxxxxxxxxx1xxxxxxxxxxxxx .....
Pong= xxxxxxx1xxxxxxxxxxxxx1xxxxxxxxxxxxx1xxxxxx .....

doubling the 5% to 10%:

Ping = 1xxxxxx1xxxxxx1xxxxxx1xxxxxx1xxxxxx1xxxxxx .....
Pong= xxx1xxxxxx1xxxxxx1xxxxxx1xxxxxx1xxxxxx1xxx .....

multiplying the GOP by 2 by keeping 10%:

Ping = 11xxxxxxxxxxxx11xxxxxxxxxxxx11xxxxxxxxxxxx .....
Pong= xxxxxxx11xxxxxxxxxxxx11xxxxxxxxxxxx11xxxxx .....

multiplying the GOP by 2 by keeping 5%:

Example (5% of the movie):
Ping = 11xxxxxxxxxxxxxxxxxxxxxxxxxx11xxxxxxxxxxxx .....
Pong= xxxxxxxxxxxxx11xxxxxxxxxxxxxxxxxxxxxxxxxxx .....


So thats the math, as IF you increase the GOP multi, you have to decrease the number of slices to match the same % in total ;)

So .... 2% and GopMulti=1 means more slices! but short! sampled
..... 2% and GopMulti=2 means less slices! but long! sampled

;)


Acording to the rest of your post ....

Well If you first do a pin and then a pong you get:
a) The size of the sample which whould be the result IF you would use the actual CQ (yep thats what we already know ;) )

b) the DIFFERENCE of the ping (slices) to the pong (slices). THAT Difference you have to keep in your mind as it affects the whole logic.

So we do

Ping = 100kb
Pong = 110kb

110-100 = 10 .... 100/10 = The difference = 10% in size as "less" to the pong. Means do add 5% to every following ping to get the wanted "how would it be if I would do a pong now" average!

Ping = xxxkb (+5% of size)
ping = xxxkb (+5% " )
Ping = xxxkb (+5% " )
Ping = xxxkb (+5% " ) ------ that would match!
Finally we would do a final "safe" pong and again we would do the same calculation way as in our first ping/pong WITHOUT adding the 5% to the LAST ping. The Result should match the last Ping+5%.

Be aware that the Calcs above are out of mind as Im in the office, but you will understand WHY you have to do maximal 2 pongs in the whole prediction. The Pongs just serve you the difference, which wouldnt be available in a prediction of the same % Amount in single passes. THATs the "Idea" of Slicer.

Prodater64 06-10-2005 01:16 PM

@Inc:
Just now I understand what do you mean with "keep the difference in mind".

For me difference was ping KB - pong KB.
But you are talking about a "proportional difference" (I don't know how to call it in english).
difference = a - b
proportional difference = (a - b) / a

It is only an explanation for other confused people as me.
:oops:

Prodater64 06-10-2005 03:31 PM

Quote:

Originally Posted by incredible
Better would be:
Video=Mpeg2source("E:\DVD Authoring Working Folder\Matrix.d2v")
ping = Video.slicer(1,15,1,"ping")
pong= Video.slicer(1,15,1,"pong")
last = ping++pong

This gives me an Evaluate: division by zero error referenced to ping=, pong= and your function period= lines.

Edited1: Forget it, was my mistake.

Edited1: When I encode separated ping and pong, it gives me same framecount that the previous script. Why?
I changed function percent, but still same framecount???

rds_correia 06-10-2005 05:33 PM

@Pro,
Only changing the GOP multiplier value will give you different sample sizes.
That's how this function is supposed to work.
You ask for 1% of a movie with 155000 frames :?:
:arrow: then you always get 1550 frames in a ping or pong.
Quote:

difference = a - b
proportional difference = (a - b) / a
It's a typo, right?
It should look like:
proportional difference = (a - b) / b
Cheers

Prodater64 06-10-2005 06:10 PM

Quote:

Originally Posted by rds_correia
@Pro,
Only changing the GOP multiplier value will give you different sample sizes.
That's how this function is supposed to work.
You ask for 1% of a movie with 155000 frames :?:
:arrow: then you always get 15500 frames in a ping or pong.
Quote:

difference = a - b
proportional difference = (a - b) / a
It's a typo, right?
It should look like:
proportional difference = (a - b) / b
Cheers

I know that, but I don't know why when I did the test, it gives me 3 times same famecount. I am doing it again now.

Not a typo. Read a few post before Inc said

ping 100
pong 110
difference (proportional difference) = 10%

It is actually -10%

(a -b) / a = -10%
(100 - 110) / 100 = -10%

rds_correia 06-10-2005 06:25 PM

Quote:

Originally Posted by Prodater64
Not a typo. Read a few post before Inc said

ping 100
pong 110
difference (proportional difference) = 10%

It is actually -10%

(a -b) / a = -10%
(100 - 110) / 100 = -10%

Ok what I've always done is for instance:
ping=27619KB
pong=28066KB
(28066-27619)/28066
So actually I've been doing (b-a)/b :lol:
But that's just because usually "b" has a higher KB value than "a".
Don't really know why.
But I guess it's because "a" usually has a few frames from the begining of the movie.
Thus these initial frames are really dark scenes that will always be visible on "a" but not on "b".
Eventually I've had a couple of a>b but usually I have b>a.
Cheers

Prodater64 06-10-2005 07:52 PM

@rds

If you are doing:

ping=27619KB
pong=28066KB

28066-27619=447
447/28066=0.0159

be carefull:

If you apply that proportional diff to pongs:

28066 * (0.159/2) = 223.5
28066 - 223.5 = 27842.5
27619 + 223.5 = 27842.5

you will obtain your target = 27842.5

But if you apply that proportional diff to pings (that is that you are doing, ping pong ping ping ping ping ping ping safe pong):
27619 * (0.159/2) = 219.94
27619 + 219.94 = 27838.94 that is a sub-value respect to your target.
(Theoretically your actual final size will be oversized, but difference is so little that maybe you can't appreciate it)

Do you understand?


All times are GMT -5. The time now is 08:46 AM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.