Commit graph

2024 commits

Author SHA1 Message Date
Ari Lemmetti 47082738aa ...and the same tricks for quantized reconstruction 2015-10-23 19:44:38 +03:00
Ari Lemmetti 7961ba80d8 Add functions for bigger block sizes to calculate more residual simultaneously and reduce memory accesses 2015-10-23 19:11:56 +03:00
Ari Lemmetti 15edd5060d Load and store multiple elements simultaneously. Use 128-bit wide zero
test. *wip*
2015-10-23 17:03:16 +03:00
Ari Lemmetti b37cca87c8 Copy generic to avx2 2015-10-23 17:03:15 +03:00
Ari Lemmetti cad2ea9d6e Move quantize_residual to quant strategies. 2015-10-23 17:03:15 +03:00
Ari Lemmetti c013e58f0c Merge branch 'avx2-faster-angular' 2015-10-23 16:54:35 +03:00
Ari Lemmetti 0c63041ba7 Add filtering functions for different block sizes. Simplify logic a bit to reduce branching. Sorry for the large commit! 2015-10-23 16:54:15 +03:00
Arttu Ylä-Outinen f7b6365db8 Merge pull request #109 from lu-zero/master
version: Bump
2015-10-23 12:26:01 +03:00
Luca Barbato 7ecd9c7284 version: Bump
d5f3778f72 provided a new interface
2015-10-23 10:02:28 +02:00
Arttu Ylä-Outinen 1cf55f066f Fix memory leak in encoder_headers.
The header data was not freed when data_out was NULL.
2015-10-23 09:55:08 +03:00
Arttu Ylä-Outinen a1272e98f8 Prevent disabling VPS from command line.
Disabling VPS when using the command line encoder would result in an
invalid bitstream.
2015-10-19 11:25:29 +03:00
Arttu Ylä-Outinen 024fedff57 Disable writing VPS when vps_period is negative.
Turns vps_period in struct encoder_control_t into a signed value.
Negative values are interpreted as "never send parameter sets."
2015-10-19 11:25:18 +03:00
Arttu Ylä-Outinen d5f3778f72 Add function encoder_headers to API.
This provides means for obtaining the VPS, SPS and PPS separately from
the rest of the bitstream.
2015-10-16 11:47:27 +03:00
Arttu Ylä-Outinen 037b72c72b Add parameter stream to VPS, SPS and PPS encoding. 2015-10-14 14:40:45 +03:00
Arttu Ylä-Outinen db17d33b0b Simplify code in encoder_state-bitstream. 2015-10-14 12:37:26 +03:00
Luca Barbato 15fd8241a9 build: Replace a sed expression with a simpler awk
The former does not work for sure on macosx.
2015-10-10 12:42:24 +02:00
Luca Barbato a44d24ce40 build: Drop a trailing space 2015-10-10 12:42:10 +02:00
Ari Lemmetti 5af7a42ebe Enable AVX2 strategy. Add first version of optimizations. 2015-10-08 12:36:20 +03:00
Ari Lemmetti f4fe3dca5e Add AVX2 strategy. Copy generic implementation there. 2015-10-08 12:36:15 +03:00
Ari Lemmetti 54e8b346a3 Add intra strategy. Move angular prediction there. 2015-10-08 12:36:05 +03:00
Ari Lemmetti c123b97fec Remove option -fno-lto from strategies. LTO is no longer used anyway. 2015-10-05 19:34:56 +03:00
Ari Koivula ff976e2afc Arrange parameters in intra fancily 2015-10-05 06:23:14 +03:00
Ari Koivula d83d57df1a Fix function names in intra
Prefix non-static functions with kvz_intra_ and static with intra_.
2015-10-05 06:23:14 +03:00
Ari Koivula 30b4fa4247 Rename intra prediction to kvz_intra_predict 2015-10-05 06:23:14 +03:00
Ari Koivula 7280dbf429 Remove unnecessary function
This function used to be more complicated, but now it's so simple that
it's just obfuscating what's happening.
2015-10-05 06:23:05 +03:00
Ari Koivula 1221e4c7d2 Remove old intra prediction code. 2015-10-05 05:30:47 +03:00
Ari Koivula 23439557e6 Remove remaining usages of old intra prediction 2015-10-05 05:23:22 +03:00
Ari Koivula ca3ba997aa Switch to new intra pred in search_intra_chroma_rough. 2015-10-05 05:03:58 +03:00
Ari Koivula eaff6e29d9 Switch to new intra pred in kvz_search_cu_intra 2015-10-05 04:00:42 +03:00
Ari Koivula 55d741e250 Switch to new intra pred in kvz_intra_recon_lcu_chroma 2015-10-05 04:00:42 +03:00
Ari Koivula 678a1dd1dd Switch to new intra pred in kvz_intra_recon_lcu_luma 2015-10-05 02:29:02 +03:00
Ari Koivula cd2f1797bf Add reimplemented intra prediction code
Just along side for now to help with debugging.

The main difference with the new versions is that they take and output
width**2 blocks and two width*2+1 arrays of reference samples,
instead of the (2*width+8)**2 blocks the old ones do. This should make
the interface clearer and the memory footprint smaller.

Also commented the shit out of angular prediction, so hopefully Ari L.
will have an easier time with a SIMD implementation.
2015-10-05 02:29:02 +03:00
Ari Koivula 115756b9d7 Accept --rd=3 parameter 2015-10-05 02:28:56 +03:00
Ari Lemmetti 7a3dabf43e Merge branch 'avx2-quant' 2015-10-02 16:31:33 +03:00
Ari Lemmetti 38106afa50 Add AVX2 version of quantization. 2015-10-02 16:18:52 +03:00
Ari Lemmetti ef0ad292ef Add quantization strategy. 2015-10-02 16:17:02 +03:00
Ari Koivula 41dd44f7cf Fix warnings with -DNDEBUG 2015-10-02 15:13:07 +03:00
Ari Koivula 81f5ca76cb Accept tile configurations with either dimension as one 2015-10-02 15:06:31 +03:00
Ari Lemmetti 989cee1b04 Add 4x4 function as well 2015-10-01 22:14:56 +03:00
Ari Lemmetti 8b57b2bb1a Refactor SATD to inline most of the function. Replace full horizontal add with shuffle and regular packed add. 2015-10-01 21:29:25 +03:00
Ari Lemmetti 55da2a9958 Add intrinsic version of SATD for 8x8 and larger blocks 2015-10-01 19:42:22 +03:00
Ari Lemmetti d68fc4c41e Add header for common utilities to use with strategies. 2015-10-01 19:40:35 +03:00
Arttu Ylä-Outinen 512e5bb25f Bump version to 0.7.0 2015-09-30 15:20:57 +03:00
Arttu Ylä-Outinen 8f404a3b6f Add NAL unit type to frame_info. 2015-09-28 10:30:59 +03:00
Arttu Ylä-Outinen 1c898a2f4a Prefix NAL unit type enum constants with KVZ_. 2015-09-28 10:30:58 +03:00
Arttu Ylä-Outinen 4e5c7fe6e8 Remove function kvz_encoder_compute_stats.
Changes main function to compute frame PSNR by calling
kvz_videoframe_compute_psnr directly with the source and reconstructed
pictures returned from encoder_encode.
2015-09-28 10:30:58 +03:00
Arttu Ylä-Outinen efd361ee8e Return the original picture from encoder_encode. 2015-09-28 10:30:58 +03:00
Arttu Ylä-Outinen afd0d3eee0 Remove encoderstate dependency from cli module.
Changes function print_frame_info to use a kvz_frame_info struct to get
the data to be printed.
2015-09-28 10:30:58 +03:00
Arttu Ylä-Outinen 7edc1b0b1c Add reference picture lists to kvz_frame_info. 2015-09-28 10:30:57 +03:00
Arttu Ylä-Outinen d5dceb45f1 Factor out a function for building ref lists.
The code for building the reference picture lists was duplicated in
functions encoder_state_ref_sort and print_frame_info. This commit moves
it to a new function kvz_encoder_get_ref_lists. Also makes
encoder_ref_insertion_sort static since it is not used outside the
encoderstate module any more.
2015-09-28 10:30:57 +03:00
Arttu Ylä-Outinen c856a6b598 Output frame info from encoder_encode.
Adds a new output parameter info_out to encoder_encode. It returns
a struct containing information about the encoded frame, including POC,
QP and slice type.
2015-09-28 10:30:57 +03:00
Arttu Ylä-Outinen 173b70b53f Rename SLICE_* enum constants to KVZ_SLICE_*. 2015-09-28 10:30:56 +03:00
Ari Koivula 63ab4068be Clean up the makefile a bit
Use the existing TARGET_CPU_ARCH and TARGET_CPU_BITS instead of filtering
ARCH over and over again.

Comment some of the more obscure parts.
2015-09-18 15:13:13 +03:00
Ari Koivula eb12fe0d98 Re-enable disabled -m32 and -m64 flags. 2015-09-18 12:13:31 +03:00
Ari Koivula 9537b996e7 Make makefile work on arm
Only compile x86 specific optimizations for x86 and don't give
-m32 or -m64 on arm.
2015-09-18 00:23:49 +03:00
Ari Koivula d76890bbff Bump version to 0.6.1 2015-09-16 18:42:20 +03:00
Ari Koivula 1d5cfbdcc2 Remove unused variable. 2015-09-16 18:39:46 +03:00
Ari Koivula 513e80bcca Fix bug causing unnecessary copying of memory
This bug caused a single tiles worth of lcu_info_t structs to be copied
unnecessarily for every LCU in the frame. This obviously caused huge
memory bandwidth issues when coding large frames without tiles. The
effect was minimized somewhat with a large number of tiles, because
only the current tile was copied.

From context it is clear that this piece of code was supposed to copy
a single tile or frame, once the frame was done, but because it was
placed in a function which is called for every LCU, it copied the data
for the LCU, but also lots of extra stuff.

The fix is to copy only the current LCU instead of the whole tile.
2015-09-16 18:23:44 +03:00
Marko Viitanen d8b50d6951 Bump version to 0.6.0 2015-09-15 15:44:55 +03:00
Marko Viitanen 5b3f2a6229 Merge branch 'pkgconfig-fix' 2015-09-15 15:37:49 +03:00
Ari Koivula f1ac0e6bc2 Rename _DEBUG to KVZ_DEBUG 2015-09-15 13:04:03 +03:00
Ari Koivula ec2d8d6ad7 Rename _DEBUG_PERF macros to KVZ_PERF
And move them to threadqueue.h, where the things that use them are.
2015-09-15 13:03:32 +03:00
Arttu Ylä-Outinen 4db06bcf07 Use correct version in kvazaar.pc.
Changes kvazaar.pc to use kvazaar version instead of the library
version. The version number is extracted from global.h using sed.
2015-09-15 12:57:34 +03:00
Marko Viitanen 3217e70f99 Revert "Revert "Fix keeping of reference frames over IDR boundary.""
This reverts commit 87936eb99f.

