Coder Social home page Coder Social logo

ultravideo / kvazaar Goto Github PK

View Code? Open in Web Editor NEW
795.0 795.0 175.0 7.69 MB

An open-source HEVC encoder

License: BSD 3-Clause "New" or "Revised" License

C 94.24% C++ 0.41% Shell 0.62% Makefile 0.34% M4 1.91% Python 1.30% Dockerfile 0.08% MATLAB 0.01% CMake 1.08%
h265 hevc video

kvazaar's People

Contributors

alexandremercat avatar arizer avatar aryla avatar bradh avatar darealshinji avatar dremek avatar fador avatar farindk avatar hyvoenen avatar jbeich avatar jeeb avatar jovasa avatar lgbaldoni avatar lu-zero avatar matoro avatar miimiz avatar mikpit avatar mrasura avatar peterdavehello avatar pkubaj avatar redfoxymoon avatar santeris avatar supersjgk avatar timotf avatar topitopotin avatar venti- avatar vfr-maniac avatar vtorri avatar whamidou avatar wiiaboo avatar

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  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  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

kvazaar's Issues

Shared and static libraries

Building shared and static libraries is very easy. This could be useful for projects like ffmpeg. However, I don't know how often the ABI changes and shared library with an ABI version in the SONAME is important on Unix systems.
I think this might be worth adding to the build system.

Building a static library:

make
rm -f interface_main.o
ar cru libkvazaar.a $(find . -name \*.o | tr '\n' ' ')
ranlib libkvazaar.a

Shared library:

CFLAGS=-fPIC make
rm -f interface_main.o
gcc -shared -Wl,-soname,libkvazaar.so.0 $(find . -name \*.o | tr '\n' ' ')\
 -lrt -lm -pthread -o libkvazaar.so.0

Test the shared library:

rm -f kvazaar
ln -s libkvazaar.so.0 libkvazaar.so
make interface_main.o
gcc interface_main.o -L. -lkvazaar -lrt -lm -pthread -o kvazaar
LD_PRELOAD=./libkvazaar.so ./kvazaar

static library build failure (-D flag is unknown)

On OS X, commit cb49586 is broken:

ar rcD libkvazaar.a bitstream.o cabac.o checkpoint.o config.o context.o cu.o encoder.o encoderstate.o rate_control.o filter.o inter.o intra.o kvazaar.o nal.o imagelist.o rdo.o sao.o scalinglist.o search.o search_intra.o search_inter.o strategyselector.o tables.o threadqueue.o transform.o encoder_state-bitstream.o encoder_state-ctors_dtors.o encoder_state-geometry.o image.o videoframe.o strategies/strategies-picture.o strategies/strategies-nal.o strategies/strategies-dct.o strategies/strategies-ipol.o strategies/generic/nal-generic.o strategies/generic/picture-generic.o strategies/sse2/picture-sse2.o strategies/sse41/picture-sse41.o strategies/altivec/picture-altivec.o strategies/avx2/picture-avx2.o strategies/x86_asm/picture-x86-asm.o strategies/generic/dct-generic.o strategies/avx2/dct-avx2.o strategies/generic/ipol-generic.o strategies/avx2/ipol-avx2.o strategies/x86_asm/picture-x86-asm-sad.o strategies/x86_asm/picture-x86-asm-satd.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar: illegal option -- D
usage:  ar -d [-TLsv] archive file ...
    ar -m [-TLsv] archive file ...
    ar -m [-abiTLsv] position archive file ...
    ar -p [-TLsv] archive [file ...]
    ar -q [-cTLsv] archive file ...
    ar -r [-cuTLsv] archive file ...
    ar -r [-abciuTLsv] position archive file ...
    ar -t [-TLsv] archive [file ...]
    ar -x [-ouTLsv] archive [file ...]
Makefile:261: recipe for target 'libkvazaar.a' failed
make: *** [libkvazaar.a] Error 1

-D seems to be GNU ar specific

The static library builds fine without the -D flag on OS X.

provide a mean to get the extradata

a kvazaar_extradata basically would need this

    // Video Parameter Set (VPS)
    kvz_nal_write(stream, KVZ_NAL_VPS_NUT, 0, 1);
    encoder_state_write_bitstream_vid_parameter_set(state);

    // Sequence Parameter Set (SPS)
    kvz_nal_write(stream, KVZ_NAL_SPS_NUT, 0, 1);
    encoder_state_write_bitstream_seq_parameter_set(state);

    // Picture Parameter Set (PPS)
    kvz_nal_write(stream, KVZ_NAL_PPS_NUT, 0, 1);
    encoder_state_write_bitstream_pic_parameter_set(state);

provided in a separate bitstream and then chunks.

(it is useful to be able to put the encoded data in mkv and mp4 without going through additional bitstream filters).

exit() in shared library

This is rpmlint's suggestion:

libkvazaar0.x86_64: W: shared-lib-calls-exit /usr/lib64/libkvazaar.so.0.0.0 exit@GLIBC_2.2.5
This library package calls exit() or _exit(), probably in a non-fork()
context. Doing so from a library is strongly discouraged - when a library
function calls exit(), it prevents the calling program from handling the
error, reporting it to the user, closing files properly, and cleaning up any
state that the program has. It is preferred for the library to return an
actual error code and let the calling program decide how to handle the
situation.

CLI: --help and --version

Can you enable --help and --version as command line arguments and make sure the output isn't sent to stderr?

Fix all the compiler warnings.

There are currently many compiler warnings with -Wall. We would like to fix them and enable -Wall so we can avoid getting any more of them. This is issue is for tracking that progress and can be closed when -Wall doesn't produce any more errors in VS or gcc.

Building on Mac OS X 10.6.8 -> cc1 error

trying to build latest repository on Mac OSX 10.6.8 I get

gcc -O2 -g -m32 -I. -I/usr/local/include -L/usr/local/lib -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wstrict-prototypes -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=declaration-after-statement -Werror=vla -c interface_main.c -o interface_main.o
cc1: error: unrecognized command line option "-Wtype-limits"
cc1: error: -Werror=vla: No option -Wvla
cc1: error: unrecognized command line option "-fno-signed-zeros"
make: *** [interface_main.o] Error 1

x86/test.asm has wrong function name for cpuId32

