Commit graph

341 commits

Author SHA1 Message Date
siivonek 0cf89e9516 [mip] Fix CI errors. 2022-02-09 12:55:16 +02:00
siivonek d5e2bbd824 [mip] Fix things according to comments. Fix asserts. Remove MIP from chroma recon and search calls. WIP mip mode cost calculation. 2022-02-09 12:55:16 +02:00
siivonek 59a86f339e [mip] Implement MIP search. 2022-02-09 12:55:16 +02:00
siivonek e672f9b24a [mip] Implement MIP functions. 2022-02-09 12:55:15 +02:00
siivonek cb2ccce753 [mip] WIP Implement mip functions. 2022-02-09 12:55:15 +02:00
siivonek 3bbef3dff6 [mip] Add mip weight matrices. 2022-02-09 12:55:15 +02:00
siivonek 746ae8ab85 [mip] WIP Implement mip functions. 2022-02-09 12:55:15 +02:00
Marko Viitanen c6b9e19b2f [mrl] Fix kvz_intra_build_reference_inner() top reference building for mrl 2021-12-08 15:00:27 +02:00
Marko Viitanen 05e55f7fea [mrl] Simplify and fix kvz_intra_build_reference_inner() for mrl cases 2021-12-08 14:39:47 +02:00
Marko Viitanen 04cb32be91 [mrl] Use kvz_intra_build_reference_inner() with MRL since WPP fixes have been made there 2021-12-08 11:39:20 +02:00
siivonek 3a81a389c3 [mrl] Fix issues transmitting multi ref idx during search. Change multi ref idx type to uint. 2021-12-06 19:23:57 +02:00
siivonek 54505e0250 [mrl] Fix warnings. 2021-11-29 20:55:39 +02:00
siivonek 675e8b2d83 [mrl] Fix extra reference length in LCU bottom edge. Disable trace origins in valgrind test. 2021-11-29 17:11:41 +02:00
siivonek a0cfb625be [mrl] Fix extra ref line length. Fix error where un-initialized ref line index was passed. 2021-11-29 17:11:40 +02:00
siivonek b83d7687dc Fix assert. 2021-11-29 17:11:40 +02:00
siivonek 65cf515070 Fix MRL to work when inter coding is enabled. 2021-11-29 17:11:40 +02:00
siivonek 0dc25b86e2 Fix invalid memory read. 2021-11-29 17:11:40 +02:00
siivonek 9cce86ff61 Fix MRL behaviour on left LCU edge. Pass additional left edge reference buffers to reference building for MRL. 2021-11-29 17:11:39 +02:00
siivonek ddd0474c21 Fix filter error in block reconstruction when MRL is used. Disable PDPC during block reconstruction if MRL is used. Fix error in reference building. 2021-11-29 17:11:39 +02:00
siivonek 231c6f3e72 Fix top left reference building. 2021-11-29 17:11:39 +02:00
siivonek 54646e7be7 Disable intra reference filtering if MRL is used. 2021-11-29 17:11:39 +02:00
siivonek eb32f40bd9 Another fix for reference building. 2021-11-29 17:11:39 +02:00
siivonek b0a4f3345a Fix top left reference building when MRL enabled. Fix reference line extension when MRL enabled. 2021-11-29 17:11:38 +02:00
siivonek c616d3bf8a Fix the inner case of reference building when MRL is used. 2021-11-29 17:11:38 +02:00
siivonek a2a1a2a1a8 Fix mistakes in MRL related reference building. 2021-11-29 17:11:38 +02:00
siivonek 54e5a2181d [mrl] Fix rebase mistake. Disable use of PDPC if MRL is used. 2021-11-29 17:11:28 +02:00
siivonek 511ce4991b [mrl] Pass multi_ref_idx to generic angular and DC prediction funcs. Fix some outdated comments. 2021-11-29 17:02:27 +02:00
siivonek ea04feaaca Add MRL handling to reference building. 2021-11-29 16:59:55 +02:00
Marko Viitanen 3fda2dd6c8 [cleanup] Fix some warnings 2021-11-29 16:31:09 +02:00
Joose Sainio ce175c503f [cclm] remove unnecessary calculation of the downsample luma reference 2021-11-26 08:12:37 +02:00
Joose Sainio 85ff5f23b1 [cclm] Fix accessing elements beyond the CU array
# Conflicts:
#	src/intra.c
2021-11-26 08:12:25 +02:00
Joose Sainio 80ddb60ccf [cclm] fix cclm when deblocking is enabled 2021-11-26 08:12:25 +02:00
Joose Sainio f030158703 [cclm] Fix search and parameter generation for CCLM 2021-11-26 08:12:17 +02:00
Joose Sainio d9875a3d92 [cclm] fix trying cclm on the upper level 2021-11-26 08:11:54 +02:00
Joose Sainio 7187678526 [cclm] Only do cclm search when it is enabled and add test for cclm 2021-11-26 08:11:53 +02:00
Joose Sainio 70f6afff4f [cclm] Search should be working
still has duplicate code and inefficiencies, but the actual search *should*
be working.
2021-11-26 08:09:54 +02:00
Joose Sainio 91877ef2c4 [cclm] fix condition for selecting the data from frame buffer and not ctu 2021-11-26 08:09:54 +02:00
Joose Sainio ecc55c9edf [cclm] align ref pixel generation code and add comments 2021-11-26 08:09:53 +02:00
Joose Sainio 677bf1edcb [cclm] linear transform 2021-11-26 08:09:53 +02:00
Joose Sainio 4e8c9043a1 [cclm] CCLM parameter calculation *should* work correctly 2021-11-26 08:09:53 +02:00
Joose Sainio 93c02644c8 [cclm] WIP fix parameter calculation and add calling to the functions 2021-11-26 08:09:53 +02:00
Joose Sainio ef5a205faa [cclm] WIP: initial implementation of the cclm parameter calculation function 2021-11-26 08:09:52 +02:00
Marko Viitanen 54eaba3dee Fix merge issues and license texts 2021-11-23 08:46:06 +02:00
Marko Viitanen 885570e181 Merge branch 'master' of https://github.com/ultravideo/kvazaar 2021-11-22 22:11:32 +02:00
Marko Viitanen 57883369ca Change all the license texts in source headers and LICENSE file to 3-clause BSD, closes #302
* All now have the same exact text string
2021-10-13 15:22:46 +03:00
Ari Lemmetti c6b33c7b92 [SIMD] Move PDPC condition out of strategy 2021-09-06 21:20:51 +03:00
Ari Lemmetti 46cf9b6871 [SIMD] Make strategy out of PDPC for planar and DC 2021-09-06 21:20:51 +03:00
Joose Sainio 3a73abd264 [jccr] disable jccr for blocks when tr-depth != depth, i.e. 64×64 2021-09-06 11:28:32 +03:00
Joose Sainio 072b84711a [jccr] fix 64×64 CUs 2021-09-06 11:28:20 +03:00
Joose Sainio 042b5078d8 [jccr] WIP initial implementation
Add somekind of search for joint chroma residual coding.
Bitstream is currently correct but prediction is incorrect because the jccr
is actually not used in the search.

