# IvtcError.avs # # (C) 2003 # Ivtc Error Clip by Sergej Qkowlew. # # Created to represent some artifacts Создан для демонстрации некоторых арте- # of Telecine-Inverse Telecine proce- фактов процесса интерлейса-деинтерлейса. # dures. # # Any MPEG1/MPEG2/MPEG4 stream coding Любой MPEG1/2/4 поток закодирован с по- # is loss-quality process. So - when терей качества. В том случае, если ему # such algorythm takes INTERLACED достался входной поток с чересстрочнмыи # frame for encoding and treates it кадрами, а кодек рассматривает его как # as progressive - fields from neigh- прогрессивный, содержимое полей после # bour frames are interefered. кодирования-декодирования интерферирует. # # If you receive MPEG stream with Если Вы получили так закодированный # such error - there is NO way to поток или файл - нет НИКАКОГО способа # correct 'intereferred frames'! восстановить отдельные кадры. # # In this demo Blur/Sharpen filter is Имитирует процесс кодирования-декодиро- # used to simulate 'packing-unpacking' вания фильтр Blur/Sharpen. # process. # loadplugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
BlankClip(4, 540, 160, "YUY2", 24, 1, 11025, false, true, $808080) KillAudio()
Subtitle("A", text_color=$F3F3A0, size=120, x=0, y=80, first_frame=0, last_frame=0, halo_color=$808080) Subtitle("B", text_color=$A0F3A0, size=120, x=0, y=80, first_frame=1, last_frame=1, halo_color=$808080) Subtitle("C", text_color=$A0A0F3, size=120, x=0, y=80, first_frame=2, last_frame=2, halo_color=$808080) Subtitle("D", text_color=$F3A0A0, size=120, x=0, y=80, first_frame=3, last_frame=3, halo_color=$808080)
AssumeFrameBased # divide frames to fields SeparateFields()
# marks to show field Subtitle("A top", text_color=$F3F3A0, size=20, x=0, y=48, first_frame=0, last_frame=0) Subtitle("B top", text_color=$A0F3A0, size=20, x=0, y=48, first_frame=2, last_frame=2) Subtitle("C top", text_color=$A0A0F3, size=20, x=0, y=48, first_frame=4, last_frame=4) Subtitle("D top", text_color=$F3A0A0, size=20, x=0, y=48, first_frame=6, last_frame=6)
Subtitle("A bottom", text_color=$F3F3A0, size=20, x=0, y=60, first_frame=1, last_frame=1) Subtitle("B bottom", text_color=$A0F3A0, size=20, x=0, y=60, first_frame=3, last_frame=3) Subtitle("C bottom", text_color=$A0A0F3, size=20, x=0, y=60, first_frame=5, last_frame=5) Subtitle("D bottom", text_color=$F3A0A0, size=20, x=0, y=60, first_frame=7, last_frame=7)
# Splice fields to frames back Weave()
Showframenumber(true) #Keep FILM original ClipStart=trim(0,3)
# Make NTSC 3:2 pulldown stream from our film
AssumeFrameBased # divide frames to fields SeparateFields() # Build NTSC sequence SelectEvery(8, 0,1,0, 3,2, 5,4,5, 6,7) # Splice fields to NTSC frames Weave()
# Simulate 'pack-depack' our NTSC clip
Blur(1.5) Sharpen(1)
# IVTC it with Decomb (y0,y1 cause Decomb not to look at fields marks) Telecide(post=false, guide=1,blend=false, show=false, chroma=true, y0=96, y1=120, firstlast=true) Decimate(cycle=5) ClipDecomb = trim(0,3)
# Second part - 'Simple' algorythm
ClipStart AssumeFrameBased SeparateFields() # Build NTSC sequence SelectEvery(8, 0,1,0, 3,2, 5,4,5, 6,7) # Splice fields to NTSC frames Weave()
# Simulate 'pack-depack' our NTSC clip
Blur(0.3) Sharpen(1)
# Simple IVTC algorythm apply SeparateFields() SelectEvery(10, 0,1, 4,3, 6,7, 8,9) Weave()
ClipSimple = trim(0,3)
ClipSimple + ClipDecomb
# Place result and original together. Stackvertical(ClipStart + ClipStart)
Subtitle("_______________________", 0,126,font="Courier", text_color=$FFFFFF, size=14)
Subtitle("Telecine: SelectEvery(8, 0,1,0, 3,2, 5,4,5, 6,7)", text_color=$000000, size=16, x=0, y=280, halo_color=$808080) Subtitle("IVTC: SelectEvery(10, 0,1, 4,3, 6,7, 8,9)", text_color=$000000, size=16, x=0, y=295, halo_color=$808080) Subtitle("Ivtc Error clip made by Sergej Qkowlew (C)2003", text_color=$FFFFFF, size=16, x=0, y=310)
# Documentation: Subtitle("Here you can see, Здесь Вы можете ви-", 84,20,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("that even if Inverse деть, что даже если", 84,40,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("Telecine filter is фильтр IVTC идеален", 84,60,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("perfect - some arti- - итоговая картинка", 84,80,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("facts appear. They содержит артефакты,", 84,100,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("are created by MPEG* порождённые упаков-", 84,120,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("algorythm from Inte- кой MPEG потока при", 84,140,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("rlaced original. Interlaced оригинале", 84,160,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("Packing-depacking is Упаковка-распаковка", 84,180,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("Simulated by Blur & смоделированы Blur и", 84,200,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle("Sharpness filters. Sharpness фильтрами.", 84,220,0,0, "Courier", text_color=$FFFFFF, size=18) Subtitle(" Blur(0.3) Sharpen(1) ", 84,246,0,0, "Courier", text_color=$FFFFFF, size=18)
Subtitle("This frame B is con- Этот фрейм B собран", 84,20,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("structed from fields из полей, которые в", 84,40,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("placed with A and C NTSC потоке находи-", 84,60,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("subfields in NTSC лись вместе с полями", 84,80,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("stream. So - you can от соседних кадров.", 84,100,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("see shades of neigh- В результате Вы ви-", 84,120,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("bour frames (000 and дите тени от кадров", 84,140,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("002 to the right, A A и C, наложенные на", 84,160,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("and C overlapping to B слева и числа 000,", 84,180,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("the left. There is 002 справа. НЕТ спо-", 84,200,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("NO method to correct соба исправить кадр,", 84,220,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("frame noised in such искажённый таким об-", 84,240,1,1, "Courier", text_color=$FFFFFF, size=18) Subtitle("way. :-( разом. ", 84,260,1,1, "Courier", text_color=$FFFFFF, size=18)
#ubtitle("SEE NEXT FRAMES -->", 84,80,0,0, text_color=$FFFFFF, size=36)
Subtitle("For DECOMB results", 84,40,2,2, text_color=$FFFFFF, size=36) Subtitle("SEE FRAMES 4-7 -->", 84,80,2,2, text_color=$FFFFFF, size=36) Subtitle("For DECOMB results", 84,40,3,3, text_color=$FFFFFF, size=36) Subtitle("SEE FRAMES 4-7 -->", 84,80,3,3, text_color=$FFFFFF, size=36)
Subtitle("Here you can see, Здесь Вы можете ви-", 84,20,4,4, "Courier", text_color=$FFFFFF, size=18) Subtitle("how DECOMB treates деть, как интерпре-", 84,40,4,4, "Courier", text_color=$FFFFFF, size=18) Subtitle("such blurred stream. тирует это DECOMB. ", 84,60,4,4, "Courier", text_color=$FFFFFF, size=18)
Subtitle("B frame is crashed, Кадр B повреждён так", 84,40,5,5, "Courier", text_color=$FFFFFF, size=18) Subtitle("as in simple IVTC же как и при простом", 84,60,5,5, "Courier", text_color=$FFFFFF, size=18) Subtitle("process. процессе IVTC. ", 84,80,5,5, "Courier", text_color=$FFFFFF, size=18)
Subtitle("Note, that NOT ONLY ЗАМЕТЬТЕ! Повреждён", 84,20,6,6, "Courier", text_color=$FFFFFF, size=18) Subtitle("frame B is crashed! НЕ ТОЛЬКО кадр B! В", 84,40,6,6, "Courier", text_color=$FFFFFF, size=18) Subtitle("DECOMB checks frames данном случае DECOMB", 84,60,6,6, "Courier", text_color=$FFFFFF, size=18) Subtitle("by difference, and сделал неправильный", 84,80,6,6, "Courier", text_color=$FFFFFF, size=18) Subtitle("sometimes keyframe выбор поля C bottom.", 84,100,6,6, "Courier", text_color=$FFFFFF, size=18) Subtitle("and it's neighbour Именно так он порой", 84,120,6,6, "Courier", text_color=$FFFFFF, size=18) Subtitle("are shaded in each портит KeyFrame и", 84,140,6,6, "Courier", text_color=$FFFFFF, size=18) Subtitle("other by wrong deci- предыдущий кадр. ", 84,160,6,6, "Courier", text_color=$FFFFFF, size=18) Subtitle("sion. Blur(1.5) Sharpen(1) ", 84,186,6,6, "Courier", text_color=$FFFFFF, size=18)
|