While building on illumos and GNU/Linux, I noticed that the build would fail for i386 builds because the function declared in x86/test.asm is _cpuId32 as opposed to cpuId32. The amd64 build appears to use cpuId64. I was able to verify that the build worked when removing the trailing underscore. The build also worked cleanly for both i386 and amd64 on illumos/SmartOS.

Building on OSX with clang

i did a git pull a few minutes and and when bulding i get this error

clang: warning: argument unused during compilation: '-pthread'

and make tests fail

../tests/speed_tests.c:109:10: error: expected ')'
++i, GET_TIME(&clock_now))
^
../tests/speed_tests.c:107:7: note: to match this '('
for (unsigned i = 0;
^
../tests/speed_tests.c:147:10: error: expected ')'
++i, GET_TIME(&clock_now))
^
../tests/speed_tests.c:145:7: note: to match this '('
for (unsigned i = 0;
^
../tests/speed_tests.c:199:8: error: expected ')'
++i, GET_TIME(&clock_now))
^
../tests/speed_tests.c:197:7: note: to match this '('
for (unsigned i = 0;
^

any help?

0.8.3 failt to build for powerpc

Hi,

I see this error with GCC 5.3.1 powerpc Debian unstable

/bin/bash ../libtool  --tag=CC   --mode=compile ccache cc -DHAVE_CONFIG_H -I. -I..   -DKVZ_DLL_EXPORTS -Wdate-time -D_FORTIFY_SOURCE=2  -Werror -Wall -Wtype-limits -Wvla -I./src -ftree-vectorize -fvisibility=hidden -pthread -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c -o strategies/avx2/libavx2_la-intra-avx2.lo `test -f 'strategies/avx2/intra-avx2.c' || echo './'`strategies/avx2/intra-avx2.c
strategies/altivec/picture-altivec.c:31:39: error: unknown type name 'pixel'
 static unsigned reg_sad_altivec(const pixel * const data1, const pixel * const data2,
                                       ^
strategies/altivec/picture-altivec.c:31:66: error: unknown type name 'pixel'
 static unsigned reg_sad_altivec(const pixel * const data1, const pixel * const data2,
                                                                  ^
Makefile:931: recipe for target 'strategies/altivec/libaltivec_la-picture-altivec.lo' failed
make[3]: *** [strategies/altivec/libaltivec_la-picture-altivec.lo] Error 1

Encoding results show a slight random variation.

This is probably due to uninitialized cu_info members or something else really dumb. Anyway it makes checking that fixes that shouldn't affect encoding performance don't affect it very difficult and we will try to fix it ASAP.

Doesn't build for powerpc

I'm sorry but I don't understand this compilation error. Build is done under Debian unstable.

libtool: compile:  ccache cc -DHAVE_CONFIG_H -I. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -Werror -Wall -Wtype-limits -Wvla -I./src -ftree-vectorize -fvisibility=hidden -std=gnu99 -DKVZ_DLL_EXPORTS -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread -c image.c  -fPIC -DPIC -o .libs/image.o
In file included from image.c:23:0:
strategyselector.h:134:7: error: expected identifier or '(' before numeric constant
   int powerpc;
       ^
Makefile:821: recipe for target 'image.lo' failed

Framework for automatic tests.

We really need some way to automatically test running the encoder against a bunch of videos with different settings to check that there are no regressions. We would also like the ability to compare bits, bitrate, PSNR, BD-rate, encoding time and such across versions and maybe even against other encoders.

I started to make a list in order to glue something together soon, so I thought I might as well make it an issue so others can comment. Maybe exactly the thing we need already exists and we just don't know it?

Requirements:

  • Decentralized. We don't want to maintain a server for this and encoding video takes so much time anyway that doing it in your own powerful computer makes sense.
  • Cross-platform.
  • Easy to add new sequences to test against. Maybe even just dropping them in a directory, at which point they would be encoded once with some default parameters.
    • Possibility to define more complex tests and fail conditions.
      • Encoding a sequence with 4 QPs and calculating the BD-rate and BD-psnr.
      • Running the sequence through ffmpeg or something to scale, crop or whatever.
      • Fail conditions? Comparing against previous iterations might be fine though.
  • Aware of git.
    • I would like it to not re-run the same tests unless order to.
    • I would like it to maintain a database that references test-results against a specific commit.

linking lib with ffmpeg: pkg-config complains can't find it

i'm trying to link in the library to my ffmpeg build,
i've created .pc and .m

prefix=/usr/local
exec_prefix=${prefix}
libdir=/usr/locall/lib
incdir=${prefix}/include

Name: libkvazaar
Description: Open-source HEVC encoder
Version: 0.7.2
Libs: -L${libdir} -lkvazaar -lm
Cflags: -I${incdir}

but pkg-config cannot find the library, did i miss something in the .pc file, pkg-config points to the correct directory as other libraries build without issue

64bit builds, dependency crash,..

I'm using https://github.com/jb-alvarado/media-autobuild_suite to build kvazaar for windows, which uses:

cd $LOCALBUILDDIR

do_git "https://github.com/ultravideo/kvazaar.git" kvazaar-git

if [[ $compile == "true" ]]; then
cd src

if [[ "$bits" = "32bit" ]]; then
make ARCH=i686 LD="gcc -pthread"
else
make ARCH=x86_64 LD="gcc -pthread"
fi

cp kvazaar.exe $LOCALDESTDIR/bin-video
do_checkIfExist kvazaar-git bin-video/kvazaar.exe
compile="false"
else
echo -------------------------------------------------
echo "kvazaar-git is already up to date"
echo -------------------------------------------------
fi
to build kvazaar.

Problem is that the 32bit version builds for fine on my system and others, but the 64bit version only work on my system, when I copy them to another 64bit system they crash.

Is this a bug in the build script or a bug in kvazaar?
(if it's a bug in the media-autobuild_suite build script, do you know that it is?)

Cu Selur

deblock <beta:tc> ranges?

What are the min/max/default values for the deblock beta and tc parameters?
(should be noted in the help output)

Improve command line parameters.

Change existing parameters to be in line with what other programs like use and add missing basic features. Now that we have also long parameter support, we should probably use the same parameter names that other encoders like x264 already use. Remember to update the documentation in README and usage string.

Please feel free to add any suggestions.

  • change
    • input resolution from -w, -h to --input-res w:h
  • add
    • seek

-fpic breaks compilation on MingW

af2b417 broke compilation on MingW because of -fpic and -Werror.

On compilation for Windows targets (afaik), -fpic is always ignored by GCC and since you also added -Werror every warning gets turned into an error. Either removing -Werror or -fpic from the Makefile fixes it.

Muxing to mp4

Using the latest 0.2.1 and mencoder to encode a testfile with:

mencoder -lavdopts threads=8 -really-quiet -of rawvideo -o - -ovc raw -demuxer lavf -vfm ffmpeg -noskip -vf scale,format=i420 -forcedsubsonly -nosub -nosound -mc 0 "F:\TESTCL~1\test.avi" | kvazaar -i - -w 640 -h 352 -q 32 -p 0 -n 429 -o "H:\Temp\test_11_02_11_7310_01.265"

encoding seems to work fine.
Playback with ffplay also seems to work, but shows:

[hevc @ 00000000053129a0] Unknown HEVC profile: 0

and lot of

[hevc @ 0000000000358300] PPS id out of range: 0

warnings, which might be the cause of MP4Box crashing (APPCRASH) when trying to mux the output using:

MP4Box -add "H:\Temp\test_11_02_11_7310_01.265"#video:fps=25 -brand hvc1 -tmp "H:\Temp" -new "H:\Output\11_02_11_7310__02.mp4"

->
a. Is there another known to be working method to multiplex the output of Kvazaar into an .mp4 container?
b. Would be nice if the missing/wrong profile/PPS id infos could be fixed.

Thanks

Clang static analyzer warnings

Clang static analyzer found some issues in code:

context.c:344:3: warning: Value stored to 'cnt' is never read
  cnt = 0;
1 warning generated.

encoder.c:1724:64: warning: The right operand of '-' is a garbage value
      block[i] = ((int16_t)base_u[x + y * (base_stride >> 1)]) -
                                                               ^
encoder.c:1760:34: warning: The right operand of '+' is a garbage value
        int16_t val = block[i++] + pred_u[x + y * (pred_stride >> 1)];
                                 ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
encoder.c:1771:61: warning: The right operand of '<' is a garbage value
        recbase_u[x + y * (recbase_stride >> 1)] = (uint8_t)CLIP(0, 255, pred_u[x + y * (pred_stride >> 1)]);
                                                            ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./global.h:103:40: note: expanded from macro 'CLIP'
#define CLIP(low,high,value) MAX((low),MIN((high),(value)))
                                       ^
./global.h:102:23: note: expanded from macro 'MIN'
#define MIN(a,b) (((a)<(b))?(a):(b))
                      ^
./global.h:101:25: note: expanded from macro 'MAX'
#define MAX(a,b) (((a)>(b))?(a):(b))
                        ^
encoder.c:1907:59: warning: The right operand of '-' is a garbage value
        block[i] = ((int16_t)base_y[x + y * base_stride]) -
                                                          ^
encoder.c:2039:32: warning: The right operand of '+' is a garbage value
          int val = block[i++] + pred_y[x + y * pred_stride];
                               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
encoder.c:2048:54: warning: The right operand of '<' is a garbage value
          recbase_y[x + y * recbase_stride] = (pixel)CLIP(0, 255, pred_y[x + y * pred_stride]);
                                                     ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~
./global.h:103:40: note: expanded from macro 'CLIP'
#define CLIP(low,high,value) MAX((low),MIN((high),(value)))
                                       ^
./global.h:102:23: note: expanded from macro 'MIN'
#define MIN(a,b) (((a)<(b))?(a):(b))
                      ^
./global.h:101:25: note: expanded from macro 'MAX'
#define MAX(a,b) (((a)>(b))?(a):(b))
                        ^
6 warnings generated.

intra.c:713:33: warning: Assigned value is garbage or undefined
        dst[k * dst_stride + l] = ref_main[l + 1];
                                ^ ~~~~~~~~~~~~~~~
intra.c:837:10: warning: Value stored to 'recbase_y' during its initialization is never read
  pixel *recbase_y = &lcu->rec.y[x_local + y_local * LCU_WIDTH];
         ^~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
intra.c:844:10: warning: Value stored to 'rec_shift' during its initialization is never read
  pixel *rec_shift  = &rec[(LCU_WIDTH >> (depth)) * 2 + 8 + 1];
         ^~~~~~~~~    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.

extras/getopt.c:853:39: warning: Access to field 'name' results in a dereference of a null pointer (loaded from variable 'p')
        for (p = longopts, option_index = 0; p->name; p++, option_index++)
                                             ^~~~~~~
1 warning generated.

undefined reference to `kvz_cpu_cpuid'

Hello,
I try to compile kavazaar under msys2 with mingw32 and I get this error:

scons_build_x86/strategyselector.o:strategyselector.c:(.text+0x338): undefined reference to `kvz_cpu_cpuid'

This is only happen with the 32 bit version, the 64 bit builds.
Have you a idea what's happen?

A nice day!
jb_

Edit: I also see that in the 64bit version I get:Segmentation fault, when I try to run it.

Valgrind issues

Seems to be based on uninitialised data after blitting in the temporary array for orig and reconstructed frames in sao:

Input: crew_cif.yuv, output: out.hevc
Video size: 352x288
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x4186ED: sao_search_best_mode (sao.c:291)
==3963== by 0x418C8C: sao_search_luma (sao.c:387)
==3963== by 0x4082B1: encode_slice_data (encoder.c:1163)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x418A57: sao_search_luma (sao.c:361)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x4186F3: sao_search_best_mode (sao.c:291)
==3963== by 0x418C8C: sao_search_luma (sao.c:387)
==3963== by 0x4082B1: encode_slice_data (encoder.c:1163)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x418A57: sao_search_luma (sao.c:361)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x41871C: sao_search_best_mode (sao.c:295)
==3963== by 0x418C8C: sao_search_luma (sao.c:387)
==3963== by 0x4082B1: encode_slice_data (encoder.c:1163)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x418A57: sao_search_luma (sao.c:361)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x41878C: sao_search_best_mode (sao.c:316)
==3963== by 0x418C8C: sao_search_luma (sao.c:387)
==3963== by 0x4082B1: encode_slice_data (encoder.c:1163)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x418A57: sao_search_luma (sao.c:361)
==3963==
==3963== Use of uninitialised value of size 8
==3963== at 0x417D62: calc_sao_edge_dir (sao.c:80)
==3963== by 0x418698: sao_search_best_mode (sao.c:277)
==3963== by 0x418A50: sao_search_chroma (sao.c:357)
==3963== by 0x4082D0: encode_slice_data (encoder.c:1164)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x4186ED: sao_search_best_mode (sao.c:291)
==3963== by 0x418A50: sao_search_chroma (sao.c:357)
==3963== by 0x4082D0: encode_slice_data (encoder.c:1164)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x4186F3: sao_search_best_mode (sao.c:291)
==3963== by 0x418A50: sao_search_chroma (sao.c:357)
==3963== by 0x4082D0: encode_slice_data (encoder.c:1164)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x41871C: sao_search_best_mode (sao.c:295)
==3963== by 0x418A50: sao_search_chroma (sao.c:357)
==3963== by 0x4082D0: encode_slice_data (encoder.c:1164)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x418735: sao_search_best_mode (sao.c:298)
==3963== by 0x418A50: sao_search_chroma (sao.c:357)
==3963== by 0x4082D0: encode_slice_data (encoder.c:1164)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x41878C: sao_search_best_mode (sao.c:316)
==3963== by 0x418A50: sao_search_chroma (sao.c:357)
==3963== by 0x4082D0: encode_slice_data (encoder.c:1164)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F4C: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x4082F5: encode_slice_data (encoder.c:1167)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x418A57: sao_search_luma (sao.c:361)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F6E: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x4082F5: encode_slice_data (encoder.c:1167)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x418A57: sao_search_luma (sao.c:361)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F93: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x4082F5: encode_slice_data (encoder.c:1167)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x418A57: sao_search_luma (sao.c:361)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F4C: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x40831A: encode_slice_data (encoder.c:1168)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F6E: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x40831A: encode_slice_data (encoder.c:1168)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F93: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x40831A: encode_slice_data (encoder.c:1168)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F4C: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x40833F: encode_slice_data (encoder.c:1169)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F6E: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x40833F: encode_slice_data (encoder.c:1169)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==
==3963== Conditional jump or move depends on uninitialised value(s)
==3963== at 0x417F93: sao_reconstruct_color (sao.c:109)
==3963== by 0x41852D: sao_reconstruct (sao.c:236)
==3963== by 0x40833F: encode_slice_data (encoder.c:1169)
==3963== by 0x405B41: encode_one_frame (encoder.c:444)
==3963== by 0x401409: main (encmain.c:231)
==3963== Uninitialised value was created by a stack allocation
==3963== at 0x4187DF: sao_search_chroma (sao.c:325)
==3963==

Recommended cmd parameters to achieve the best coding effciency

Hi, I wonder the best coding efficiency kvazaar v0.4 can achieve? Can its coding efficiency close to the HM encoder?
If the cmd line as following can achieve the best coding efficiency(with full RDO, sub ME and full intra search)?
--rd 2 --subme 1 --full-intra-search

Building on Mac OS X 10.9.5 Mavericks fails

Calling make inside the src folder gives me:

gcc -O2 -g -Werror -ftree-vectorize -m64 -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c interface_main.c -o interface_main.o
gcc -O2 -g -Werror -ftree-vectorize -m64 -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c encmain.c -o encmain.o
encmain.c:323:5: error: implicit declaration of function 'clock_gettime' is
invalid in C99 [-Werror,-Wimplicit-function-declaration]
GET_TIME(&encoding_start_real_time);
^
./threads.h:31:27: note: expanded from macro 'GET_TIME'

define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))

                      ^

encmain.c:323:5: error: use of undeclared identifier 'CLOCK_MONOTONIC'
./threads.h:31:41: note: expanded from macro 'GET_TIME'

define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))

                                    ^

