Quantcast Improved Replacement for Gripfit - digitalFAQ.com Forums [Archives]
  #1  
02-05-2004, 10:40 AM
vmesquita vmesquita is offline
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)
}
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Site Staff / Ad Manager
 
Join Date: Dec 2002
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
02-07-2004, 05:45 AM
Edlund Edlund is offline
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?
Reply With Quote
  #3  
02-07-2004, 07:14 AM
Boulder Boulder is offline
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.
Reply With Quote
  #4  
02-09-2004, 12:56 AM
jonny_eh jonny_eh is offline
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?
Reply With Quote
  #5  
02-09-2004, 04:42 PM
vmesquita vmesquita is offline
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...
Reply With Quote
  #6  
02-09-2004, 05:20 PM
Dialhot Dialhot is offline
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
Reply With Quote
  #7  
02-09-2004, 05:28 PM
vmesquita vmesquita is offline
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.
Reply With Quote
  #8  
02-15-2004, 10:58 AM
vmesquita vmesquita is offline
Invalid Email / Banned / Spammer
 
Join Date: May 2003
Posts: 3,726
Thanks: 0
Thanked 0 Times in 0 Posts
I improved the function to work more like gripfit and do macroblock optimization!
Reply With Quote
  #9  
02-21-2004, 10:10 AM
Critter Critter is offline
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
Reply With Quote
  #10  
02-21-2004, 06:15 PM
vmesquita vmesquita is offline
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.
Reply With Quote
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Blockbuster causes a/v out of sync - Any replacement? dongxu Video Encoding and Conversion 9 10-07-2004 07:42 AM
TMPGENc Improved video encoding??? azel Video Encoding and Conversion 0 10-20-2003 11:08 AM
KVCD: more Avi resolution, gain any improved quality? dug175 Video Encoding and Conversion 1 07-19-2003 02:47 PM
Avisynth: Experimental fxToon replacement - mfToon jorel Avisynth Scripting 1 05-02-2003 11:22 AM
Recording Video: Best new Capture card replacement? kenny Video Capturing / Recording 4 11-24-2002 11:24 AM

Thread Tools



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