Conflicts:
	src/encoderstate.c
2015-09-14 14:31:58 +03:00
Arttu Ylä-Outinen b4ec664fc9 Set DTS values of output pictures.
Adds field dts to struct kvz_picture and rewrites kvz_encoder_feed_frame
to set the DTS when returning pictures.
2015-09-14 14:16:56 +03:00
Arttu Ylä-Outinen 25c23aa298 Remove static variables from kvz_encoder_feed_frame.
Adds struct input_frame_buffer_t for storing the input buffer state.
2015-09-14 14:12:19 +03:00
Arttu Ylä-Outinen 1d2a398197 Move function kvz_encoder_feed_frame to a separate module.
Adds module input_frame_buffer.
2015-09-14 14:12:18 +03:00
Arttu Ylä-Outinen 009717bf7c Remove unused field bitstream_length from kvz_encoder. 2015-09-14 14:12:18 +03:00
Arttu Ylä-Outinen 97913cee40 Add pts field to kvz_picture.
The pts field can be used to set the presentation timestamp of the input
frames. The timestamps are copied to the reconstructed frames.
2015-09-14 14:12:00 +03:00
Ari Koivula 24618c90ce Fix wrong type in debug code.
- This type is expected by outside debug scripts. It does not have to
  match the function name.
2015-09-10 16:07:18 +03:00
Ari Koivula 0ac2bc31a3 Put parenthesis around _DEBUG.
- To protect against precedence issues.
2015-09-10 16:06:19 +03:00
Ari Koivula 3958e8b6f7 Handle VS warnings with _DEBUG.
- Conditional expression is constant was being triggered by debug code.
2015-09-10 14:16:42 +03:00
Ari Koivula cb1a206c74 Dump threading data structures only with _DEBUG_PRINT_THREADING_INFO.
- They are usually not needed when using _DEBUG.
2015-09-10 14:16:42 +03:00
Arttu Ylä-Outinen 70b3e10e27 Fix a crash with owf=4, gop=8, frames=10.
A call to kvz_threadqueue_waitfor caused the tqj_bitstream_written field
of the previous encoder state to become a dangling pointer, subsequently
causing an assertion to fail. This would only occur when the encoder
state used for a new frame was not the last finished one.

Fixed by setting tqj_bitstream_written to NULL after the job is done and
removing unnecessary calls to kvz_threadqueue_waitfor.
2015-09-07 15:37:04 +03:00
Arttu Ylä-Outinen 3c35f470a1 Fix get_ctx_cu_split_model. 2015-09-02 11:47:03 +03:00
Ari Koivula 9a23ae3d92 Resolve remaining Visual Studio warnings.
- Ignore most of them and fix the ones that can't be ignored.
2015-08-31 15:02:25 +03:00
Luca Barbato efe5291427 build: Drop the gnu-only option Deterministic
Unbreak building on MacOSX and possibly other BSDs.
2015-08-29 10:38:10 +02:00
Ari Koivula c52f7858ab Use long start code in picture_timing_sei if it's first NAL in AU. 2015-08-27 15:23:34 +03:00
Ari Koivula 69d1059602 Fix access unit delimiter.
- The nal header was written after the pic_type.
2015-08-27 15:18:25 +03:00
Ari Koivula 9584cd7352 Move rbsp_trailing_bits elements to encapsulating functions.
- Also add missing bitstream align. It's unnecessary as the version can't not
  be byte aligned.
2015-08-27 15:18:18 +03:00
Ari Koivula 207367f317 Add new kvz_bitstream_align which only aligns when needed.
- Changing picture_timing_sei_message to align doesn't change anything, but
  protects against future changes if more data is added there in future.
2015-08-27 15:16:20 +03:00
Ari Koivula b2fb1b6d4a Rename kvz_bitstream_align to kvz_bitstream_rbsp_trailing_bits.
- The syntax is called rbsp_trailing_bits in spec and 1 byte is added
  even when the bitstream is already aligned, so align is a bad name.
2015-08-27 14:33:30 +03:00
Arttu Ylä-Outinen 3a10e9e3e0 Prefix all non-static symbols with "kvz_". 2015-08-26 13:02:28 +03:00
Arttu Ylä-Outinen bfe2b31cee Make generic satd functions static. 2015-08-26 12:10:27 +03:00
Arttu Ylä-Outinen d0bc58a874 Document the library API in more detail. 2015-08-26 12:10:27 +03:00
Arttu Ylä-Outinen 04ba5dca41 Make config_destroy accept a NULL pointer. 2015-08-26 12:10:26 +03:00
darealshinji 87a4e53c35 Makefile: add $(CPPFLAGS), use -Wl,-z,noexecstack and install development files on Linux 2015-08-22 16:00:26 +02:00
Ari Lemmetti 3661f3f3f5 Fix incorrect free on error 2015-08-21 18:26:12 +03:00
Ari Lemmetti 4103bd2786 Add missing padding for frame allocation 2015-08-21 17:25:54 +03:00
Ari Lemmetti d6c3363dc8 Merge branch 'interlacing_experimental' 2015-08-21 15:50:24 +03:00
Ari Lemmetti ed7948810e Fix help message and update README.md 2015-08-21 15:29:48 +03:00
Ari Lemmetti 68fcc67a16 Add extraction of fields according to source scan type 2015-08-21 15:15:20 +03:00
Ari Lemmetti 581ff95412 Write flags and SEI messages for interlacing. 2015-08-21 14:46:05 +03:00
Arttu Ylä-Outinen 38893d2da1 Use the static lib to link the program.
Changes the Makefile to use the static library and additional object
files as linker input instead of all the object files when linking the
command line program.
2015-08-20 16:42:29 +03:00
Arttu Ylä-Outinen cb49586d36 Add static library target to Makefile.
Adds targets libkvazaar.a and install-static to the Makefile.
2015-08-20 16:42:29 +03:00
Arttu Ylä-Outinen 23159e45b7 Rename LIB_OBJS to SHARED_OBJS in Makefile.
SHARED_OBJS is a more appropriate name since the objects are only used
for building shared libraries, not static ones.
2015-08-20 16:42:28 +03:00
Arttu Ylä-Outinen 8488ba1bb7 Remove unnecessary objects from libraries.
Removes the cli and yuv_io modules from libraries.
2015-08-20 16:42:28 +03:00
Arttu Ylä-Outinen dd874a0a4a Move writing of reconstructed picture to encmain.
- Removes parameter recout of function encoder_compute_stats.
- Now only encmain uses the yuv_io module.
2015-08-20 16:42:28 +03:00
Ari Lemmetti 923f4a74d5 Fix filtering over limits 2015-08-17 17:39:56 +03:00
Ari Lemmetti febe66f148 Fix typo 2015-08-17 16:16:11 +03:00
Ari Lemmetti 82cf4e8ff4 Output error messages to stderr 2015-08-17 15:01:46 +03:00
Ari Lemmetti 3da71b62bf Add checks if malloc fails 2015-08-17 15:01:46 +03:00
Ari Lemmetti 4718fe7fda Change variable names to match used convention 2015-08-17 15:01:46 +03:00
Ari Lemmetti 6a5eaf08de Rename extend_borders to get_extended_block. Add kvz_ prefix to type definition. 2015-08-17 15:01:46 +03:00
Ari Lemmetti d82582c37c Changes to extend border function.
Now outputs a pointer to a block with guaranteed padding for filtering.
Only generate extra pixels if samples are needed out of bounds.
Use memcpy otherwise.
2015-08-17 15:01:46 +03:00
Ari Lemmetti fc038cb8bf Add --source-scan-type parameter
Options progressive (default)
        tff for top field first
        bff for bottom field first
2015-08-13 12:53:14 +03:00
Ari Lemmetti 4dcc0d876d Fix rate control when --owf=auto (default)
Value in cfg stays -1 if auto selection is used.
Use value in encoder instead.
2015-08-12 18:20:57 +03:00
Ari Lemmetti 5d96dbc6c0 Make strategy selection use bit depth given via parameter instead of excluding registration with defines 2015-08-12 13:33:38 +03:00
Ari Lemmetti 4122f36089 Prevent the registration of strategies that are incompatible when KVZ_BIT_DEPTH != 8
Remove unnecessary or misleading mentions of "8bit"
2015-08-12 11:29:53 +03:00
Ari Lemmetti 33b6481660 Remove unused variables. 2015-08-11 15:53:40 +03:00
Ari Lemmetti 348d7780fc Remove third shift and offset from 14-bit sampling functions (change missing from rebase) 2015-08-11 15:06:16 +03:00
Marko Viitanen 8409317bd9 Fixed rebasing errors for 10bit branch 2015-08-11 14:56:45 +03:00
Marko Viitanen 58f12bd530 Changed frame 8bit to 10bit conversion to be done without memory allocation 2015-08-11 08:18:14 +03:00
Marko Viitanen 6453a511d7 Scale SAD/SATD costs to match bit depth
Conflicts:
	src/image.c
2015-08-11 08:18:14 +03:00
Marko Viitanen 0304b6c412 Fixed luma interpolation filter when 10bit coding and some other minor fixes 2015-08-11 08:17:48 +03:00
Marko Viitanen 450b5e64ca Fixed overflow on generic ipol filters when 10bit encoding
Conflicts:
	src/strategies/generic/ipol-generic.c
2015-08-11 08:17:48 +03:00
Marko Viitanen 191d3e4d87 Fixed RDOQ on 10bit encoding 2015-08-11 08:14:35 +03:00
Marko Viitanen 414ebe6101 Fixed checksum on bitdepth > 8 cases
Conflicts:
	src/nal.c
	src/nal.h
	src/strategies/generic/nal-generic.c
	src/strategies/strategies-nal.c
	src/strategies/strategies-nal.h
2015-08-11 08:14:35 +03:00
Marko Viitanen 57ab46f110 Small fixes all around to enable 10bit encoding
Conflicts:
	src/encmain.c
	src/encoder.c
	src/encoderstate.c
	src/global.h