encmain.c:349:9: error: use of undeclared identifier 'CLOCK_MONOTONIC'
GET_TIME(&encoding_start_real_time);
^
./threads.h:31:41: note: expanded from macro 'GET_TIME'

define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))

                                    ^

encmain.c:394:5: error: use of undeclared identifier 'CLOCK_MONOTONIC'
GET_TIME(&encoding_end_real_time);
^
./threads.h:31:41: note: expanded from macro 'GET_TIME'

define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))

                                    ^

4 errors generated.
make: *** [encmain.o] Error 1
macmini:src selur$ make
gcc -O2 -g -Werror -ftree-vectorize -m64 -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c encmain.c -o encmain.o
encmain.c:323:5: error: implicit declaration of function 'clock_gettime' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
GET_TIME(&encoding_start_real_time);
^
./threads.h:31:27: note: expanded from macro 'GET_TIME'

define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))

                      ^

encmain.c:323:5: error: use of undeclared identifier 'CLOCK_MONOTONIC'
./threads.h:31:41: note: expanded from macro 'GET_TIME'

define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))

                                    ^

encmain.c:349:9: error: use of undeclared identifier 'CLOCK_MONOTONIC'
GET_TIME(&encoding_start_real_time);
^
./threads.h:31:41: note: expanded from macro 'GET_TIME'

