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. |
3rd March 2020, 17:10 | #5183 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
|
|
3rd March 2020, 17:47 | #5184 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
PSNR r:99.994716 g:inf b:73.777761 average:78.538609 min:78.538609 max:78.538609 infinity with vapoursynth / avsresize / zlib/zimg PSNR r:inf g:inf b:inf average:inf min:inf max:inf |
|
3rd March 2020, 17:57 | #5185 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
Code:
class SimpleText : public GenericVideoFilter /** * SimpleText creation class **/ { public: SimpleText(PClip _child, const char _text[], int _x, int _y, int _firstframe, int _lastframe, const char _fontname[], int _size, int _textcolor, int _halocolor, int _align, int _spc, bool _multiline, int _lsp, int _font_width, int _font_angle, bool _interlaced, const char _font_filename[], const bool _utf8, IScriptEnvironment* env); virtual ~SimpleText(void); PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env); static AVSValue __cdecl Create(AVSValue args, void*, IScriptEnvironment* env); int __stdcall SetCacheHints(int cachehints, int frame_range) override { AVS_UNUSED(frame_range); return cachehints == CACHE_GET_MTMODE ? MT_NICE_FILTER : 0; } private: const int x, y, firstframe, lastframe; const int size; // n/a const int lsp; const int font_width, font_angle; // n/a const bool multiline; const bool interlaced; // n/a const int textcolor, halocolor, align; const int spc; // n/a const int halocolor_orig; const char* const fontname; // n/a const char* const text; const char* const font_filename; // n/a const bool utf8; };
__________________
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 ??? |
|
3rd March 2020, 18:26 | #5187 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
pre r2944 [Parsed_psnr_4 @ 000000f905391940] PSNR r:59.321403 g:87.953516 b:73.777761 average:63.933949 min:63.933949 max:63.933949 r2944, r3043 - improved [Parsed_psnr_4 @ 00000049feda2dc0] PSNR r:99.994716 g:inf b:73.777761 average:78.538609 min:78.538609 max:78.538609 It's "inf" with vapoursynth or avsresize in all cases [Parsed_psnr_4 @ 00000014ab642a00] PSNR r:inf g:inf b:inf average:inf min:inf max:inf Results do not change if I test a written out bmp, or pipe into ffmpeg Historically, ffmpeg swscale had many issues in the past with YUV/RGB conversions; but even it gets this 8bit RGB => 10bit YUV444 => 8bit RGB conversion correct now (at least with this test image) Code:
ffmpeg -i yuv_exprm_02_bird.png -vf scale=out_color_matrix=bt709,format=yuv444p10le,scale=in_color_matrix=bt709,format=gbrp ffmpeg_swscale.bmp Code:
ffmpeg -r 24 -i ffmpeg_swscale.bmp -r 24 -i yuv_exprm_02_bird.png -lavfi "[0:v]settb=1/AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=1/AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr="stats_file=ff_psnr_ffmpeg_swscale.log"" -f null - Thanks for your work pinterf and qyot27 Last edited by poisondeathray; 3rd March 2020 at 22:05. |
|
4th March 2020, 01:36 | #5188 | Link |
French Love
Join Date: Oct 2008
Location: France
Posts: 456
|
Strange crash with 2 plugins
Hi all,
I search for works my two plugins x86 HDR_AGC and svpflow With only HDR it's works With only svpflow works With both HDR_AGC and svpflow WMP crash How fix it Thank's for all Plugins is HDR > https://github.com/Anime4000/IFME/wi...nth--HDR-Video SVP > https://www.svp-team.com/forum/viewt...d=57410#p57410
__________________
2013-11-29 MVC Player Free v0.0.2.6 BD & 3D BD's Player, Demuxer v0.0.0.8b, Recoder. Tutorial Demo for MVC Player Free: Trailer 3D 3DBD's Free - v0.0.0.0005.exe Old Programing free for all. Last edited by frencher; 4th March 2020 at 01:39. |
4th March 2020, 08:47 | #5189 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,782
|
For Windows, the Far manager is my choice.
|
4th March 2020, 09:34 | #5190 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Avsresize has the advantage that it can convert _directly_ from 8 bit rgb to 10 bit YUV. I suppose that there is no 10 bit intermediate rgb result. Test 1: I have tried ConvertBits(10) right before avsresize Result: mixed ConvertBits - Avsresize chain stopped being lossless Code:
a ConvertToPlanarRGB() ConvertBits(10) # Z advantage: single step 8 bit rgb 10 bit yuv z_ConvertFormat(pixel_type="YUV444P10") z_ConvertFormat(pixel_type="RGBP10") ConvertToRGB24() z1=last #RGBP10 step before RGB24 works There are several types of converters, their usage depends on bit depth and processor capability. One method (SSE2) is using the usual 15 bit integer arithmetic. I'm using it for 10-14 bit targets. The other is converting the pixels to float, do the matrix multiplication and then converts the result back to the integer domain. Now I'm using it only for 16 bit case because the first method's SIMD intrinsics support only signed data without any tricks (16 bit is unsigned). Test2: So I built a test version, where I was using the 32 bit float way for 10 bit data instead of the above mentioned integer arithmetics. Result: I only looked at the difference clips and visually (looking at rare dot distribution showing the non-losslessness) it had the same output as z_ConvertXXX (latter with the 10 bit input in order to compare apples to apples) If I enable the internally float version for 10-14 bits, it can be a little bit slower* but of greater precision. *no AVX implementation yet only SSE2/SSE4.1 so there is room for improvement to compensate the slowdown (which I think is not that much considering a whole big script) But Avisynth resizer is not capable to chain bit depth conversion with rgb->yuv conversion so I'd say it'll never give such losslessness. |
|
4th March 2020, 12:07 | #5192 | Link | ||
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
Quote:
See https://github.com/sekrit-twc/zimg/b...ilder.cpp#L669 for details, it has comments describing the process of building a filter chain for doing arbitrary conversions. Last edited by TheFluff; 4th March 2020 at 12:11. |
||
4th March 2020, 16:21 | #5193 | Link | |||
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
I have seen implementation differences between vapoursynth's resize, ffmpeg -vf zscale, and avsresize. Despite being based the same library. It might be that the "snapshot" was based on different build or commits, I didn't look too closely. But this occurs for certain. Quote:
And ConvertBits(12) was NOT enough to "fix" it, yet 12bits is "enough" for internal resizer (for amplified visual differences, I didn't check PSNR). It doesn't entirely make sense, could something else be going on there? Quote:
Thanks for taking the time to investigate this Does that imply ffmpeg swscale is using float internally too? I'd imagine that it didn't for speed purposes My memory is a bit rusty, but once upon a time, I recall someone did some matlab calculations and +2 bits was supposedly enough to cover this conversion (just like 12bit YUV444 was sufficient to cover 10bit RGB), but I should have looked into the details more thoroughly |
|||
4th March 2020, 17:22 | #5194 | Link | |
Registered User
Join Date: Sep 2007
Posts: 5,377
|
Quote:
[Parsed_psnr_4 @ 00000062fb042cc0] PSNR r:inf g:inf b:92.591089 average:97.362301 min:97.362301 max:97.362301 Code:
a ConvertToPlanarRGB() z_ConvertFormat(pixel_type="YUV444P10") z_ConvertFormat(pixel_type="RGBP10") ConvertToRGB24() z1=last Z2 was lossless [Parsed_psnr_4 @ 0000005dfa5d2cc0] PSNR r:inf g:inf b:inf average:inf min:inf max:inf Code:
a ConvertToPlanarRGB() z_ConvertFormat(pixel_type="YUV444P10") z_ConvertFormat(pixel_type="RGBP") ConvertToRGB24() z2=last |
|
4th March 2020, 18:09 | #5195 | Link | |
Registered User
Join Date: Mar 2007
Posts: 114
|
Quote:
|
|
4th March 2020, 20:27 | #5198 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
- Internal calculation method is changed to use floats for 10-14 bits as well (16 bit was already working like this) for greater precision - much quicker AVX2 implementation for 10-16 bits (was: SSE2/SSE4) |
|
7th March 2020, 16:43 | #5199 | Link | ||
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
BugRep:
From here[EDIT: LINK FIXED]:- https://forum.doom9.org/showthread.p...55#post1728455 Quote:
Code:
Colorbars S=ReplaceStr("hello","","1") Subtitle(s) Code:
Function StrReplace(string base, string sought, string rep) { # http://avisynth.nl/index.php/HDColorBars pos = FindStr(base, sought) return (sought=="")||(pos==0)?base:StrReplace(LeftStr(base,pos-1)+rep+MidStr(base,pos+StrLen(sought)),sought,rep) } Quote:
__________________
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; 7th March 2020 at 18:25. |
||
8th March 2020, 18:29 | #5200 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
New types.h prevents plugin compile on older versions of visual studio [missing header files].
Mine is VS 2008 Express with Windows SDK 7.0. Previous Types.h Code:
#ifndef AVS_TYPES_H #define AVS_TYPES_H // Define all types necessary for interfacing with avisynth.dll #ifdef __cplusplus #include <cstddef> #else #include <stddef.h> #endif // Raster types used by VirtualDub & Avisynth typedef unsigned int Pixel32; typedef unsigned char BYTE; // Audio Sample information typedef float SFLOAT; #ifdef __GNUC__ typedef long long int INT64; #else typedef __int64 INT64; #endif #endif //AVS_TYPES_H Code:
#ifndef AVS_TYPES_H #define AVS_TYPES_H // Define all types necessary for interfacing with avisynth.dll #include <stdint.h> #include <stdbool.h> #ifdef __cplusplus #include <cstddef> #else #include <stddef.h> #endif // Raster types used by VirtualDub & Avisynth typedef uint32_t Pixel32; typedef uint8_t BYTE; // Audio Sample information typedef float SFLOAT; #endif //AVS_TYPES_H (You can probably get headers from eg VS 2017 community) EDIT: stdint.h on github:- https://github.com/glfw/glfw/blob/ma...s2008/stdint.h
__________________
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; 8th March 2020 at 18:46. |
|
|