Hard coded to be enabled
2021-09-06 11:28:08 +03:00
Marko Viitanen 3516972237 [LMCS] Move LMCS mapping / inverse to the source LCU data 2021-05-18 21:22:22 +03:00
Marko Viitanen 178d62bde3 [LMCS] Move LMCS data structures under the frame 2021-05-12 11:42:34 +03:00
Marko Viitanen 0c5e1db0fa Fix wpp chroma bug 2020-12-15 22:59:22 +02:00
Marko Viitanen 071fe7fd51 Limit the top-right intra references when wpp is turned on
Chroma hash still fails.
2020-12-15 22:33:32 +02:00
Marko Viitanen bddfb47a55 Merge remote-tracking branch 'remotes/kvazaar_github/master' 2020-09-25 11:49:11 +03:00
Ari Lemmetti f31dddc019 Bypass inverse quantization and inverse transform when trying early skip 2020-04-10 16:02:09 +03:00
Marko Viitanen 94d89f03c7 Added cfg variable intra_smoothing_disabled and some cleanup 2019-11-20 08:38:33 +02:00
Pauli Oikkonen 979d66031c Create a strategy out of intra_pred_filtered_dc 2019-11-19 14:50:31 +02:00
Marko Viitanen 28dc4fa2ed Fix intra MPM selection 2019-09-05 09:39:13 +03:00
RLamm 60be6d411c Intra filtering fixed at least for luma. All intra modes output valid luma (hashes match), but chroma is still broken. 2019-08-30 16:14:00 +03:00
RLamm 83ac39094a Use new PDPC filtering for planar and DC modes 2019-08-29 12:51:34 +03:00
Ari Lemmetti 2343958a14 Fix transform split for small luma blocks 2019-08-24 21:50:17 +03:00
Ari Lemmetti 800fc8644d Reset CBFs because CBFs might have been set earlier for depth earlier. 2019-08-24 21:49:33 +03:00
Marko Viitanen 5bebb18943 Change intra filtering according to VTM6 2019-08-23 08:56:35 +03:00
Marko Viitanen dfa5621024 Intrapred cleanup 2019-07-16 14:23:10 +03:00
Marko Viitanen 8280bd3217 Add channel info to angular_pred and fix the displacement tables.
Also includes 4-tap intra filtering code commented out
2019-07-04 09:35:47 +03:00
Sami Ahovainio 3564b4829e Fixed split context decision. Modified intra mode initialization to match VTM version aa76fc5c04cf43390f43d63f9977bea8ee31997a. 2019-06-12 12:59:16 +03:00
Marko Viitanen 3bdc8ac8d3 Fix intra_chroma_pred_mode and cbf contexts 2019-03-26 09:10:09 +02:00
Marko Viitanen d15f58517f Changed intra coding to use 6 MPM, implemented merge sort and MPM selection 2019-03-20 15:20:31 +02:00
Marko Viitanen e015d7eb2b Fix compiler warnings 2018-10-17 10:43:11 +03:00
Marko Viitanen b6f2c66c73 Fixed intra Most Probable Mode (mpm) derivation to conform VTM 2.1 2018-09-21 10:33:54 +03:00
Marko Viitanen 35fa8e9785 Fix kvz_intra_get_dir_luma_predictor -> Intra working 2018-09-13 12:32:17 +03:00
Marko Viitanen f75b0b11c3 Simplify intra filtered ref pixel selection 2018-09-13 10:09:52 +03:00
Marko Viitanen 82de0fbee7 Switch intra search to use the actual 67 modes 2018-09-13 09:43:45 +03:00
Marko Viitanen 382917bcd3 New table for choosing angular intra filtered references and a small bugfix on the end condition of angular intra 2018-09-13 09:35:55 +03:00
Sami Ahovainio d2291fea83 Intra mode scaling moved from angular prediction to kvz_intra_predict. pdpc implemented in kvz_intra_predict. 2018-08-31 10:01:28 +03:00
Sami Ahovainio 54ebadfc43 Clarifying comments and changes towards WAIP 2018-08-29 16:00:08 +03:00
Sami Ahovainio 42741a2c40 Some changes for PCM and Intra towards VTM 2.0 compatibility. 2018-08-27 09:18:15 +03:00
Marko Viitanen b33aa37484 Enable max_trans_hier_depth values and disable DC and angular filtering 2018-08-14 15:24:21 +03:00
Arttu Ylä-Outinen 8b2483ca1c Combine intra reconstruction functions
Replaces function kvz_intra_recon_lcu_luma and
kvz_intra_recon_lcu_chroma in intra.c with function kvz_intra_recon_cu.
The new function can handle reconstruction for both luma and chroma.
Removes some duplicated code.
2017-05-24 12:07:31 +03:00
Arttu Ylä-Outinen e67fdb853d Move intra leaf TB recon to a separate function
Moves code for intra leaf transform block reconstruction from functions
kvz_intra_recon_lcu_luma and kvz_intra_recon_lcu_chroma to a new
function intra_recon_tb_leaf. Removes some duplicated code.
2017-05-24 12:07:31 +03:00
Arttu Ylä-Outinen 9395867a9a Quantize all colors in a single traversal
Changes kvz_quantize_lcu_residual to process all three colors in
a single traversal of the TU tree.
2017-05-12 16:42:41 +03:00
Arttu Ylä-Outinen cc87e0dcc7 Combine luma and chroma quantization functions
Replaces functions kvz_quantize_lcu_luma_residual and
kvz_quantize_lcu_chroma_residual in transform.c with function
kvz_quantize_lcu_residual. The new function can handle any of the YUV
colors. Removes some duplicated code.
2017-05-12 16:42:41 +03:00
Pierre-Loup Cabarat 2b8ce5e47c Add intra prediction modes encryption 2017-03-06 17:27:39 +01:00
Arttu Ylä-Outinen e78a8dfcf5 Copy the kvz_config passed to encoder_open
The kvz_config struct is created by the user but kvazaar keeps a pointer
to it. It is easy to break things by modifying the configuration outside
kvazaar. In addition, kvazaar modifies the struct even though it is has
a const modifier.

