ResampleMT

From Avisynth wiki
Jump to: navigation, search
Abstract
Author jpsdr
Version v2.2.3
Download ResampleMT_v2_2_3.7z
Category Resize
License GPLv3
Discussion Doom9 Thread
(Desampling functions)

Contents

[edit] Description

Internaly multi-threaded resampling functions, also includes desampling functions (DeBilinear, DeBicubic,...). .

[edit] Requirements


[edit] Syntax and Parameters

Sampling Fucntions

BicubicResizeMT (clip, int "target_width", int "target_height", float "b", float "c", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
BilinearResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
BlackmanResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
GaussResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", float "p", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
Lanczos4ResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int int "ThreadLevel")
LanczosResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
PointResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
SincResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
Spline16ResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
Spline36ResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")
Spline64ResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "ThreadLevel")


Desampling Functions

DeBicubicResizeMT (clip, int "target_width", int "target_height", float "b", float "c", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeBilinearResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeBlackmanResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeGaussResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", float "p", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeLanczos4ResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeLanczosResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeSincResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "taps", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeSpline16ResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeSpline36ResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")
DeSpline64ResizeMT (clip, int "target_width", int "target_height", float "src_left", float "src_top", float "src_width", float "src_height", int "threads", bool "logicalCores", bool "MaxPhysCore", bool "SetAffinity", bool "sleep", int "prefetch", int "range", int "accuracy", int "order", int "ThreadLevel")



clip    =
Input clip.


int  target_width =
int  target_height =
Output width and height in pixels.


float  b = 1.0/3.0
float  c = 1.0/3.0
Parameters for BicubicResizeMT and DeBicubicResizeMT only.


float  src_left = 0.0
float  src_top = 0.0
float  src_width =
float  src_height =
Optional crop syntax is the same as AviSynth's internal resizers.


float  p = 30.0
Parameter for GaussResizeMT and DeGaussResizeMT only.


int  taps =
Parameter for BlackmanResizeMT, DeBlackmanResizeMT, LanczosResizeMT, DeLanczosResizeMT, SincResizeMT and DeSincResizeMT only.


int  threads = 0
Controls how many threads will be used for processing. If set to 0, threads will be set equal to the number of detected logical or physical cores,according logicalCores parameter.


bool  logicalCores = true
If threads is set to 0, it will specify if the number of threads will be the number of logical CPU (true) or the number of physical cores (false). If your processor doesn't have hyper-threading or threads<>0, this parameter has no effect.


bool  MaxPhysCore = true
If true, the threads repartition will use the maximum of physical cores possible. If your processor doesn't have hyper-threading or the SetAffinity parameter is set to false, this parameter has no effect.


bool  SetAffinity = false
If this parameter is set to true, the pool of threads will set each thread to a specific core, according MaxPhysCore parameter. If set to false, it's leaved to the OS. If prefecth>number of physical cores, it's automaticaly set to false.


bool  sleep = false
If this parameter is set to true, once the filter has finished one frame, the threads of the threadpool will be suspended (instead of still running but waiting an event), and resume when the next frame will be processed.
If set to false, the threads of the threadpool are always running and waiting for a start event even between frames.


int  prefetch = 0
This parameter will allow to create more than one threadpool, to avoid mutual resources acces if "prefetch" is used in the avs script.
  • 0 : Will set automaticaly to the prefetch value use in the script. Well... that's what i wanted to do, but for now it's not possible for me to get this information when i need it, so, for now, 0 will result in 1. For now, if you're using "prefetch" in your script, put the same value on this parameter.


int  range = 1
This parameter specify the range the output video data has to comply with. Limited range is 16-235 for Y, 16-240 for U/V. Full range is 0-255 for all planes. Alpha channel is not affected by this paramter, it's always full range. Values are adjusted according bit depth of course. This parameter has no effect for float datas.
  • 0 : Automatic mode. If video is YUV mode is limited range, if video is RGB mode is full range, if video is greyscale (Y/Y8) mode is Y limited range.
  • 1 : Force full range whatever the video is.
  • 2 : Force limited Y range for greyscale video (Y/Y8), limited range for YUV video, no effect for RGB video.
  • 3 : Force limited U/V range for greyscale video (Y/Y8), limited range for YUV video, no effect for RGB video.
  • 4 : Force special camera range (16-255) for greyscale video (Y/Y8) and YUV video, no effect for RGB video.


int  accuracy = 0
Will specify the accuracy used for the desampling.
  • 0 : Average
  • 1 : A little less than 0.
  • 2 : A little better than 0.
Note: this parameter is only for the desampling functions.


int  order = 0
Will specify in what order the desampling will be done (process horizontal or vertical first).
  • 0 : Automatic, will choose according the same method implemented in the core filters.
  • 1 : Process vertical first.
  • 2 : Process horizontal first.
Note: this parameter is only for the desampling functions.


int  ThreadLevel = 6
This parameter will set the priority level of the threads created for the processing (internal multithreading). No effect if threads=1.
  • 1 : Idle level.
  • 2 : Lowest level.
  • 3 : Below level.
  • 4 : Normal level.
  • 5 : Above level.
  • 6 : Highest level.
  • 7 : Time critical level (WARNING !!! use this level at your own risk)



[edit] Examples

Upscale to 1920x1080 with Spline36ResizeMT:

AviSource("Blah.avi")
Spline36ResizeMT(target_width=1920, target_height=1080)


Using the desampling functions
The usage is the following: You have to enter in the parameters exactly the same that have been used for the original resampling, except the size of course, where you specify the original size you want back.

For example, if the source file is a 1280x720 video:

Spline36ResizeMT(1920,1080, src_left=-0.2)
# or Spline36Resize(1920,1080, src_left=-0.2)
# To revert :
DeSpline36ResizeMT(1280,720, src_left=-0.2)

For more information, see discussion thread.


[edit] External Links

  • GitHub - Source code repository.




Back to External Filters

Personal tools