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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd August 2014, 16:38   #1  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 577
Deblock

https://github.com/HomeOfVapourSynth...Synth-Deblock/

Ported from the usual AviSynth plugin http://www.avisynth.nl/users/fizick/...s/deblock.html. Nothing new or interesting really. Just picked a plugin which is simple enough for me to practice porting plugin.

Last edited by HolyWu; 13th June 2017 at 18:02.
HolyWu is offline   Reply With Quote
Old 3rd August 2014, 17:11   #2  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 707
Yay! Another step towards independence from AviSynth plugins. Thank you.
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 3rd August 2014, 17:41   #3  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,932
It's the code review patrol!

This is the only definitively wrong part:
Code:
if (!isConstantFormat(d.vi) || d.vi->format->colorFamily == cmCompat || d.vi->format->sampleType != stInteger || d.vi->format->bytesPerSample > 2) {
       vsapi->setError(out, "Deblock: only constant format 8-16 bits integer input supported");
        vsapi->freeNode(d.node);
        return;
}
You probably want this instead:
Code:
  if (!isConstantFormat(d.vi) || d.vi->format->sampleType != stInteger || (d.vi->format->bitsPerSample != 8 && d.vi->format->bitsPerSample != 16)) {
        vsapi->setError(out, "Deblock: only constant format 8 or 16 bits integer input supported");
        vsapi->freeNode(d.node);
        return;
    }
The motivation:
1. Normal filters will never get cmCompat formats as input so no need to check for it
2. You actual processing code actually only works for 8 and 16 bit. For 9-15 bits you don't clamp the output range properly so the output will technically be invalid. You could of course fix the clamping too for the 9-16 bit case which is probably more elegant.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th August 2014, 15:40   #4  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 577
Thanks for the hints, Myrsloik.

It should have been fixed now. Link is updated in first post.
HolyWu is offline   Reply With Quote
Old 7th August 2014, 22:09   #5  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 452
Hi

for build on linux/gcc is with '-std=gnu++11' or what?

greetings

Last edited by sl1pkn07; 7th August 2014 at 23:44.
sl1pkn07 is offline   Reply With Quote
Old 7th August 2014, 23:32   #6  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 275
This works for me:
Code:
gcc -shared -fPIC -march=native -O3 -std=c++11 -o libdeblock.so Deblock.cpp $(pkg-config --cflags vapoursynth)
Are_ is offline   Reply With Quote
Old 7th August 2014, 23:44   #7  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 452
thanks Are_
sl1pkn07 is offline   Reply With Quote
Old 9th June 2015, 18:30   #8  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 577
Update r4.
  • Support 32-bit float input.
HolyWu is offline   Reply With Quote
Old 1st November 2016, 07:14   #9  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 577
Update r5.
  • Remove the mod 8 requirement.
HolyWu is offline   Reply With Quote
Old 2nd November 2016, 04:42   #10  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,824
Thanks, works fine.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 12th June 2017, 13:04   #11  |  Link
TalasNetrag
Registered User
 
Join Date: Feb 2015
Posts: 38
It seems like the VS DeBlock does something diffrent than the AV-version. With quant=25 the AV-version seems to do a better job at deblocking.
http://screenshotcomparison.com/comparison/212508

Edit: AS=Vapoursynth, AV=Avisynth (Some weird typo I did there..)

Last edited by TalasNetrag; 13th June 2017 at 20:53.
TalasNetrag is offline   Reply With Quote
Old 13th June 2017, 17:50   #12  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 577
Update r6.
  • Remove clamping for float sample type.
  • Fix bug introduced in r4. It caused the deblocking strength weaker than expected.


Quote:
Originally Posted by TalasNetrag View Post
It seems like the VS DeBlock does something diffrent than the AV-version. With quant=25 the AV-version seems to do a better job at deblocking.
http://screenshotcomparison.com/comparison/212508
Thanks for reporting.
HolyWu is offline   Reply With Quote
Old 13th June 2017, 20:58   #13  |  Link
TalasNetrag
Registered User
 
Join Date: Feb 2015
Posts: 38
Quote:
Originally Posted by HolyWu View Post
Update r6.
  • Remove clamping for float sample type.
  • Fix bug introduced in r4. It caused the deblocking strength weaker than expected.
Thank you! Now the output is identical.
TalasNetrag is offline   Reply With Quote
Old 2nd August 2017, 20:36   #14  |  Link
groucho86
Registered User
 
Join Date: Apr 2016
Posts: 40
Does someone have the proper syntax to compile this plugin as a dylib for Mac?
groucho86 is offline   Reply With Quote
Old 3rd August 2017, 13:11   #15  |  Link
HolyWu
Registered User
 
HolyWu's Avatar
 
Join Date: Aug 2006
Location: Taiwan
Posts: 577
Quote:
Originally Posted by groucho86 View Post
Does someone have the proper syntax to compile this plugin as a dylib for Mac?
Is the usual ./autogen.sh && ./configure && make doesn't produce dylib for Mac?
HolyWu is offline   Reply With Quote
Old 3rd August 2017, 16:51   #16  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 153
Quote:
Originally Posted by groucho86 View Post
Does someone have the proper syntax to compile this plugin as a dylib for Mac?
The method HolyWu mentioned should work, are you getting an error compiling or when running configure? Did you install VapourSynth via brew or did you compile it yourself?
l33tmeatwad is offline   Reply With Quote
Old 3rd August 2017, 18:29   #17  |  Link
l33tmeatwad
Registered User
 
l33tmeatwad's Avatar
 
Join Date: Jun 2007
Posts: 153
if you browse into the .libs folder you should see the dylib file.
l33tmeatwad is offline   Reply With Quote
Old 3rd August 2017, 18:46   #18  |  Link
groucho86
Registered User
 
Join Date: Apr 2016
Posts: 40
...You are absolutely correct. Sorry for wild goose chase.

Specifically:
"make" compiles it into a hidden folder:
/VapourSynth-Deblock-master/.libs/libdeblock.dylib

"make install" copies libdeblock.dylib to:
/usr/local/lib/
groucho86 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.