2015-08-11 07:59:20 +03:00
Ari Lemmetti 7cd4f7a5c9 Enable fractional motion vectors with bipred 2015-08-10 18:49:12 +03:00
Ari Lemmetti 5887c96991 Add and use 14bit reconstruction for fractional motion vectors with bipred 2015-08-10 18:45:29 +03:00
Ari Lemmetti a87dafb27a Add hi_prec_buf_t for higher precision intermediate values for interpolation filter. 2015-08-10 18:35:06 +03:00
Ari Lemmetti 3e31ff2476 Use the function to sample half-pixels. 2015-08-10 18:30:41 +03:00
Ari Lemmetti 0a096c7040 Move qpel and octpel reconstruction in separate functions. 2015-08-10 18:25:52 +03:00
Ari Lemmetti fc00b4795c Preparations for more accurate reconstruction with bipred 2015-08-10 18:08:13 +03:00
Ari Lemmetti 8b4a6c92da Add 14bit precision sample functions. 2015-08-10 18:02:06 +03:00
Ari Lemmetti b30f17d4b8 Add fractional pixel sampling for chroma 2015-08-10 17:55:37 +03:00
Ari Lemmetti 650dd7d840 Use pixels_blit to copy neccessary pixels. 2015-08-10 17:52:00 +03:00
Ari Lemmetti 01f40ec104 Add fractional pixel sampling for luma 2015-08-10 17:51:48 +03:00
Ari Koivula 0c3c93d456 Optimize intra SAD intrinsics.
- Added 64x64 version for completeness.
- With the exception of 16x16, these were all slightly slower than the ASM
  versions, as measured by "kvazaar_test -s speed -t intra_sad", but now they
  are on par or slightly faster.
- None of these actually use any AVX2 intrinsics, and probably never will,
  unless someone adds an interface for doing more than one block at a time,
  in which case the non-destructive versions might come in handy.
2015-08-06 19:35:00 +03:00
Ari Lemmetti 20b833bc8e Fix mingw errors 2015-07-31 18:44:36 +03:00
Ari Lemmetti 12c391eb08 Add auto-detection for input resolution.
Use --input-res=auto as default.
2015-07-31 17:35:16 +03:00
Ari Koivula 0740a73fbb Clean up Makefile.
- Move stuff around.
- LDFLAGS -shared and -dynamiclib imply -fpic.
2015-07-31 15:57:05 +03:00
Ari Koivula beec2705b1 Add cli, lib-shared and lib-static to Makefile. 2015-07-31 15:57:05 +03:00
Ari Koivula 24b3306325 Fix incorrect pattern rules in Makefile.
- Having more than one rule in a pattern rule means that both of those files
  are created at the same time with the rule. This only worked for debug,
  because debug build was never done in the same invocation as release build.
2015-07-31 14:36:45 +03:00
Ari Koivula 1c27f67963 Remove -flto.
- Always use the compiler to invoke the linker. Clang will give additional
  parameters to the linker when compiled with -flto.
- Giving a different optimization level to linker did not make any difference
  in gcc-5.1.1.
2015-07-31 14:36:26 +03:00
Ari Koivula 54b1be341e Don't compile executable with PIC.
- It's required for .so and .dylib, but not for .dll or the executable.
- It might be better to use libtool for this, but I'm not ready to go that
  far yet.
2015-07-29 17:12:09 +03:00
Ari Koivula f8154f8382 Merge branch 'make-dylib' 2015-07-29 11:28:43 +03:00
Ari Koivula 60437fd0c3 Add -lrt back the exe link command. 2015-07-29 11:28:11 +03:00
Luca Barbato 5c7a808bbd build: Generate a pkg-conf file 2015-07-29 02:27:12 +02:00
Ari Koivula 04e1a21ded Merge branch 'make-dylib'
Closes #94.
2015-07-28 11:42:46 +03:00
Ari Koivula 2211b90a24 Move comments for defines to a different line.
- Having comment as part of the define confuses doxygen. They get added
  to every function that uses the macro.
2015-07-21 17:10:08 +03:00
Ari Koivula 022d28ab11 Fix small hexbs pattern.
- Who could mess this up? Oh.. right.
2015-07-21 16:12:44 +03:00
Ari Koivula 22e56f86c7 Move inter search patterns inside the search functions. 2015-07-21 16:06:31 +03:00
Ari Koivula b73b275e08 Remove unused includes from search. 2015-07-21 15:06:06 +03:00
Ari Koivula ae56118010 Move functions from search to search_intra. 2015-07-21 14:59:19 +03:00
Ari Koivula bf7542c35d Move functions from search to search_inter. 2015-07-21 12:16:05 +03:00
Ari Koivula 3c9b830d8f Add modules search_intra and search_inter.
- For breaking up search module.
2015-07-21 12:04:16 +03:00
Arttu Ylä-Outinen 06ea593477 Change dylib file name to libkvazaar.X.dylib.
Changes the version number in the dylib filename from a three-digit
version (libkvazaar.X.Y.Z.dylib) to a single-digit one
(libkvazaar.X.dylib).
2015-07-20 15:09:46 +03:00
Arttu Ylä-Outinen df749e032e Add necessary linker options when building dylib.
Sets linker options -compatibility_version and -install_name when making
dylib.
2015-07-20 15:09:09 +03:00
Luca Barbato 9c414995c5 build: Add a MacOSX install target for the library 2015-07-17 19:44:20 +02:00
Arttu Ylä-Outinen 59f95b8e73 Add nasm support.
Makes is possible to build kvazaar using nasm instead of yasm.
- Adds trailing slashes to -I params in ASFLAGS.
- Disables CPU NOP directives when assembler is not yasm.
2015-07-17 13:59:25 +03:00
Arttu Ylä-Outinen e307b7cec4 Check that input dimensions are multiples of two.
Fixes wrongly accepting non-multiple of two resolutions and a segfault
when one of the input dimensions is one.
2015-07-17 10:07:24 +03:00
Arttu Ylä-Outinen d2c42cb303 Fix making tests.
Commit 9cfbd55e removed "./" prefix of the TESTS variable in the
Makefile but the recipe of target tests was expecting it. Fixed by
prepending "./" to the tests recipe.
2015-07-17 10:07:24 +03:00
Luca Barbato 56ff1c7805 build: Drop the non-standard -t
Should unbreak freebsd.
2015-07-16 16:50:09 +02:00
Arttu Ylä-Outinen 94e8fc1536 Build dylib on Darwin.
Adds target libkvazaar.dylib to Makefile. On Darwin, libkvazaar.dylib is
set as a prerequisite of the all target.
2015-07-16 14:15:09 +03:00
Arttu Ylä-Outinen a4ec92081a Make symbols hidden by default.
Adds "-fvisibility=hidden" to CFLAGS and LDFLAGS. Defines macro
KVZ_PUBLIC for marking symbols that should be visible.
2015-07-13 14:20:21 +03:00
Arttu Ylä-Outinen 9cfbd55ea8 Add making symlinks to make install.
Running "make install" now creates symlinks libkvazaar.so and
libkvazaar.so.X pointing to libkvazaar.so.X.Y.Z.
2015-07-13 11:45:42 +03:00
Ari Koivula c94d91061c Merge branch 'cpuid-fix' 2015-07-09 11:40:46 +03:00
Arttu Ylä-Outinen 8550c6ccd8 Fix AVX2 detection.
Replaces calls to __get_cpuid by __cpuid_count on gcc and clang and
calls to __cpuid by __cpuidex on MSVC. Unlike __get_cpuid and __cpuid,
__cpuid_count and __cpuidex set the ecx register which is required for
AVX2 detection.
2015-07-09 11:20:37 +03:00
Ari Koivula 9acf7795a2 Refactor cpuid capability detection.
- Moved cpuid data to a struct to make it easier to group data from one
  cpuid call together.
- Renamed the bit masks to make it harder to mask the wrong register or
  cpuid.
- Remove the .byte trick. We don't really need to support such ancient
  compilers?
2015-07-09 11:20:37 +03:00
Arttu Ylä-Outinen e69088026e Write slice header before joining child streams.
The lengths of the leaf streams must be available when the slice header
is written. Writing the header before joining child streams removes the
need to copy leaf bitstreams instead of moving them.
2015-07-08 13:14:17 +03:00
Arttu Ylä-Outinen 907451590e Fix encoding when both GOP and OWF are enabled.
Changes kvazaar_encode to not increase cur_state_num unless a frame is
started.
2015-07-07 10:05:42 +03:00
Arttu Ylä-Outinen 3efdee2c13 Fix compilation warnings when using clang.
Removes typedef redefinitions in kvazaar_internal.h.
2015-07-06 13:46:56 +03:00
Arttu Ylä-Outinen cc580ac861 Only print PSNR if some frames were encoded. 2015-07-06 13:39:47 +03:00
Arttu Ylä-Outinen 089ff895ad Fix seeking when input stream is not seekable. 2015-07-06 12:07:05 +03:00
Arttu Ylä-Outinen aca5d7514f Fix pocs reallocation in imagelist.
Replaced sizeof(int32_t*) by sizeof(int32_t).
2015-07-06 11:58:05 +03:00
Arttu Ylä-Outinen ca8435f581 Remove setting CC in Makefile. 2015-07-06 11:27:28 +03:00
Arttu Ylä-Outinen 3a47aab696 Fix allocating tile boundary arrays.
Column and row numbers had been mixed up.
2015-07-06 10:48:19 +03:00
Arttu Ylä-Outinen a0865ff351 Change ime_algorithm in kvz_config to an enum.
Adds enum kvz_ime_algorithm to kvzaar.h.
2015-07-06 09:47:18 +03:00
Arttu Ylä-Outinen 66656fdebc Move handling of command line args to cli module.
- Adds struct cmdline_opts_t.
- Adds functions cmdline_opts_parse and cmdline_opts_free to cli module.
- Removes fields input, output, debug, frames and seek from struct
  kvz_config.
- Removes function config_read from config module.
2015-07-06 08:25:54 +03:00
Arttu Ylä-Outinen 581f740c59 Fix compilation when checkpoints are enabled.
- Include string.h in checkpoint.h
- Check return values of fgets calls in checkpoint.h.
- Replace variable length array in image.c by a dynamically allocated
  array.
