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. |
4th February 2017, 21:43 | #2981 | Link | |
Registered User
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
|
Quote:
|
|
4th February 2017, 21:55 | #2983 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
How about integrating these conversion functions into the core DLL? In that way, plugin developers could write 16-bit code using the native format, and still support Stack16 by calling these standard conversion functions. Otherwise, I might as well copy and integrate that code into my DLL to avoid dependencies.
Basically, I keep the standard v2.6 conversion code, and on Avisynth+, I'm branching into another code that does it using the new functions -- and supports extra formats. The Stack16 conversion functions would be useful for any developer doing that. I also want to keep using DoubleWidth to preserve compatibility with v2.6 |
4th February 2017, 22:08 | #2984 | Link |
Registered User
Join Date: Sep 2010
Location: Ukraine, Bohuslav
Posts: 377
|
Indeed. But if we need to process our clip with filter which can process exposed 32-bit data, but does not support avs+ colorspaces, that will help.
Last edited by DJATOM; 4th February 2017 at 22:10. |
5th February 2017, 00:25 | #2985 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I would need a "ConvertToQuadripleWidth" if I want to allow someone to use AviSynthShader while allowing overflow values; as all other formats are INT. Again, I keep the double-width hack to maintain compatibility with AVS 2.6, and since I'm doing a data transfer to the GPU, it doesn't matter how the metadata is set.
|
5th February 2017, 01:21 | #2986 | Link | |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Quote:
__________________
See My Avisynth Stuff |
|
5th February 2017, 08:52 | #2987 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
Code:
#rgtools # starting from v0.94, the plugin self registers the MT mode SetFilterMTMode("removegrain", MT_NICE_FILTER) SetFilterMTMode("repair", MT_NICE_FILTER) SetFilterMTMode("verticalcleaner", MT_NICE_FILTER) SetFilterMTMode("clense", MT_NICE_FILTER) Code:
#rgtools # starting from v0.94, the plugin self registers the MT mode SetFilterMTMode("removegrain", MT_NICE_FILTER) SetFilterMTMode("repair", MT_NICE_FILTER) SetFilterMTMode("verticalcleaner", MT_NICE_FILTER) #SetFilterMTMode("clense", MT_NICE_FILTER)
__________________
See My Avisynth Stuff |
5th February 2017, 17:36 | #2988 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Is there a way to pass a format as a string and get the properties of that format? For example, a parameter "FormatOut" might be set to "YUVAP16", and in my code, I want to know a few things. Does that format have an alpha plane? What is BitsPerComponent?
Of course I can get it done with a bunch of IF, but the code then gets very clumsy especially with all the new formats. |
5th February 2017, 17:50 | #2989 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
|
|
5th February 2017, 19:17 | #2990 | Link | |
Registered User
Join Date: Apr 2015
Posts: 84
|
I update r2420 from r1858, have a problem with MP_Pipeline.
Very high CPU usage and very slow. r2420 1.6 fps 40-50% CPU usage r1858 26 fps 16-20% CPU usage Quote:
Last edited by edcrfv94; 5th February 2017 at 20:55. |
|
7th February 2017, 11:16 | #2991 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
Beginning from r2068 Eval-like and runtime functions are detected internally in order to apply an appropriate cache and MT behaviour for them. But MP_Pipeline is an external Eval-like filter and the core is not able to detect it. In my test, when I have set a hardcoded line to apply this rule on MP_Pipeline, the speed returned to the original. I don't know yet how to detect such external filters automatically, from the core point of view it is a filter that takes a string parameter and returns a clip. Like a source filter. Perhaps we have to introduce a registration command for this case, e.g. RegisterScriptFunction(string filter_name) (?) |
|
8th February 2017, 13:44 | #2992 | Link |
Registered User
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
|
since there are no more than 8 bit in 411, then should convertbits show error Message, but it's not
if I use convertbits(16) in yv411 source it will work but with unsupported colour format
__________________
See My Avisynth Stuff |
9th February 2017, 09:44 | #2993 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,309
|
Quote:
Currently under progress: Integrate GScriptClip and co. Better handling MP_Pipeline-like filters (speedwise) Playing with masktools. |
|
10th February 2017, 03:59 | #2997 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I got a lot of priorities to focus on already (but I guess that also applies to most of us). For now I must get 16-bit to work with AviSynthShader (somehow I'm having a hard time to get that simple task done), and release the next version of Natural Grounding Player as the YouTube downloader doesn't work anymore with the currently released version. And even more importantly... working on my business instead of putting too much time on Open Source projects, and publishing some more books.
There's the Floyd-Steinberg Dithering I could work on, but then, it would only be a CPU version. Someone else would have to write it in assembly. I can write a C# 432hz Music Player and playlist manager in a few hours, but C++ is much harder for me. So yeah... first must empty the pipeline of work to do. |
10th February 2017, 18:32 | #2998 | Link | |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Quote:
So there are 2 tasks: 1. Get current format as a string so the script can use it. 2. Get VideoInfo from string to know the properties of specified format. Formats were quite easy to handle in Avisynth 2.6 because there were only a few pixel formats. With the new version, however, the amount of formats increased exponentially. The best might be to create a map and use it for both tasks.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 10th February 2017 at 18:50. |
|
10th February 2017, 19:36 | #2999 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I believe code like this should do the job to convert back and forth between INT and STRING format types. It might be useful to have something similar in the header.
Code:
#pragma once #include <map> #include <string> #include "avisynth.h" class PixelFormatParser { typedef std::map<std::string, int> my_map; my_map enumMap; public: PixelFormatParser(); int GetPixelFormatAsInt(std::string format) { my_map::const_iterator iValue = enumMap.find(format); if (iValue == enumMap.end()) return 0; return iValue->second; } std::string GetPixelFormatAsString(int pixel_type) { int key = 0; std::string Result = std::string(""); for (auto &i : enumMap) { if (i.second == pixel_type) { Result = i.first; // If format ends with P8, continue searching to return the other name variant. if (i.first.length() < 3 || i.first.substr(i.first.length() - 2, 2) != std::string("P8")) break; } } return Result; } VideoInfo GetVideoInfo(int pixel_type) { VideoInfo Result; Result.pixel_type = pixel_type; return Result; } VideoInfo GetVideoInfo(std::string format) { VideoInfo Result; Result.pixel_type = GetPixelFormatAsInt(format); return Result; } }; PixelFormatParser::PixelFormatParser() { enumMap["RGB24"] = VideoInfo::CS_BGR24; enumMap["RGB32"] = VideoInfo::CS_BGR32; enumMap["YUY2"] = VideoInfo::CS_YUY2; enumMap["RAW32"] = VideoInfo::CS_RAW32; enumMap["YV24"] = VideoInfo::CS_YV24; enumMap["YV16"] = VideoInfo::CS_YV16; enumMap["YV12"] = VideoInfo::CS_YV12; enumMap["I420"] = VideoInfo::CS_I420; enumMap["IYUV"] = VideoInfo::CS_IYUV; enumMap["YUV9"] = VideoInfo::CS_YUV9; enumMap["YV411"] = VideoInfo::CS_YV411; enumMap["Y8"] = VideoInfo::CS_Y8; enumMap["YUV444P8"] = VideoInfo::CS_YV24; enumMap["YUV422P8"] = VideoInfo::CS_YV16; enumMap["YUV420P8"] = VideoInfo::CS_YV12; enumMap["YUV444P10"] = VideoInfo::CS_YUV444P10; enumMap["YUV422P10"] = VideoInfo::CS_YUV422P10; enumMap["YUV420P10"] = VideoInfo::CS_YUV420P10; enumMap["Y10"] = VideoInfo::CS_Y10; enumMap["YUV444P12"] = VideoInfo::CS_YUV444P12; enumMap["YUV422P12"] = VideoInfo::CS_YUV422P12; enumMap["YUV420P12"] = VideoInfo::CS_YUV420P12; enumMap["Y12"] = VideoInfo::CS_Y12; enumMap["YUV444P14"] = VideoInfo::CS_YUV444P14; enumMap["YUV422P14"] = VideoInfo::CS_YUV422P14; enumMap["YUV420P14"] = VideoInfo::CS_YUV420P14; enumMap["Y14"] = VideoInfo::CS_Y14; enumMap["YUV444P16"] = VideoInfo::CS_YUV444P16; enumMap["YUV422P16"] = VideoInfo::CS_YUV422P16; enumMap["YUV420P16"] = VideoInfo::CS_YUV420P16; enumMap["Y16"] = VideoInfo::CS_Y16; enumMap["YUV444PS"] = VideoInfo::CS_YUV444PS; enumMap["YUV422PS"] = VideoInfo::CS_YUV422PS; enumMap["YUV420PS"] = VideoInfo::CS_YUV420PS; enumMap["Y32"] = VideoInfo::CS_Y32; enumMap["RGB48"] = VideoInfo::CS_BGR48; enumMap["RGB64"] = VideoInfo::CS_BGR64; enumMap["RGBP"] = VideoInfo::CS_RGBP; enumMap["RGBP8"] = VideoInfo::CS_RGBP; enumMap["RGBP10"] = VideoInfo::CS_RGBP10; enumMap["RGBP12"] = VideoInfo::CS_RGBP12; enumMap["RGBP14"] = VideoInfo::CS_RGBP14; enumMap["RGBP16"] = VideoInfo::CS_RGBP16; enumMap["RGBPS"] = VideoInfo::CS_RGBPS; enumMap["RGBAP"] = VideoInfo::CS_RGBAP; enumMap["RGBAP8"] = VideoInfo::CS_RGBAP; enumMap["RGBAP10"] = VideoInfo::CS_RGBAP10; enumMap["RGBAP12"] = VideoInfo::CS_RGBAP12; enumMap["RGBAP14"] = VideoInfo::CS_RGBAP14; enumMap["RGBAP16"] = VideoInfo::CS_RGBAP16; enumMap["RGBAPS"] = VideoInfo::CS_RGBAPS; enumMap["YUVA444"] = VideoInfo::CS_YUVA444; enumMap["YUVA422"] = VideoInfo::CS_YUVA422; enumMap["YUVA420"] = VideoInfo::CS_YUVA420; enumMap["YUVA444P8"] = VideoInfo::CS_YUVA444; enumMap["YUVA422P8"] = VideoInfo::CS_YUVA422; enumMap["YUVA420P8"] = VideoInfo::CS_YUVA420; enumMap["YUVA444P10"] = VideoInfo::CS_YUVA444P10; enumMap["YUVA422P10"] = VideoInfo::CS_YUVA422P10; enumMap["YUVA420P10"] = VideoInfo::CS_YUVA420P10; enumMap["YUVA444P12"] = VideoInfo::CS_YUVA444P12; enumMap["YUVA422P12"] = VideoInfo::CS_YUVA422P12; enumMap["YUVA420P12"] = VideoInfo::CS_YUVA420P12; enumMap["YUVA444P14"] = VideoInfo::CS_YUVA444P14; enumMap["YUVA422P14"] = VideoInfo::CS_YUVA422P14; enumMap["YUVA420P14"] = VideoInfo::CS_YUVA420P14; enumMap["YUVA444P16"] = VideoInfo::CS_YUVA444P16; enumMap["YUVA422P16"] = VideoInfo::CS_YUVA422P16; enumMap["YUVA420P16"] = VideoInfo::CS_YUVA420P16; enumMap["YUVA444PS"] = VideoInfo::CS_YUVA444PS; enumMap["YUVA422PS"] = VideoInfo::CS_YUVA422PS; enumMap["YUVA420PS"] = VideoInfo::CS_YUVA420PS; } Code:
AVSValue __cdecl Create_GetFormat(AVSValue args, void* user_data, IScriptEnvironment* env) { VideoInfo vi = args[0].AsClip()->GetVideoInfo(); static PixelFormatParser pfp; std::string Result = pfp.GetPixelFormatAsString(vi.pixel_type); return AVSValue(env->SaveString(Result.c_str(), Result.length() + 1)); }
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 10th February 2017 at 22:03. |
Thread Tools | Search this Thread |
Display Modes | |
|
|