Commit graph

127 commits

Author SHA1 Message Date
Marko Viitanen c9cbdd5dc3 Added couple of ToDo comments for large CTU support 2018-08-17 09:37:14 +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
Marko Viitanen 7abadaafe4 Disable CTU splitting and configure max CTU sizes to 64x64 2018-07-27 11:04:21 +03:00
Marko Viitanen 37b5ce3d33 Change configurations to ease VVC debugging, max-BT-depth = 0 2018-07-26 16:12:11 +03:00
Marko Viitanen 5d4a2a004f Remove depentent slice, wpp/tile and scaling list parameters from PPS 2018-07-26 10:43:21 +03:00
Marko Viitanen 31a6cbfe6d Disable sign bit hiding 2018-07-26 10:41:35 +03:00
Marko Viitanen e84276f7f6 Fixed version string 2018-07-26 08:17:55 +03:00
Marko Viitanen e38109d102 Enable QTBT and set correct general_profile_idc for Next 2018-07-25 12:24:17 +03:00
Marko Viitanen 079ca9b8b2 Disable tile/wpp flags in slice header 2018-07-25 11:19:53 +03:00
Marko Viitanen b0ac7002e5 Disable VPS 2018-07-25 11:02:09 +03:00
Marko Viitanen c5bf6a3774 Bugfix: add missing parameters to WRITE_U 2018-07-25 10:18:48 +03:00
Marko Viitanen 9befe35961 Modify slice header to conform VVC 2018-07-25 10:17:42 +03:00
Marko Viitanen 95ce1e1a25 Modify parameter sets to conform VVC 2018-07-25 10:05:11 +03:00
Miika Metsoila 62b44efaa4 Write the encoding tier (main/high) into the bitstream 2018-06-14 12:41:03 +03:00
Arttu Ylä-Outinen a343f6d587 Prepare for delta QPs at CU-level
- Replaces lcu_dqp_enabled with max_qp_delta_depth in encoder_control_t.
- Fixes set_cu_qps so that it can handle quantization groups of
  arbitrary size.
- Fixes computation of QP predictors so that it works for quantization
  groups of arbitrary size.
2018-06-13 15:36:19 +03:00
Arttu Ylä-Outinen 7155dd0db7 Add negative references to L1 list
Changes reference index list creation so that the negative references
are added to L1 in addition to L0 when biprediction is enabled and no
reordering of pictures is done. Biprediction can now be used with the
low-delay GOP structure.
2018-02-07 14:54:52 +02:00
Miika Metsoila ebba0a4f01 Test if input conforms to it's level's limits (excluding bitrate) 2017-11-08 16:15:41 +02:00
Arttu Ylä-Outinen 841597e123 Fix picture and slice types
Changes handling of intra pictures for --gop=8 so that every picture
with POC divisible by the intra period is intra. The first picture is
IDR and the rest of the intra pictures are CRA. POC is not reset at CRA
pictures. The leading pictures that follow the CRA picture are changed
to RASL so they are allowed to refer to pictures before the CRA picture.

Changes inter slice types to P when the L1 reference list is empty and
to B otherwise.

In all-intra, all pictures are now IDR pictures with POC zero.
2017-10-20 13:35:26 +03:00
Arttu Ylä-Outinen 20aea8df63 Fix POCs when using --gop=8
When using --gop=8 with an intra period greater than one, a single POC
would be skipped before every intra frame. This commit fixes the problem
by turning the intra frames into BLA frames with leading pictures when
using --gop=8.
2017-09-19 09:31:58 +03:00
Arttu Ylä-Outinen bc47fe94af Drop thread queue debug code 2017-08-11 14:18:12 +03:00
Eemeli Kallio 8674c0f5ee Added paremeter for band and edge sao. 2017-08-11 11:57:09 +03:00
Arttu Ylä-Outinen b74e0458fd Set inter transform depth to zero
Sets max_transform_hierarchy_depth_inter to 0 in SPS. This saves some
bits because split_transform_flag does not need to be coded for inter
blocks.