- Add -DCHECKPOINTS to CFLAGS in Makefile when CHECKPOINTS is defined.
2015-07-03 13:54:44 +03:00
Arttu Ylä-Outinen 6eb89a2813 Adjust Makefile for building kvazaar.dll.
Adds targets "kvazaar.dll" and "install-dll" to the Makefile.
2015-07-02 16:58:30 +03:00
Arttu Ylä-Outinen af2b417809 Set up Makefile for building libkvazaar.so.
Adds targets "libkvazaar.so.0.0.0", "install", "install-prog" and
"install-lib" to the Makefile.
2015-07-02 16:58:30 +03:00
Arttu Ylä-Outinen 4ab9aa3e2f Move kvz_encoder definition to kvazaar_internal.h. 2015-07-02 16:58:30 +03:00
Arttu Ylä-Outinen b715ae9767 Return length of the data from encoder_encode.
Adds parameter len_out returning the length of the encoded data in bytes
to function encoder_encode.
2015-07-02 16:58:29 +03:00
Arttu Ylä-Outinen 538deaa9d6 Add functions picture_{alloc,free} to kvazaar API. 2015-07-02 16:58:29 +03:00
Arttu Ylä-Outinen 6451df9a4f Move bitstream chunk definition to kvazaar.h.
- Renames struct bitstream_chunk_t to kvz_data_chunk.
- Renames macro BITSTREAM_MEMORY_CHUNK_SIZE to KVZ_DATA_CHUNK_SIZE.
- Removes kvz_payload typedef.
- Adds function chunk_free(kvz_data_chunk *chunk) to kvazaar API.
2015-07-02 16:58:28 +03:00
Arttu Ylä-Outinen f7f17a060c Rename pixel_t to kvz_pixel. 2015-07-02 16:58:28 +03:00
Arttu Ylä-Outinen cecea44d37 Rename config_t to kvz_config. 2015-07-02 16:58:28 +03:00
Arttu Ylä-Outinen 17d720363a Rename struct image_t to kvz_picture. 2015-07-02 16:55:48 +03:00
Arttu Ylä-Outinen fab07d80da Rename macro BIT_DEPTH to KVZ_BIT_DEPTH. 2015-07-02 16:55:47 +03:00
Arttu Ylä-Outinen 7b6178f6e0 Rename macro MAX_GOP to KVZ_MAX_GOP_LENGTH. 2015-07-02 16:55:47 +03:00
Arttu Ylä-Outinen 3f32d500e2 Move config_t structure to kvazaar.h. 2015-07-02 16:55:46 +03:00
Arttu Ylä-Outinen cecdf4f34e Move config validation to encoder_control_init.
Ensures that config is valid even when not initialized by config_read.
2015-07-02 16:47:28 +03:00
Arttu Ylä-Outinen 04a1fc07cf Move all config validation to config_validate. 2015-07-02 16:43:19 +03:00
Arttu Ylä-Outinen 25706af770 Add a function for moving bitstream data.
Replaces calls to bitstream_append with bitstream_move where possible.
2015-07-02 16:35:47 +03:00
Arttu Ylä-Outinen 398f0c823b Replace memory bitstreams with linked lists.
- Removes all bitstream types.
- Changes encoder_encode to return the encoded data as list of chunks.
- Moves writing of the encoded data to the main function.
2015-07-02 16:35:46 +03:00
Arttu Ylä-Outinen 7e20e62cc7 Make kvazaar_encode consume one frame on each call.
- Replaces read_one_frame by encoder_feed_frame.
- Adds field "prepared" to encoderstate_t to indicate that
  encoder_next_frame has been called.
- Input frames are read in the main function and passed to
  encoder_encode.
2015-07-02 16:28:40 +03:00
Arttu Ylä-Outinen 012c0580df Move writing reconstructed image to yuv_io module.
Adds function yuv_io_write.
2015-07-02 16:28:39 +03:00
Arttu Ylä-Outinen 7bd23f5dbb Rename yuv_input module to yuv_io. 2015-07-02 16:28:39 +03:00
Arttu Ylä-Outinen 1f41717351 Rename stats_done to frame_done in encoderstate.
The new field frame_done is set to zero when starting to encode a new
frame and reset to one when the encoded data has been written.
2015-07-02 16:24:26 +03:00
Arttu Ylä-Outinen 50a5d5faa5 Let subimages have multiple references.
Adds function image_copy_ref to image module for getting a new reference
to an image. It can be used instead of image_make_subimage when the
sizes of the original and the subimage are same.
2015-07-02 16:24:26 +03:00
Arttu Ylä-Outinen cec9b937dc Make image list resize use realloc.
Much simpler than allocating, copying and freeing the arrays manually.
2015-07-02 16:24:25 +03:00
Arttu Ylä-Outinen fe3b629905 Move poc from image_t to image_list_t. 2015-07-02 16:24:25 +03:00
Arttu Ylä-Outinen 5d524c0290 Move seeking to yuv_input module. 2015-07-02 16:24:24 +03:00
Arttu Ylä-Outinen f41ce04488 Refactor main function.
- Make sure that everything which is allocated gets deallocated.
- Move finalization of encoder states to kvazaar.c.
- Remove empty strategyselector_free function.
- Remove unused variable curpos.
- Fix includes.
2015-07-02 16:24:24 +03:00
Arttu Ylä-Outinen 9c20f96397 Move opening files in main to separate functions. 2015-07-02 16:24:24 +03:00
Arttu Ylä-Outinen 40b136cf48 Fix seeking when reading from stdin.
Seeking used read_one_frame to skip frames. Changed to simply use fread
instead.
2015-07-02 16:24:24 +03:00
Arttu Ylä-Outinen 970d0ec182 Move input reading functions to yuv_input module.
Adds function read_yuv_frame and moves functions fill_after_frame and
read_and_fill_frame_data from encoderstate to yuv_input.
2015-07-02 16:24:23 +03:00
Arttu Ylä-Outinen 4a7b86a43b Make g_exp_table statically allocated.
Removes the need to free the table.
2015-07-02 16:14:52 +03:00
Arttu Ylä-Outinen b130ecc9bb Fix "reference not found" when GOP is enabled.
The encoder state must be cleared by calling encoder_next_frame before
calling read_one_frame.
2015-07-02 16:14:51 +03:00
Ari Koivula 7e98a483d7 Use the API for checking whether the encoding is finished. 2015-07-02 16:14:51 +03:00
Ari Koivula fc58748ae8 Output bitstream through API.
- Use the existing bitstream_t type to give access to the bitstream.
  We can extend it later to make it a linked list like I was planning
  to do with the payload type.
- The main encoder now also stores the bitstream in memory.
2015-07-02 16:10:51 +03:00
Ari Koivula df50a0dae6 Move config_parse into api. 2015-07-02 15:52:24 +03:00
Ari Koivula 4e5326d3d5 Move encoding to API.
- Api->encoder_encode can now be called repeatedly to start encoder
  jobs and to retrieve the results.

Conflicts:
	src/encmain.c
2015-07-02 15:52:23 +03:00
Ari Koivula 9a3edce3fc Separate input and output from encoding.
- Move image_t and pixel_t to the kvazaar.h API.
- Try and arrange things such that image_t can be used as input and
  output for encoding.

Conflicts:
	src/encmain.c
2015-07-02 15:52:23 +03:00
Ari Koivula f87cea78da Wait for bitstream immediately after encoding the frame.
- This should reduce the encoding delay by one frame when encoding in
  real time.
2015-07-02 15:52:23 +03:00
Ari Koivula ad11d1bca5 Add kvazaar.h to hold high-level encoder API.
- Move encoder initialization from main to kvazaar.c.
- Have main use the API for initialization.

Conflicts:
	src/encmain.c
2015-07-02 15:52:23 +03:00
Ari Koivula 0170e9280f Move some initialization to encoder_control_init.
- Removed some members from encoder_control_t that weren't really used
  very much anymore.
2015-07-02 15:45:35 +03:00
Ari Koivula 504f3d9c9b Move some config initialization to config_read. 2015-07-02 15:45:34 +03:00
Ari Koivula c99fe63860 Move seek functionality outside the main input loop. 2015-07-02 15:45:34 +03:00
Ari Koivula 4f4b62b13c Fix owf. 2015-07-02 15:45:34 +03:00
Ari Koivula 5c28745457 Move OWF logic and CLI stuff out of encoder_compute_stats.
- CLI stuff is moved to either cli-module or to main function.
- OWF stuff is made more explicit by counting the frames instead of
  communicating through encoder_state_t.stats_done.
2015-07-02 15:45:33 +03:00
Ari Koivula ea50d03e52 Add cli module and move interface stuff to there. 2015-07-02 15:45:33 +03:00
Marko Viitanen ff4fb64169 Fixed a precedence bug in bipred search 2015-06-12 09:49:56 +03:00
Marko Viitanen 44ba9d9f7c Bump version number to 0.5.0 2015-06-11 10:33:27 +03:00
Ari Koivula 30f8640380 Disable trskip SAD calcultation when trskip is not enabled. 2015-06-08 13:16:12 +03:00
Marko Viitanen 3253ba4812 Fixed non-deterministic behavior when using bipred and owf 2015-06-08 13:14:53 +03:00
Ari Koivula cdb66baf16 Fix mutex being unlocked twice. 2015-06-01 16:28:50 +03:00
Ari Koivula 80ec1fda3a Remove unnecessary dependency between I-frames.
- Inter OWF dependency was being added to non-IDR I-frames.
2015-06-01 16:26:30 +03:00
Arttu Ylä-Outinen 984e7cb4e0 Fix setting QP when rate control is disabled.
When rate control is disabled, QP and lambda are now selected like they
were before rate control was implemented.
2015-06-01 13:57:11 +03:00
Arttu Ylä-Outinen b0435d37a9 Update rate control parameters.
On each frame, adjust the parameters alpha and beta in the equation

    lambda = alpha * pow(R, beta)
