Commit graph

205 commits

Author SHA1 Message Date
Ari Koivula fcb6fa6d4b Fix compilation error on PowerPC.
- Need abs from stdlib.
2014-10-21 18:14:32 +03:00
Ari Koivula 55ab08c213 Fix incorrect const qualifiers.
- Change input pointers to const in dct-generic, like they should have been.
- Fixes compilation error on GCC.
2014-10-13 16:57:15 +03:00
Ari Koivula 8a5b24bcbe Remove usages of GCC __attribute__.
- To allow clang to compile, as it doesn't according to #58.
- The target attributes are not needed anymore due to makefile handling
  targetting now.
- The __attribute__((unused)) used for debugging. I don't know if clang
  supports this attribute or not but it doesn't seem very important so
  I'm removing it just in case.
2014-10-13 16:46:26 +03:00
Ari Koivula d893a489d6 Fix mingw compilation issue.
strategies/avx2/dct-avx2.c:334:25: error: pasting "g_dct_16" and "[" does
not give a valid preprocessing token

- The [ is not part of the token so compilation failed on mingw GCC 4.9.1.
- Fixes #86.
2014-10-10 16:32:39 +03:00
Ari Lemmetti bcf12567d0 Added some comments. 2014-10-03 17:51:58 +03:00
Ari Lemmetti fea517c2ae Misc code cleanup 2014-10-03 17:06:09 +03:00
Ari Lemmetti 85682c3b6a Removed unused transpose functions. 2014-10-03 11:39:31 +03:00
Ari Koivula f6272f06fc Unify signature for transform functions.
- Some used block, coeff and some src, dst. Now all signatures are const input
  and non-const output.
2014-10-03 11:21:43 +03:00
Ari Koivula b932cf4b21 Clean up avx2 dct macros. 2014-10-03 11:16:25 +03:00
Ari Koivula 47244a15c3 Merge branch 'dct-optimizations'
Conflicts:
	src/strategies/avx2/dct-avx2.c
	src/strategies/generic/dct-generic.c
2014-10-02 13:45:21 +03:00
Ari Lemmetti 61e1510480 Transform functions in dct-avx2.c are now generated with macros. 2014-10-02 13:24:30 +03:00
Ari Lemmetti 9407610555 Moved DCT / DST matrices to dct-generic.c 2014-10-02 13:24:30 +03:00
Ari Lemmetti 7255112bd8 Added transposed DCT/DST tables. Use them while calculating transforms instead of doing runtime transpose. Added separate functions for DST and IDST. 2014-10-02 13:24:30 +03:00
Ari Lemmetti e7bcb58846 Added 32x32 IDCT 2014-10-02 13:24:30 +03:00
Ari Lemmetti eacf173b7e Added 32x32 DCT for AVX2 2014-10-02 13:24:30 +03:00
Ari Lemmetti d2856a5d40 Added 32x32 transpose 2014-10-02 13:24:30 +03:00
Ari Lemmetti 7a33f08312 Added 16x16 DCT and IDCT for AVX2 2014-10-02 13:24:30 +03:00
Ari Lemmetti d2fe2a5391 Added 16x16 transpose 2014-10-02 13:24:30 +03:00
Ari Lemmetti d6af146a2e Added part of the functions 16x16 DCT needs 2014-10-02 13:24:30 +03:00
Ari Lemmetti aba3acdfff Added AVX2 optimized transforms for 4x4 and 8x8 blocks 2014-10-02 13:24:30 +03:00
Ari Lemmetti 5856f32d81 Fixed incorrect shift values for inverse transforms in generic strategy 2014-10-02 13:24:29 +03:00
Ari Lemmetti 41b032664d First version of 4x4 forward DCT 2014-10-02 13:24:29 +03:00
Laurent Fasnacht f1b303a2d2 Fix compilation errors 2014-08-11 09:53:06 +02:00
Ari Lemmetti 47e3bcfb50 Fixed incorrect shift values for inverse transforms in generic strategy 2014-08-07 16:01:30 +03:00
Ari Lemmetti 709520a233 Removed all AVX2 instructions from SATD functions.
-Zero extend macro now returns results in 2 xmm registers instead of one ymm
2014-07-31 13:25:28 +03:00
Ari Lemmetti 0beb278f5b Partial butterfly strategy is now called DCT strategy. Made changes to transform functions in preparation for optimizations.
-Moved fast_forward_dst and fast_inverse_dst to DCT strategies
2014-07-31 13:25:28 +03:00
Ari Lemmetti 6bf63bd171 Added AVX2 strategy for partial butterfly (no optimizations yet) 2014-07-31 13:25:28 +03:00
Ari Lemmetti faccc4f09b Partial butterfly functions now utilize the strategy selector 2014-07-31 13:25:28 +03:00
Ari Koivula 669e99dd7f Improve intra SAD AVX2 intrinsics.
- Moved implementations for different sizes to inline functions that are
  defined using each other, reducing the amount of redundant code.

- Performance of sad_8bit_32x32_avx2 improved by about 10% due to unrolling of
  the loop.
2014-07-25 15:59:55 +03:00
Ari Koivula e00102f0ca Compile asm optimizations only if yasm is present. 2014-07-23 14:57:40 +03:00
Ari Lemmetti 85fb0784e4 Fixed intendentation and added some empty lines for readability 2014-07-23 12:32:27 +03:00
Ari Lemmetti 4f88ebce5a Added comments and made visual studio not to compile x86inc.asm 2014-07-22 15:07:57 +03:00
Ari Koivula cfd3636e08 Move some repetitive SATD asm into a macro.
Conflicts:
	src/strategies/x86_avx/picture_x86.asm
2014-07-22 12:46:39 +03:00
Ari Lemmetti c81639dd09 Removed old unused macro 2014-07-22 11:11:20 +03:00
Ari Lemmetti cf0797cafd Reordered and intended assembly code 2014-07-22 11:07:42 +03:00
Ari Lemmetti fea44c8234 Renaming AVX/asm files
-Splitted SAD and SATD functions in separate files
2014-07-21 18:02:01 +03:00
Ari Lemmetti a64df6f0d0 Merge branch 'asm'
Conflicts:
	build/kvazaar_lib/kvazaar_lib.vcxproj.filters
	src/Makefile
	src/strategies/strategies-picture.c
2014-07-21 16:41:09 +03:00
Ari Lemmetti 1be2c3aae5 Preparing push to master and misc
-Removed unnecessary <math.h> headers
-Updated AVX/asm optimizations to match the new file hierarchy
-Makefile only compiles .asm files if KVAZAAR_DISABLE_YASM is not set to 1 and TARGET_CPU_ARCH is x86
2014-07-21 12:39:56 +03:00
Ari Koivula a8f7103797 Add AVX2 implementations for sad_8bit_ 8x8, 16x16 and 32x32. 2014-07-18 18:27:30 +03:00
Ari Koivula 3daa5dd1f1 Add sse2 implementaton for sad_8bit_4x4. 2014-07-18 18:20:34 +03:00
Ari Koivula f49332c9b8 Add missing includes. 2014-07-18 17:56:15 +03:00
Ari Lemmetti 1e94262f85 Made AVX asm compatible with the changed system
- x86inc.asm is now located in extras
- Removed unused cpu.asm/h
2014-07-14 18:51:17 +03:00
Ari Lemmetti 683eda1183 Merge branch 'master' into asm
Conflicts:
	build/kvazaar_lib/kvazaar_lib.vcxproj
	build/kvazaar_lib/kvazaar_lib.vcxproj.filters
	src/Makefile
	src/strategies/strategies-picture.c
2014-07-14 16:42:33 +03:00
Ari Lemmetti 2169f9ab8c Added AVX asm comments and fixes
-Added vzeroupper to satd macro to prevent AVX-SSE transition penalties int picture_x86.asm
-Fixed the order of registers in zero extend macro in picture_x86.asm
-Fixed SATD checkers test pattern in satd_tests.c
2014-07-14 14:43:36 +03:00
Ari Koivula 5d0df56c94 Move optimizations to their own compilation units according to target.
- This is necessary in order to compile AVX intrinsics correctly in
  Visual Studio. Having everything in their own units should also make
  compiling normal C code with optimizations on easier.

- For now the makefile still relies on GCC __target__ attribute for compiling
  intrinsics.
2014-07-11 17:26:19 +03:00
Ari Lemmetti 048127c7e3 AVX assembly optimizations improved 2014-07-02 16:57:06 +03:00
Ari Lemmetti bdef5384ef Added AVX strategy 2014-06-17 16:52:24 +03:00
Ari Koivula 1c97a10a6d Move intra SAD and SATD functions under strategies. 2014-06-16 12:13:41 +03:00
Ari Koivula 1de102be61 Move strategies to their own compilation units.
- Enforces a little bit more hierarchy. Compilation units are in strategies
  and whatever inline includes they have are in a folder with the same name
  as the strategy.
2014-06-13 15:30:23 +03:00
Laurent Fasnacht 27a49d287d Big refactor to use videoframe, image_list, and image instead of picture* 2014-06-10 09:19:06 +02:00
Laurent Fasnacht ea04bcd6a4 AltiVec support for SAD 2014-06-05 06:57:34 +02:00
Laurent Fasnacht 5ed69b063b Strategy selector for array_checksum, basic implementation using precomputed 256*256 block with larger accesses than byte 2014-06-03 07:42:22 +02:00
Ari Koivula 42295d3cb9 Pass preprocessor defines for supported intrinsics in VS2010 explicitly.
- _M_IX86_FP defines whether VS should generate code using SSE or SSE2
  instructions. It isn't correct to use it to check whether optional runtime
  optimizations should be compiled in. It's also not defined at all in 64-bit
  mode.

- So let's just keep it simple and give a list of everything that is supported
  as release optimizations. It's not clear from the documentation if all of
  these are really supported. It just list a bunch of intrinsics from these
  that are.
2014-04-30 17:41:15 +03:00
Ari Koivula bd7e021742 Modify strategyselector to work with VS2010.
- VS doesn't have snprintf.

- VS doesn't support GCC attributes.

- Add defines for __SSE__ and __SSE2__ on VS.
2014-04-29 15:29:06 +03:00
Laurent Fasnacht bf7e755cf7 Strategies and runtime detection/choice of best algorithm 2014-04-29 11:51:41 +02:00