This commit changes the field cfg in encoder_control_t to be a copy of
the kvz_config struct instead of a pointer, removing modifications to
the const struct and allowing users to do whatever they want with it
after opening the encoder.
2017-02-09 13:23:54 +09:00
Ari Lemmetti c31207ea7d Optimize intra reference building
-Add function with reduced logic for the most common case
2016-11-16 18:28:42 +02:00
Arttu Ylä-Outinen 5fb7afe8c4 Add --implicit-rdpcm command line parameter.
Makes it possible to use lossless coding without implicit residual DPCM.
2016-10-03 20:01:55 +09:00
Arttu Ylä-Outinen 5affc0f527 Use implicit RDPCM in lossless mode.
Sets implicit RDPCM flag in SPS when lossy coding is disabled and
applies DPCM to intra residual when prediction mode is horizontal or
vertical.
2016-10-03 19:31:38 +09:00
Arttu Ylä-Outinen 5fbb0a8c27 Fix includes 2016-08-10 13:05:40 +09:00
Arttu Ylä-Outinen ae832cda8c Pack cbf flags in cu_info_t to two bytes.
Reduces size of cu_info_t.
2016-06-16 20:24:19 +09:00
Arttu Ylä-Outinen 2ae260e422 Change width of cells in lcu_t to 4 pixels.
Intra mode info for NxN partition units is now stored in the
corresponding 4x4 cell in lcu_t.cu array.
2016-06-16 18:53:17 +09:00
Ari Koivula 61fc3e87ba Run include-what-you-use fix_includes.py fix_includes.py
The includes should make more sense now and not just happen to compile
due to headers included from other headers.