When SMP and AMP blocks are enabled the depth is set to 1 instead.
Otherwise inter split flag would default to 1 for SMP and AMP blocks,
resulting in an unnecessary transform split.
2017-06-08 10:08:20 +03:00
Arttu Ylä-Outinen edfbd6f122 Add field lcu_dqp_enabled to encoder_control_t
Delta QPs for LCUs are enabled when either ROI coding or rate control is
enabled. Having a single field is simpler than always checking whether
ROI or rate control is enabled.
2017-05-11 12:13:47 +03:00
Marko Viitanen 95effb00d0 Disable TMVP in frames with zero L0 references 2017-02-13 15:19:24 +02:00
Marko Viitanen e538a94eda Enable TMVP with B-frames 2017-02-13 15:19:22 +02: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
Ari Koivula 52904d3e9f Add --slices=tiles and --slices=wpp
This encapsulates tiles or WPP rows into their own slices, making
it possible to send them as soon as they are done, instead of waiting
for the other substreams to finish and coding the substream offsets
in the slice header.
2017-01-31 15:44:23 +02:00
Ari Koivula 0d4d0e869c Add support for independent slices
Not used yet, but they work.
2017-01-31 15:11:50 +02:00
Ari Koivula 46ae382498 Fix bugs with slice header
These fixes allow more than one slice to be used to code a picture.
- Use correct number of bits to code the slice segment address.
- Don't offset_len_minus1 for slices without substreams.
2017-01-31 14:01:59 +02:00
Ari Koivula f1fc0de2bf Write slice headers to the parent stream
Appending to the child stream doesn't work is the child is a leaf
slice state.

Simplifies flow by removing distinction between tile and slice. Now
that slice headers are written in the parent stream, there is zero
difference between tiles and slices from bitstream point of view.
2017-01-31 13:55:05 +02:00
Ari Koivula 04cd875b2c Move substream finalization to LCU coding job
Having some of the termination bits in the LCU coding and some in the
substream finalization was needlessly confusing. Doing substream
finalization directly after LCU coding makes it easy to verify that the
finalization is done correctly.

Removes one job per WPP row from the job queue.

Removes kvz_cabac_flush, because I don't like bits being put into the
bitstream implicitly. Better to have it all in the open.
2017-01-31 13:01:57 +02:00
Ari Koivula ead490b7b7 Write a new slice NAL for every slice 2017-01-31 12:36:18 +02:00
Ari Koivula cd496bf50b Move first_nal_in_au to encoder_state->frame
Needed for writing NALs from encoder_state_write_bitstream_children
2017-01-31 12:28:28 +02:00
Ari Koivula 4a0121ac42 Add --roi parameter
Adds region of interest coding capability.

Works by reading a file of delta QP values which will then be applied
to each frame at LCU level.
2017-01-26 09:14:14 +02:00
Arttu Ylä-Outinen ee518e8ac4 Take header bits into account in rate control 2017-01-11 15:53:55 +09:00
Arttu Ylä-Outinen 71633889ce Enable CU QP delta when using rate control
When rate control is enabled, enable cu_qp_delta_enabled_flag in PPS
with diff_cu_qp_delta_depth set to 0. Also adds code for writing the QP
deltas and a new cabac context.
2017-01-09 01:24:23 +09:00
Arttu Ylä-Outinen 435c387357 Refactor rate control
- Defines MIN_LAMBDA and MAX_LAMBDA constants.
- Moves resetting state->frame->cur_gop_bits_coded to rate_control.c.
- Changes gop_allocate_bits to return the number of bits allocated like
  pic_allocate_bits does.
2017-01-09 01:24:23 +09: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
Ari Koivula 4ec039004b Add monochrome encoding
Write bitstream without chroma when encoding with --input-format=P400.
This reduces bitstream size by 0-1 %, compared to coding monochrome in
420 format, and speeds up encoding slightly due to not processing
chroma.
2016-08-25 20:15:26 +03:00
Ari Koivula 48ccc26839 Add --input-format and --input-bitdepth
Adds reading of 10 bit input for 10-bit encoding.
2016-08-24 19:20:53 +03:00
Marko Viitanen 5ae1c595f2 Fixed slice_temporal_mvp_enabled_flag and disabled TMVP with tiles
- slice_temporal_mvp_enabled_flag should be signalled also with non-IDR I-slices
2016-08-10 14:51:41 +03:00
Marko Viitanen 5326519182 TMVP cleanup and const qualifier fixes 2016-08-10 14:10:43 +03:00
Marko Viitanen f40907260d Added config parameter for TMVP and cmdline option --no-tmvp
- Enabled by default
 - Cannot be used with GOP at the moment
2016-08-10 14:09:29 +03:00
Marko Viitanen c664bc8cf7 Added flag collocated_ref_idx to the slice header 2016-08-10 14:09:28 +03:00
Marko Viitanen 2956bdb379 Added flag slice_temporal_mvp_enabled_flag 2016-08-10 14:09:19 +03: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 2113b0182d Enable PPS-level tq bypass flag with --lossless.
Sets transquant_bypass_enable_flag to true in PPS when --lossless is
given.
2016-08-03 14:25:08 +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