2015-05-29 11:50:08 +03:00
Arttu Ylä-Outinen b24d92bd6e Move initialization of constants to encoder.c.
Some constants used in rate control are now initialized only once instead
of being computed on every frame. Adds pixels_per_pic, target_avg_bppic,
target_avg_bpp and gop_layer_weights to encoder_control_t.
2015-05-29 11:45:36 +03:00
Arttu Ylä-Outinen b54d5aa91f Select GOP picture weights according to bitrate.
Pictures in same layer have equal weights. At low bitrates, the difference
between low and high layers is greater than at high bitrates.
2015-05-29 11:43:42 +03:00
Arttu Ylä-Outinen 93d2a95ddc Implement rate control in lambda domain.
- Rate control adjusts the lambda value.
- QP is selected according to lambda.
- Bits are allocated for GOPs and individual pictures.
2015-05-19 11:40:51 +03:00
Arttu Ylä-Outinen 664de9ade0 Keep track of bits written in current gop.
Adds cur_gop_bits_coded into encoder_state_config_global_t. The count is
updated whenever a frame is written.
2015-05-19 10:42:23 +03:00
Arttu Ylä-Outinen 4a5698a6ba Implement basic rate control. 2015-05-19 10:42:17 +03:00
Arttu Ylä-Outinen d27cde55a4 Add --input-fps and --bitrate parameters. 2015-05-15 13:57:51 +03:00
Arttu Ylä-Outinen 5b8cd76f01 Keep track of total number of bits coded.
Adds total_bits_coded into encoder_state_config_global_t. The count is
updated whenever a frame is written.
2015-05-15 13:57:50 +03:00
Arttu Ylä-Outinen 815a2bea55 Use bitstream_tell to get stream position. 2015-05-15 13:57:50 +03:00
Ari Koivula 56bb8e75ba Fix non-deterministic behavior with tiles.
- Depend on the whole previous frame.
- We should really go through all these FIXME's sometime.
2015-05-12 12:00:32 +03:00
Ari Koivula a48d91dacd Fix WPP not working when SAO is off and OWF is on.
- Every wavefront row was being set to done when the first wavefront
  row got done.
- Looks like I didn't understand how the data structure worked when I
  "cleaned this up", and it didn't get caught in tests because it
  needs OWF to be on to affect anything.
2015-05-11 12:01:17 +03:00
Ari Koivula 87936eb99f Revert "Fix keeping of reference frames over IDR boundary."
This reverts commit b43f1cb9eb.

- This change resulted in use of uninitialized memory with owf != 0.

Conflicts:
	src/encoderstate.c
2015-05-05 17:07:49 +03:00
Ari Koivula c3b42291e1 Merge branches 'coverity-fix-5', 'coverity-fix-6', 'coverity-fix-7', 'coverity-fix-8', 'coverity-fix-9', 'coverity-fix-10', 'coverity-fix-11', 'coverity-fix-12', 'coverity-fix-13' and 'coverity-fix-14' into coverity-fixes2 2015-05-05 12:27:02 +03:00
Ari Koivula 62285c405c Fix coverity warning.
- False positive about a shift with -1 when code_num overflows.
2015-05-05 12:20:07 +03:00
Ari Koivula ed670f4185 Fix coverity warning.
- False positive about buffer overrun due to thinking work_tree_copy_up
  could be called with depth == 4.
2015-05-05 11:54:09 +03:00
Ari Koivula 2276e0028f Fix coverity warning.
- False positive about use of an uninitialized value. Actually just
  copying uninitialized data from one struct to another.
2015-05-05 10:39:29 +03:00
Ari Koivula 41d9889e28 Fix coverity warning.
- False positive about coeff_y being uninitialized when width == 0.
2015-05-05 10:23:52 +03:00
Ari Koivula 80cbda364b Fix coverity warning.
- Variable guards dead code. Although, maybe it will complain about the
  dead code now instead.
2015-05-05 10:17:06 +03:00
Ari Koivula 08d079773f Fix coverity warning.
- Dead code.
2015-05-05 10:12:01 +03:00
Ari Koivula e225c5b302 Fix coverity warning.
- Dead code due to current value of MRG_MAX_NUM_CANDS. Not sure if this
  fix will work but I think it looks better.
2015-05-05 10:06:18 +03:00
Ari Koivula 17bdc82b5e Fix coverity warning.
- Dereferencing a pointer from realloc before checking if it's null.
2015-05-05 09:40:24 +03:00
Ari Koivula cc980fb815 Fix coverity warning.
- False positive for use of uninitialized variable.
2015-05-05 09:37:34 +03:00
Ari Koivula 7a551bece5 Fix coverity warning.
- Remove dead code.
2015-05-05 09:29:40 +03:00
Ari Koivula cf2a406aba Fix coverity warning.
- False positive for overflow. Fixed the parameter declaration.
2015-05-04 17:38:16 +03:00
Ari Koivula 1c6c4963e7 Fix coverity warning.
- Mutex was left locked when malloc failed. Fixed.
2015-05-04 17:38:16 +03:00
Ari Koivula 1c3873f5b2 Fix coverity warning.
- Overflow from buggy implementation of modulo behavior for
  pattern_type. As there is no need for such behavior I removed it.
2015-05-04 17:38:16 +03:00
Ari Koivula 6234b09461 Fix coverity warning.
- A false alarm about buffer overflow. No new modes are added if all modes
  are already in the list.
- Skip checking predicted modes if all modes are in the list.
2015-05-04 17:38:16 +03:00
Ari Koivula 9015aab996 Clean up IDR handling code.
- IDR was called RADL, probably because the NAL type is IDR_W_RADL.
- Move things around to make it clearer what is happening.
2015-04-30 20:46:07 +03:00
Ari Koivula b43f1cb9eb Fix keeping of reference frames over IDR boundary.
-
2015-04-30 15:42:16 +03:00
Ari Koivula c0c9bc619a Fix valgrind warning.
- Attribute state->global->slicetype was used before being initialized.
- The reference frame lists should be updated based on current frame,
  not on previous frame (or uninitialized data).
2015-04-30 13:18:28 +03:00
Ari Lemmetti afcccb5c81 Merge branch 'memory_leak_test' 2015-04-29 16:26:59 +03:00
Ari Lemmetti 0081384727 Clean Makefile a bit. Add debug build option. 2015-04-24 20:45:19 +03:00
Marko Viitanen 8ed5d06ebe Fixed compiler warnings caused by the bipred branch merge 2015-04-23 15:12:48 +03:00
Marko Viitanen fd060cf2c6 Merge branch 'bipred'
Conflicts:
	README.md
	src/config.c
	src/config.h
	src/encmain.c
2015-04-23 14:45:44 +03:00
Marko Viitanen 79dc7e7270 Bi-pred search cleanup 2015-04-23 14:39:41 +03:00
Marko Viitanen 0e958ebe84 Fixed merge candidate selection 2015-04-23 12:18:33 +03:00
Marko Viitanen 3c694a8f6e Fixed bipred mv candidate selection 2015-04-23 12:18:05 +03:00
Marko Viitanen 9951810910 Fixed deblocking with bi-dir blocks 2015-04-23 09:43:39 +03:00
Marko Viitanen 7f504b7808 Added a commandline parameter --bipred to enable bi-pred search 2015-04-21 14:35:16 +03:00
Marko Viitanen fb74f86a5b Bi-pred search now actually does cost calculations 2015-04-21 14:16:06 +03:00
Marko Viitanen e12ba7c80f Created function inter_recon_lcu_bipred() and moved bipred recon there 2015-04-21 12:05:21 +03:00
Marko Viitanen 50fce975d9 Clamp bi-pred motion vectors because ipol filtering requires modifications 2015-04-21 11:24:07 +03:00
Ari Koivula 13924a2057 Add --no-info parameter.
- Stops encoder information from being added to bitstream.
- The version information overhead is too big when doing comparisons with
  very short sequences.
2015-04-16 17:30:36 +03:00
Ari Koivula 7028846423 Fix bug in intra mode search.
- The cost of the first mode in the mode list was returned instead of cost of
  the selected mode, as this used to be the best mode when the list was
  sorted. Should only matter when doing inter coding.