Used a modified version of IWYU. Modifications were to attribute int8_t
and so on to stdint.h instead of sys/types.h and immintrin.h instead of
more specific headers.

include-what-you-use 0.7 (git:b70df35)
based on clang version 3.9.0 (trunk 264728)
2016-04-01 17:46:55 +03:00
Ari Koivula 4112a4364d Remove g_to_bits table 2016-03-10 15:59:51 +02:00
Ari Lemmetti 62799a9fc3 Create generic strategy of planar prediction 2016-01-12 23:50:47 +02:00
Ari Koivula 947bae24f9 Update Doxygen documentation
Add module information to all header files.

Update all header file documentations to briefly say what they are, and
to use the javadoc format so the brief actually gets included into the
doxygen documentation.

Remove \file from implementation files, in order to not repeat the info
from the header files.

Add files under strategies and tools to Doxygen and update the Doxygen
settings to be just plain better.

Make README be the main page of Doxygen documentation.
2015-12-17 14:05:50 +02:00
Arttu Ylä-Outinen 8db8f3d523 Use macro SUB_SCU where possible.
Replaces expressions like (x & 0x3f) with SUB_SCU(x).
2015-11-18 11:16:26 +02:00
Arttu Ylä-Outinen 9532d79adb Add macros for indexing cu array in lcu_t.
- Adds macros LCU_GET_CU and LCU_GET_CU_AT_PX to cu.h.
- Replaces accesses to the cu array of lcu_t by calls to these macros.
2015-11-18 11:16:26 +02:00
Ari Lemmetti 0816fbea2c Create generic strategy of blit function 2015-11-04 10:07:25 +02:00
Ari Lemmetti 54e8b346a3 Add intra strategy. Move angular prediction there. 2015-10-08 12:36:05 +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 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
Arttu Ylä-Outinen 3a10e9e3e0 Prefix all non-static symbols with "kvz_". 2015-08-26 13:02:28 +03:00
Arttu Ylä-Outinen f7f17a060c Rename pixel_t to kvz_pixel. 2015-07-02 16:58:28 +03:00
Ari Koivula 7a551bece5 Fix coverity warning.
- Remove dead code.
2015-05-05 09:29:40 +03: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 ded6fd9ee8 Renamed typedef pixel to pixel_t. 2015-03-04 16:35:53 +02:00
Ari Koivula a0767a76d2 Rename struct vector2d to vector2d_t. 2015-03-04 14:01:16 +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 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
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 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 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 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 e591e89ade Add prediction mode to chroma reconstruction parameters.
- Just like in luma.
2014-10-03 11:36:56 +03:00
Ari Koivula bfa399c8fc Fix compiler warnings.
- Non-parenthesized parameter in a macro.
- Unused variables.
- Wrong const qualifiers.
- Signed/unsigned comparison.
2014-09-22 10:04:57 +03:00
Ari Koivula c5fa824347 Rebase transform split search. 2014-09-08 14:13:59 +03:00
Ari Lemmetti f88c3b6f37 Removed unnecessary if (both branches did the same thing) 2014-08-20 11:54:35 +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 2456c65822 Replace accesses to picture->cu_array with picture_get_cu and picture_get_cu_const 2014-06-05 10:41:58 +02:00
Laurent Fasnacht 642564b6fb Remove unused variable 2014-05-28 15:04:45 +02:00
Ari Koivula a6962e2974 Separate intra transform coding to luma and chroma functions. 2014-05-22 09:40:34 +03:00
Ari Koivula 4751a3744b Fix intra mode search not doing boundary smoothing for DC.
- Move the boundary smoothing to the prediction function to make sure it's not
  forgotten.
