Giter VIP home page Giter VIP logo

fmtconv's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fmtconv's Issues

Feature Request, High Dynamic Range Video Conversion

Dear Laurent,

I would like to request a feature. Can you add the capability to do UHD compliant Standard Dynamic Range (SDR) to High Dynamic Range (HDR) conversion (and also the opposite HDR to SDR conversion) to Fmtconv plugin?

I also sent you a long email with all the technical research that I could find. In summary, the required new features are listed below.

  1. A custom HDR-1000 system compatible SMPTE ST 2084 transfer function that maps to "0 cd/m2 to 1000 cd/m2" luminance range. (Note: current 2084 function included in Fmtconv maps to 0 to 10,000 cd/m2)

  2. Add DCI-P3 color primaries as a preset to primaries function. This is not very urgent since "gd=[0.265, 0.69], bd=[0.15, 0.06], rd=[0.68, 0.32], wd=[0.3127, 0.329]" command can be used to manually define DCI-P3 primaries in fmtconv r18.

Once these two new features are implemented, the workflow in Fmtconv will be the following for SDR to HDR conversion.
-Convert source video to "Linear light RGB 4:4:4"
-If necessary, change primaries to one of the HDR compatible primaries (BT709, BT2020, or DCI-P3)
-Convert transfer function from Linear to the custom SMPTE ST 2084 that maps to "0 to 1000 cd/m2" luminance range
-Resample to YUV 4:2:0 10 bit using BT2020 or BT709 matrix (which ever matrix is appropriate)
-Send YUV to x265 encoder. Specify the 2084 transfer fuction, appropriate matrix and appropriate primaries in the x265 command line.

The opposite steps can be used to convert HDR to SDR.

Please let me know what you think.

Best Regards

Building using Mingw64 - gcc v9.2(rev2) fails for x64

The x86 version compiles without errors, but the x64 version gives me the following:

Using

LDFLAGS+=" -static-libgcc -static-libstdc++" \
    CFLAGS+=" -std=gnu++11 -pipe -static-libgcc" \
    CXXFLAGS="${CFLAGS} -static-libstdc++" \
    ../configure --prefix="$LOCALDESTDIR" --{host,target}="${MINGW_CHOST}"
    make -j4
    make install

Build log