- This pretty much affects only --rd=1 in inter frames.
2015-04-09 16:05:53 +03:00
Marko Viitanen da3fe9f199 Fixed rounding in bi-pred reconstruction 2015-04-02 15:55:13 +03:00
Marko Viitanen c7a17cf1c4 Changed motion vector candidate derivation to work with bi-pred case 2015-04-02 14:05:24 +03:00
Marko Viitanen 73db9fec83 Fixed asserts for intra PU-depth configurations 2015-04-02 10:31:56 +03:00
Marko Viitanen 5d71fb3136 Fixed leaf aligning 2015-04-01 08:49:22 +03:00
Marko Viitanen d26b89174b Fixed intra chroma search ref_v pointer 2015-03-31 15:43:22 +03:00
Marko Viitanen 4b7db2e014 Added a dummy bi-pred search, always selects bi-pred block when possible 2015-03-31 15:02:43 +03:00
Marko Viitanen 2c676927f0 Fixed a bug in bipred reconstruction causing an overflow 2015-03-31 15:02:10 +03:00
Marko Viitanen 06bc4f3d5e Fixed duplicate checking for merge cand and some cleanup 2015-03-31 12:23:46 +03:00
Marko Viitanen 004e8082ab Fixed deblocking after L0/L1 mv changes 2015-03-31 12:22:48 +03:00
Marko Viitanen c02e3b8e26 Fixed inter_get_mv_cand() reference picture checking 2015-03-30 15:22:56 +03:00
Marko Viitanen f881d6bf8a Modified structures and mv handling to use L0/L1 vectors 2015-03-30 14:40:29 +03:00
Marko Viitanen d6f68d0950 Force clearing of references when GOP not used and I-slice 2015-03-30 10:21:41 +03:00
Marko Viitanen f28ebbcd41 Moved GOP defining to config.c and added parameter --gop
* Checking that intra period and gop_len match
2015-03-30 10:09:54 +03:00
Marko Viitanen c82915761f Enabled insertion of I-slices when GOP is used 2015-03-30 10:09:49 +03:00
Marko Viitanen 815e0b8897 Moved reference list printing to encoder_compute_stats() 2015-03-30 10:09:32 +03:00
Marko Viitanen 2243d139bf Fixed GOP reference usage when using owf 2015-03-26 14:11:13 +02:00
Marko Viitanen 1dc53be8fc Fixed leaf aligning 2015-03-26 13:54:17 +02:00
Marko Viitanen bbeb85f9ee Fixed case when cfg->frames is zero 2015-03-26 11:24:41 +02:00
Marko Viitanen 5c04603421 Remove unused ref frames on GOP case even when number of ref frames is within limits 2015-03-26 11:14:13 +02:00
Marko Viitanen 5071b5c990 Moved reference list sorting and parsing to encoder_state_new_frame()
* fixed a bug in reference verification and added an error state
2015-03-26 10:58:56 +02:00
Marko Viitanen c40ca49b6c When GOP is used, verify the references are available 2015-03-26 10:38:21 +02:00
Marko Viitanen fe581b881e Changed GOP structure to enable coding sequences not divisible by gop_len 2015-03-25 16:00:20 +02:00
Marko Viitanen 42e02dbfd9 Fixed tr-skip cost calculation 2015-03-24 13:35:28 +02:00
Marko Viitanen a7328ab008 Fixed tr-skip cost calculation 2015-03-24 12:40:01 +02:00
Marko Viitanen c649c90f3a Changes to enable adaptation to any GOP len 2015-03-24 12:01:57 +02:00
Marko Viitanen 9a828ae5da Fixed merge candidate scaling in hexbs and excluded weighted pred candidates in cost calc 2015-03-24 09:38:24 +02:00
Marko Viitanen 2d8552d0d6 Fixed merge candidate usage by skipping weighted prediction candidate 2015-03-23 15:17:41 +02:00
Marko Viitanen 7952f892fc Fixed GOP reference usage 2015-03-23 14:17:44 +02:00
Marko Viitanen 34e8f70c8c Fixed temporal MV predictor offset 2015-03-23 09:22:47 +02:00
Marko Viitanen eccf1c1a16 Fixed temporal MV predictor offset 2015-03-23 09:21:52 +02:00
Marko Viitanen 164b7a7743 Merge remote-tracking branch 'remotes/origin/master' into GOP 2015-03-20 11:40:15 +02:00
Marko Viitanen 5ae9a70e38 Disable usage of P-slices when GOP 2015-03-20 10:43:59 +02:00
Marko Viitanen 26082d5328 Zero merge candidate fix for B-frames 2015-03-20 10:33:05 +02:00
Marko Viitanen 0c1aa6f73c Better reference picture removal function encoder_state_remove_refs() 2015-03-20 10:28:17 +02:00
Marko Viitanen 7dab3ea0f6 Replaced temporary reference lists with the ones in gop configurations 2015-03-20 10:25:40 +02:00
Marko Viitanen f166d25dd0 Added positive and negative reference frames to the gop config 2015-03-20 10:22:53 +02:00
Arttu Ylä-Outinen 3f31e7bf47 Merge branch 'tz-search' 2015-03-19 19:04:44 +02:00
Arttu Ylä-Outinen 176dbb6a5b Add --me parameter.
Selects the integer motion estimation algorithm (hexbs or tz).
2015-03-19 18:48:10 +02:00
Marko Viitanen d72c560880 Generate sorted reference list for L0 and L1 2015-03-19 12:26:59 +02:00
Marko Viitanen c761a6beb3 Added encoder state as an input parameter to inter_get_merge_cand() 2015-03-18 12:35:47 +02:00
Marko Viitanen c56b4d5747 Added combined merge candidates on B-slices and struct inter_merge_cand_t 2015-03-18 10:03:06 +02:00
Ari Koivula 6ec177f75c Improve handling of input vector to inter search. 2015-03-17 17:16:15 +02:00
Ari Koivula 55ae02f367 Copy cu_info from tiles to main state.
- Main states cu_array can be accessed through state->global->ref, which
  allows the use of cu_info data from reference frames.
- This was already used by giving previous frames movement vector to next
  frame as a starting point candidate, but that functionality was broken at
  some point because the data wasn't being moved from child tiles cu_array
  to the main cu_array.
- Alternative would be to access the child tiles array directly, but
  currently there isn't a mechanism to preserve those arrays for reference
  frames.
2015-03-17 13:24:20 +02:00
Ari Koivula 4bec6cec93 Simplify wavefront handling.
- Move the reconstruction status assignment out of the main for job loop.
2015-03-17 13:23:27 +02:00
Ari Koivula 4a27f79f20 Update comments. 2015-03-17 13:23:16 +02:00
Marko Viitanen 1da1dc9578 Clean up reference index and mvd writing 2015-03-16 09:41:02 +02:00
Ari Koivula ca09e8bfe3 Fix WPP not working with threads=0.
- Apparently threadqueue_submit runs the job if there are no threads.
2015-03-13 17:15:05 +02:00
SanteriS 913ade461b tz_search step 1, first if: && -> || 2015-03-12 17:57:17 +02:00
SanteriS 949ec57849 Merge branch 'master' of https://github.com/ultravideo/kvazaar 2015-03-12 17:55:03 +02:00
SanteriS bdb0639ac9 fixed function interfaces for tz_search and its subfunctions. 2015-03-12 17:54:21 +02:00
Ari Koivula d2bb71739f Clean up and comment WPP threading code.
- Remove WPP row reconstruction dependency to the row above current one in
  the previous frame. It's obviously unnecessary.
- Remove WPP row reconstruction dependency to the current row in the
  previous frame, unless the current row is the last row.
2015-03-11 18:30:37 +02:00
Ari Lemmetti b9ec4b0a54 AVX2 acceleration for new luma filtering. 2015-03-11 15:33:38 +02:00
Marko Viitanen bc8ea9547e Use P-frames when last GOP picture 2015-03-11 15:23:16 +02:00
Marko Viitanen a4b5f46b46 Fixed reference list delta and num_ref_idx_lX_active values 2015-03-11 15:19:32 +02:00
Marko Viitanen ac4973c544 Fixed deblocking strength in this configuration when B-slice 2015-03-10 15:20:02 +02:00
Marko Viitanen 1527822753 Fixed GOP POC order when not using threads 2015-03-10 14:12:51 +02:00
Marko Viitanen 866c3bfdf1 Setting gop_len to 0 now works 2015-03-10 12:16:57 +02:00
Marko Viitanen 1c38fbbd3b Fixed GOP when no threads are used 2015-03-10 10:45:05 +02:00
Marko Viitanen 66660516b7 Merge remote-tracking branch 'remotes/github/master' into GOP
Conflicts:
	src/cabac.h
	src/config.h
	src/cu.h
	src/encoder_state-bitstream.c
	src/encoderstate.c
2015-03-10 10:32:00 +02:00
Marko Viitanen ff41ef557d Fixed reference usage of top GOP layer pictures 2015-03-10 09:18:19 +02:00
Marko Viitanen eba298e635 Added cu->inter.mv_ref_coded variable 2015-03-10 09:17:25 +02:00
Marko Viitanen ec02642cc8 Added more bits to POC counter and fixed num_reorder_pic and max_dec_pic_buffering values 2015-03-10 09:06:32 +02:00
SanteriS 9e9f5e3150 Merge branch 'master' of https://github.com/ultravideo/kvazaar 2015-03-08 19:20:08 +02:00
SanteriS e2f9fe130a changed step 1 for tz_search 2015-03-08 19:19:23 +02:00
Ari Lemmetti 39eceec38d Rewrite of luma fractional pixel filtering. Utilizes intermediate values instead of calculating everything again. 2015-03-06 17:58:22 +02:00
Marko Viitanen 42d3f2a8b0 Added B-frame encoding and reference list exceptions for top-layer GOP pictures 2015-03-06 16:32:50 +02:00
Marko Viitanen 1afba671e2 Added missing cabac bits to mv coding 2015-03-06 16:31:27 +02:00
Marko Viitanen 6095503918 Modified search to use correct reference id and mv directions 2015-03-06 16:29:24 +02:00
Marko Viitanen 13c925b701 Testset of data for reference picture lists 2015-03-06 16:28:23 +02:00
Marko Viitanen 43b086caed Added missing slice header flag "mvd_l1_zero_flag" 2015-03-06 16:27:42 +02:00
Marko Viitanen 18d9789fab Cabac context array for inter direction 2015-03-06 16:26:16 +02:00
Ari Koivula 2f79bfebf7 Rename parameter encoder_state to state in all functions.
- It's so widely used that there isn't really need to emphasize that
  it's the encoders state. Also, it isn't really the encoders state,
  but encoding jobs state.
2015-03-04 17:31:07 +02:00
Ari Koivula 14fe1b6648 Rename enum color_index to color_t. 2015-03-04 16:37:35 +02:00
Ari Koivula ded6fd9ee8 Renamed typedef pixel to pixel_t. 2015-03-04 16:35:53 +02:00
Ari Koivula 1f42adb1ea Renamed typedef coefficient to coeff_t. 2015-03-04 16:33:47 +02:00
Ari Koivula fedd05465d Rename struct sao_info to sao_info_t. 2015-03-04 16:32:38 +02:00
Ari Koivula 3d135324da Rename struct threadqueue_queue to threadqueue_queue_t. 2015-03-04 16:30:20 +02:00
Ari Koivula b7fcb800b2 Rename struct threadqueue_job to threadqueue_job_t. 2015-03-04 16:28:56 +02:00
Ari Koivula cf5f240604 Rename struct hardware_flags to hardware_flags_t. 2015-03-04 16:24:59 +02:00
Ari Koivula e7754bb518 Rename struct strategy_to_select to strategy_to_select_t. 2015-03-04 16:24:06 +02:00
Ari Koivula e95b138e62 Rename struct strategy_list to strategy_list_t. 2015-03-04 16:23:04 +02:00
Ari Koivula 95afc5af51 Rename struct strategy to strategy_t. 2015-03-04 16:17:45 +02:00
Ari Koivula db42176a64 Rename struct image_list to image_list_t. 2015-03-04 16:13:57 +02:00
Ari Koivula 7bafd34cfa Remove struct rd_stats. 2015-03-04 14:01:17 +02:00
Ari Koivula fe55961f84 Rename struct image to image_t. 2015-03-04 14:01:17 +02:00
Ari Koivula 5431d0ce19 Rename struct lcu_order_element to lcu_order_element_t. 2015-03-04 14:01:17 +02:00
Ari Koivula 9e64ee3cee Suffix encoder_state_config structs with _t. 2015-03-04 14:01:17 +02:00
Ari Koivula cdb1a25f05 Inline struct me into encoder_control_t. 2015-03-04 14:01:16 +02:00
Ari Koivula e5b18cd536 Inline cu_info_intra and cu_info_inter into cu_info_t. 2015-03-04 14:01:16 +02:00
Ari Koivula a0767a76d2 Rename struct vector2d to vector2d_t. 2015-03-04 14:01:16 +02:00
Ari Koivula 5b12830756 Rename struct config to config_t. 2015-03-04 14:01:16 +02:00
Ari Koivula 1a62fee300 Rename struct cabac_data to cabac_data_t. 2015-03-04 14:01:16 +02:00
Ari Koivula 727fefacc4 Rename struct cabac_ctx to cabac_ctx_t. 2015-03-04 14:01:16 +02:00
Ari Koivula 4bc0308b7e Rename struct bitstream_file to bitstream_file_t. 2015-03-04 14:01:15 +02:00
Ari Koivula d6ec6a618d Rename struct bitstream_mem to bitstream_mem_t. 2015-03-04 14:01:15 +02:00
Ari Koivula 106c9128ad Rename struct bitstream_base to bitstream_base_t. 2015-03-04 14:01:15 +02:00
Ari Koivula 5d8498dc88 Rename struct bit_table to bit_table_t. 2015-03-04 14:01:15 +02:00
Ari Koivula 8cd8240f7a Rename struct bitstream to bitstream_t. 2015-03-04 14:01:15 +02:00
Ari Koivula 7ca688b376 Rename struct videoframe to videoframe_t. 2015-03-04 14:01:15 +02:00
Ari Koivula 63e224574e Rename struct cu_info to cu_info_t. 2015-03-04 14:01:15 +02:00
Ari Koivula f3fab62d33 Rename struct cu_array to cu_array_t. 2015-03-04 14:01:15 +02:00
Ari Koivula 78f0c3a83b Rename struct scaling_list to scaling_list_t. 2015-03-04 14:01:14 +02:00
Ari Koivula f6147b410a Rename struct encoder_control to encoder_control_t.
Conflicts:
	src/encoder_state-geometry.h
	src/encoderstate.h