2014-05-19 16:23:17 +03:00
Ari Koivula f9a603e4ea Move intra mode search form intra module to search module.
- Make the actual intra prediction function global.

- Move the rdo stuff to rdo module.
2014-05-19 16:12:02 +03:00
Ari Koivula 846b608125 Add transform split recursion to intra reconstruction. 2014-05-19 15:58:54 +03:00
Ari Koivula f0e990905e Remove chroma mode "36".
- It's an unnecessary chore to handle this special case everywhere (it means
  chroma_mode == intra_mode). Better just to use the actual mode.
2014-05-14 19:56:35 +03:00
Ari Koivula 9147b7acbf Split residual quantization to separate luma and chroma function. 2014-05-14 11:19:48 +03:00
Laurent Fasnacht 6c6adf18c7 Refactor encoder_state 2014-05-07 11:47:31 +02:00
Ari Koivula 4490e8afd6 Remove depth dimension from picture->cu_array.
- It isn't used for anything anymore.

- It was used in the past to hold information during search, but now that
  information is held in lcu_t structs.
2014-04-28 10:18:22 +03:00
Laurent Fasnacht 19b1642aa2 Removed all cabac parameters (cabac is part of encoder_state) 2014-04-22 11:46:53 +02:00
Laurent Fasnacht 5fea5875a5 Huge refactoring
Split some parts of encoder_control into encoder_state
(idea: encoder_control is immutable)

Goal is to allow multiple substreams in the future.
2014-04-22 10:39:12 +02:00
Ari Koivula 0704c43836 Address clang-analyzer warning about undefined behavior in intra.
- Related to issue #35.
2014-04-17 18:43:08 +03:00
Laurent Fasnacht 3396264f3c Moved g_cur_lambda_cost into encoder_control.cur_lambda_cost 2014-04-17 12:00:21 +02:00
Laurent Fasnacht 4a9c239027 Remove g_bitdepth 2014-04-17 11:13:13 +02:00
Ari Koivula b35f33b3da Address warnings about unused values.
- Related to issue #35.
2014-04-16 18:05:03 +03:00
Laurent Fasnacht 78c579053a encoder_control should be const in nearly all the code 2014-04-14 10:56:06 +02:00
Ari Koivula 29787efbbc Fix whitespace.
Fix some whitespace issues from a merge.
2014-04-11 17:06:21 +03:00
Marko Viitanen de1c0b7e8d Fixed intra RDO to include mode bitcost 2014-04-10 16:28:41 +03:00
Marko Viitanen a657cf84d9 Insert most probable (predicted) intra modes to RDO search 2014-04-10 15:59:36 +03:00
Marko Viitanen 05169d9476 Added more modes to RDO mode selection in intra search
Now 8 best modes for sizes 4x4 and 8x8 are added to RDO checking and 3 for other block sizes as before, only applies when --rd 2
2014-04-10 15:20:49 +03:00
Ari Koivula 5fa5e01e05 Merge branch 'intra-cleanup'
Conflicts:
	src/intra.c
	src/intra.h
	src/search.c
2014-04-10 13:51:14 +03:00