

                            FrameDiff v1.4  -  HELP FILE  (03/23/2006)


GENERAL INFO:


     ** Currently FrameDiff only supports YV12 and YUY2 colorspaces!

      FrameDiff exposes tdecimate's metric calculation routines to allow for some
   interesting operations and visualizations. There is also a version of FrameDiff
   that can be used in conditional filtering called "CFrameDiff" that allows using
   tdecimate's metric calculation abilities in Avisynth's conditional environment.
   CFrameDiff returns the calculated metric to the script.

   Syntax=>

	FrameDiff(int mode, bool prevf, int nt, int blockx, int blocky, bool chroma,
                    float thresh, int display, bool debug, bool norm, bool denoise,
                    bool ssd, int opt)

	CFrameDiff(int mode, bool prevf, int nt, int blockx, int blocky, bool chroma,
                    bool debug, bool norm, bool denoise, bool ssd, int opt)

   example =>

        conditionalfilter(last,source1,source2,"CFrameDiff",">","2.0")



PARAMETERS:


     mode -

         Sets whether the highest metric value or the lowest metric value for the
         frame is returned.

            0 - lowest
            1 - highest

         Default:  1  (int)


     prevf -

         Sets whether the difference to the previous frame or the difference to the
         next frame is calculated.

            true -  previous
            false - next

         Default:  true  (bool)


     nt -

         The noise threshold used when calculating the metrics.  This is the same as
         the nt parameter in TDecimate.

         Default:  0  (int)


     blockx/blocky -

         Defines the size of the blocks used during metric calculations. blockx = x-axis
         size, blocky = y-axis size.  Must be powers of 2 that are greater than or equal
         to 4 and less than or equal to 2048.  These are the same as the blockx/blocky
         settings in TDecimate.

         Default:  blockx = 32  (int)
                   blocky = 32  (int)


     chroma -

         Sets whether or not chroma is considered in the metric calculations.

         Default:  false  (bool)


     display -

         Controls what, if anything, is drawn on the frames.  Possible settings:

            0 - nothing
            1 - debug info + a box is drawn around the block that the metric
                   came from (the lowest metric'd block for mode = 0 and the
                   highest metric'd block for mode = 1)
            2 - debug info + if mode = 0 then all blocks with a metric that
                   is <= to the "thresh" parameter will be filled in white,
                   else if mode = 1 then all blocks with a metric that is >=
                   "thresh" will be filled in white.  (A black single pixel
                   mark is added to the middle of each filled block)

         Default:  0  (int)


     thresh -

         Used by display=2 to determine what blocks to fill.  Is based on the normalized
         (0.0 to 100.0) scale used by tdecimate.

         Default:  2.0 (float)


     debug -

         Output metric information via OutputDebugString().

         Default:  false (bool)


     norm -

         Sets whether to return the normalized metrics (0.0 to 100.0 scale) or the
         unnormalized metrics when using CFrameDiff in conditional filtering. Also
         effects which metrics are displayed by the "display" option for FrameDiff.

            true - return normalized metrics
            false - return unnormalized metrics

         Default:  true (bool)


     denoise -

         Sets whether or not to denoise frames prior to doing the difference calculations.
         This can greatly improve metrics for noisy sources (i.e. stabilize duplicate
         frame metrics and make it easier to tell the difference between duplicates and
         non-duplicates).  It also works very well for sources with lots of dotcrawl
         because the denoising effectively cancels all dot-crawl.  Using denoising
         will slow things down somewhat, but it is MMX optimized and pretty fast.

           true - use denoising
           false - don't

         Default:  false (bool)


      ssd -

         Controls whether the metrics are calculated as SAD (sum of absolute differences)
         or SSD (sum of squared differences).

           true - use ssd
           false - use sad

         Default:  false (bool)


      opt -

         Controls which optimizations are used.  Possible settings:

            0 - use c routines
            1 - use mmx routines
            2 - use isse routines
            3 - use sse2 routines
            4 - auto detect

         Default:  4  (int)



CHANGE LIST:


   v1.4 - (03/23/2006)

      - replace frame copy with makewritable


   v1.3 - (01/24/2006)

      + ported new mmx/isse/sse2 optimizations from TDecimate
      + added opt parameter
      - fixed ssd missing in CFrameDiff parameter string


   v1.2 - (11/01/2005)

      + added ssd parameter


   v1.1 - (9/28/2005)

      + added denoise parameter



TO DO LIST:


    - nothing




contact:   forum.doom9.org  nick = tritical  or  email:  kes25c@mizzou.edu