2015-03-04 14:01:14 +02:00
Ari Koivula b14f89c88f Rename struct encoder_state to encoder_state_t. 2015-03-04 14:00:46 +02:00
Marko Viitanen 890b4c1e20 Modified image handling and QP calculations to support GOP 2015-03-03 12:22:50 +02:00
Marko Viitanen c3d9e0b707 Added testset of data for GOP 2015-03-03 12:22:09 +02:00
Marko Viitanen 34b231378b Modified config and encoder_state structs for GOP 2015-03-03 12:21:45 +02:00
SanteriS b55bfe1729 Merge branch 'master' of https://github.com/ultravideo/kvazaar 2015-02-25 18:15:35 +02:00
SanteriS bef7cae4f8 Merge branch 'master' of https://github.com/ultravideo/kvazaar 2015-02-25 15:29:11 +02:00
SanteriS f478732b4c tz search bugfix 2015-02-25 15:28:45 +02:00
Ari Koivula d7383ccb25 Change license to LGPL.
- Everyone who has contributed code to the project has been asked to license
  their contributions under LPGL and they have agreed.

- COPYING file changed to say LGPLv2.1 instead of GPLv2.

- GPL changed to LGPL in the header of every single file that a header and
  header added to the few that were missing one.

- Also.. Happy new year!
2015-02-25 15:19:05 +02:00
Ari Koivula 3e58e03b56 Select motion compensation search starting point from among merge candidates.
- Greatly reduces bdrate for most sequences.
2015-02-25 12:58:15 +02:00
SanteriS 2f68cf3847 (TZ search) Fixed missing check for owf mode. Added 6 point hexagon search pattern. 2015-02-23 16:59:48 +02:00
Ari Koivula 9865e73b90 Remove NetBSD getopt dependency to unistd.h.
- Remove the $NetBSD header as it wouldn't get updated and is wrong.
2015-02-19 16:26:14 +02:00
Ari Koivula dd54b5ae10 Replace GNU getopt with NetBSD getopt.
- This doesn't compile, but I'm including it to have a version history for
  changes required to make it work.
- We need this for to have a getopt implementation on Windows.
- It's necessary to change the implementation to switch from GPL to LGPL.
2015-02-19 16:26:14 +02:00
Ari Koivula c979db7e95 Avoid sorting intra modes unnecessarily. 2015-02-19 16:25:45 +02:00
Ari Koivula 1c2129fdcb Improve sort_modes.
- When encoding with fast enough settings this function can use up to 5%
  of the cpu time, so I tried to optimize it a little bit.
2015-02-19 16:25:38 +02:00
Ari Koivula 5fa6438b25 Clean up calls to memset.
- Replaces all calls to memset with new FILL and FILL_ARRAY macros. The use
  of memset was inconsistent and we never use it for anything complicated.
2015-02-19 16:25:28 +02:00
Arttu Ylä-Outinen b6776a8cee Add --vps-period parameter. 2015-02-18 13:55:27 +02:00
SanteriS 1a4d30d15a fixed step 1 of TZ algorithm 2015-02-11 18:51:21 +02:00
SanteriS ce4c251cd1 Merge branch 'master' of https://github.com/ultravideo/kvazaar 2015-02-09 17:29:49 +02:00
Ari Lemmetti 8aea1a0fa9 Updated version string. Fixed dct strategy registration error message. 2015-02-05 14:07:26 +02:00
Ari Lemmetti 7846cf3093 Merge branch 'faster_interpolation' 2015-02-05 13:29:43 +02:00
Ari Lemmetti 7430622038 Copy ipol-generic strategy as a base for avx2 strategy 2015-02-05 13:28:07 +02:00
Ari Lemmetti 8495870df8 Using BIT_DEPTH macro because it is constant 2015-02-05 13:19:54 +02:00
Ari Lemmetti c82adae0c4 Use four tap functions in octpel chroma interpolation 2015-02-04 18:23:57 +02:00
Ari Lemmetti 2f11caeb73 Added generic four tap functions. Use them in halfpel chroma interpolation. 2015-02-04 17:50:12 +02:00
Ari Lemmetti ff456c120a Enabled link time optimizations. Disabled default rules. 2015-02-04 15:19:47 +02:00
SanteriS 50dd59eb21 Added different search patterns for TZ search. 2015-02-02 19:14:45 +02:00
Ari Lemmetti 041d970ece Apply fast clipping also to chroma filtering. 2015-01-29 16:19:04 +02:00
Ari Koivula ff721bab81 Fix possible non-determinism with owf.
- Triggers when owf is on, sao is off and deblocking is on.
2015-01-26 16:02:31 +02:00
Ari Koivula f01cbbb5ca Add --no-signhide parameter. 2015-01-24 21:29:37 +02:00
Ari Koivula 5f24c6b73d Make normal dequant use runtime sign-hiding configuration. 2015-01-24 21:29:25 +02:00
Ari Koivula 1ccb3bd324 Move sign hiding stuff in rdoq to its own function.
- There is some stuff from sign hiding left intermingled with rdoq code,
  but I don't want to change the code too before testing that I didn't
  break anything.
2015-01-24 21:27:20 +02:00
Ari Koivula 804a3b648b Clean up quantization sign hiding.
- To allow for later configuration at runtime.
2015-01-23 16:03:59 +02:00
Ari Koivula c940ccb549 Fix gcc error.
encmain.c:433:13: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t’
2015-01-23 15:50:14 +02:00
Ari Koivula 5d16fa6c4f Add VPS every intra frame.
- Just rdo=0 for now. Later this can be extended to be configured separately.
2015-01-22 13:13:23 +02:00
Ari Koivula d685ee86d6 Record total bitstream length correctly when using stdout.
- If the output is not a file, we can't check the size of the file.
2015-01-22 12:29:06 +02:00
Ari Koivula 1b19afc706 Flush output buffer after every frame. 2015-01-22 12:29:06 +02:00
Ari Lemmetti b4aab06073 Added new files in Makefile. 2015-01-21 18:38:09 +02:00
Ari Lemmetti c21351cc12 Added fast clipping function for clamping values to bit depth. 2015-01-21 17:53:06 +02:00
SanteriS 4b3d77aaf2 Enable tz search. 2015-01-21 12:55:00 +02:00
Ari Koivula f86def8ed8 Remove unused variables. 2015-01-20 17:50:19 +02:00
Ari Koivula 8ac66934c0 Clean up NAL header code.
- Use long start code for RADL NAL units if they are the first NAL in the
  access unit.
- Ffmpeg mpegts was complaining about start codes not being present.
  There wasn't anything wrong that I could find though, besides the
  missing intra long start code.
2015-01-20 17:34:59 +02:00
Ari Koivula 81ad583e08 Use the same coeff cost calculation for all rd modes.
- It's not worth it to have these faster approximations for coefficient cost.
2015-01-20 17:34:59 +02:00
Ari Koivula 870171e6ad Fix --rd=0 actually work. 2015-01-20 17:34:59 +02:00
Ari Lemmetti f037ed580c Improved data layout 2015-01-15 16:31:18 +02:00
Ari Lemmetti 4382c2f088 Added missing -1 to PIXEL_MAX macro 2015-01-15 16:14:07 +02:00
Ari Lemmetti 465f718eeb Move value clipping away from separate loop 2015-01-15 16:14:00 +02:00
Ari Lemmetti 9d12ce21d5 Cleaned luma interpolation, added functions for 8-tap filtering. 2015-01-15 16:13:12 +02:00
Ari Lemmetti 0e56d13b5d Use smaller bit depth for fractional pixel interpolation 2015-01-15 15:00:09 +02:00
Ari Lemmetti cc061b4c3d Added ipol strategy for interpolation filters.
Added initial files for AVX2 and generic strategies.
2015-01-15 14:59:37 +02:00
Ari Lemmetti 73762062b6 Clarified comments a bit 2015-01-15 11:57:19 +02:00
Ari Koivula ab3364afb4 Add skipping of intra search in inter frames for rd=0. 2015-01-15 11:54:35 +02:00
Ari Lemmetti c9f310a6c2 Use pixel type instead of uint8_t 2015-01-15 11:47:00 +02:00
Ari Lemmetti cad5f14372 Fixed compile errors (-Werror) 2015-01-14 18:27:35 +02:00
SanteriS 126569c737 Added first version of TZ search algorithm. 2015-01-14 14:54:09 +02:00
Ari Koivula 660547098a Merge branch 'intra-fast-lcu' 2015-01-14 12:03:12 +02:00
Ari Koivula 01195aecbb Move cu split model to a function. 2015-01-14 11:16:34 +02:00
Ari Koivula 8c89dcfc50 Move mode bit calculation to a function. 2015-01-14 10:44:52 +02:00
Daniel Eneyev 27d79ffae3 workaround for GET_TIME in Mac OS 2015-01-13 17:06:55 +03:00
Ari Koivula fc79c2103e Generalize the fast intra-mode tryout code to work for any depth. 2015-01-12 11:47:21 +02:00
Ari Koivula f1364d297b Fix bug resulting in incorrect bitstream.
- If 64x64 intra PUs were enabled and --rd was less than 2, no intra mode
  search was performed for depth 0 resulting in incorrect bitstream.
