Commit graph

217 commits

Author SHA1 Message Date
Joose Sainio 153afc6739 Merge branch 'improve-intra-search' 2022-05-30 13:35:46 +03:00
Marko Viitanen b5dce4c94e Rename all files containing "kvazaar" or "kvz" to "uvg266" and "uvg" 2022-04-28 14:26:05 +03:00
Marko Viitanen f14ea35ec9 Rename kvz_ to uvg_ 2022-04-28 14:18:09 +03:00
Joose Sainio a88553b206 fix jccr and improve intra parameter passing 2022-03-24 11:11:33 +02:00
Joose Sainio 0be443d309 WIP: Merge remote-tracking branch 'remotes/kvz_github/master' into update-cabac-during-search 2022-03-21 11:03:46 +02:00
Marko Viitanen 3a447e09c2 [trskip] Allow changing the max tr-skip size 2021-12-02 22:56:07 +02:00
Ari Lemmetti ec2f4e0bac Use double for RD costs in most places 2021-12-02 20:00:15 +02:00
Marko Viitanen 3fda2dd6c8 [cleanup] Fix some warnings 2021-11-29 16:31:09 +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
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 29d86aea84 [jccr] cmdline option 2021-09-06 11:28:08 +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 5604b6f946 [cleanup] remove all crypto related stuff, fix warnings, move estimate.m to tools/ 2021-07-27 09:27:51 +03:00
Joose Sainio cfffd7166c Use correct context for calculating coeff costs for transform skip 2021-06-07 13:06:03 +03:00
Marko Viitanen 4594bf0ca8 Merge branch 'lmcs_chroma' 2021-06-02 15:05:04 +03:00
Marko Viitanen 5babb14ee7 [LMCS] Use chroma scaling 2021-06-01 12:17:03 +03:00
Joose Sainio f9de8ebc4f Merge branch 'master' into '4x4-rd'
# Conflicts:
#   src/encoder.c
#   tests/test_intra.sh
2021-05-28 11:43:55 +00: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
Joose Sainio a998f3ed74 [transform-skip] Convert the HEVC transfrom skip to VVC
For some reason transform skip uses QP MAX(52, QP) and the coeffs are
no longer shifted
2021-04-30 10:55:23 +03:00
Joose Sainio e8eab326fb Update context selection to match VVC 2021-04-23 10:51:01 +03:00
Joose Sainio b2076d3b39 Enable chroma scaling
WIP: user defined scaling array
2021-03-16 10:31:26 +02:00
Arttu Makinen 7098a94a6f Implemented implicit MTS.
Added selection of implicit MTS to command parameters.
Updated the transform selection to support implicit MTS.
2021-02-11 15:11:15 +02:00
Arttu Makinen c5570abe1b Removed 'emt' variable from cu_info_t and changed 'emt' globally to 'mts' for consistency. 2021-02-10 12:08:05 +02:00
Arttu Makinen 2e7c342645 Implemented DCT2, DST7, and DCT8 transforms, and search for selecting transform for MTS. Using MTS results mismatch for luma component. 2021-02-02 11:09:43 +02:00
Marko Viitanen 54b8fd054d Fix Chroma QP scaling issue 2020-10-02 15:40:23 +03: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
Ari Lemmetti aa0ade3f65 Cast values to unsigned to make UBSan not trigger due to left-shifting negatives 2020-03-16 19:52:34 +02:00
Ari Lemmetti 800fc8644d Reset CBFs because CBFs might have been set earlier for depth earlier. 2019-08-24 21:49:33 +03:00
Sami Ahovainio 82fb80ab6e Fixed couple of if-clauses which still used the old intra mode range. 2018-09-17 08:56:43 +03:00
Arttu Ylä-Outinen c438bb4a19 Add an option to skip CABAC for residual costs
Adds command line option --fast-residual-cost=<limit>. When QP is below
the limit, estimates the cost of coding the residual coefficients from
the sum of absolute coefficients. Skipping CABAC is not worth it with
high QPs because there are fewer coefficients so CABAC is not as slow.
2018-07-16 12:31:20 +03:00
Arttu Ylä-Outinen fb462b25ef Fix transform skip for inter
The transform skip flag in cu_info_t was stored under the intra
substruct even though transform skip can be used for inter as well. This
caused bitstream errors. Fixed by moving the flag out of the substruct.
2018-03-20 11:01:33 +02:00
Arttu Ylä-Outinen c74ede148b Fix CBF flags for 4x4 luma blocks
CBF flags were not being propagated to the upper level from blocks of
size 4x4.
2018-01-18 10:36:25 +02:00
Arttu Ylä-Outinen 0a69e6d18f Fix selection of transform function for 4x4 blocks
DST function was returned for inter luma transform blocks of size 4x4
even though they must use DCT. Fixed by checking the prediction mode of
the block in addition to whether it is chroma or luma.
2018-01-18 10:36:25 +02:00
Ari Lemmetti 14892fda00 Replace simple coefficient cost estimation with CABAC. Substantial improvement.
Approximation proved to be too inaccurate while not giving actually that much speedup.
2017-12-10 01:23:48 +02:00
Arttu Ylä-Outinen 95775a1645 Change coefficient storage order
Changes coefficient storage order to a zig-zag order. Reduces
unnecessary copying of coefficients to temporary arrays.
2017-05-12 16:46:57 +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 1e58fd6b16 Split kvz_quantize_lcu_residual
Splits kvz_quantize_lcu_residual to two functions that handle the TU
tree recursion and quantization of a single TU.
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
Arttu Ylä-Outinen 51786eda67 Drop redundant fields in encoder_control_t
Some of the fields in encoder_control_t were simply copies of the
corresponding fields in kvz_config. This commit drops the copied fields
in favor of using the fields in encoder_control_t.cfg directly.
2017-02-09 14:05:28 +09: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
Arttu Ylä-Outinen 640ff94ecd Use separate lambda and QP for each LCU
Adds fields lambda, lambda_sqrt and qp to encoder_state_t. Drops field
cur_lambda_cost_sqrt from encoder_state_config_frame_t and renames
cur_lambda_cost to lambda.
2017-01-09 01:24:23 +09:00
Ari Lemmetti 6f5d7c9e06 Move SSD to strategies 2016-10-21 15:07:23 +03: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 2a946bd88e Rename encoder_state_t.global to frame
"Frame" is more accurate than "global" since when OWF is used, encoder
states for each frame have their own struct.
2016-08-10 13:22:36 +09:00
Arttu Ylä-Outinen 5fbb0a8c27 Fix includes 2016-08-10 13:05:40 +09:00
Arttu Ylä-Outinen 1dc94663c3 Bypass transform and quantization with --lossless.
When --lossless is given, set cu_transquant_bypass_flag for every CU and
bypass transform and quantization by directly copying reference pixels
to reconstruction and the residual to coefficients.
2016-08-03 14:25:08 +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
Arttu Ylä-Outinen 49677810b5 Rename config module to cfg.
Prevents a conflict with config.h and src/config.h so that the config.h
generated by configure is included in global.h. Fixes problems with
large input files on 32-bit systems.
2016-01-25 12:26:46 +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 cf347e33c4 Move dequant to strategies. Copy generic to AVX2 as well. 2015-10-23 19:53:50 +03:00
Ari Lemmetti cad2ea9d6e Move quantize_residual to quant strategies. 2015-10-23 17:03:15 +03:00
Ari Lemmetti ef0ad292ef Add quantization strategy. 2015-10-02 16:17:02 +03:00
Arttu Ylä-Outinen 173b70b53f Rename SLICE_* enum constants to KVZ_SLICE_*. 2015-09-28 10:30:56 +03:00
Arttu Ylä-Outinen 3a10e9e3e0 Prefix all non-static symbols with "kvz_". 2015-08-26 13:02:28 +03:00
Marko Viitanen 8409317bd9 Fixed rebasing errors for 10bit branch 2015-08-11 14:56:45 +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
Arttu Ylä-Outinen f7f17a060c Rename pixel_t to kvz_pixel. 2015-07-02 16:58:28 +03:00
Marko Viitanen a7328ab008 Fixed tr-skip cost calculation 2015-03-24 12:40:01 +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 a0767a76d2 Rename struct vector2d to vector2d_t. 2015-03-04 14:01:16 +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 5f24c6b73d Make normal dequant use runtime sign-hiding configuration. 2015-01-24 21:29:25 +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 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 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 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 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 47244a15c3 Merge branch 'dct-optimizations'
Conflicts:
	src/strategies/avx2/dct-avx2.c
	src/strategies/generic/dct-generic.c