17:38:36 + vs-fmtc git  ................................. [Files missing]
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /usr/bin/autoconf --force
autoreconf: configure.ac: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:8: installing './compile'
configure.ac:5: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
configure: loading site script /mingw64/etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking how to print strings... printf
checking whether make supports the include directive... yes (GNU style)
checking for x86_64-w64-mingw32-gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /mingw64/bin/nm -B
checking the name lister (/mingw64/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for x86_64-w64-mingw32-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for x86_64-w64-mingw32-dlltool... no
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for x86_64-w64-mingw32-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for x86_64-w64-mingw32-strip... strip
checking for x86_64-w64-mingw32-ranlib... no
checking for ranlib... ranlib
checking command to parse /mingw64/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for x86_64-w64-mingw32-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for x86_64-w64-mingw32-as... no
checking for as... as
checking for x86_64-w64-mingw32-dlltool... dlltool
checking for x86_64-w64-mingw32-objdump... objdump
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether we are using the GNU C++ compiler... yes
checking whether ccache g++ accepts -g... yes
checking dependency style of ccache g++... gcc3
checking how to run the C++ preprocessor... ccache g++ -E
checking for ld used by ccache g++... H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe
checking if the linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking whether the ccache g++ linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking for ccache g++ option to produce PIC... -DDLL_EXPORT -DPIC
checking if ccache g++ PIC flag -DDLL_EXPORT -DPIC works... yes
checking if ccache g++ static flag -static works... yes
checking if ccache g++ supports -c -o file.o... yes
checking if ccache g++ supports -c -o file.o... (cached) yes
checking whether the ccache g++ linker (H:/Mingw647/msys64/mingw64/x86_64-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
config.status: executing libtool commands
  CXX      ../../src/fstb/libsse2_la-ToolsSse2.lo
  CXX      ../../src/fmtcl/libavx_la-MatrixProc_avx.lo
  CXX      ../../src/fmtcl/libavx2_la-BitBltConv_avx2.lo
  CXX      ../../src/fmtcl/libavx2_la-MatrixProc_avx2.lo
  CXX      ../../src/fmtcl/libavx2_la-Scaler_avx2.lo
  CXX      ../../src/fmtcl/libavx2_la-TransLut_avx2.lo
  CXX      ../../src/fstb/libavx2_la-ToolsAvx2.lo
  CXX      ../../src/AvstpWrapper.lo
  CXX      ../../src/main.lo
  CXX      ../../src/fmtc/Bitdepth.lo
  CXX      ../../src/fmtc/Convert.lo
  CXX      ../../src/fmtc/ConvStep.lo
In file included from ../../../src/conc/Interlocked.h:132,
                 from ../../../src/conc/AtomicPtr.hpp:27,
                 from ../../../src/conc/AtomicPtr.h:121,
                 from ../../../src/conc/CellPool.h:30,
                 from ../../../src/conc/ObjPool.h:44,
                 from ../../../src/fmtc/Bitdepth.h:30,
                 from ../../../src/main.cpp:18:
../../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
../../../src/conc/Interlocked.hpp:297:4: error: '::InterlockedCompareExchange128' has not been declared; did you mean 'InterlockedCompareExchange16'?
  297 |  ::InterlockedCompareExchange128 (
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |    InterlockedCompareExchange16
../../../src/conc/Interlocked.hpp:299:4: error: 'excg_hi' was not declared in this scope; did you mean 'excg'?
  299 |    excg_hi,
      |    ^~~~~~~
      |    excg
../../../src/conc/Interlocked.hpp:300:4: error: 'excg_lo' was not declared in this scope; did you mean 'excg'?
  300 |    excg_lo,
      |    ^~~~~~~
      |    excg
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-private-field'
make: *** [Makefile:1206: ../../src/main.lo] Error 1
make: *** Waiting for unfinished jobs....
In file included from ../../../src/conc/Interlocked.h:132,
                 from ../../../src/conc/AtomicPtr.hpp:27,
                 from ../../../src/conc/AtomicPtr.h:121,
                 from ../../../src/conc/CellPool.h:30,
                 from ../../../src/conc/ObjPool.h:44,
                 from ../../../src/fmtc/Bitdepth.h:30,
                 from ../../../src/fmtc/Bitdepth.cpp:28:
../../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
../../../src/conc/Interlocked.hpp:297:4: error: '::InterlockedCompareExchange128' has not been declared; did you mean 'InterlockedCompareExchange16'?
  297 |  ::InterlockedCompareExchange128 (
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |    InterlockedCompareExchange16
../../../src/conc/Interlocked.hpp:299:4: error: 'excg_hi' was not declared in this scope; did you mean 'excg'?
  299 |    excg_hi,
      |    ^~~~~~~
      |    excg
../../../src/conc/Interlocked.hpp:300:4: error: 'excg_lo' was not declared in this scope; did you mean 'excg'?
  300 |    excg_lo,
      |    ^~~~~~~
      |    excg
In file included from ../../../src/conc/Interlocked.h:132,
                 from ../../../src/conc/AtomicPtr.hpp:27,
                 from ../../../src/conc/AtomicPtr.h:121,
                 from ../../../src/conc/CellPool.h:30,
                 from ../../../src/conc/ObjPool.h:44,
                 from ../../../src/fmtcl/FilterResize.h:31,
                 from ../../../src/fmtc/Resample.h:31,
                 from ../../../src/fmtc/Convert.cpp:33:
../../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
../../../src/conc/Interlocked.hpp:297:4: error: '::InterlockedCompareExchange128' has not been declared; did you mean 'InterlockedCompareExchange16'?
  297 |  ::InterlockedCompareExchange128 (
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |    InterlockedCompareExchange16
../../../src/conc/Interlocked.hpp:299:4: error: 'excg_hi' was not declared in this scope; did you mean 'excg'?
  299 |    excg_hi,
      |    ^~~~~~~
      |    excg
../../../src/conc/Interlocked.hpp:300:4: error: 'excg_lo' was not declared in this scope; did you mean 'excg'?
  300 |    excg_lo,
      |    ^~~~~~~
      |    excg
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-private-field'
make: *** [Makefile:1206: ../../src/fmtc/Convert.lo] Error 1
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-private-field'
make: *** [Makefile:1206: ../../src/fmtc/Bitdepth.lo] Error 1
  CXX      ../../src/main.lo
In file included from ../../../src/conc/Interlocked.h:132,
                 from ../../../src/conc/AtomicPtr.hpp:27,
                 from ../../../src/conc/AtomicPtr.h:121,
                 from ../../../src/conc/CellPool.h:30,
                 from ../../../src/conc/ObjPool.h:44,
                 from ../../../src/fmtc/Bitdepth.h:30,
                 from ../../../src/main.cpp:18:
../../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
../../../src/conc/Interlocked.hpp:297:4: error: '::InterlockedCompareExchange128' has not been declared; did you mean 'InterlockedCompareExchange16'?
  297 |  ::InterlockedCompareExchange128 (
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |    InterlockedCompareExchange16
../../../src/conc/Interlocked.hpp:299:4: error: 'excg_hi' was not declared in this scope; did you mean 'excg'?
  299 |    excg_hi,
      |    ^~~~~~~
      |    excg
../../../src/conc/Interlocked.hpp:300:4: error: 'excg_lo' was not declared in this scope; did you mean 'excg'?
  300 |    excg_lo,
      |    ^~~~~~~
      |    excg
At global scope:
cc1plus.exe: warning: unrecognized command line option '-Wno-unused-private-field'
make: *** [Makefile:1206: ../../src/main.lo] Error 1
17:40:24 + vs-fmtc-git  ........................................ [Failed]

Using this patch allows it to compile 👍 , but I'm not sure it is ok or not.
Please have a look at it and let me know if it should be correct or not.

fmtc.patch.txt

error: '_mm_storeu_si32' was not declared in this scope; did you mean '_mm_storeu_si64'?

Hi there. I met this error when I tried to compile in debian 11 with the latest master branch

../../src/fmtcl/TransLut.cpp: In function 'void fmtcl::TransLut_store_sse2(uint8_t*, __m128)':
../../src/fmtcl/TransLut.cpp:242:2: error: '_mm_storeu_si32' was not declared in this scope; did you mean '_mm_storeu_si64'?
  242 |  _mm_storeu_si32 (dst_ptr, val_u8);
      |  ^~~~~~~~~~~~~~~
      |  _mm_storeu_si64
make[1]: *** [Makefile:1851: ../../src/fmtcl/TransLut.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory 'fmtconv/build/unix'

Hope the developer check it out, thanks

Fail to build on m1 macOS.

MacBook Air M1, macOS Monterey, fmtconv r26

cd build/unix/
./autogen.sh
./configure
make

...=>

  CXX      ../../src/fmtcl/Dither.lo
 In file included from ../../src/fmtcl/Dither.cpp:29:
 In file included from ./../../src/fmtcl/Dither.h:26:
 In file included from ./../../src/conc/ObjPool.h:44:
 In file included from ./../../src/conc/CellPool.h:33:
 In file included from ./../../src/conc/LockFreeStack.h:45:
 In file included from ./../../src/conc/AtomicPtrIntPair.h:40:
 In file included from ./../../src/conc/Interlocked.h:132:
 ./../../src/conc/Interlocked.hpp:267:4: error: invalid output constraint '+A' in asm
         :       "+A" (old)
                 ^
 1 error generated.
 make: *** [../../src/fmtcl/Dither.lo] Error 1

It is located at:

#if defined (__APPLE__) || (defined (__CYGWIN__) && conc_WORD_SIZE == 64)
old = comp;
__asm__ __volatile__
(
" lock cmpxchg16b %1"
: "+A" (old)
, "+m" (*&dest)
: "b" (int64_t (excg ))
, "c" (int64_t (excg >> 64))
: "cc"
);

version 27 fail to build with static assertion failed: 128-bit atomic operations are not lock-fre

Debian unstable amd64, gcc 11.2.0 vapoursynth 57

libtool: compile:  g++ -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r27\" "-DPACKAGE_STRING=\"fmtconv r27\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++14 -O3 -g3 -DNDEBUG -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wshadow -Wunused -Wnull-dereference -Wvla -Wstrict-aliasing -Wuninitialized -Wunused-parameter -Wreorder -Wsign-compare -Wunreachable-code -Wconversion -Wno-sign-conversion -Wredundant-decls -Wno-ignored-attributes -Wno-expansion-to-defined -I./../../src -g -O2 -ffile-prefix-map=/home/marillat/src/fmtconv-27=. -fstack-protector-strong -Wformat -Werror=format-security -c ../../src/fmtcl/Dither.cpp  -fPIC -DPIC -o ../../src/fmtcl/.libs/Dither.o
In file included from ./../../src/conc/Interlocked.h:132,
                 from ./../../src/conc/AtomicPtr.hpp:27,
                 from ./../../src/conc/AtomicPtr.h:123,
                 from ./../../src/conc/CellPool.h:30,
                 from ./../../src/conc/ObjPool.h:44,
                 from ./../../src/fmtcl/Dither.h:26,
                 from ../../src/fmtcl/Dither.cpp:29:
./../../src/conc/Interlocked.hpp: In static member function 'static void conc::Interlocked::cas(conc::Interlocked::Data128&, volatile Data128&, const Data128&, const Data128&)':
./../../src/conc/Interlocked.hpp:329:43: error: static assertion failed: 128-bit atomic operations are not lock-free
  329 |                 __atomic_always_lock_free (sizeof (dest), nullptr),
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:1779: ../../src/fmtcl/Dither.lo] Error 1

Matrix col_fam and the cm* constants in future VS versions

I changed most of the constant values in the new version of the VS API but due to how things are structured filters that use the cm* (cmRGB, cmYUV...) constants from a different API version may leak through. Since fmtconv's matrix filter is the only external one that uses these constants it's probably easier to ask you to implement the workaround than to inspect and manipulate all the arguments whenever you filter is invoked.

Basically you need to check against both the API3 and API4 values. Here's how ShufflePlanes does it:
https://github.com/vapoursynth/vapoursynth/blob/doodle1/src/core/simplefilters.cpp#L561

Note that in the new version YCoCg has been removed as a separate format and is now considered to be "YUV". The experimental new builds can be found here:
https://forum.doom9.org/showthread.php?t=183070

A longer summary of the issue here:
vapoursynth/vapoursynth#726

bitdepth() does not set _ColorRange property after conversion

I noticed that when a color range conversion is performed using bitdepth() it does not set the _ColorRange property accordingly. matrix() however does.

Here is a small repro:

import vapoursynth as vs
from vapoursynth import core

def TestColorRange(clip, title, expected, method):
    if clip.get_frame(0).props['_ColorRange'] == expected:
        color = (149 << 8, 43 << 8, 21 << 8) # Green
    else:
        color = (76 << 8, 84 << 8, 255 << 8) # Red
    
    clip = core.std.Expr(clip, expr=color, format=vs.YUV444P16)
    clip = clip.text.FrameProps(props="_ColorRange")
    return clip.text.Text("%s\nExpected _ColorRange == %d\n%s" % (title, expected, method), alignment=2)


c1 = core.std.BlankClip(width=320, height=240, format=vs.RGBS)
c1 = c1.std.SetFrameProp(prop="_ColorRange", intval=0)
c1 = c1.fmtc.matrix(mats="rgb", matd="709", col_fam=vs.YUV)
c1 = c1.fmtc.bitdepth(bits=16, fulls=True, fulld=False)
c1 = TestColorRange(c1, "c1", 1, "bitdepth(fulls=True, fulld=False)")

c2 = core.std.BlankClip(width=320, height=240, format=vs.RGBS)
c2 = c2.std.SetFrameProp(prop="_ColorRange", intval=0)
c2 = c2.fmtc.matrix(mats="rgb", matd="709", fulls=True, fulld=False, col_fam=vs.YUV)
c2 = c2.fmtc.bitdepth(bits=16)
c2 = TestColorRange(c2, "c2", 1, "matrix(fulls=True, fulld=False)")

c3 = core.std.BlankClip(width=320, height=240, format=vs.YUV444P8)
c3 = c3.std.SetFrameProp(prop="_ColorRange", intval=1)
c3 = c3.fmtc.matrix(mats="601", matd="709")
c3 = c3.fmtc.bitdepth(bits=16, fulls=False, fulld=True)
c3 = TestColorRange(c3, "c3", 0, "bitdepth(fulls=False, fulld=True)")

c4 = core.std.BlankClip(width=320, height=240, format=vs.YUV444P8)
c4 = c4.std.SetFrameProp(prop="_ColorRange", intval=1)
c4 = c4.fmtc.matrix(mats="601", matd="709", fulls=False, fulld=True)
c4 = c4.fmtc.bitdepth(bits=16)
c4 = TestColorRange(c4, "c4", 0, "matrix(fulls=False, fulld=True)")

c1and2 = core.std.StackHorizontal(clips=[c1, c2])
c3and4 = core.std.StackHorizontal(clips=[c3, c4])
oc = core.std.StackVertical(clips=[c1and2, c3and4])
oc.set_output()

Which results in the following output. Red squares indicate an unexpected value for _ColorRange while green squares indicate expected values:

image

Segfault on FreeBSD - debug build has undefined symbol at runtime

Hello,

I'm trying to get QTGMC to run in a freebsd jail on my freenas server.

I've run into a problem where vspipe segfaults when I try to run it (my script is included below).

I've rebuilt vapoursynth and fmtconv with debug builds.

My configure options for the fmtconv build are:
--enable-debug --libdir="/usr/local/lib/vapoursynth" --prefix=/usr/local

The rebuilt fmtc won't autoload, and when I force load it in the script and run vspipe -i /my/script - I get the following output:
vapoursynth.Error: Failed to load /usr/local/lib/vapoursynth/libfmtconv.so. Error given: /usr/local/lib/vapoursynth/libfmtconv.so: Undefined symbol "_ZN4fstb9ToolsSse29_mask_absE"

My script is:
import vapoursynth as vs import havsfunc as haf core = vs.get_core() core.std.LoadPlugin(path='/usr/local/lib/vapoursynth/libfmtconv.so') clip = core.ffms2.Source(source='/mnt/public/rawvideo/test-cropped.avi') clip = haf.QTGMC(clip, Preset='Placebo', TFF=True, TR0=2, TR1=2, TR2=3, Rep0=3, Rep2=3, NNSize=3, NNeurons=4, EdiQual=2, Precise=True, MatchPreset='Placebo', SourceMatch=3, Lossless=2, SrchClipPP=3, SubPel=2, SubPelInterp=2, BlockSize=4, Overlap=2, Search=3, SearchParam=8, PelSearch=4, ChromaMotion=True, TrueMotion=True, EZDenoise=25, NoisePreset='Slower', ChromaNoise=True, Denoiser="dfttest", DenoiseMC=True, NoiseTR=2, NoiseDeint='Generate', StabilizeNoise=True, NoiseProcess=2, GrainRestore=0.3, EdiMode='EEDI3+NNEDI3', EdiMaxD=12, Sharpness=0.1, SMode=2, SLMode=4, SLRad=3, Sbb=3, MatchPreset2='Placebo', ShutterBlur=3, ProgSADMask=10, SBlurLimit=8, MatchTR2=2, MatchEnhance=0.65) clip.set_output()

I'm not sure where to go next in troubleshooting this?

Feature request: convert YV12 interlaced <--> YV12 progressive

Use case: DVD with progressive content encoded as interlaced YV12 and telecined.

After IVTC I end up with interlaced YV12, but want to treat the picture as progressive.

Currently, the only option is to assume the frame as progressive and live with slightly off chroma.

This request is minor, but the use case itself is quite popular :)

Linux: can only build with g++-4.9

I'm trying to build a package on Launchpad for Ubuntu 14.04. But I can only build it with g++-4.9 which isn't available in Ubuntu 14.04. Building with g++-4.8, clang++-3.5 or clang++-3.6 fails.

Here are the build logs:

g++-4.8

depbase=`echo ../../src/main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile g++-4.8 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" -DPACKAGE_STRING=\"fmtconv\ r15\" -DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php\?t=166504\" -DPACKAGE_URL=\"http://forum.doom9.org/showthread.php\?t=166504\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.    -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src  -MT ../../src/main.lo -MD -MP -MF $depbase.Tpo -c -o ../../src/main.lo ../../src/main.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++-4.8 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" "-DPACKAGE_STRING=\"fmtconv r15\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src -MT ../../src/main.lo -MD -MP -MF ../../src/.deps/main.Tpo -c ../../src/main.cpp  -fPIC -DPIC -o ../../src/.libs/main.o
In file included from ./../../src/fmtcl/FilterResize.h:36:0,
                 from ../../src/fmtc/Resample.h:32,
                 from ../../src/main.cpp:25:
./../../src/fmtcl/Scaler.h:247:40: error: '__m256' has not been declared
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                        ^
./../../src/fmtcl/Scaler.h:247:54: error: '__m256' has not been declared
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                      ^
./../../src/fmtcl/Scaler.h:247:157: error: '__m256i' does not name a type
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                             ^
./../../src/fmtcl/Scaler.h:247:166: error: ISO C++ forbids declaration of 'zero' with no type [-fpermissive]
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                      ^
./../../src/fmtcl/Scaler.h:247:194: error: '__m256' does not name a type
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                                                  ^
./../../src/fmtcl/Scaler.h:247:202: error: ISO C++ forbids declaration of 'add_cst' with no type [-fpermissive]
                 process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                                                          ^
./../../src/fmtcl/Scaler.h:252:26: error: '__m256i' does not name a type
  static fstb_FORCEINLINE __m256i
                          ^
In file included from ../../src/main.cpp:27:0:
../../src/fmtc/Transfer.h:325:61: error: '__m256i' has not been declared
                  find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                             ^
../../src/fmtc/Transfer.h:325:77: error: '__m256' has not been declared
                  find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                             ^
../../src/fmtc/Transfer.h:345:61: error: '__m256i' has not been declared
                  find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                             ^
../../src/fmtc/Transfer.h:345:77: error: '__m256' has not been declared
                  find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                             ^
../../src/fmtc/Transfer.h:359:42: error: '__m256' has not been declared
                  store_avx2 (T *dst_ptr, __m256 val);
                                          ^
Makefile:937: recipe for target '../../src/main.lo' failed
make: *** [../../src/main.lo] Error 1

clang++-3.5

depbase=`echo ../../src/main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile clang++-3.5 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" -DPACKAGE_STRING=\"fmtconv\ r15\" -DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php\?t=166504\" -DPACKAGE_URL=\"http://forum.doom9.org/showthread.php\?t=166504\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.    -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src  -MT ../../src/main.lo -MD -MP -MF $depbase.Tpo -c -o ../../src/main.lo ../../src/main.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  clang++-3.5 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" "-DPACKAGE_STRING=\"fmtconv r15\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src -MT ../../src/main.lo -MD -MP -MF ../../src/.deps/main.Tpo -c ../../src/main.cpp  -fPIC -DPIC -o ../../src/.libs/main.o
In file included from ../../src/main.cpp:25:
In file included from ./../../src/fmtc/Resample.h:32:
In file included from ./../../src/fmtcl/FilterResize.h:36:
./../../src/fmtcl/Scaler.h:247:40: error: unknown type name '__m256'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                              ^
./../../src/fmtcl/Scaler.h:247:54: error: unknown type name '__m256'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                            ^
./../../src/fmtcl/Scaler.h:247:157: error: unknown type name '__m256i'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                                                                                                   ^
./../../src/fmtcl/Scaler.h:247:194: error: unknown type name '__m256'
  ...process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                                      ^
./../../src/fmtcl/Scaler.h:252:26: error: unknown type name '__m256i'
        static fstb_FORCEINLINE __m256i
                                ^
./../../src/fmtcl/Scaler.h:253:46: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                    ^
./../../src/fmtcl/Scaler.h:253:87: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                             ^
./../../src/fmtcl/Scaler.h:253:157: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                                                                                                   ^
./../../src/fmtcl/Scaler.h:253:194: error: unknown type name '__m256i'
  ...process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256i &sign_bit, int len);
                                                                                                                                                                                      ^
In file included from ../../src/main.cpp:27:
./../../src/fmtc/Transfer.h:325:61: error: unknown type name '__m256i'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                          ^
./../../src/fmtc/Transfer.h:325:77: error: unknown type name '__m256'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                                          ^
./../../src/fmtc/Transfer.h:345:61: error: unknown type name '__m256i'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                          ^
./../../src/fmtc/Transfer.h:345:77: error: unknown type name '__m256'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                                          ^
./../../src/fmtc/Transfer.h:359:42: error: unknown type name '__m256'
                               store_avx2 (T *dst_ptr, __m256 val);
                                                       ^
14 errors generated.
Makefile:937: recipe for target '../../src/main.lo' failed
make: *** [../../src/main.lo] Error 1

clang++-3.6

depbase=`echo ../../src/main.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile clang++-3.6 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" -DPACKAGE_STRING=\"fmtconv\ r15\" -DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php\?t=166504\" -DPACKAGE_URL=\"http://forum.doom9.org/showthread.php\?t=166504\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.    -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src -Wno-tautological-undefined-compare -MT ../../src/main.lo -MD -MP -MF $depbase.Tpo -c -o ../../src/main.lo ../../src/main.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  clang++-3.6 -DPACKAGE_NAME=\"fmtconv\" -DPACKAGE_TARNAME=\"fmtconv\" -DPACKAGE_VERSION=\"r15\" "-DPACKAGE_STRING=\"fmtconv r15\"" "-DPACKAGE_BUGREPORT=\"http://forum.doom9.org/showthread.php?t=166504\"" "-DPACKAGE_URL=\"http://forum.doom9.org/showthread.php?t=166504\"" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -std=c++11 -O3 -mfpmath=sse -msse2 -mcx16 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wshadow -I./../../src -Wno-tautological-undefined-compare -MT ../../src/main.lo -MD -MP -MF ../../src/.deps/main.Tpo -c ../../src/main.cpp  -fPIC -DPIC -o ../../src/.libs/main.o
In file included from ../../src/main.cpp:25:
In file included from ./../../src/fmtc/Resample.h:32:
In file included from ./../../src/fmtcl/FilterResize.h:36:
./../../src/fmtcl/Scaler.h:247:40: error: unknown type name '__m256'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                              ^
./../../src/fmtcl/Scaler.h:247:54: error: unknown type name '__m256'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                            ^
./../../src/fmtcl/Scaler.h:247:157: error: unknown type name '__m256i'
                       process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                                                                                                   ^
./../../src/fmtcl/Scaler.h:247:194: error: unknown type name '__m256'
  ...process_vect_flt_avx2 (__m256 &sum0, __m256 &sum1, int kernel_size, const float *coef_base_ptr, typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256 &add_cst, int len);
                                                                                                                                                                                      ^
./../../src/fmtcl/Scaler.h:252:26: error: unknown type name '__m256i'
        static fstb_FORCEINLINE __m256i
                                ^
./../../src/fmtcl/Scaler.h:253:46: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                    ^
./../../src/fmtcl/Scaler.h:253:87: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                             ^
./../../src/fmtcl/Scaler.h:253:157: error: unknown type name '__m256i'
                       process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __...
                                                                                                                                                                   ^
./../../src/fmtcl/Scaler.h:253:194: error: unknown type name '__m256i'
  ...process_vect_int_avx2 (const __m256i &add_cst, int kernel_size, const __m256i coef_base_ptr [], typename SRC::PtrConst::Type pix_ptr, const __m256i &zero, int src_stride, const __m256i &sign_bit, int len);
                                                                                                                                                                                      ^
In file included from ../../src/main.cpp:27:
./../../src/fmtc/Transfer.h:325:61: error: unknown type name '__m256i'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                          ^
./../../src/fmtc/Transfer.h:325:77: error: unknown type name '__m256'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                                          ^
./../../src/fmtc/Transfer.h:345:61: error: unknown type name '__m256i'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                          ^
./../../src/fmtc/Transfer.h:345:77: error: unknown type name '__m256'
                               find_index (const FloatIntMix val_arr [8], __m256i &index, __m256 &frac);
                                                                                          ^
./../../src/fmtc/Transfer.h:359:42: error: unknown type name '__m256'
                               store_avx2 (T *dst_ptr, __m256 val);
                                                       ^
14 errors generated.
Makefile:937: recipe for target '../../src/main.lo' failed
make: *** [../../src/main.lo] Error 1

Possible bug.

In file included from ../fmtconv/build/unix/../../src/conc/CellPool.h:141:
../fmtconv/build/unix/../../src/conc/CellPool.hpp:273:26: warning: variable 'i' used in loop condition not
      modified in loop body [-Wfor-loop-analysis]
                for (size_t i = count; i > 0; --count)

I suppose --count should be --i :)

cplaced (avs+)

Hi,

It seems cplaced accepts the cplaces value and it cannot be changed.

Colorbars(pixel_type="yv12")
a=fmtc_resample(width/2, height/2, cplace="mpeg1", cplaces="mpeg1")
fmtc_resample(width/2, height/2, cplaces="mpeg1", cplaced="mpeg2")
Compare(a)

transfer: Vapoursynth crash when use r26

If I input a GRAY clip to fmtc.transfer like below when I use fmtconv r26, Vapoursynth will crash. RGB clip look fine.

import vapoursynth as vs
from vapoursynth import core

src = core.std.BlankClip(format=vs.GRAY16)
res = src.fmtc.transfer(transs="709", transd="linear", fulls=False, fulld=False)

res.set_output(0)

Problem with spline16

I use:

# Imports
import vapoursynth as vs
core = vs.get_core()
# Loading Plugins
core.std.LoadPlugin(path="I:/workspace/Hybrid/debug/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="I:/workspace/Hybrid/debug/64bit/vsfilters/SourceFilter/FFMS2/ffms2.dll")
# source: 'F:\TestClips&Co\files\test.avi'
# current color space: YUV420P8, bit depth: 8, resolution: 640x352, fps: 25, color matrix: 470bg, yuv luminance scale: limited, scanorder: progressive
# Loading source using FFMS2
clip = core.ffms2.Source(source="F:/TestClips&Co/files/test.avi",cachefile="E:/Temp/avi_078c37f69bb356e7b5fa040c71584c40_853323747.ffindex",format=vs.YUV420P8,alpha=False)
# making sure input color matrix is set as 470bg
clip = core.resize.Point(clip, matrix_in_s="470bg",range_s="limited")
# making sure frame rate is set to 25
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# Setting color range to TV (limited) range.
clip = core.std.SetFrameProp(clip=clip, prop="_ColorRange", intval=1)
original = clip
clip = core.fmtc.resample(clip=clip, kernel="bicubic", w=1280, h=704, interlaced=False, interlacedd=False)
original = core.fmtc.resample(clip=original, kernel="bicubic", w=1280, h=704, interlaced=False, interlacedd=False)
# adjusting output color from: YUV420P16 to YUV420P8 for FFvHuffModel (i420@8)
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, range_s="limited")
# adjusting for FilterView
if (original.format.id != clip.format.id):
  if (original.format.color_family == vs.RGB and clip.format.color_family != vs.RGB):
    original = core.resize.Bicubic(clip=original, format=clip.format.id, matrix_s="470bg", range_s="limited")
  elif (original.format.color_family == clip.format.color_family):
    original = core.resize.Bicubic(clip=original, format=clip.format.id, range_s="limited")
  else:
    original = core.resize.Bicubic(clip=original, format=clip.format.id, matrix_in_s="470bg", range_s="limited")
stacked = core.std.StackHorizontal([original,clip])
# set output frame rate to 25.000fps
stacked = core.std.AssumeFPS(clip=stacked, fpsnum=25, fpsden=1)
# Output
stacked.set_output()

which works fine.
Problem is when I replace:

clip = core.fmtc.resample(clip=clip, kernel="bicubic", w=1280, h=704, interlaced=False, interlacedd=False)
original = core.fmtc.resample(clip=original, kernel="bicubic", w=1280, h=704, interlaced=False, interlacedd=False)

with:

clip = core.fmtc.resample(clip=clip, kernel="spline16", w=1280, h=704, interlaced=False, interlacedd=False)
original = core.fmtc.resample(clip=original, kernel="spline16", w=1280, h=704, interlaced=False, interlacedd=False)

preview in Vapoursynth Editor crashes (no error editor just closes).
Using:

VSPipe.exe -p --y4m c:\Users\Selur\Desktop\test.vpy e:\Test.y4m

it sometimes crashes for example at "Frame: 274/429" (no error) and other times it runs through the clip.

Is this a bug or am I doing something wrong here?

r24 fails to build on IA32 (32-bit x86)

Regressed by 5216839. From error log:

In file included from src/fmtcl/Dither.cpp:29:
src/fmtcl/Dither.h:210:26: error: unknown type name '__m128i'
        static fstb_FORCEINLINE __m128i
                                ^
src/fmtcl/Dither.h:212:26: error: unknown type name '__m128i'
        static fstb_FORCEINLINE __m128i
                                ^
src/fmtcl/Dither.h:213:33: error: unknown type name '__m128i'
                       remap_tpdf_vec (__m128i d) noexcept;
                                       ^
src/fmtcl/Dither.cpp:1662:17: error: out-of-line definition of 'generate_dith_n_vec' does not match any declaration in 'fmtcl::Dither'
__m128i Dither::generate_dith_n_vec (uint32_t &rnd_state) noexcept
                ^~~~~~~~~~~~~~~~~~~
src/fmtcl/Dither.cpp:1704:17: error: out-of-line definition of 'remap_tpdf_vec' does not match any declaration in 'fmtcl::Dither'
__m128i Dither::remap_tpdf_vec (__m128i d) noexcept
                ^~~~~~~~~~~~~~
src/fmtcl/Dither.cpp:1532:23: error: use of undeclared identifier 'generate_dith_n_vec'
                        __m128i                 dith_n = generate_dith_n_vec <TN_FLAG> (rnd_state);
                                                         ^
src/fmtcl/Dither.cpp:1094:2: note: in instantiation of function template specialization 'fmtcl::Dither::process_seg_common_int_int_sse2<false, false, fmtcl::SplFmt_INT8, 8, fmtcl::SplFmt_INT16, 9, (lambda at src/fmtcl/Dither.cpp:1097:3)>' requested here
        process_seg_common_int_int_sse2 <
        ^
src/fmtcl/Dither.cpp:615:4: note: in instantiation of function template specialization 'fmtcl::Dither::process_seg_ord_int_int_sse2<false, false, false, fmtcl::SplFmt_INT8, 8, fmtcl::SplFmt_INT16, 9>' requested here
                        fmtcl_Dither_SET_FNC_INT_SSE2,
                        ^
src/fmtcl/Dither.cpp:1662:17: note: must qualify identifier to find this declaration in dependent base class
__m128i Dither::generate_dith_n_vec (uint32_t &rnd_state) noexcept
                ^

Crashed using fmtc.bitdepth()

Operating system : Windows 10-64bit
Python version : 3.7.1
vs core version : R48
Input clip format : vs.GRAY16
latest version from fmtconv/releases
description:

VS edit crashed over and over again without giving any error message running this line code below:

... # load
mask = mask.fmtc.bitdepth(bits=16, fulls=True, fulld=True, dmode=1)
mask.set_output()

Warnings with -Wfloat-equal

  CXX      ../../src/AvstpWrapper.lo
  CXX      ../../src/main.lo
In file included from ./../../src/fmtcl/Mat4.h:118:0,
                 from ./../../src/fmtcl/MatrixProc.h:32,
                 from ../../src/fmtc/Matrix.h:33,
                 from ../../src/main.cpp:22:
./../../src/fmtcl/Mat4.hpp: In member function ‘bool fmtcl::Mat4::operator==(const fmtcl::Mat4&) const’:
./../../src/fmtcl/Mat4.hpp:115:50: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    eq_flag = (_data [y] [x] == other._data [y] [x]);
                                                  ^
  CXX      ../../src/fmtc/Bitdepth.lo
../../src/fmtc/Bitdepth.cpp: In member function ‘void fmtc::Bitdepth::init_fnc_ordered()’:
../../src/fmtc/Bitdepth.cpp:829:47: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  const bool           simple_flag = (_ampo == 1 && _ampn == 0);
                                               ^
../../src/fmtc/Bitdepth.cpp:829:61: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  const bool           simple_flag = (_ampo == 1 && _ampn == 0);
                                                             ^
../../src/fmtc/Bitdepth.cpp: In member function ‘void fmtc::Bitdepth::init_fnc_errdiff()’:
../../src/fmtc/Bitdepth.cpp:865:47: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  const bool           simple_flag = (_ampo == 1 && _ampn == 0);
                                               ^
../../src/fmtc/Bitdepth.cpp:865:61: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  const bool           simple_flag = (_ampo == 1 && _ampn == 0);
                                                             ^
../../src/fmtc/Bitdepth.cpp: In member function ‘void fmtc::Bitdepth::dither_plane(fmtcl::SplFmt, int, uint8_t*, int, fmtcl::SplFmt, int, const uint8_t*, int, int, int, const fmtcl::BitBltConv::ScaleInfo&, const int16_t (&)[32][32], uint32_t)’:
../../src/fmtc/Bitdepth.cpp:958:69: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    || scale_info._gain * ((uint64_t (1)) << (src_res - dst_res)) != 1
                                                                     ^
../../src/fmtc/Bitdepth.cpp:959:30: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    || scale_info._add_cst != 0);
                              ^
  CXX      ../../src/fmtc/Convert.lo
In file included from ./../../src/fmtcl/Mat4.h:118:0,
                 from ./../../src/fmtcl/MatrixProc.h:32,
                 from ./../../src/fmtc/Matrix.h:33,
                 from ../../src/fmtc/Convert.cpp:32:
./../../src/fmtcl/Mat4.hpp: In member function ‘bool fmtcl::Mat4::operator==(const fmtcl::Mat4&) const’:
./../../src/fmtcl/Mat4.hpp:115:50: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    eq_flag = (_data [y] [x] == other._data [y] [x]);
                                                  ^
  CXX      ../../src/fmtc/ConvStep.lo
  CXX      ../../src/fmtc/fnc.lo
  CXX      ../../src/fmtc/Matrix2020CL.lo
  CXX      ../../src/fmtc/Matrix.lo
In file included from ./../../src/fmtcl/Mat4.h:118:0,
                 from ./../../src/fmtcl/MatrixProc.h:32,
                 from ./../../src/fmtc/Matrix.h:33,
                 from ../../src/fmtc/Matrix.cpp:34:
./../../src/fmtcl/Mat4.hpp: In member function ‘bool fmtcl::Mat4::operator==(const fmtcl::Mat4&) const’:
./../../src/fmtcl/Mat4.hpp:115:50: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    eq_flag = (_data [y] [x] == other._data [y] [x]);
                                                  ^
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/cassert:43:0,
                 from ../../src/fmtc/Matrix.cpp:44:
../../src/fmtc/Matrix.cpp: In static member function ‘static void fmtc::Matrix::make_mat_yuv(fmtcl::Mat4&, double, double, double, bool)’:
../../src/fmtc/Matrix.cpp:766:16: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  assert (kg != 0);
                ^
../../src/fmtc/Matrix.cpp:767:16: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  assert (kb != 1);
                ^
../../src/fmtc/Matrix.cpp:768:16: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  assert (kr != 1);
                ^
  CXX      ../../src/fmtc/NativeToStack16.lo
  CXX      ../../src/fmtc/Resample.lo
../../src/fmtc/Resample.cpp: In constructor ‘fmtc::Resample::Resample(const VSMap&, VSMap&, void*, VSCore&, const VSAPI&)’:
../../src/fmtc/Resample.cpp:308:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
   if (s._w == 0)
               ^
../../src/fmtc/Resample.cpp:321:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
   if (s._h == 0)
               ^
../../src/fmtc/Resample.cpp:379:37: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
   if (plane_data._kernel_scale_h == 0)
                                     ^
../../src/fmtc/Resample.cpp:383:37: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
   if (plane_data._kernel_scale_v == 0)
                                     ^
  CXX      ../../src/fmtc/Stack16ToNative.lo
  CXX      ../../src/fmtc/Transfer.lo
../../src/fmtc/Transfer.cpp: In member function ‘void fmtc::Transfer::init_table()’:
../../src/fmtc/Transfer.cpp:412:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  if (_gcor != 1)
               ^
../../src/fmtc/Transfer.cpp:419:19: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  if (_contrast != 1)
                   ^
  CXX      ../../src/fmtcl/ArrayMultiType.lo
  CXX      ../../src/fmtcl/BitBltConv.lo
../../src/fmtcl/BitBltConv.cpp: In member function ‘void fmtcl::BitBltConv::bitblt_int_to_flt(uint8_t*, int, fmtcl::SplFmt, int, const uint8_t*, const uint8_t*, int, int, int, const fmtcl::BitBltConv::ScaleInfo*)’:
../../src/fmtcl/BitBltConv.cpp:225:39: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    && (   scale_info_ptr->_gain    != 1
                                       ^
../../src/fmtcl/BitBltConv.cpp:226:39: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
        || scale_info_ptr->_add_cst != 0));
                                       ^
../../src/fmtcl/BitBltConv.cpp: In static member function ‘static bool fmtcl::BitBltConv::is_si_neutral(const fmtcl::BitBltConv::ScaleInfo*)’:
../../src/fmtcl/BitBltConv.cpp:821:45: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
          || (   scale_info_ptr->_gain    == 1
                                             ^
../../src/fmtcl/BitBltConv.cpp:822:45: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
              && scale_info_ptr->_add_cst == 0));
                                             ^
  CXX      ../../src/fmtcl/ChromaPlacement.lo
  CXX      ../../src/fmtcl/CoefArrInt.lo
  CXX      ../../src/fmtcl/ContFirBlackman.lo
  CXX      ../../src/fmtcl/ContFirBlackmanMinLobe.lo
  CXX      ../../src/fmtcl/ContFirCubic.lo
  CXX      ../../src/fmtcl/ContFirFromDiscrete.lo
  CXX      ../../src/fmtcl/ContFirGauss.lo
  CXX      ../../src/fmtcl/ContFirInterface.lo
  CXX      ../../src/fmtcl/ContFirLanczos.lo
  CXX      ../../src/fmtcl/ContFirLinear.lo
  CXX      ../../src/fmtcl/ContFirRect.lo
  CXX      ../../src/fmtcl/ContFirSinc.lo
  CXX      ../../src/fmtcl/ContFirSnh.lo
  CXX      ../../src/fmtcl/ContFirSpline16.lo
  CXX      ../../src/fmtcl/ContFirSpline36.lo
  CXX      ../../src/fmtcl/ContFirSpline64.lo
  CXX      ../../src/fmtcl/ContFirSpline.lo
  CXX      ../../src/fmtcl/DiscreteFirCustom.lo
../../src/fmtcl/DiscreteFirCustom.cpp: In member function ‘int fmtcl::DiscreteFirCustom::compute_real_support() const’:
../../src/fmtcl/DiscreteFirCustom.cpp:76:41: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  ; pos < half_len && _coef_arr [pos] == 0 && _coef_arr [len - 1 - pos] == 0
                                         ^
../../src/fmtcl/DiscreteFirCustom.cpp:76:75: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  ; pos < half_len && _coef_arr [pos] == 0 && _coef_arr [len - 1 - pos] == 0
                                                                           ^
  CXX      ../../src/fmtcl/DiscreteFirInterface.lo
  CXX      ../../src/fmtcl/ErrDifBuf.lo
  CXX      ../../src/fmtcl/ErrDifBufFactory.lo
  CXX      ../../src/fmtcl/FilterResize.lo
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/cassert:43:0,
                 from ../../src/fmtcl/FilterResize.cpp:47:
../../src/fmtcl/FilterResize.cpp: In constructor ‘fmtcl::FilterResize::FilterResize(const fmtcl::ResampleSpecPlane&, fmtcl::ContFirInterface&, fmtcl::ContFirInterface&, bool, double, double, double, fmtcl::SplFmt, int, fmtcl::SplFmt, int, bool, bool, bool)’:
../../src/fmtcl/FilterResize.cpp:107:34: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  assert (spec._kernel_scale_h != 0);
                                  ^
../../src/fmtcl/FilterResize.cpp:108:34: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  assert (spec._kernel_scale_v != 0);
                                  ^
../../src/fmtcl/FilterResize.cpp:111:18: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  assert (gain != 0);
                  ^
../../src/fmtcl/FilterResize.cpp:150:42: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
      || _win_size [dir] != _dst_size [dir]
                                          ^
../../src/fmtcl/FilterResize.cpp:151:32: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
      || _kernel_scale [dir] != 1.0
                                ^
../../src/fmtcl/FilterResize.cpp:153:52: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    || _center_pos_src [dir] != _center_pos_dst [dir]
                                                    ^
  CXX      ../../src/fmtcl/fnc.lo
  CXX      ../../src/fmtcl/KernelData.lo
  CXX      ../../src/fmtcl/Matrix2020CLProc.lo
  CXX      ../../src/fmtcl/MatrixProc.lo
In file included from ./../../src/fmtcl/Mat4.h:118:0,
                 from ./../../src/fmtcl/MatrixProc.h:32,
                 from ../../src/fmtcl/MatrixProc.cpp:34:
./../../src/fmtcl/Mat4.hpp: In member function ‘bool fmtcl::Mat4::operator==(const fmtcl::Mat4&) const’:
./../../src/fmtcl/Mat4.hpp:115:50: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    eq_flag = (_data [y] [x] == other._data [y] [x]);
                                                  ^
  CXX      ../../src/fmtcl/ResampleSpecPlane.lo
  CXX      ../../src/fmtcl/ResizeData.lo
  CXX      ../../src/fmtcl/ResizeDataFactory.lo
  CXX      ../../src/fmtcl/Scaler.lo
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/cassert:43:0,
                 from ../../src/fmtcl/Scaler.cpp:45:
../../src/fmtcl/Scaler.cpp: In constructor ‘fmtcl::Scaler::Scaler(int, int, double, double, fmtcl::ContFirInterface&, double, bool, double, double, double, double, double, bool, bool, bool)’:
../../src/fmtcl/Scaler.cpp:132:18: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  assert (gain != 0);
                  ^
../../src/fmtcl/Scaler.cpp: In member function ‘void fmtcl::Scaler::build_scale_data()’:
../../src/fmtcl/Scaler.cpp:832:17: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    assert (n != 0);
                 ^
../../src/fmtcl/Scaler.cpp:871:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
   if (accu != 0 || info._kernel_size == 0)
               ^
  CXX      ../../src/fmtcl/TransLut.lo
  CXX      ../../src/fmtcl/TransOp2084.lo
  CXX      ../../src/fmtcl/TransOpAffine.lo
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4/cassert:43:0,
                 from ../../src/fmtcl/TransOpAffine.cpp:29:
../../src/fmtcl/TransOpAffine.cpp: In constructor ‘fmtcl::TransOpAffine::TransOpAffine(double, double)’:
../../src/fmtcl/TransOpAffine.cpp:46:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
  assert (a != 0);
               ^
  CXX      ../../src/fmtcl/TransOpCanonLog.lo
  CXX      ../../src/fmtcl/TransOpFilmStream.lo
  CXX      ../../src/fmtcl/TransOpLinPow.lo
../../src/fmtcl/TransOpLinPow.cpp: In member function ‘virtual double fmtcl::TransOpLinPow::operator()(double) const’:
../../src/fmtcl/TransOpLinPow.cpp:91:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    if (_p2 == 1)
               ^
../../src/fmtcl/TransOpLinPow.cpp:119:15: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    if (_p2 == 1)
               ^
  CXX      ../../src/fmtcl/TransOpLogC.lo
  CXX      ../../src/fmtcl/TransOpLogTrunc.lo
  CXX      ../../src/fmtcl/TransOpPow.lo
  CXX      ../../src/fmtcl/TransOpSLog.lo
  CXX      ../../src/fmtcl/VoidAndCluster.lo
  CXX      ../../src/fstb/CpuId.lo
  CXX      ../../src/fstb/fnc.lo
  CXX      ../../src/fstb/ToolsSse2.lo
  CXX      ../../src/vsutl/CpuOpt.lo
  CXX      ../../src/vsutl/FilterBase.lo
  CXX      ../../src/vsutl/fnc.lo
  CXX      ../../src/vsutl/PlaneProcCbInterface.lo
  CXX      ../../src/vsutl/PlaneProcessor.lo
../../src/vsutl/PlaneProcessor.cpp: In member function ‘void vsutl::PlaneProcessor::set_filter(const VSMap&, VSMap&, const VSVideoInfo&, bool, int, const char*, const char*)’:
../../src/vsutl/PlaneProcessor.cpp:154:47: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
      else if (_proc_mode_arr [plane_index] == PlaneProcMode_PROCESS)
                                               ^
../../src/vsutl/PlaneProcessor.cpp: In member function ‘int vsutl::PlaneProcessor::process_frame(VSFrameRef&, int, void*, VSFrameContext&, VSCore&, vsutl::NodeRefSPtr, vsutl::NodeRefSPtr, vsutl::NodeRefSPtr)’:
../../src/vsutl/PlaneProcessor.cpp:271:31: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
   if (_manual_flag || mode == PlaneProcMode_PROCESS)
                               ^
../../src/vsutl/PlaneProcessor.cpp:288:16: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
       (mode == PlaneProcMode_COPY3) ? src_node3_sptr
                ^
../../src/vsutl/PlaneProcessor.cpp:289:16: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
     : (mode == PlaneProcMode_COPY2) ? src_node2_sptr
                ^
  CXX      ../../src/fmtcl/libavx_la-MatrixProc_avx.lo
In file included from ./../../src/fmtcl/Mat4.h:118:0,
                 from ./../../src/fmtcl/MatrixProc.h:32,
                 from ../../src/fmtcl/MatrixProc_avx.cpp:34:
./../../src/fmtcl/Mat4.hpp: In member function ‘bool fmtcl::Mat4::operator==(const fmtcl::Mat4&) const’:
./../../src/fmtcl/Mat4.hpp:115:50: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    eq_flag = (_data [y] [x] == other._data [y] [x]);
                                                  ^
  CXXLD    libavx.la
  CXX      ../../src/fmtcl/libavx2_la-BitBltConv_avx2.lo
../../src/fmtcl/BitBltConv_avx2.cpp: In member function ‘void fmtcl::BitBltConv::bitblt_int_to_flt_avx2_switch(uint8_t*, int, fmtcl::SplFmt, int, const uint8_t*, const uint8_t*, int, int, int, const fmtcl::BitBltConv::ScaleInfo*)’:
../../src/fmtcl/BitBltConv_avx2.cpp:67:39: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    && (   scale_info_ptr->_gain    != 1
                                       ^
../../src/fmtcl/BitBltConv_avx2.cpp:68:39: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
        || scale_info_ptr->_add_cst != 0));
                                       ^
../../src/fmtcl/BitBltConv_avx2.cpp: In member function ‘void fmtcl::BitBltConv::bitblt_flt_to_int_avx2_switch(fmtcl::SplFmt, int, uint8_t*, uint8_t*, int, const uint8_t*, int, int, int, const fmtcl::BitBltConv::ScaleInfo*)’:
../../src/fmtcl/BitBltConv_avx2.cpp:114:39: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    && (   scale_info_ptr->_gain    != 1
                                       ^
../../src/fmtcl/BitBltConv_avx2.cpp:115:39: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
        || scale_info_ptr->_add_cst != 0));
                                       ^
  CXX      ../../src/fmtcl/libavx2_la-MatrixProc_avx2.lo
In file included from ./../../src/fmtcl/Mat4.h:118:0,
                 from ./../../src/fmtcl/MatrixProc.h:32,
                 from ../../src/fmtcl/MatrixProc_avx2.cpp:35:
./../../src/fmtcl/Mat4.hpp: In member function ‘bool fmtcl::Mat4::operator==(const fmtcl::Mat4&) const’:
./../../src/fmtcl/Mat4.hpp:115:50: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
    eq_flag = (_data [y] [x] == other._data [y] [x]);
                                                  ^
  CXX      ../../src/fmtcl/libavx2_la-Scaler_avx2.lo
  CXX      ../../src/fmtcl/libavx2_la-TransLut_avx2.lo
  CXX      ../../src/fstb/libavx2_la-ToolsAvx2.lo
  CXXLD    libavx2.la
  CXXLD    libfmtconv.la

Fails to build on non-x86 architectures

Ignoring warnings about unused _sse2_flag or _avx2_flag for now building on aarch64 fails with the following.

../../src/fmtcl/MatrixProc.cpp:66:3: error: initializer '_coef_simd_arr' does not name a non-static
      data member or base class; did you mean the member '_coef_int_arr'?
,       _coef_simd_arr ()
        ^~~~~~~~~~~~~~
        _coef_int_arr
./../../src/fmtcl/MatrixProc.h:134:17: note: '_coef_int_arr' declared here
                       _coef_int_arr;
                       ^
../../src/fmtcl/MatrixProc.cpp:66:3: error: multiple initializations given for non-static member
      '_coef_int_arr'
,       _coef_simd_arr ()
        ^~~~~~~~~~~~~~~~~
../../src/fmtcl/MatrixProc.cpp:65:3: note: previous initialization is here
,       _coef_int_arr ()
        ^~~~~~~~~~~~~~~~
../../src/fmtcl/MatrixProc.cpp:362:18: error: out-of-line definition of 'setup_fnc_sse' does not
      match any declaration in 'fmtcl::MatrixProc'
void    MatrixProc::setup_fnc_sse (bool int_proc_flag, SplFmt src_fmt, int src_bits, SplFmt d...
                    ^~~~~~~~~~~~~
../../src/fmtcl/MatrixProc.cpp:368:17: error: no member named 'process_1_flt_sse' in
      'fmtcl::MatrixProc'; did you mean '::fmtcl::MatrixProc::process_1_flt_cpp'?
                        _proc_ptr = &ThisType::process_1_flt_sse;
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                     ::fmtcl::MatrixProc::process_1_flt_cpp
./../../src/fmtcl/MatrixProc.h:106:17: note: '::fmtcl::MatrixProc::process_1_flt_cpp' declared here
        void           process_1_flt_cpp (uint8_t * const dst_ptr_arr [NBR_PLANES], const in...
                       ^
../../src/fmtcl/MatrixProc.cpp:372:17: error: no member named 'process_3_flt_sse' in
      'fmtcl::MatrixProc'; did you mean '::fmtcl::MatrixProc::process_3_flt_cpp'?
                        _proc_ptr = &ThisType::process_3_flt_sse;
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                                     ::fmtcl::MatrixProc::process_3_flt_cpp
./../../src/fmtcl/MatrixProc.h:105:17: note: '::fmtcl::MatrixProc::process_3_flt_cpp' declared here
        void           process_3_flt_cpp (uint8_t * const dst_ptr_arr [NBR_PLANES], const in...
                       ^
../../src/fmtcl/MatrixProc.cpp:379:18: error: out-of-line definition of 'setup_fnc_sse2' does not
      match any declaration in 'fmtcl::MatrixProc'
void    MatrixProc::setup_fnc_sse2 (bool int_proc_flag, SplFmt src_fmt, int src_bits, SplFmt ...
                    ^~~~~~~~~~~~~~
../../src/fmtcl/MatrixProc.cpp:408:28: error: use of undeclared identifier 'ProxyRwSse2'
                fmtcl_MatrixProc_SPAN_I (fmtcl_MatrixProc_CASE_INT)
                                         ^
../../src/fmtcl/MatrixProc.cpp:408:28: error: no member named 'process_n_int_sse2' in
      'fmtcl::MatrixProc'
                fmtcl_MatrixProc_SPAN_I (fmtcl_MatrixProc_CASE_INT)
                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
./../../src/fmtcl/MatrixProc_macro.h:30:2: note: expanded from macro 'fmtcl_MatrixProc_SPAN_I'
        CI (INT8   ,  8, INT8   ,  8) \
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/fmtcl/MatrixProc.cpp:386:27: note: expanded from macro 'fmtcl_MatrixProc_CASE_INT'
                        _proc_ptr = &ThisType::process_n_int_sse2 < \
                                     ~~~~~~~~~~^
../../src/fmtcl/MatrixProc.cpp:408:28: error: expected expression
../../src/fmtcl/MatrixProc.cpp:408:28: error: use of undeclared identifier 'ProxyRwSse2'
../../src/fmtcl/MatrixProc.cpp:408:28: error: expected expression
../../src/fmtcl/MatrixProc.cpp:408:28: error: expected expression
../../src/fmtcl/MatrixProc.cpp:408:28: error: use of undeclared identifier 'ProxyRwSse2'
../../src/fmtcl/MatrixProc.cpp:408:28: error: no member named 'process_n_int_sse2' in
      'fmtcl::MatrixProc'
                fmtcl_MatrixProc_SPAN_I (fmtcl_MatrixProc_CASE_INT)
                ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
./../../src/fmtcl/MatrixProc_macro.h:30:2: note: expanded from macro 'fmtcl_MatrixProc_SPAN_I'
        CI (INT8   ,  8, INT8   ,  8) \
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/fmtcl/MatrixProc.cpp:393:27: note: expanded from macro 'fmtcl_MatrixProc_CASE_INT'
                        _proc_ptr = &ThisType::process_n_int_sse2 < \
                                     ~~~~~~~~~~^
../../src/fmtcl/MatrixProc.cpp:408:28: error: expected expression
../../src/fmtcl/MatrixProc.cpp:408:28: error: use of undeclared identifier 'ProxyRwSse2'
../../src/fmtcl/MatrixProc.cpp:408:28: error: expected expression
../../src/fmtcl/MatrixProc.cpp:408:28: error: expected expression
../../src/fmtcl/MatrixProc.cpp:408:28: error: use of undeclared identifier 'ProxyRwSse2'
fatal error: too many errors emitted, stopping now [-ferror-limit=]
In file included from ../../src/fstb/ToolsSse2.cpp:19:
In file included from ../../src/fstb/ToolsSse2.h:32:
In file included from /usr/bin/../lib/clang/3.8.0/include/emmintrin.h:27:
In file included from /usr/bin/../lib/clang/3.8.0/include/xmmintrin.h:27:
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:39:5: error: use of undeclared identifier
      '__builtin_ia32_emms'; did you mean '__builtin_isless'?
    __builtin_ia32_emms();
    ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:39:5: note: '__builtin_isless' declared here
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:39:25: error: too few arguments to function call,
      expected 2, have 0
    __builtin_ia32_emms();
                        ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:45:19: error: use of undeclared identifier
      '__builtin_ia32_vec_init_v2si'
    return (__m64)__builtin_ia32_vec_init_v2si(__i, 0);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:51:12: error: use of undeclared identifier
      '__builtin_ia32_vec_ext_v2si'
    return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
           ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:69:19: error: use of undeclared identifier
      '__builtin_ia32_packsswb'
    return (__m64)__builtin_ia32_packsswb((__v4hi)__m1, (__v4hi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:75:19: error: use of undeclared identifier
      '__builtin_ia32_packssdw'
    return (__m64)__builtin_ia32_packssdw((__v2si)__m1, (__v2si)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:81:19: error: use of undeclared identifier
      '__builtin_ia32_packuswb'
    return (__m64)__builtin_ia32_packuswb((__v4hi)__m1, (__v4hi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:87:19: error: use of undeclared identifier
      '__builtin_ia32_punpckhbw'
    return (__m64)__builtin_ia32_punpckhbw((__v8qi)__m1, (__v8qi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:93:19: error: use of undeclared identifier
      '__builtin_ia32_punpckhwd'
    return (__m64)__builtin_ia32_punpckhwd((__v4hi)__m1, (__v4hi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:99:19: error: use of undeclared identifier
      '__builtin_ia32_punpckhdq'
    return (__m64)__builtin_ia32_punpckhdq((__v2si)__m1, (__v2si)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:105:19: error: use of undeclared identifier
      '__builtin_ia32_punpcklbw'
    return (__m64)__builtin_ia32_punpcklbw((__v8qi)__m1, (__v8qi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:111:19: error: use of undeclared identifier
      '__builtin_ia32_punpcklwd'
    return (__m64)__builtin_ia32_punpcklwd((__v4hi)__m1, (__v4hi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:117:19: error: use of undeclared identifier
      '__builtin_ia32_punpckldq'
    return (__m64)__builtin_ia32_punpckldq((__v2si)__m1, (__v2si)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:123:19: error: use of undeclared identifier
      '__builtin_ia32_paddb'
    return (__m64)__builtin_ia32_paddb((__v8qi)__m1, (__v8qi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:129:19: error: use of undeclared identifier
      '__builtin_ia32_paddw'
    return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:135:19: error: use of undeclared identifier
      '__builtin_ia32_paddd'
    return (__m64)__builtin_ia32_paddd((__v2si)__m1, (__v2si)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:141:19: error: use of undeclared identifier
      '__builtin_ia32_paddsb'
    return (__m64)__builtin_ia32_paddsb((__v8qi)__m1, (__v8qi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:147:19: error: use of undeclared identifier
      '__builtin_ia32_paddsw'
    return (__m64)__builtin_ia32_paddsw((__v4hi)__m1, (__v4hi)__m2);
                  ^
/usr/bin/../lib/clang/3.8.0/include/mmintrin.h:153:19: error: use of undeclared identifier
      '__builtin_ia32_paddusb'
    return (__m64)__builtin_ia32_paddusb((__v8qi)__m1, (__v8qi)__m2);
                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]

http://thunderx1.nyi.freebsd.org/data/110arm64-default/445841/logs/errors/vapoursynth-fmtconv-r20.log

fmtc.bitdepth(bits=14) does not work

Supported input formats:

8-–12-, 14- and 16-bit integer.
32-bit floating point.
Any planar colorspace.

But this does not work clip = clip.fmtc.bitdepth(bits=14)
This error is shown vapoursynth.Error: bitdepth: output pixel bitdepth not supported.

Maybe in the condition "res == 14" was forgotten?

if (! ( (st == ::stInteger && bps == 1 && res == 8 )
|| (st == ::stInteger && bps == 2 && ( res == 9
|| res == 10
|| res == 12
|| res == 16))
|| (st == ::stFloat && bps == 4 && res == 32 )))
{
throw_inval_arg ("output pixel bitdepth not supported.");

matrix: unsupported color family for output.

This works.

clip = clip.resize.Bicubic(format = vs.RGBS)
clip = clip.fmtc.matrix(col_fam = vs.YUV, mat="709")

This throws "matrix: unsupported color family for output."

clip = clip.resize.Bicubic(format = vs.RGBS)
clip = clip.fmtc.matrix(col_fam = vs.YUV, coef=[1/3,1/3,1/3,0, 1/2,0,-1/2,0, 1/4,-1/2,1/4,0])

Why?

Linear to Slog3 not working properly

Hello,
I have a SGamut3.Cine Linear EXR. It seems like the Linear to Slog3 conversion is clipping in the highlights.

import vapoursynth as vs
import muvsfunc
core = vs.get_core()

input_path = 'source_sgamut

c = core.imwri.Read(input_path,float_output=True)
c = core.fmtc.transfer (clip=c, transs='linear', transd='slog3')
c.set_output()

I'm attaching:
source_sgamut3cine_linear.exr <-- source file
resolve_delinearized.tif <-- expected result
vs_delinearized.png <-- fmtconv result

linear_to_slog3_tb.zip

Uses bit shifting even for full-range depth conversions

for a function call like this:

clip = core.std.BlankClip(format=vs.GRAY8, color=255)
clip.fmtc.bitdepth(bits=16, fulls=True, fulld=True).set_output()

the clip should have a color of 65535 (255 * 257) but instead is 65280 (255 * 256)

Typo in src/fstb/Vu32.hpp

fmtconv fail to build for some architecture (armhf, arm64) with the following error
Replacing Vs32 by Vu32 solve this issue.

./../../src/fstb/Vu32.hpp: In function ‘fstb::Vu32 fstb::operator!=(const Vu32&, const Vu32&)’:
./../../src/fstb/Vu32.hpp:963:9: error: ‘Vs32’ was not declared in this scope; did you mean ‘Vu32’?
./../../src/fstb/Vu32.hpp:963:13: error: expected ‘;’ before ‘{’ token

Build Errors and Warnings on OS X (10.11) (gcc5)

_Update: Successfully built it now with gcc-4.9 (still: "OS-X-native" building would be nice)
_-----
When building fmtconv r17 on a Mac (OS X 10.11.3) make fails with three errors (and a lot of warnings):

  1. In file included from ./../../src/conc/Interlocked.h:132: ./../../src/conc/Interlocked.hpp:268:16: error: invalid lvalue in asm input for constraint 'm' : [excg] "m" (&excg) ^~~~~
  2. In file included from ./../../src/conc/Interlocked.h:132: ./../../src/conc/Interlocked.hpp:312:16: error: invalid lvalue in asm input for constraint 'm' : [old] "m" (&old) ^~~~
    I've worked around this by simply removing the &-references in both blocks - but I do not really know what I was doing there and it most likely broke something.
  3. For TransLut.cpp to compile on a Mac another include is needed:
    #include <cstdlib>
    Else, a call to 'abs' is ambiguous error gets thrown for line 350
    (const int ind_3 = std::abs (ind_2) - 1;)
    I've googled this one https://stackoverflow.com/questions/30084577/ambiguous-call-to-abs. Maybe there's another way.
  4. A whole lot of warnings like this one were thrown but didn't break the build process:
    warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to true [-Wtautological-undefined-compare] assert (&dst1 != 0)
  5. And make install was complaining:
    make: *** No rule to make target../../src/fmtc/Matrix_avx2.cpp', needed by ../../src/fmtc/libavx2_la-Matrix_avx2.lo'. Stop.
    I believe I got around that ("avx issues? Like discussed for Linux at doom9?) by building from within Xcode and setting some platform specifics for the release build but again I didn't actually know what I was doing. It's just that I was hoping to somehow get havsfunc to work on my Mac. I did not succeed yet... ;)

Would be great if a next / future releases would cross another platform border. :)

Catch i14 input in fmtc.resample

import vapoursynth as vs
core = vs.core

blank = core.std.BlankClip(format=vs.YUV420P14)

fmtc = core.fmtc.resample(blank, css='444').set_output()

When running this code, a strange error is produced:

vspipe -p fmtc.vpy .
Script evaluation done in 0.06 seconds
Fatal: A frame was returned by resample but an error was also set, this is not allowed
VapourSynth encountered a fatal error: A frame was returned by resample but an error was also set, this is not allowed
terminate called without an active exception
[1]    97151 IOT instruction (core dumped)  vspipe -p fmtc.vpy .

In contrast to the error produced by fmtc.bitdepth(bits=14):

Script evaluation failed:
Python exception: bitdepth: output pixel bitdepth not supported.

Traceback (most recent call last):
  File "src/cython/vapoursynth.pyx", line 2819, in vapoursynth._vpy_evaluate
  File "src/cython/vapoursynth.pyx", line 2820, in vapoursynth._vpy_evaluate
  File "fmtc.vpy", line 6, in <module>
    fmtc = core.fmtc.bitdepth(blank, bits=14).set_output()
  File "src/cython/vapoursynth.pyx", line 2565, in vapoursynth.Function.__call__
vapoursynth.Error: bitdepth: output pixel bitdepth not supported.

Does not work correctly on Apple Silicon after successful compilation

While fmtconv compiles fine on Apple Silicon, it doesn't seem to work correctly. I noticed that nnedi3_rpow2 doesn't seem to work correctly (with different input formats): luma seems to be fine, but chroma is all solid green.
While I thought nnedi3 is the problem, it works perfect if I do not use fmtconv (disabling all the chroma alignment corrections).

I'm not sure what is causing this issues, are there automated test cases that can identify incorrect functions or could someone else confirm?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.