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 > Avisynth Development
Register FAQ Calendar Today's Posts Search

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 7th April 2017, 20:20   #3221  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
dev news: ImageReader and ImageWriter got RGB48, RGB64 and Y16 support through devIL.
Strange, saving greyscale (8 or 16 bit) TIFF is corrupted, while PNG is O.K.
pinterf is offline  
Old 8th April 2017, 20:53   #3222  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by pinterf View Post
dev news: ImageReader and ImageWriter got RGB48, RGB64 and Y16 support through devIL.
Strange, saving greyscale (8 or 16 bit) TIFF is corrupted, while PNG is O.K.
Awesome.

Don't know if you have any interest in fixing this but a while back I reported an issue with ImageWriter and Y8 colorspace: https://github.com/AviSynth/AviSynthPlus/issues/58

Feature request:
Is it possible to add a parameter to ImageWriter to be able to specify DPI? And also add the ability to save B/W 1-bit images?

I don't know the ins and outs of DevIL so if it's something complicated, please ignore me.
Reel.Deel is offline  
Old 8th April 2017, 21:22   #3223  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
I recognized the vertical flipping at greyscale, and corrected it already, I flip always. Or is raw format an exception?
pinterf is offline  
Old 8th April 2017, 21:25   #3224  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,666
Quote:
Originally Posted by pinterf View Post
I recognized the vertical flipping at greyscale, and corrected it already, I flip always. Or is raw format an exception?l
IIRC, raw format did not need flipping. I'll test again when you release the update.
Reel.Deel is offline  
Old 9th April 2017, 18:21   #3225  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
High bit image processing under avisynth

Hi all!
Thanks for support!
I am trying filtering grey scale image 6639x4032 using
Code:
KNLMeansCL(device_type="GPU",h=2, lsb_inout=true,a=32,s=4)
and image was ready after 30 seconds with my GTX 960, using Ximagic filter, CPU based with (a=16,s=2) need 20-30 minutes.
yup.
yup is offline  
Old 10th April 2017, 18:30   #3226  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
More dev news:
- avs scripts with unicode filenames can be opened though the VfW interface (VirtualDub, MPC-HC)
- SubTitle: new parameter bool "utf8" to allow rendering an UTF8 encoded text. Something like this:
Title="Cherry blossom "+CHR($E6)+CHR($A1)+CHR($9C)+CHR($E3)+CHR($81)+CHR($AE)+CHR($E8)+CHR($8A)+CHR($B1)
SubTitle(Title,utf8=true)
I don't know whether this was a huge demand or not, but someone probably can use it.
pinterf is offline  
Old 10th April 2017, 19:24   #3227  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by pinterf View Post
- avs scripts with unicode filenames can be opened though the VfW interface (VirtualDub, MPC-HC)
In Docs, maybe should point out failure caveat of ScriptName(), ScriptFile() and ScriptDir() if UniCode used in script names in such cases.
(Also other functions using filenames, builtin or plugin [EDIT: where filenames generated from eg ScripName()]).
__________________
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; 10th April 2017 at 19:35.
StainlessS is offline  
Old 11th April 2017, 08:00   #3228  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by StainlessS View Post
In Docs, maybe should point out failure caveat of ScriptName(), ScriptFile() and ScriptDir() if UniCode used in script names in such cases.
(Also other functions using filenames, builtin or plugin [EDIT: where filenames generated from eg ScripName()]).
Yes, this fix only helps opening such scripts.
The plugin directories, reading them from registry, adding them through LoadPlugin and SCRIPTxxx macro expansion is not effected yet.
Now there are ScriptNameUtf8(), ScriptFileUtf8() and ScriptDirUtf8() functions.
All functions working with file names and path would be nice to have an utf8 version, maybe we'll need functions converting to and from utf8 as well. ImageSource, etc. have to be extended too. Nice plans anyway, but sticking with the idea of "keep it compatible with everything existed so far" makes it harder.
pinterf is offline  
Old 12th April 2017, 04:28   #3229  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
Thanks for adding support to read 16bit images. I use this also for processing of raw stills in avisynth, for filtering and to make time lapse.

filed under: finally in 2017
jmac698 is offline  
Old 12th April 2017, 19:28   #3230  |  Link
blaze077
Registered User
 
Join Date: Jan 2016
Posts: 79
I have a few questions regarding Stacked16, its interleaved counterpart and "Native" bit depth.
First off, how is a Stacked format converted to and from "native" bit depth and likewise for interleaved formats? I also do not understand what native bitdepth. Is it when both the MSB and the LSb are at the same place in memory?
Secondly, let's say you have a piece of code like this:
Code:
ConvertToStacked()
StackVertical(dither_get_msb().mt_lut("x 20 +"), dither_get_lsb().mt_lut("x 0.8 ^")).ConvertFromStacked()
Is there a way to perform this in "native" bit depth rather than utilizing the Stack16 format?
Sorry if I don't make much sense.