define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))

                                    ^

encmain.c:394:5: error: use of undeclared identifier 'CLOCK_MONOTONIC'
GET_TIME(&encoding_end_real_time);
^
./threads.h:31:41: note: expanded from macro 'GET_TIME'

define GET_TIME(clock_t) clock_gettime(CLOCK_MONOTONIC, (clock_t))

                                    ^

4 errors generated.
make: *** [encmain.o] Error 1

might be that the gcc which comes with latest XCode isn't new enough:

macmini:MacOS selur$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

just wanted to report it, in case this is not due to gcc not being new enough. (replacing gcc with clang, doesn't help either)

Please release static builds,..

or include the required dlls with the releases, couldn't run Kvazaar on Win8 64bit pro until I installed Visual C++ Runtime for VS2010.

Thanks!

Build without -fvisibility=hidden on Linux

I figured that linking the command line program against the shared library actually works if I build Kvazaar without -fvisibility=hidden. Just wanted to let you know.

64bit version broken

I guess it's known that the 64bit builds are broken.
At least for me 32bit builds work fine, 64bit builds crash. (using VS2010)

ASMFLAG for mingw-w64-x86_64

Hello,
I want to inform you that under 64 bit mingw-w64 it need now a new ASMFLAGS, otherwise it crashes. I you this:
-DHAVE_ALIGNED_STACK=0
and with that it works.

Question about library version

According to the Makefile the current library version is 2.2.0, resulting in the library name libkvazaar.so.2 on ELF systems and libkvazaar.2.dylib on OSX.
But in src/kvazaar_version.h the current public API is 9. Shouldn't that one be used on the shared library name instead?

Building on Mac OS X requires different symbols and YASM flags

For Mac the cpuId64 in test64.asm must become _cpuId64. Also the YASM object file flag has to be macho64 instead of elf64.

Patch

diff --git a/src/Makefile b/src/Makefile
index ab56e9d..bf005c7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -35,10 +35,10 @@ $(PROG): $(OBJS) $(ASMOBJS)
         $(LD) $(LDFLAGS) $^ -o $@

 test.o: x86/test.asm
-        $(YASM) -f elf x86/test.asm -o test.o
+        $(YASM) -f macho32 x86/test.asm -o test.o

 test64.o: x64/test64.asm
-        $(YASM) -f elf64 x64/test64.asm -o test64.o
+        $(YASM) -f macho64 x64/test64.asm -o test64.o

 %.o: %.c
         $(CC) $(CCFLAGS) -c $< -o $@
diff --git a/src/x64/test64.asm b/src/x64/test64.asm
index b112767..17ef077 100644
--- a/src/x64/test64.asm
+++ b/src/x64/test64.asm
@@ -1,11 +1,11 @@
 ; Function to get CPUID for identifying CPU capabilities
 bits 64
 section .code
-global cpuId64
+global _cpuId64

 ;void __cdecl cpuId64(int* ecx, int *edx );

-cpuId64:
+_cpuId64:
     push rbx
     mov  r8, rcx ; pointer to ecx-output
     mov  r9, rdx ; pointer to edx-output

cannot compile library on OSX

Hi, I am trying to compile kvazaar from git HEAD, but on OSX it yields

gcc encmain.o interface_main.o bitstream.o cabac.o checkpoint.o cli.o config.o context.o cu.o encoder.o encoderstate.o rate_control.o filter.o inter.o intra.o kvazaar.o nal.o imagelist.o rdo.o sao.o scalinglist.o search.o strategyselector.o tables.o threadqueue.o transform.o encoder_state-bitstream.o encoder_state-ctors_dtors.o encoder_state-geometry.o image.o videoframe.o yuv_io.o strategies/strategies-picture.o strategies/strategies-nal.o strategies/strategies-dct.o strategies/strategies-ipol.o strategies/generic/nal-generic.o strategies/generic/picture-generic.o strategies/sse2/picture-sse2.o strategies/sse41/picture-sse41.o strategies/altivec/picture-altivec.o strategies/avx2/picture-avx2.o strategies/x86_asm/picture-x86-asm.o strategies/generic/dct-generic.o strategies/avx2/dct-avx2.o strategies/generic/ipol-generic.o strategies/avx2/ipol-avx2.o strategies/x86_asm/picture-x86-asm-sad.o strategies/x86_asm/picture-x86-asm-satd.o -fvisibility=hidden -lm -pthread -m64 -shared -Wl,-soname,libkvazaar.so.0 -o libkvazaar.so.0.0.0
ld: unknown option: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libkvazaar.so.0.0.0] Error 1

