Commit graph

62 commits

Author SHA1 Message Date
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 9fcfba637f Remove duplicated inline functions 2016-03-10 15:28:31 +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 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 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 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
Ari Koivula f73bef0941 Remove unused include. 2014-05-16 16:09:59 +03: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 356c17e0de Add missing break in bitstream_writebyte 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 288a4537ba const bit_table for exp_golomb 2014-04-15 16:09:52 +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 13398e011b Fix create_bitstream() 2014-04-14 10:23:09 +02:00
Laurent Fasnacht baba299bb8 Obviously a void function cannot return NULL 2014-04-14 09:11:15 +02: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
Laurent Fasnacht 1e03cf8ac1 Add a function to free g_exp_table.
Even though g_exp_table has to be global (used in #define), it's better to avoid requiring other module to directly access it.
2014-04-04 14:26:39 +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 db3b96b90b Fix compiler warnings for VS2010 /W4 in bitstream.c and cabac.c.
- Working towards issue #11.
2014-02-21 17:28:11 +02:00
Luca Barbato ae59116945 bitstream: Add correct header for htonl 2014-02-21 14:59:50 +01:00
Ari Koivula 91ff5ff086 Merge branch 'jeeb-cleanup'
Conflicts:
	src/encoder.c
	src/encoder.h
2014-02-03 17:13:13 +02:00
Ari Koivula 478740cf21 Add missing new lines to ends of files. 2014-02-03 16:54:03 +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
Marko Viitanen 60cb42735e Fixed issues on compiling the encoder on linux 2013-11-13 08:46:31 +02:00
Ari Koivula e770f77564 Remove unnecessary preprocessor defines from project settings.
- _WIN32 and _WIN64 are defined by windows headers.
- _DEBUG is defined when debug libs are used.
- _CONSOLE does nothing.
2013-09-23 17:32:07 +03:00
Ari Koivula adf619f9dd Refactor: Update file comments. 2013-09-18 18:01:20 +03:00
Marko Viitanen db3d8d8a6e Refactor: bitstream.c full cleanup 2013-09-18 16:03:47 +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 dce892dce8 Merge branch 'master' of Z:/Work/HEVC_encoder into fador
Conflicts:
	.gitignore
2013-09-09 12:11:09 +03:00
Marko Viitanen 1b007efe43 Fixed bug with 8x8 split_flag coding. 4x4 chroma still produces wrong data. 2013-05-16 15:27:54 +03:00
Marko Viitanen a737e8660c New search.c/.h files and changed department name on all files 2013-04-16 11:23:03 +03:00