Thank you.
blaze077 is offline  
Old 12th April 2017, 20:44   #3231  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Quote:
Originally Posted by blaze077 View Post
I have a few questions regarding Stacked16, its interleaved counterpart and "Native" bit depth.
First off, how is a Stacked format converted to and from "native" bit depth and likewise for interleaved formats? I also do not understand what native bitdepth. Is it when both the MSB and the LSb are at the same place in memory?
Secondly, let's say you have a piece of code like this:
Code:
ConvertToStacked()
StackVertical(dither_get_msb().mt_lut("x 20 +"), dither_get_lsb().mt_lut("x 0.8 ^")).ConvertFromStacked()
Is there a way to perform this in "native" bit depth rather than utilizing the Stack16 format?
Sorry if I don't make much sense.

Thank you.
Stacked16 hack and interleaved16 hack both 8bit (will be yv12 or yv24 or y8 or so) but some plugins can read them with some Parameters (like lsb), Stacked16 is slow and interleaved is fast like native one

native in memory will be like interleaved, but it's not use any hack, so no extra parameters will needed to tell the filter what is the bitdepth
__________________
See My Avisynth Stuff

Last edited by real.finder; 12th April 2017 at 21:32.
real.finder is offline  
Old 12th April 2017, 21:11   #3232  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
With pinterf's masktools v2.2.x, stacking is not needed. The following statements are equivalent (or very close):
Code:
## 8-bit gamma 0.8, TV range:
mt_lut("x 16 - 219 / 1 0.8 / ^ 219 * 16 +")
Code:
## 16-bit gamma 0.8, TV range:
ConvertBits(16) ## (if needed)
mt_lut(x 16 @B - 219 @B / 1 0.8 / ^ 219 @B * 16 @B +")
ConvertBits(8) ## (if needed)
You might have other reasons for using stack16, but masktools ain't one of them.
raffriff42 is offline  
Old 13th April 2017, 01:42   #3233  |  Link
blaze077
Registered User
 
Join Date: Jan 2016
Posts: 79
I am aware of what you both said but I guess I'm looking for a description of the method to convert from stack16 to native 16 bits and vice versa and the same thing for stack16 and interleaved. As in when converting from stack16 to native 16 bits, is it the average of the MSB and LSB then bitshifted [((MSB+LSB)/2) >> 8]. It's probably not that easy so I would just like to know. Again, sorry if I do not make much sense.

Thank you.
blaze077 is offline  
Old 13th April 2017, 02:17   #3234  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Quote:
Originally Posted by blaze077 View Post
when converting from stack16 to native 16 bits, is it the average of the MSB and LSB then bitshifted [((MSB+LSB)/2) >> 8].
They are added together, like this: [MSB<<8 + LSB]
raffriff42 is offline  
Old 13th April 2017, 02:52   #3235  |  Link
blaze077
Registered User
 
Join Date: Jan 2016
Posts: 79
Quote:
Originally Posted by raffriff42 View Post
They are added together, like this: [MSB<<8 + LSB]
That's what I was looking for. Thank you.
blaze077 is offline  
Old 13th April 2017, 04:51   #3236  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
so this will do same thing

Code:
mt_lut("x 256 / Floor 20 + 0 255 clip 8 << x 256 % 0.8 ^ +")
it only work on 16 bit native

and this

Code:
mt_lut("i16 clamp_f_i16 x 256 scalef / Floor 20 + 0 255 clip 256 scalef * x 256 scalef % 0.8 ^ +")
will work on all
__________________
See My Avisynth Stuff

Last edited by real.finder; 13th April 2017 at 10:24.
real.finder is offline  
Old 14th April 2017, 07:40   #3237  |  Link
blaze077
Registered User
 
Join Date: Jan 2016
Posts: 79
Quote:
Originally Posted by real.finder View Post
Code:
mt_lut("i16 clamp_f_i16 x 256 scalef / Floor 20 + 0 255 clip 256 scalef * x 256 scalef % 0.8 ^ +")
Thanks, this is quite useful too. Now I understand the usage of the scaling operators better.
blaze077 is offline  
Old 14th April 2017, 07:58   #3238  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
i am on r2420_MT 64 bit version. I have problem if I convertto YUY2()
my script is

Code:
imagesource(....)
#converttoYV24()
#converttoYUY2()
a = stackhorizontal(last, last)
b = stackhorizontal(last, last)
stackvertical(a,b)
# reduceby2 does take back last to image with YUY2
reduceby2()
return(last)
It appears reduceby2() call is the problem. If I convertto YV24 it works OK. If I remove reduceby2 it works ok for YUY2 also
__________________
mohan
my plugins are now hosted here
vcmohan is offline  
Old 14th April 2017, 08:05   #3239  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,784
The planar equivalent of YUY2 is YV16. How does it look if you try this (and in addition, convert to YUY2 as last step before the return)?
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 14th April 2017, 08:56   #3240  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
What's the problem exactly? YUY2 looks identical to the other formats for me.
pinterf is offline  
Closed Thread


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 04:10.


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