-soname is unavailable on OSX and it looks like the right extension would be .dylib.

./configure: line 12368: syntax error near unexpected token `-mavx2,'

configure on OS X fails with:

acMini:kvazaar selur$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
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 for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for ar... ar
checking the archiver (ar) interface... ar
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking build system type... x86_64-apple-darwin15.3.0
checking host system type... x86_64-apple-darwin15.3.0
checking how to print strings... printf
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... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm
checking the name lister (/usr/bin/nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-apple-darwin15.3.0 file names to x86_64-apple-darwin15.3.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin15.3.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for objdump... no
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @file support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
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 objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin15.3.0 dyld
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... yes
./configure: line 12368: syntax error near unexpected token -mavx2,' ./configure: line 12368:AX_CHECK_COMPILE_FLAG(-mavx2, flag_avx2="true")'

avx2 DCT Macro problem compiling with gcc

trying to compile kvazaar using https://github.com/jb-alvarado/media-autobuild_suite I end up with a lot of warnings and an error:

....
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c cu.c -o cu.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c encoder.c -o encoder.o
encmain.c: In function 'main':
encmain.c:405:11: warning: unknown conversion type character 'l' in format [-Wformat=]
psnr[0] / stat_frames, psnr[1] / stat_frames, psnr[2] / stat_frames);
^
encmain.c:405:11: warning: format '%f' expects argument of type 'double', but argument 4 has type 'uint64_t' [-Wformat=]
encmain.c:405:11: warning: too many arguments for format [-Wformat-extra-args]
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c encoderstate.c -o encoderstate.o
config.c: In function 'config_read':
config.c:502:13: warning: passing argument 1 of 'getopt_long' makes pointer from integer without a cast
int c = getopt_long(argc, argv, short_options, long_options, &long_options_index);
^
In file included from config.c:30:0:
./extras/getopt.h:150:12: note: expected 'int ' but argument is of type 'int'
extern int getopt_long (int __argc, char *const *__argv, const char *shortopts,
^
config.c:502:13: warning: passing argument 2 of 'getopt_long' from incompatible pointer type
int c = getopt_long(argc, argv, short_options, long_options, &long_options_index);
^
In file included from config.c:30:0:
./extras/getopt.h:150:12: note: expected 'char * const
' but argument is of type 'char *
'
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
^
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c filter.c -o filter.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c inter.c -o inter.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c intra.c -o intra.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c nal.c -o nal.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c imagelist.c -o imagelist.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c rdo.c -o rdo.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c sao.c -o sao.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c scalinglist.c -o scalinglist.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c search.c -o search.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c strategyselector.c -o strategyselector.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c tables.c -o tables.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c threadqueue.c -o threadqueue.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c transform.c -o transform.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c encoder_state-bitstream.c -o encoder_state-bitstream.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c encoder_state-ctors_dtors.c -o encoder_state-ctors_dtors.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c encoder_state-geometry.c -o encoder_state-geometry.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c image.c -o image.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c videoframe.c -o videoframe.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c strategies/strategies-picture.c -o strategies/strategies-picture.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c strategies/strategies-nal.c -o strategies/strategies-nal.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c strategies/strategies-dct.c -o strategies/strategies-dct.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c strategies/generic/nal-generic.c -o strategies/generic/nal-generic.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c strategies/generic/picture-generic.c -o strategies/generic/picture-generic.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -msse2 -c strategies/sse2/picture-sse2.c -o strategies/sse2/picture-sse2.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -msse4.1 -c strategies/sse41/picture-sse41.c -o strategies/sse41/picture-sse41.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c strategies/altivec/picture-altivec.c -o strategies/altivec/picture-altivec.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -mavx2 -c strategies/avx2/picture-avx2.c -o strategies/avx2/picture-avx2.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -DKVZ_COMPILE_ASM -c strategies/x86_asm/picture-x86-asm.c -o strategies/x86_asm/picture-x86-asm.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -c strategies/generic/dct-generic.c -o strategies/generic/dct-generic.o
gcc -O2 -g -ftree-vectorize -std=gnu99 -I. -I./strategies -I./extras -Wall -Wtype-limits -Wvla -mavx2 -c strategies/avx2/dct-avx2.c -o strategies/avx2/dct-avx2.o
yasm -f win64 -DHAVE_ALIGNED_STACK=0 -DARCH_X86_64=1 -I. -I./strategies -I./extras -o strategies/x86_asm/picture-x86-asm-sad.o strategies/x86_asm/picture-x86-asm-sad.asm
strategies/generic/dct-generic.c: In function 'dct_4x4_generic':
strategies/generic/dct-generic.c:577:3: warning: passing argument 1 of 'partial_butterfly_4_generic' discards 'const' qualifier from pointer target type
partial_butterfly
## n ## generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:592:1: note: in expansion of macro 'DCT_NXN_GENERIC'
DCT_NXN_GENERIC(4);
^
strategies/generic/dct-generic.c:246:13: note: expected 'short int *' but argument is of type 'const int16_t *'
static void partial_butterfly_4_generic(short *src, short *dst,
^
strategies/generic/dct-generic.c: In function 'dct_8x8_generic':
strategies/generic/dct-generic.c:577:3: warning: passing argument 1 of 'partial_butterfly_8_generic' discards 'const' qualifier from pointer target type
partial_butterfly
## n ## generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:593:1: note: in expansion of macro 'DCT_NXN_GENERIC'
DCT_NXN_GENERIC(8);
^
strategies/generic/dct-generic.c:299:13: note: expected 'short int *' but argument is of type 'const int16_t *'
static void partial_butterfly_8_generic(short *src, short *dst,
^
strategies/generic/dct-generic.c: In function 'dct_16x16_generic':
strategies/generic/dct-generic.c:577:3: warning: passing argument 1 of 'partial_butterfly_16_generic' discards 'const' qualifier from pointer target type
partial_butterfly
## n ## generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:594:1: note: in expansion of macro 'DCT_NXN_GENERIC'
DCT_NXN_GENERIC(16);
^
strategies/generic/dct-generic.c:371:13: note: expected 'short int *' but argument is of type 'const int16_t *'
static void partial_butterfly_16_generic(short *src, short *dst,
^
strategies/generic/dct-generic.c: In function 'dct_32x32_generic':
strategies/generic/dct-generic.c:577:3: warning: passing argument 1 of 'partial_butterfly_32_generic' discards 'const' qualifier from pointer target type
partial_butterfly
## n ## generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:595:1: note: in expansion of macro 'DCT_NXN_GENERIC'
DCT_NXN_GENERIC(32);
^
strategies/generic/dct-generic.c:461:13: note: expected 'short int *' but argument is of type 'const int16_t *'
static void partial_butterfly_32_generic(short *src, short *dst,
^
strategies/generic/dct-generic.c: In function 'idct_4x4_generic':
strategies/generic/dct-generic.c:588:3: warning: passing argument 1 of 'partial_butterfly_inverse_4_generic' discards 'const' qualifier from pointer target type
partial_butterfly_inverse
## n ## generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:597:1: note: in expansion of macro 'IDCT_NXN_GENERIC'
IDCT_NXN_GENERIC(4);
^
strategies/generic/dct-generic.c:272:13: note: expected 'short int *' but argument is of type 'const int16_t *'
static void partial_butterfly_inverse_4_generic(short *src, short *dst,
^
strategies/generic/dct-generic.c: In function 'idct_8x8_generic':
strategies/generic/dct-generic.c:588:3: warning: passing argument 1 of 'partial_butterfly_inverse_8_generic' discards 'const' qualifier from pointer target type
partial_butterfly_inverse
## n ## generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:598:1: note: in expansion of macro 'IDCT_NXN_GENERIC'
IDCT_NXN_GENERIC(8);
^
strategies/generic/dct-generic.c:336:13: note: expected 'int16_t *' but argument is of type 'const int16_t *'
static void partial_butterfly_inverse_8_generic(int16_t *src, int16_t *dst,
^
strategies/generic/dct-generic.c: In function 'idct_16x16_generic':
strategies/generic/dct-generic.c:588:3: warning: passing argument 1 of 'partial_butterfly_inverse_16_generic' discards 'const' qualifier from pointer target type
partial_butterfly_inverse
## n ## generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:599:1: note: in expansion of macro 'IDCT_NXN_GENERIC'
IDCT_NXN_GENERIC(16);
^
strategies/generic/dct-generic.c:418:13: note: expected 'int16_t *' but argument is of type 'const int16_t *'
static void partial_butterfly_inverse_16_generic(int16_t *src, int16_t *dst,
^
strategies/generic/dct-generic.c: In function 'idct_32x32_generic':
strategies/generic/dct-generic.c:588:3: warning: passing argument 1 of 'partial_butterfly_inverse_32_generic' discards 'const' qualifier from pointer target type
partial_butterfly_inverse
## n ## generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:600:1: note: in expansion of macro 'IDCT_NXN_GENERIC'
IDCT_NXN_GENERIC(32);
^
strategies/generic/dct-generic.c:517:13: note: expected 'int16_t *' but argument is of type 'const int16_t *'
static void partial_butterfly_inverse_32_generic(int16_t *src, int16_t *dst,
^
strategies/generic/dct-generic.c: In function 'fast_forward_dst_4x4_generic':
strategies/generic/dct-generic.c:608:3: warning: passing argument 1 of 'fast_forward_dst_4_generic' discards 'const' qualifier from pointer target type
fast_forward_dst_4_generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:209:13: note: expected 'short int *' but argument is of type 'const int16_t *'
static void fast_forward_dst_4_generic(short *block, short *coeff, int32_t shift) // input block, output coeff
^
strategies/generic/dct-generic.c: In function 'fast_inverse_dst_4x4_generic':
strategies/generic/dct-generic.c:618:3: warning: passing argument 1 of 'fast_inverse_dst_4_generic' discards 'const' qualifier from pointer target type
fast_inverse_dst_4_generic(input, tmp, shift_1st);
^
strategies/generic/dct-generic.c:227:13: note: expected 'short int *' but argument is of type 'const int16_t *'
static void fast_inverse_dst_4_generic(short *tmp, short *block, int shift) // input tmp, output block
^
yasm -f win64 -DHAVE_ALIGNED_STACK=0 -DARCH_X86_64=1 -I. -I./strategies -I./extras -o strategies/x86_asm/picture-x86-asm-satd.o strategies/x86_asm/picture-x86-asm-satd.asm
strategies/avx2/dct-avx2.c: In function 'matrix_dst_4x4_avx2':
strategies/avx2/dct-avx2.c:318:25: error: pasting "g_dst_4" and "[" does not give a valid preprocessing token
const int16_t *dct = &g
## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:341:1: note: in expansion of macro 'TRANSFORM'
TRANSFORM(dst, 4);
^
strategies/avx2/dct-avx2.c: In function 'matrix_dct_4x4_avx2':
strategies/avx2/dct-avx2.c:318:25: error: pasting "g_dct_4" and "[" does not give a valid preprocessing token
const int16_t *dct = &g
## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:342:1: note: in expansion of macro 'TRANSFORM'
TRANSFORM(dct, 4);
^
strategies/avx2/dct-avx2.c: In function 'matrix_dct_8x8_avx2':
strategies/avx2/dct-avx2.c:318:25: error: pasting "g_dct_8" and "[" does not give a valid preprocessing token
const int16_t *dct = &g
## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:343:1: note: in expansion of macro 'TRANSFORM'
TRANSFORM(dct, 8);
^
strategies/avx2/dct-avx2.c: In function 'matrix_dct_16x16_avx2':
strategies/avx2/dct-avx2.c:318:25: error: pasting "g_dct_16" and "[" does not give a valid preprocessing token
const int16_t *dct = &g
## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:344:1: note: in expansion of macro 'TRANSFORM'
TRANSFORM(dct, 16);
^
strategies/avx2/dct-avx2.c: In function 'matrix_dct_32x32_avx2':
strategies/avx2/dct-avx2.c:318:25: error: pasting "g_dct_32" and "[" does not give a valid preprocessing token
const int16_t *dct = &g
## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:345:1: note: in expansion of macro 'TRANSFORM'
TRANSFORM(dct, 32);
^
strategies/avx2/dct-avx2.c: In function 'matrix_idst_4x4_avx2':
strategies/avx2/dct-avx2.c:334:25: error: pasting "g_dst_4" and "[" does not give a valid preprocessing token
const int16_t *dct = &g
## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:347:1: note: in expansion of macro 'ITRANSFORM'
ITRANSFORM(dst, 4);
^
strategies/avx2/dct-avx2.c: In function 'matrix_idct_4x4_avx2':
strategies/avx2/dct-avx2.c:334:25: error: pasting "g_dct_4" and "[" does not give a valid preprocessing token
const int16_t *dct = &g_ ## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:348:1: note: in expansion of macro 'ITRANSFORM'
ITRANSFORM(dct, 4);
^
strategies/avx2/dct-avx2.c: In function 'matrix_idct_8x8_avx2':
strategies/avx2/dct-avx2.c:334:25: error: pasting "g_dct_8" and "[" does not give a valid preprocessing token
const int16_t *dct = &g_ ## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:349:1: note: in expansion of macro 'ITRANSFORM'
ITRANSFORM(dct, 8);
^
strategies/avx2/dct-avx2.c: In function 'matrix_idct_16x16_avx2':
strategies/avx2/dct-avx2.c:334:25: error: pasting "g_dct_16" and "[" does not give a valid preprocessing token
const int16_t *dct = &g_ ## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:350:1: note: in expansion of macro 'ITRANSFORM'
ITRANSFORM(dct, 16);
^
strategies/avx2/dct-avx2.c: In function 'matrix_idct_32x32_avx2':
strategies/avx2/dct-avx2.c:334:25: error: pasting "g_dct_32" and "[" does not give a valid preprocessing token
const int16_t *dct = &g_ ## type ## _ ## n ## [0][0];
^
strategies/avx2/dct-avx2.c:351:1: note: in expansion of macro 'ITRANSFORM'
ITRANSFORM(dct, 32);
^
Makefile:157: recipe for target 'strategies/avx2/dct-avx2.o' failed

would be nice if this could be fixed

kvazaar doesn't compile on mingw

Trying to compile the latest git checkout with https://github.com/jb-alvarado/media-autobuild_suite I get:

config.c: In function 'config_read':
config.c:506:13: error: passing argument 1 of 'getopt_long' makes pointer from integer without a cast [-Werror]
int c = getopt_long(argc, argv, short_options, long_options, &long_options_index);
^
In file included from config.c:30:0:
./extras/getopt.h:150:12: note: expected 'int ' but argument is of type 'int'
extern int getopt_long (int __argc, char *const *__argv, const char *shortopts,
^
config.c:506:13: error: passing argument 2 of 'getopt_long' from incompatible pointer type [-Werror]
int c = getopt_long(argc, argv, short_options, long_options, &long_options_index);
^
In file included from config.c:30:0:
./extras/getopt.h:150:12: note: expected 'char * const
' but argument is of type 'char *
'
extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
^
gcc -I/local32/include -I/mingw32/include -mms-bitfields -mthreads -mtune=generic -pipe -O2 -g -Werror -ftree-vectorize -m32 -D__USE_MINGW_ANSI_STDIO=1 -std=gnu99 -I. -I./strategies -I./extras -I.. -Wall -Wtype-limits -Wvla -c inter.c -o inter.o
gcc -I/local32/include -I/mingw32/include -mms-bitfields -mthreads -mtune=generic -pipe -O2 -g -Werror -ftree-vectorize -m32 -D__USE_MINGW_ANSI_STDIO=1 -std=gnu99 -I. -I./strategies -I./extras -I.. -Wall -Wtype-limits -Wvla -c intra.c -o intra.o
gcc -I/local32/include -I/mingw32/include -mms-bitfields -mthreads -mtune=generic -pipe -O2 -g -Werror -ftree-vectorize -m32 -D__USE_MINGW_ANSI_STDIO=1 -std=gnu99 -I. -I./strategies -I./extras -I.. -Wall -Wtype-limits -Wvla -c nal.c -o nal.o
gcc -I/local32/include -I/mingw32/include -mms-bitfields -mthreads -mtune=generic -pipe -O2 -g -Werror -ftree-vectorize -m32 -D__USE_MINGW_ANSI_STDIO=1 -std=gnu99 -I. -I./strategies -I./extras -I.. -Wall -Wtype-limits -Wvla -c imagelist.c -o imagelist.o
gcc -I/local32/include -I/mingw32/include -mms-bitfields -mthreads -mtune=generic -pipe -O2 -g -Werror -ftree-vectorize -m32 -D__USE_MINGW_ANSI_STDIO=1 -std=gnu99 -I. -I./strategies -I./extras -I.. -Wall -Wtype-limits -Wvla -c rdo.c -o rdo.o
cc1.exe: all warnings being treated as errors
Makefile:192: recipe for target 'config.o' failed

Compiling on Mac OS X 10.6.x - Snow Leopard fails

Calling make on Mac OS X 10.6.x gives me:

gcc  -I. -I/usr/local/include -L/usr/local/lib -c interface_main.c -o interface_main.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c encmain.c -o encmain.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c bitstream.c -o bitstream.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c cabac.c -o cabac.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c config.c -o config.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c context.c -o context.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c debug.c -o debug.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c encoder.c -o encoder.o
encoder.c: In function ‘reconstruct_chroma’:
encoder.c:1448: warning: comparison is always false due to limited range of data type
encoder.c:1448: warning: comparison is always false due to limited range of data type
encoder.c:1448: warning: comparison is always false due to limited range of data type
encoder.c: In function ‘encode_transform_tree’:
encoder.c:1672: warning: comparison is always false due to limited range of data type
encoder.c:1672: warning: comparison is always false due to limited range of data type
encoder.c:1672: warning: comparison is always false due to limited range of data type
gcc  -I. -I/usr/local/include -L/usr/local/lib -c filter.c -o filter.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c inter.c -o inter.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c intra.c -o intra.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c nal.c -o nal.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c picture.c -o picture.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c rdo.c -o rdo.o
gcc  -I. -I/usr/local/include -L/usr/local/lib -c sao.c -o sao.o
sao.c: In function ‘sao_search_chroma’:
sao.c:350: warning: passing argument 1 of ‘sao_search_best_mode’ from incompatible pointer type
sao.c:350: warning: passing argument 2 of ‘sao_search_best_mode’ from incompatible pointer type
sao.c: In function ‘sao_search_luma’:
sao.c:378: warning: passing argument 1 of ‘sao_search_best_mode’ from incompatible pointer type
sao.c:378: warning: passing argument 2 of ‘sao_search_best_mode’ from incompatible pointer type
gcc  -I. -I/usr/local/include -L/usr/local/lib -c search.c -o search.o
search.c: In function ‘search_tree’:
search.c:485: warning: comparison is always true due to limited range of data type
gcc  -I. -I/usr/local/include -L/usr/local/lib -c transform.c -o transform.o
transform.c: In function ‘dequant’:
transform.c:996: warning: comparison is always false due to limited range of data type
transform.c:996: warning: comparison is always false due to limited range of data type
transform.c:996: warning: comparison is always false due to limited range of data type
yasm  -DARCH_X86_64=0 -f macho32 -DPREFIX x86/cpu.asm -o cpu.o
gcc interface_main.o encmain.o bitstream.o cabac.o config.o context.o debug.o encoder.o filter.o inter.o intra.o nal.o picture.o rdo.o sao.o search.o transform.o cpu.o -lm -o kvazaar
ld: warning: ignoring file cpu.o, file was built for i386 which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
  "_kvz_cpu_cpuid", referenced from:
      _main in encmain.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [kvazaar] Error 1

ABI changes without soname change

kvz_api_get_apiv8() has been renamed to kvz_api_get_apiv() and

mpv: symbol lookup error: /usr/lib/i386-linux-gnu/i686/cmov/libavcodec.so.56: undefined symbol: kvz_api_get_apiv8
ffplay: symbol lookup error: /usr/lib/i386-linux-gnu/i686/cmov/libavcodec.so.56: undefined symbol: kvz_api_get_apiv8

Building on Mac OS X 10.6.8 -> cc1 error

trying to compile latest version I get:

encoder.c: In function encode_one_frame:
encoder.c:699: error: expected #pragma omp clause before collapse
cc1: warnings being treated as errors
encoder.c: In function reconstruct_chroma:
encoder.c:2053: warning: comparison is always false due to limited range of data type
encoder.c:2053: warning: comparison is always false due to limited range of data type
encoder.c:2053: warning: comparison is always false due to limited range of data type
encoder.c: In function encode_transform_tree:
encoder.c:2334: warning: comparison is always false due to limited range of data type
encoder.c:2334: warning: comparison is always false due to limited range of data type
encoder.c:2334: warning: comparison is always false due to limited range of data type
make: *** [encoder.o] Error 1

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.