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 > Capturing and Editing Video > Avisynth Usage

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 9th August 2013, 07:59   #1  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,549
MDec2 - v1.02 - 26 Apr 2018

dll's for Avisynth v2.58, Avs+v2.6 x86 and x64.
Requires CPP runtimes for VS 2008.

Code:
MDec2 by StainlessS

MDec2, MultiDecimate like decimating filter.

Planar, YUY2, RGB

MDEC2(clip c,float "rate"=24.0,bool "show"=false,bool "create"=false,string "dir"="C:\",bool "chroma"=true,bool "ver"=false)

MDec2 is a 2 pass decimating filter, acting much like the Multidecimate filter by Donald A. Graft.
Requires MultiDecimate.Exe & ProcessMD.Exe from MultiDecimate package.

Args:-

 c, clip. No default

 Rate=24.0, final output frame rate, used only on 2nd pass.

 show=false. 1st pass, shows metrics on frame, 2nd pass shows frame being used.

 create=false. Set true for 1st pass, false on 2nd pass after using MultiDecimate.Exe.

 dir="C:\". Path to data files (mfile.txt, cfile.txt, dfile.txt).

 chroma=true. If false then only use luma for metrics. (RGB not used).

 ver=false. True shows version on frame.

 See MultiDecimate docs for further info.


Metrics:-
 MDec2, modified metrics based on FDecimate by Donald Graft.
 Splits frames into blocks and returns metric of block with greatest difference.
 YUV Metrics weight combined chroma with same weight as luma.

NOTE, if wanting to eg decimate 29.97 to 25.0, then numbers dont work and will throw an error because of
mismatch to what it is expecting. In such circomstance, use something like:-
>>>>>>>>>>>
    SHOW=True
    ORG=Last
    AssumeFPS(30.0,sync_audio=True)
#    ResampleAudio(ORG.AudioRate)
    Mdec2(Rate=25.0,create=True,Show=True,Dir="")    # Pass 1 [Dir="", files in current directory]
    ###
    Use MultiDecimate.Exe, eg drop 1 frame in every 6.
    ######
    SHOW=False
    ORG=Last
    AssumeFPS(30.0,sync_audio=True)
    ResampleAudio(ORG.AudioRate)
    Mdec2(Rate=25.0,create=False,Show=SHOW,Dir="")    # Pass 2, output 25 fps.
<<<<<<<<<<<

StainlessS
Script included in zip, MDec2_MetricsTest.avs
Code:
########################################################################
# Script to test metrics of MultiDecimate, FDecimate and MDec2.        #
# MultiDecimate v1.07 & FDecimate v1.02/v1.10 metrics are both bugged. #
########################################################################

#Loadplugin("MDec2_x86.dll")
Loadplugin("Multidecimate.dll")
#Loadplugin("FDecimate.dll")

MODE=1   #    Testing Mode, 0 = MDec2 : 1=MultiDecimate : 2=FDecimate (All three should show metrics as 100.0%)
         # 0) MDec2, any valid 8 bit ColorSpace. Metrics shown on frame. (only 100.0% @ PC Levels)
         # 1) MultiDecimate YUY2 ONLY, Metrics stored script directory MFile.txt. (YUY2, Shows 108.51% Qual=2, 217.02% Qual=3)
         # 2) FDecimate YV12 and YUY2, Metrics shown on frame. (Shows 187.68% for YV12, 112.61% YUY2)

C="YUY2" # Choose Test Colorspace (must be valid for the called dll)

MDQUAL=2 # MultiDecimate Quality setting default 2. 2=Luma Only : 3=Luma+Chroma

IsRGBClip=FindStr(C,"RGB")!=0

W=(IsRGBClip) ? BlankClip(Pixel_Type=C,Color=$FFFFFF) : BlankClip(Pixel_Type=C,Color_YUV=$FFFFFF)
K=(IsRGBClip) ? BlankClip(Pixel_Type=C,Color=$000000) : BlankClip(Pixel_Type=C,Color_YUV=$000000)
Interleave(W,K) # White/Black(RGB) or Pink/Green(YUV) alternate frames

MODE==0  ? MDec2(rate=25.0,create=true,Show=true,dir="",Ver=True,Chroma=true) : \
MODE==1  ? MultiDecimate(Pass=1,Show=True,quality=MDQUAL) : \
           FDecimate(Rate=25.0,Metrics=true)
Return Last
EDIT: Above script modified on-line.

Zip contains dll's + source + FDecimate() original source. (metrics modified from FDecimate metrics).
Zip ~ 120KB.

See MediaFire or SendSpace below this post in my sig.

EDIT: Original MultiDecimate page gone, so also available here:- http://www.mediafire.com/file/bw4i71...ecimate107.zip
(maybe of use for docs, and MultiDecimate.exe and ProcessMD.exe).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 27th April 2018 at 01:05. Reason: Update
StainlessS is online now   Reply With Quote
 

Tags
decimate, fdecimate, multidecimate

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:13.


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