Log in

View Full Version : Feature Request: ValueHex()


bilu
11th April 2003, 19:03
It's supposed to do the opposite of HexValue() :D

The whole point is to be able to use CALL to export registry keys like this one


[HKEY_CURRENT_USER\Software\GNU\XviD]
"mode"=dword:00000005
"desired_size"=dword:0000094a


after making calculations for the desired size. Of course I would need to know the 1st pass size, I can get it with Import() and make calculations with a XVID NULL encode and keep the value in a file.

My idea is to use AVS2AVI with this option

-c <4cc> : Use codec having <4cc> with default settings

and change the settings in the registry. This way I could use 65% compressibility on the fly ;)



Bilu

Si
11th April 2003, 21:48
Did you miss something from your post?

An explanation of what you are talking about maybe? :confused:

regards
Simon

WarpEnterprises
11th April 2003, 22:07
Here you go:


function Hex(int n) {
v="0123456789ABCDEF"
tmp=midstr(v, 1+n%16,1)
n=n/16
tmp=midstr(v, 1+n%16,1) + tmp
n=n/16
tmp=midstr(v, 1+n%16,1) + tmp
n=n/16
tmp=midstr(v, 1+n%16,1) + tmp
n=n/16
tmp=midstr(v, 1+n%16,1) + tmp
n=n/16
tmp=midstr(v, 1+n%16,1) + tmp
n=n/16
tmp=midstr(v, 1+n%16,1) + tmp
n=n/16
tmp=midstr(v, 1+n%16,1) + tmp
return tmp
}

[edit]: it's really a script function, not C :p

bilu
12th April 2003, 11:23
@WarpEnterprises

Thanks, it works :D
It's very simple and yet it so beautiful :p


@siwalters

The whole spirit of the thing is to:

1)make first pass

2)using batch file to create a new AVS with 1st pass size as variable, for compressibility calculations ( 1st pass size * 0.65 = 65% compressibility) and convert new size to Hex.
Use CALL to export the value to a batch file and import to registry a key like "desired_size"=dword:0000094a where 0000094a is replaced by the calculated size.

3) Make 2nd pass



Will use AVS2AVI -c xvid file.avs file.avi (encodes with whatever settings the codec has) after changing keys in [HKEY_CURRENT_USER\Software\GNU\XviD] like this:

1) "mode"=dword:00000003 -> 2-pass, 1st pass

2) "mode"=dword:00000006 -> NULL encode
"desired_size"=dword:0000094a -> Calculated size

3) "mode"=dword:00000005 -> 2-pass, 2nd pass

Pass 2) will be used just for calculations, therefore BlankClip and NULL encode will do just fine.

I think it is possible to integrate a 2-pass encode with a given compressibility value within robot4rip :sly:


Best regards,
Bilu

Si
12th April 2003, 11:38
Thanks for explanation.
regards
Simon