2015-01-12 11:16:33 +02:00
Ari Koivula bbae2e8a27 Update usage and readme. 2015-01-12 10:59:28 +02:00
Ari Koivula f4bd322804 Add command line options for prediction unit depth. 2015-01-12 10:40:34 +02:00
Ari Koivula edf2681ea4 Comment functions in search.c. 2015-01-07 14:56:14 +02:00
Ari Koivula 8c1e0b8a7f Tweak owf=auto.
- Twice the required number is too little.
2014-12-10 11:23:51 +02:00
Ari Koivula 129c8e38e0 Set owf default to auto. 2014-12-09 19:00:11 +02:00
Ari Koivula 51b5692121 Rewrite owf=auto code to be more general.
- Change the definition to be a bit more general. The mapping from resolution
  to owf frames stays mostly the same however, but should handle weird
  resolutions better.
- Move everything to config module.
- Fix handling of tiles. It had a bug where owf for tiles was always
  threads * 4/3 - 1. Works as intended now.
2014-12-09 19:00:11 +02:00
Ari Koivula 374012ab26 Merge branch 'intraskip' 2014-12-01 17:30:03 +02:00
Ari Lemmetti 24492adb02 Merge branch 'fme_merge' 2014-11-21 15:08:45 +02:00
Ari Koivula 21d221c075 Add fast 64x64 intra test.
- If intra search is not enabled for a depth, try the result from the
  top left CU of the next depth. This seems to give most of the benefit
  of at least 64x64 intra prediction units without costing very much
  in performance.
2014-11-20 17:20:24 +02:00
Ari Lemmetti 4874f2662f Added --subme commandline parameter for fractional pixel motion estimation: 1 == enable (default), 0 == disable. 2014-11-20 14:59:04 +02:00
Ari Lemmetti d5d2e04995 Merge branch 'fme' 2014-11-19 16:40:22 +02:00
Ari Koivula 3ef88dfda5 Add --owf=auto option.
- The optimal value for Overlapping Wave Front (OWF) depends on a bunch of
  variables. Attempt to set the optimal owf value, at least for all intra.
2014-11-18 02:19:40 +02:00
Ari Lemmetti 5a946f24ea Fixed time output formatting. 2014-11-14 16:46:41 +02:00
Ari Lemmetti 56c537e145 Build fixes for MinGW.
threads.h: use windows.h headers for clock stuff on MinGW
strategyselector.c: assert with strlen for MinGW support
2014-11-14 16:46:41 +02:00
Daniel Eneyev 992a98c5c4 If output name is dash - write to stdout 2014-11-13 12:45:53 +03:00
Ari Lemmetti c46b75a0ca Fixed mingw build error. Modified function declaration in getopt.h.
A macro definition adds * in front of __argc and __argv, causing
build error with mingw. Renamed them to argc and argv to prevent this.
2014-10-31 17:40:18 +02:00
Ari Lemmetti 6a12bc406d Load greatest submodule. Fixed loop that occurred during build process. 2014-10-30 15:17:50 +02:00
Ari Lemmetti a64aae7c53 Makefile now compiles tests. Fixed test files. Removed unused stuff. 2014-10-29 15:32:47 +02:00
Ari Koivula 50643eeaf8 Merge pull request #88 from darealshinji/patch-2
version.h is no longer used
2014-10-27 20:23:15 +02:00
darealshinji 81ecef17d7 version.h is no longer used 2014-10-27 18:17:26 +01:00
darealshinji e230fb2eab make it possible to add custom CFLAGS 2014-10-27 17:19:05 +01:00
Ari Lemmetti e93fa54838 Added -lrt to fix undefined references to clock_gettime on some systems 2014-10-23 14:51:28 +03:00
Ari Lemmetti eb7cecc3dd Added .travis.yml for continuous integration. Added env variable to disable AVX2 for Travis (GCC version doesn't support it yet). 2014-10-23 14:20:07 +03:00
Ari Lemmetti 20967cfafe Allow CC to be defined other than gcc. If not defined, use gcc as default. 2014-10-23 13:25:00 +03:00
Ari Koivula fcb6fa6d4b Fix compilation error on PowerPC.
- Need abs from stdlib.
2014-10-21 18:14:32 +03:00
Ari Koivula f6fead6221 Fix crash on inter frames.
- If the bitcost was 0 it would underflow for skip mode. The bitcost is now
  checked before decrementing.
2014-10-21 18:11:39 +03:00
Ari Koivula dfc67b766a Disable rd1 chroma search.
- The bdrate improvement isn't really worth the time it takes, so enable it
  only for rd3 untill it can be made faster or better.
2014-10-16 13:59:20 +03:00
Ari Koivula e9b8d9b889 Fix gcc warnings.
- Remove unused variables.
- Change intra prediction functions to take their inputs as const pointers.
- Change intra_get_pred to take two pointers instead of an array of pointers,
  because the warnings got just too exotic.
2014-10-16 13:17:46 +03:00
Ari Koivula 4bac52d9b6 Merge branch 'intra' 2014-10-16 13:11:23 +03:00
Ari Koivula afb9e8c3f4 Remove extra parameter sets. 2014-10-16 12:21:36 +03:00
Ari Koivula 02ec26fcea Try different number of chroma intra modes for different depths.
- And avoid doing extra work if no extra modes are tested for certain depths.
2014-10-16 12:21:36 +03:00
Ari Koivula 3cf5e422e8 Make fast chroma mode search select modes for slower chroma search. 2014-10-16 12:21:36 +03:00
Ari Koivula d12dbd4aa0 Add fast intra chroma mode search. 2014-10-16 12:21:08 +03:00
Ari Koivula 75a137c1e9 Add --cpuid parameter to disable runtime optimizations. 2014-10-16 12:01:36 +03:00
Ari Koivula 3e6023dfb5 Rename search constants and set sane defaults. 2014-10-16 03:08:11 +03:00
Ari Koivula 8a407b0313 Estimate luma and chroma intra mode bits separately.
- Remove cu_info.intra[].cost and bitcost as unnecessary.
- Add luma_mode_bits to complement chroma_mode_bits and remove
  intra_pred_ratecost as unneccessary. Difference is that intra_pred_ratecost
  was more coarse and included chroma mode with the assumption that it would
  be the same as chroma.
2014-10-16 03:08:11 +03:00
Ari Koivula c9e212ba92 Add intra chroma mode search.
- Based on full chroma reconstruction so enabled only for --rd=2.
2014-10-16 03:07:50 +03:00
Ari Koivula b32867be2a Remove -lrt from LDFLAGS.
- This might be required on some embedded system, but from what I can see
  all the functions we use from real time extensions are included in libc
  and the program seems to work fine without it.
- It doesn't exist on MingwW or Mac, so I think it's better to remove it
  completely and add it later on any system that actually requires it.
- Related to #85.
2014-10-14 11:48:57 +03:00
Ari Koivula 6f8a976b12 Give ARCH_X86_64 to yasm on Mac.
- Issue raised in #85.
2014-10-14 09:47:56 +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 04613bd5b3 Disable GET_TIME on Mac.
- This should fix the Mac version not compiling in issue #85.
2014-10-13 16:22:11 +03:00
Ari Koivula a469c059a5 Take chroma tr-skip bits into account. 2014-10-13 10:48:39 +03:00
Ari Koivula 7a5cf5d865 Add trskip mode cost to fast trskip mode decision. 2014-10-13 10:45:41 +03:00
Ari Koivula f164a5ba79 Add fast transform skip estimation to rough intra search. 2014-10-13 10:42:24 +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 Koivula 28d1532578 Make rd=1 use cabac for coeff cost estimation. 2014-10-08 12:50:03 +03:00
Ari Koivula cbb2aa75b7 Add macros for adjusting weight of distortion between luma and chroma.
- Everything needs to have a short name because windows has a maximum path
  length limitation that is breaking my testing framework.
2014-10-08 10:31:54 +03:00
Ari Koivula 49ad845c33 Add cabac bits for part_mode. 2014-10-08 10:31:54 +03:00
Ari Koivula b6710e7893 Add cabac bits for cu split flag. 2014-10-08 10:31:54 +03:00
Ari Koivula 38b224cf69 Change rest of cu split search costs to double. 2014-10-08 10:31:54 +03:00
Ari Koivula 17473624d3 Add transform tree bit costs for cbf_luma. 2014-10-08 10:31:54 +03:00
Ari Koivula 3b04d39db4 Take cabac bits into account on transform tree. 2014-10-08 10:31:54 +03:00
Ari Koivula 296f142d9e Retain coded block flag data during transform split search. 2014-10-08 10:31:54 +03:00
Ari Koivula 85dea10f3f Clean up transform split search.
- Remove unnecessary checks and comment.
2014-10-08 10:31:54 +03:00
Ari Koivula e1b801eb6f Add transform tree chroma cbf bits. 2014-10-08 10:31:23 +03:00
Ari Koivula 3868cc7ff1 Fix crash on inter search when --tr-depth-intra is used.
- Transform splits meant for intra modes were used for inter when inter mode
  was chosen, which caused an assert to be triggered if the split transform
  block didn't have any coefficients.
2014-10-03 19:29:06 +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 8a80845b91 Add chroma to transform split search. 2014-10-03 11:36:57 +03:00
Ari Koivula 51662e1081 Fix differences between cu_rd_cost_luma and rdo_cost_intra. 2014-10-03 11:36:57 +03:00
Ari Koivula bc7d7d5cb6 Add cu_info* as parameter to reconstruction functions.
- This is required so these functions can be used for searching. When NULL
  is given they take the CU from LCU struct as they did previously.

Conflicts:
	src/search.c
2014-10-03 11:36:56 +03:00
Ari Koivula ccc575e2c6 Disable transform tree bits. 2014-10-03 11:36:56 +03:00
Ari Koivula a0ab469c89 Disable rdo_cost_intra. 2014-10-03 11:36:56 +03:00
Ari Koivula c164978e21 Add FULL_CU_SPLIT_SEARCH macro for disabling cu split optimization. 2014-10-03 11:36:56 +03:00
Ari Koivula 549ac96438 Change costs to doubles to avoid rounding intermediate results.
- Helps with debugging.
2014-10-03 11:36:56 +03:00
Ari Koivula e591e89ade Add prediction mode to chroma reconstruction parameters.
- Just like in luma.
2014-10-03 11:36:56 +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