02-05-2004, 09:40 AM
|
Invalid Email / Banned / Spammer
|
|
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi everyone,
It took a while, but finally gripfit gave me that caught an access violation error.
EDIT: The function has been improved to do macroblock optimization and has been divided in two: DivXResize and divxborders. Replace gripcrop and gripsize by DivXresize, and gripborders by DivXBorders. Please note that the parameters are different from the Grip functions:
How to use:
DivXResize(width,height, overscan,resizer)
DivXBorders(height,overscan)
where width and height are the destination ones, and resizer is "bicubicresize","bilinearresize" or "lanczosresize"
#######
# Script
########
Function DivXResize(clip c, int WIDTH, int HEIGHT, int OVERSCAN, string RESIZER) {
halfheight43=(round(c.width()/1.33333)-c.height())/2
#What would be the height keeping the aspect ratio if width was 640/320-NTSC or 768/384-PAL(4:3)
no_borders_height1=c.height()
no_borders_height1=(HEIGHT == 480) ? (640*c.height())/(c.width()) : no_borders_height1
no_borders_height1=(HEIGHT == 240) ? (320*c.height())/(c.width()) : no_borders_height1
no_borders_height1=(HEIGHT == 576) ? (768*c.height())/(c.width()) : no_borders_height1
no_borders_height1=(HEIGHT == 28 ? (384*c.height())/(c.width()) : no_borders_height1
#Now how much we have to shrink to make it fit inside a macroblock?
mod16height=no_borders_height1 % 16
#If the rest is <=8, subtracts the rest, else, completes to 16.
completion= (mod16height <= ? (-mod16height) : (16-mod16height)
no_borders_height2=no_borders_height1+completion
#finally resize
c=Eval( RESIZER + "(c," + string(WIDTH) + "," + string(no_borders_height2) + ")" )
#add lateral overscan
c=letterbox(c,0,0,overscan*8,overscan*
return(c)
}
Function DivXBorders(clip c, int HEIGHT, int OVERSCAN) {
halfheight43=(HEIGHT-c.height())/2
c=addborders(c,0,halfheight43,0,halfheight43)
#Add vertical overscan
c=letterbox(c,overscan*8,overscan*8,0,0)
return(c)
}
|
Someday, 12:01 PM
|
|
Site Staff / Ad Manager
|
|
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
|
|
|
02-07-2004, 04:45 AM
|
Free Member
|
|
Join Date: Jul 2003
Location: Pazardjik, Bulgaria
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
So where can we download it from?
|
02-07-2004, 06:14 AM
|
Free Member
|
|
Join Date: Sep 2002
Location: Lahti, Finland
Posts: 1,652
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No need to download anything, the needed function is in vmesquita's post. You can cut and paste it into Notepad and save it in your AVS2.5 plugins folder with the extension .avsi and it will be automatically loaded when it is called.
|
02-08-2004, 11:56 PM
|
Free Member
|
|
Join Date: Jan 2004
Location: Canada
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I like how you put an emoticon in the script
I had one avi file that didn't quite work with it. The resulting aspect ratio was a little off, i.e. the people looked slightly squished.
The source dimensions: 640*320
It's a very cool function indeed. How does moviestacker calculate? Maybe you could have just borrowed from them?
|
02-09-2004, 03:42 PM
|
Invalid Email / Banned / Spammer
|
|
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi jonny_eh,
I don't know if this is the problem, but remember that actually 704x480 is not 4:3, people look squished when you play the mpeg in the monitor in a window, but in the TV it is squized to 4:3.
Actually I never used moviestacker. I just implemented in the function the calculation I used to do manually before I discovered gripfit. Basically. it first complements the image above and below with black borders to make it 4:3. Then it resizes to the final resolution.
So in your case:
640*320 if first complemented with 80 pixels of border above and 80 pixels of borders below, making it 640x480. Then the image is resized to 704x480.
One thing I did not implement is macroblock optimization. It's not hard to add this, but it's so much to do...
|
02-09-2004, 04:20 PM
|
Free Member
|
|
Join Date: May 2003
Posts: 10,463
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Don't bother yourself with that. use Moviestacker that's all
|
02-09-2004, 04:28 PM
|
Invalid Email / Banned / Spammer
|
|
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Dialhot
Don't bother yourself with that. use Moviestacker that's all 
|
Dialhot,
Actually I wanted to develop this to use in DIKO  But I'll download MovieStacker now and try to get some ideas from it.
|
02-15-2004, 09:58 AM
|
Invalid Email / Banned / Spammer
|
|
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
02-21-2004, 09:10 AM
|
Free Member
|
|
Join Date: Jun 2003
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Nice work ! But what about GripFits dest_anamorphic=true option.
I have done many skvcds (2 CD) with anamorphic picture. No need to play with TVs zoom button
|
02-21-2004, 05:15 PM
|
Invalid Email / Banned / Spammer
|
|
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Critter,
You can use this functions, just replace 1.33333 for 1.777 and you're all set. But I advise against doing this since you can get a better picture by zooming the TV instead of encoding anamorphic, since you're DivX A.R. 1:1 is much close to 1:333 than 1:7777, so you're enlarging artificially the picture, losing compressibility but not gaining any resolution.
|
All times are GMT -5. The time now is 12:27 PM — vBulletin © Jelsoft Enterprises Ltd
|