2014-10-02 13:45:21 +03:00
Ari Lemmetti 9407610555 Moved DCT / DST matrices to dct-generic.c 2014-10-02 13:24:30 +03:00
Ari Koivula 46b6b1243b Add --rd=3 mode and enable searching of intra depth 0.
- intra_build_reference_border was overflowing at depth 0 because it uses
  arrays just large enough to accommodate 32x32 transforms, which is the
  biggest transform.
- For similar reasons search_intra_rough doesn't work at depth 0.
- The --rd=3 mode tries all modes with transform search. It also works without
  rough search so it was used to test depth 0 search. If --rd=3 is not on intra
  split at depth 0 is not searched for.

Conflicts:
	src/search.c
2014-09-11 10:54:41 +03:00
Ari Koivula c5fa824347 Rebase transform split search. 2014-09-08 14:13:59 +03:00
Ari Lemmetti 0beb278f5b Partial butterfly strategy is now called DCT strategy. Made changes to transform functions in preparation for optimizations.
-Moved fast_forward_dst and fast_inverse_dst to DCT strategies
2014-07-31 13:25:28 +03:00
Ari Lemmetti faccc4f09b Partial butterfly functions now utilize the strategy selector 2014-07-31 13:25:28 +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
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 aee9bf2875 Re-add rdo control to transformskip decision.
- It got left out when rewriting the function.
2014-05-14 12:39:23 +03:00
Ari Koivula 9147b7acbf Split residual quantization to separate luma and chroma function. 2014-05-14 11:19:48 +03:00
Ari Koivula e947bd4c0e Clean up trskip decision code and remove old code.
- You can define structs inside functions! This changes everything!!

- Bitstream changes a little bit compared to old trskip decision. Bdrate
  change is insignificant though.
2014-05-13 22:00:04 +03:00
Ari Koivula a3cdee9ec5 Move new trskip decision to a function. 2014-05-13 21:59:00 +03:00
Ari Koivula 2ff713ccb2 Add new implementation for trskip decision. 2014-05-13 21:57:45 +03:00
Ari Koivula 8b8da6f493 Make luma and chroma use the same quantization function.
- Only thing not working was transform skip.
2014-05-13 21:57:23 +03:00
Ari Koivula f0bfcedba2 Clean up coeff reconstruction code. 2014-05-13 21:56:10 +03:00