Commit graph

59 commits

Author SHA1 Message Date
Marko Viitanen 78363ccab0 Replace bitstream->simulation with cabac->only_count 2021-09-14 17:44:56 +03:00
Marko Viitanen 19ff5a21ca [alf] Fix a problem with alf and not updating the cabac contexts
* Added a bitstream coding simulation after LCU search
2021-09-14 10:03:23 +03:00
Marko Viitanen ac2032eb65 Fixing P/B frame headers and debug output formatting 2020-09-28 14:58:07 +03:00
Marko Viitanen 63760ca0cf Use kvz_cabac_bins_verbose flag to control cabac debug printing 2018-09-26 12:01:23 +03:00
Ari Koivula 4467506ef1 Add missing kvz_ prefix 2017-01-31 18:38:02 +02:00
Ari Koivula ed3bd898fd Remove Exp-Golomb lookup table
This table takes 256kB and isn't used very much. Au revoir!
2017-01-31 18:31:05 +02:00
Ari Koivula a9e45efcfc Add a fast lane for byte-aligned bitstream writes
The CABAC engine only writes to the bitstream when it has a full byte.
These writes are also always byte-aligned, so there is no need to even
check for stream alignment.

Speedup was around 3% with ultrafast and low QP.
2016-12-23 17:01:44 +02: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 4876879b82 Add IWYU pragmas 2016-03-31 12:33:34 +03:00
Ari Koivula fa1af14637 Fix includes to include global.h first everywhere 2016-01-22 15:07:49 +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
Ari Koivula f1ac0e6bc2 Rename _DEBUG to KVZ_DEBUG 2015-09-15 13:04:03 +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 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 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 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 4a7b86a43b Make g_exp_table statically allocated.
Removes the need to free the table.
2015-07-02 16:14:52 +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 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 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
Laurent Fasnacht 0fe080ad0a bitstream_tell 2014-05-05 08:53:06 +02:00
Laurent Fasnacht fd89b9af76 New functions: bitstream_append and bitstream_clear 2014-04-24 08:38:18 +02:00
Laurent Fasnacht d01e3ae67f bitstream is a union, and is statically in encoder_control structure 2014-04-17 11:13:12 +02:00
Laurent Fasnacht 94a48fc153 added const in bitstream 2014-04-17 11:13:11 +02:00
Laurent Fasnacht 2286175378 nal are now written to a bitstream, not a FILE* 2014-04-17 11:13:09 +02:00
Laurent Fasnacht 677fc2ec7d Fix prototype of create_bitstream in bitstream.h 2014-04-17 11:13:08 +02:00
Laurent Fasnacht 288a4537ba const bit_table for exp_golomb 2014-04-15 16:09:52 +02:00
Laurent Fasnacht 7897f7d5cd Remove counter from debug version of WRITE_*
It's not very useful, and create unneeded noise when trying to make diffs
2014-04-15 11:37:45 +02:00
Marko Viitanen 04f09a2bc8 Merge pull request #25 from lfasnacht/memory_bitstream
Changed bitstream handling to allow in-memory bitstream.
2014-04-14 11:29:25 +03:00
Laurent Fasnacht 418e6eae51 Changed bitstream handling to allow in-memory bitstream. 2014-04-14 08:13:00 +02:00
Laurent Fasnacht 520dbdd86d Change return type of free_exp_golomb to be void, and add it to bitstream.h 2014-04-14 06:41:27 +02:00
Panu Sjövall c8f629495d Remove unnecessary buffer from bitstream.
- Writing encoded data to file is done in bitstream_put one byte at a time and nal_write only writes the packet headers
2014-03-25 11:46:56 +02:00
Ari Koivula 47af5207c5 Remove dead code and fix white space. 2014-03-06 18:35:17 +02:00
Ari Koivula 91ff5ff086 Merge branch 'jeeb-cleanup'
Conflicts:
	src/encoder.c
	src/encoder.h
2014-02-03 17:13:13 +02:00
Jan Ekström ac8fbc0519 Move initialization away from main() 2014-02-03 16:53:51 +02:00
Marko Viitanen ffd00695c7 Better cleanup of allocated memory at exit
Using valgrind all the leaks were tracked and fixed.
2014-02-03 11:52:43 +02:00
Ari Koivula 77339efa57 Add COPYING file and add boilerplate for copyright and GPLv2 to every file. 2014-01-24 12:48:48 +02:00
Ari Koivula 627762dcd8 Refactor: Fix include guards.
- Remove _ from the beginning of include guards because that prefix is
  for the implementation.
- Move include guards to the beginning of file.
- Unify the syntax.
2013-09-19 10:36:24 +03:00
Ari Koivula adf619f9dd Refactor: Update file comments. 2013-09-18 18:01:20 +03:00
Marko Viitanen a1621bf900 Refactor: bitstream.h/.c renaming 2013-09-18 14:11:23 +03:00
Ari Koivula 44a5498e30 Reorder includes to avoid hidden dependencies.
- Includes of global.h have been moved to headers because most headers
  require stdint.h.
- Includes required by the header have been moved from the .c to the header.
- Spaces have been added between includes to distinguish classes of includes.
2013-09-18 12:29:23 +03:00
Marko Viitanen 3a53654cf4 Added intra prediction, image reconstruction and iTr and iQ. Fixed a bug with negative SE values 2013-03-07 17:42:00 +02:00
Marko Viitanen 10fe0f8018 Added new function to free/clear pointers and added new types of SLICE_TRAIL_N NAL units to get multiple I-pictures in the stream. 2013-02-21 16:45:22 +02:00