Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
21st November 2012, 12:24 | #1 | Link |
Registered User
Join Date: Apr 2007
Posts: 240
|
horizontal stripes after upgrading from v2.58 to v2.60
I've upgraded from Avisynth v2.58 to 2.60, and when I opened my project horizontal stripes appeared on the image that weren't there before. Here's a picture. See those stripes on the right side of the orange credits, around the heads of the couple and the very left side of the image? That shouldn't be there.
Here's the same frame taken from an encode made with v2.58 (it's heavily tweaked but still proves that no stripes are supposed to be seen): The code part that's responsible for the problem is simple as this: Code:
LoadPlugin("Decomb[5.2.2].dll") MPEG2Source("TDUV.d2v") AssumeTFF() Telecide(guide=1) Decimate(cycle=5) AssumeFPS(23.976) I could go back to Avisynth 2.58, but I had to switch to 2.60 because of some new features needed for the very same project. I've tried both 2.60 alpha 1 and alpha 3 with the same result. The new feature I needed was ConvertToYV12's 'chromaresample' parameter. I have to do several colorspace conversions while avoiding chroma shifts, and this parameter is a key for archieving that. Discussed here: http://forum.doom9.org/showthread.php?t=164737, Gavino's posts. What can I do? |
21st November 2012, 13:06 | #2 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Try
... Telecide(guide=1) SetPlanarLegacyAlignment(true) ...
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
22nd November 2012, 00:21 | #5 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
The problem isn't about chroma pitch, or is it?
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
22nd November 2012, 06:12 | #6 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
People have been notified since 2.57 to not assume any relationship between memory attributes of planes. Yet we still have plugins that do foolish things like pitchUV=pitchY/2; and even more foolish srcV=SrcY+src->GetPitch()*vi.height; (and this one dies with all versions after a crop).
As noted there is always the SetPlanarLegacyAlignment(true) compatibility mode and/or Crop(... align=true) for plugins that cannot be corrected. @neuron2, I appreciate you did not write the offending mpeg2source pp code, but you did assume the role of custodian, you did accept the chalenge to fix the bug and did suceed. I have pointed to offending lines of code and offered ammended code but the relevant posts seem to have avoided your notice. Not so sure about Telecide. Last edited by Guest; 22nd November 2012 at 14:09. Reason: accidentally hit edit instead of quote |
22nd November 2012, 10:46 | #7 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Telecide has always made unsafe assumptions about pitch, and there has been quite a bit of hurf durfed regarding this, so I'm a bit baffled by neuron2's apparent surprise and attempt to blame Avisynth 2.6 for breaking things. As IanB points out, assuming things about pitch is a recipe for disaster and it has never been the correct thing to do, so blaming Avisynth 2.6 for "breaking" things when what it did was stopping to work around silly bugs is sorta like trying to sweep your problems under somebody else's rug IMO.
Last edited by TheFluff; 22nd November 2012 at 10:51. |
22nd November 2012, 14:20 | #9 | Link |
typo lover
Join Date: May 2009
Posts: 595
|
__________________
my repositories |
22nd November 2012, 16:49 | #12 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Could perhaps just duplicate functionality from 2.6a3
avisynth_2-6\src\filters\debug.cpp Code:
class PlanarLegacyAlignment : public GenericVideoFilter { private: const IScriptEnvironment::PlanarChromaAlignmentMode mode; public: PlanarLegacyAlignment( PClip _child, const bool _mode, IScriptEnvironment* env ) : GenericVideoFilter(_child), mode(_mode ? IScriptEnvironment::PlanarChromaAlignmentOff // Legacy PLANAR_Y alignment : IScriptEnvironment::PlanarChromaAlignmentOn) // New PLANAR_UV priority alignment { } PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) { const IScriptEnvironment::PlanarChromaAlignmentMode oldmode = env->PlanarChromaAlignment(mode) // Set the PLANAR alignement mode ? IScriptEnvironment::PlanarChromaAlignmentOn : IScriptEnvironment::PlanarChromaAlignmentOff; PVideoFrame src = child->GetFrame(n, env); // run the GetFrame chain env->PlanarChromaAlignment(oldmode); // reset the PLANAR alignement mode return src; } static AVSValue __cdecl Create(AVSValue args, void*, IScriptEnvironment* env) { return new PlanarLegacyAlignment(args[0].AsClip(), args[1].AsBool(), env); } }; In GetFrame(), switch to required mode using constructor set mode using env->PlanarChromaAlignment(mode) and remember original returned in "oldmode". Get child PVideoFrame with the set alignment, finally switch back to "oldmode". Does not take into consideration the mentioned crop alignment.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
22nd November 2012, 23:36 | #13 | Link | |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Quote:
As for the Crop(... Align=True) that is just a blit to new suitably aligned frame, so sure you could do that as well, but it costs you an extra set of blits. The PlanarLegacyAlignment mode only effects the behaviour of the env->NewVideoFrame(vi); calls, so you probably need to wrap them as well, but then you end up feeding your parent filter with potentially unaligned output, so the crash and burn target moves down the script a few lines. Anyway the PlanarLegacyAlignment mode only applies to YV12 frames, so to support new formats like YV16 and YV24 you are going to have to use the correct pitch values for the chroma planes. Oops, I have previously looked at fixes for your Decomb package, but it seems I never got around to sending them to you or posting about them, life distractions are such a pain, particularly when you remember the intent instead of the action so no there is no post about Decomb only the one about PP in Mpeg2Source. (damn the forum search is lame, thank God for Google's site: modifier) |
|
23rd November 2012, 01:42 | #14 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Perhaps I'm not terribly bright (It's not up for discussion) but,
why would (( x + 15) / 16) * 16, not be mod 16 aligned ? (think mentioned in linked thread rather than this one). EDIT: Here:- http://forum.doom9.org/showthread.ph...05#post1337605
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 23rd November 2012 at 02:12. |
23rd November 2012, 10:41 | #15 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
However, what IanB said was: The problem there is not the mod16 alignment, but the erroneous asumption that the pitch is derived simply from the source width, which is wrong if a Crop has been used earlier in the chain. |
|
23rd November 2012, 15:27 | #16 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Arh yes Of course, maybe it was the 'and/or' that threw me.
Thank you Big G. EDIT: I would always use ((x + 15) & 0xFFFFFFF0) rather than ((( x + 15) / 16) * 16), except in script.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 23rd November 2012 at 18:05. |
Tags |
2.58, 2.60, horizontal, stripes, telecide |
|
|