Log in

View Full Version : SeparateFields() duplicate handling bug ? ConvertToRGB32(interlaced=true) vs RGB24


poisondeathray
7th May 2016, 17:20
When you use AssumeTFF().SeparateFields() , (or AssumeBFF().Separatefields() , depending on field order), Every 2nd field appears to become duplicate when ConvertToRGB32(interlaced=true) is used BUT NOT when ConvertToRGB24(interlaced=true) is used prior to separating the fields, or vice-versa, depending on video (some seem to have the bug with RGB24, others RGB32).


-does not happen with a double rate deinterlacer, like bob() or yadif with mode=1, only with separatefields()
-separating fields works fine in YUV.
-repeatable occurrence to every interlaced video samples tested so far, different types of compressions, different source filters
-also occurs with non native camera samples (eg. RGB animation, converted to interlaced YUV in avisynth, back to interlaced RGB24 or RGB32, then assumetff/bff , separatefields)
-vanilla avisynth 2.6 or set's mt 2.6 , haven't tested the others


e.g RGB lagarith animation, bug occurs in RGB32, but not RGB24
1.52MB
zippyshare mirror
http://www32.zippyshare.com/v/kEyHDG1d/file.html
mediafire mirror
https://www.mediafire.com/?c1y1iy1m3nibied

AVISource("LAGS.avi")
AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
ConvertToYV12(interlaced=true)
ConvertToRGB32(interlaced=true)
#ConvertToRGB24(interlaced=true)
AssumeTFF()
Separatefields()


eg. video8 huffyuv capture, bug occurs in RGB24, but not RGB32
85.1MB
hotlink
http://forum.videohelp.com/attachments/36584-1460771889/k15_raw%20capture.avi
original forum post
http://forum.videohelp.com/threads/378093-Video8-restoration-advice?p=2441461&viewfull=1#post2441461

AVISource("k15_raw capture.avi")
#ConvertToRGB32(interlaced=true)
ConvertToRGB24(interlaced=true)
AssumeTFF()
Separatefields()


eg. MPEG2 camcorder sample, bug occurs in RGB32, but not RGB24
9.7MB
hotlink
http://forum.videohelp.com/attachments/36908-1462609215/M2U00386.mpg
original forum post
http://forum.videohelp.com/threads/378427-DV-footage-is-giving-me-yellow-blue-spots-any-way-to-remove-it?p=2444302&viewfull=1#post2444302

MPEG2Source("M2U00386.d2v")
ConvertToRGB32(interlaced=true)
#ConvertToRGB24(interlaced=true)
AssumeTFF()
Separatefields()

wonkey_monkey
7th May 2016, 19:18
I tried the last one. Didn't see any problem. AviSynth 2.60.

What happens if you add another converttorgb24 at the end? Does the problem disappear?

poisondeathray
7th May 2016, 19:30
I tried the last one. Didn't see any problem. AviSynth 2.60.

What happens if you add another converttorgb24 at the end? Does the problem disappear?

Thanks,

Yes, you're right - it "fixes" it.

So I tried vdub and it works there with the initial RGB32 only, so it might be related to avspmod, not avisynth itself. I'll investigate farther

poisondeathray
7th May 2016, 19:46
It works fine in MPCHC as well. Can someone else check this in avspmod 2.51 ?

wonkey_monkey
7th May 2016, 20:15
Out of curiosity, does the problem also disappear if you add an "invert" to the end?

poisondeathray
7th May 2016, 20:23
invert() fixes it (well, the duplicate issue anyway) . What are you thinking programmatically ? Do you have an idea as to why it's happening in avspmod ?

I know next to nothing about programming , but it would make more sense to me if it always affected RGB32 - not sometimes RGB24, sometimes RGB32

Or it might just be something affecting this local computer, still waiting for someone else to confirm if it affects avspmod for them too. It works fine in megui's preview - so it's definitely something to do with avspmod (or maybe something buggy installed on this local configuration)

Sharc
7th May 2016, 22:23
It works fine in MPCHC as well. Can someone else check this in avspmod 2.51 ?
No problem here with avspmod 2.5.1. with your mpeg2 source or mpeg4 source.
(Interlaced source is indexed with DGIndexNV, or using DirectShowSource .... all o.k., no field duplications)

Edit:
Now I can duplicate your issue in avspmod.
The reason why I did not see it initially was because I had info() at the end of my script. After removing it I get the field repetitions as you described.

ChiDragon
8th May 2016, 21:35
I noticed the issue with AvsPmod a couple months back but couldn't come up with a short script that didn't require external input, so posting about it fell off my radar.

poisondeathray
8th May 2016, 23:22
Thanks for checking it out guys. It looks like it's not just me. I'll make a post in the avspmod thread

vdcrim
10th May 2016, 22:50
Found the problem and pushed a fix to GitHub. AvsP was assuming the buffer that holds the frame data to be at least Pitch * Height. That's usually the case, but it's only really guaranteed to be Pitch * (Height - 1) + RowSize. When the buffer was the later frames failed to be displayed, so the previous one remained.