<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=RestoreSuper8Frames</id>
	<title>RestoreSuper8Frames - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://www.avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=RestoreSuper8Frames"/>
	<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=RestoreSuper8Frames&amp;action=history"/>
	<updated>2026-08-24T15:12:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=RestoreSuper8Frames&amp;diff=6077&amp;oldid=prev</id>
		<title>Reel.Deal: link</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=RestoreSuper8Frames&amp;diff=6077&amp;oldid=prev"/>
		<updated>2015-09-15T17:46:23Z</updated>

		<summary type="html">&lt;p&gt;link&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:46, 15 September 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;copy &lt;/del&gt;the code below into a file &#039;RestoreSuper8Frames.avsi&#039; in your AviSynth plugins directory or directly into your script:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Discussion thread: http://forum.doom9.org/showthread.php?t=155245&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Copy &lt;/ins&gt;the code below into a file &#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;tt&amp;gt;&lt;/ins&gt;RestoreSuper8Frames.avsi&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/tt&amp;gt;&lt;/ins&gt;&#039; in your AviSynth plugins directory or directly into your script:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   # RestoreSuper8Frames()   ( 9 Mar 2007 )&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   # RestoreSuper8Frames()   ( 9 Mar 2007 )&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Reel.Deal</name></author>
	</entry>
	<entry>
		<id>http://www.avisynth.nl/index.php?title=RestoreSuper8Frames&amp;diff=968&amp;oldid=prev</id>
		<title>Admin: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://www.avisynth.nl/index.php?title=RestoreSuper8Frames&amp;diff=968&amp;oldid=prev"/>
		<updated>2013-05-09T21:34:45Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;copy the code below into a file &amp;#039;RestoreSuper8Frames.avsi&amp;#039; in your AviSynth plugins directory or directly into your script:&lt;br /&gt;
&lt;br /&gt;
  # RestoreSuper8Frames()   ( 9 Mar 2007 )&lt;br /&gt;
  #&lt;br /&gt;
  # A combed-frames eliminator for transcript of old movies to video by Martin Wagener&lt;br /&gt;
  #&lt;br /&gt;
  # RestoreSuper8Frames() is designed to select the video frames that were best exposed with single images of the movie&lt;br /&gt;
  # and transform all the other frames to plain black.&lt;br /&gt;
  #&lt;br /&gt;
  # RestoreSuper8Frames() expects a data stream with at least 3 and no more than 4 time the field(!) rate of the movie.&lt;br /&gt;
  # i.e. the video frame rate must be between 1.5 and 2 of the movie image rate.&lt;br /&gt;
  #&lt;br /&gt;
  # The algorithm is simple: with the help of FieldDeinterlace(), the combing of the previous, current and&lt;br /&gt;
  # next frame are compared and a black frame is returned if the current frame is not the minimum.&lt;br /&gt;
  #&lt;br /&gt;
  # The filter returns irregular sequences of single best-choice frames and one to three black frames.&lt;br /&gt;
  # These sequences can be turned into alternating black-good-black-good sequences with MultiDecimate()&lt;br /&gt;
  # and then into the perfect sequence with SelectEven().&lt;br /&gt;
  #&lt;br /&gt;
  # In favor to guarantee that it is always SelectEven() and not SelectOdd() for the good frames,&lt;br /&gt;
  # this filter always turns the first frame black.&lt;br /&gt;
  #&lt;br /&gt;
  # To supply RestoreSuper8Frames() with the neccessary frames, use DoubleWeave().&lt;br /&gt;
  # DoubleWeave() will recombine all fields of the raw video in a way that always outputs one uncombed frame in the sequence.&lt;br /&gt;
  #&lt;br /&gt;
  # Movie:        |   A  |~|   B   |~|   C  |~|   D   ( A...D are the movie images - Projector slow at B, ~ is shutter)&lt;br /&gt;
  # source vid.:  |a* a*|b  b*|c* c*|d  d*|e* e |     (a..e are the video frames, * shows the uncombed)&lt;br /&gt;
  #               |1  2 |1  2 |1  2 |1  2 |1  2 |     (1 and 2 are the the fields of the frames)&lt;br /&gt;
  #               |  a  |  b  |  c  |  d  |  e  |     (this shows the complete frames before DoubleWeave()&lt;br /&gt;
  # DoubleWeave:  |aa|ab|bb|bc|cc|cd|dd|de|ee|&lt;br /&gt;
  #               |12|21|12|21|12|21|12|21|12|&lt;br /&gt;
  #               |a |a&amp;#039;|b |b&amp;#039;|c |c&amp;#039;|d |d&amp;#039;|e |        (the frames after DoubleWeave())&lt;br /&gt;
  #                A  -  -  B  -  -  -  C  -          (A-C=good frames after RestoreSuper8Frames(), -=black frames)&lt;br /&gt;
  #&lt;br /&gt;
  # The exact(!) image sequence of the celluloid movie will be reconstructed if the camera takes not less than&lt;br /&gt;
  # three and not more than four fields per image.&lt;br /&gt;
  #&lt;br /&gt;
  ## --------&lt;br /&gt;
  &lt;br /&gt;
  function RestoreSuper8Frames(clip &amp;quot;clip&amp;quot;, bool &amp;quot;map&amp;quot;, bool &amp;quot;show&amp;quot;)&lt;br /&gt;
  {&lt;br /&gt;
      map= default(map, false)&lt;br /&gt;
      SC= &amp;quot;clip=(ip&amp;lt;=ic)?blank:last&amp;quot;+chr(13)+&amp;quot;clip=(in&amp;lt;ic)?blank:clip&amp;quot;+chr(13)+&amp;quot;return((RS8Fshow)?clip.Subtitle(string(ic)):clip)&amp;quot;&lt;br /&gt;
      FE= &amp;quot;ip=AverageLuma(cp)&amp;quot;+chr(13)+&amp;quot;ic=AverageLuma(cc)&amp;quot;+chr(13)+&amp;quot;in=AverageLuma(cn)&amp;quot;&lt;br /&gt;
      global RS8Fshow= default(show,false)&lt;br /&gt;
      global ip=0&lt;br /&gt;
      global ic=0&lt;br /&gt;
      global in=0&lt;br /&gt;
      dt=8&lt;br /&gt;
      global cf=clip.GreyScale().HorizontalReduceBy2().Blur(1.58,0)&lt;br /&gt;
      global blank=BlankClip(clip,length=clip.FrameCount(),color=0)&lt;br /&gt;
      global cp=cf.DuplicateFrame(0).FieldDeinterlace(threshold=255,dthreshold=dt,map=true).Levels(140,1,255,0,255,coring=false)&lt;br /&gt;
      global cc=cf.FieldDeinterlace(threshold=255,dthreshold=dt,map=true).Levels(140,1,255,0,255,coring=false)&lt;br /&gt;
      global cn=cf.DeleteFrame(0).DuplicateFrame(clip.Framecount()-1).FieldDeinterlace(threshold=255,dthreshold=dt,map=true).Levels(140,1,255,0,255,coring=false)&lt;br /&gt;
      f1= clip.ScriptClip(SC)&lt;br /&gt;
      f0= f1.FrameEvaluate(FE)&lt;br /&gt;
      return((map) ? Overlay(f0,clip,opacity=0.5).Overlay(BilinearResize(cc,clip.Width(),clip.Height()),opacity=0.5,mode=&amp;quot;add&amp;quot;) : f0)&lt;br /&gt;
  #   return((show) ? BilinearResize(cc,clip.Width(),clip.Height()) : f0)&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
Back to [[Shared functions]].&lt;br /&gt;
[[Category:Shared_functions]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>