Commit graph

124 commits

Author SHA1 Message Date
Ari Koivula 51ba80513b Centralize resource deallocation for encmain.
- CppCheck was complaining about unreleased resources for FILE*. They weren't
  really because they get flushed and closed when program exits normally, but
  let's close them anyway.
2014-04-17 11:58:03 +03:00
Laurent Fasnacht 9901c38dd5 scalinglist in independent file 2014-04-16 10:25:16 +02:00
Laurent Fasnacht e135a88fb5 Remove encoder_control.cqmfile 2014-04-15 14:21:25 +02:00
Laurent Fasnacht 486768fc79 scalinglist privatization 2014-04-14 13:39:28 +02:00
Marko Viitanen 0e7a5057d1 Merge pull request #26 from lfasnacht/warnings_fix
Fix warnings and compile with -Werror
2014-04-14 11:30:37 +03:00
Laurent Fasnacht 89ef1161c4 Fix warnings 2014-04-14 09:37:39 +02:00
Laurent Fasnacht 418e6eae51 Changed bitstream handling to allow in-memory bitstream. 2014-04-14 08:13:00 +02:00
Ari Koivula 83d5a4753d Move input resolution to the same line as internal resolution.
The \n must have been left there by accident.
2014-04-11 16:55:08 +03:00
Ari Koivula 0b5c357795 Move all output to stderr.
It has to be in stderr to allow piping bitstream from stdout.
2014-04-11 16:50:59 +03:00
Ari Koivula 115872b300 Add total running time to output. 2014-04-11 12:42:37 +03:00
Marko Viitanen c38ec1aa10 Added commandline option for RDO (--rd) 2014-04-09 12:29:15 +03: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
Ari Koivula 61ae195af7 Resolve warnings about assignments within conditions.
- Working towards issue #11.
2014-04-04 13:02:06 +03:00
Ari Koivula 46d33d3945 Resolve unsigned/signed mismatch warnings.
- Working towards issue #11.
2014-04-04 12:56:23 +03:00
Laurent Fasnacht b371a8bb59 Use realloc correctly
Quote from MALLOC(3) manpage:

The realloc() function returns a pointer to the newly allocated memory, which is suitably aligned for  any  kind  of
variable and may be different from ptr, or NULL if the request fails.
2014-04-04 06:37:35 +02:00
Ari Koivula f380e7d4b0 Check for malloc failure. 2014-04-03 15:38:17 +03:00
Ari Koivula 313466fdff Remove unused variables.
- Working towards issue #11.

- Either removed or redefined variables to not cause a warning.
2014-04-03 15:37:59 +03:00
Marko Viitanen a14fb14e33 Added new commandline parameter --no-transform-skip 2014-04-02 14:49:48 +03: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 eacad83ff9 Fix encoder reconstruction output for non multiple of 8 sized input.
Output changed so that only pixels within the conformance window are output.
2014-03-19 13:24:01 +02:00
Ari Koivula 319174258b Increment version number and update usage information. 2014-03-12 18:06:41 +02:00
Marko Viitanen 17b9c9d0b7 Unified all uses of --input-res to use 'x' as delimiter
Addresses issue #20
2014-03-12 15:20:57 +02:00
Marko Viitanen d2d877933a bugfix: only fclose recout if it was opened 2014-03-11 09:09:43 +02:00
Ari Koivula 1b2705a042 Add video dimensions to the filename of encoder reconstruction. 2014-03-10 18:10:50 +02:00
Ari Koivula 965d8c377a Make encoder reconstruction obey --debug. 2014-03-10 18:10:49 +02:00
Ari Koivula 7e507fd615 Add --input-res CLI parameter.
- Also set default width and height to 0 because it makes no sense to assume
  dimensions. It's kind of like defaulting to the most common altitude when
  the altimeter is broken.
- Add config_validate to have a place for checks on overall cfg state.
2014-03-10 16:09:33 +02:00
Ari Koivula a644848b36 Add --seek CLI parameter.
Related to issue #12.

Motivation for adding this is that the syntax for frame accurate seeking in
ffmpeg is a little cumbersome. Also it's kind of a standard feature I guess.
2014-03-10 15:14:56 +02:00
Marko Viitanen a935aa5d96 Untabified encmain.c and nal.c 2014-03-10 12:10:40 +02:00
Marko Viitanen 9a4b0d2cc7 Added newline after printing of real video frame size 2014-03-10 10:16:30 +02:00
Ari Koivula 1cf03cfb37 Add --no-rdoq parameter. 2014-03-05 17:02:21 +02:00
Ari Koivula 73f5c3b80e Fix compiler warnings for VS2010 /W4 in config.c and encmain.c.
- Working towards issue #11.
- Widened datatypes for cfg struct members that take values from atoi to full
  ints so that bounds checking can be done after parsing without overflow.
2014-02-21 17:28:11 +02:00
Luca Barbato 47677af690 Drop remaining unused variables 2014-02-21 15:07:16 +01:00
Luca Barbato 934a4e3b88 whitespace: Drop trailing spaces 2014-02-21 15:03:35 +01:00
Ari Koivula 5760c79272 Fix crash with dimensions that are not multiples of 8.
The clean up of input parsing and encoder initialization code had caused the
real source input dimensions to be used for array initialization, instead of
the dimensions modified to be multiples of the smallest coding unit.
2014-02-21 12:48:33 +02:00
Marko Viitanen bb1ae0da62 Limited maximum number of reference frames to 15
This now complies with the specification (when using only L0 reference list)
2014-02-20 11:09:09 +02:00
Marko Viitanen db689227f4 Increased maximum ref frame count to 16 and set default to 3 2014-02-19 15:09:17 +02:00
Marko Viitanen 478552ea00 Added commandline parameter for reference frame number
Also updated README and usage with the new parameter
2014-02-18 17:45:54 +02:00
Marko Viitanen a6e8373349 Fixed crash issue on windows when cqmfile was not specified
fclose(cqmfile) crashed on windows when cqmfile was NULL
2014-02-14 14:38:53 +02:00
Yusuke Nakamura a860bbc7f9 config: Add --cqmfile to use custom quantization matrices from a file.
The coefficients in a matrix are stored in up-right diagonal order.

The following indicates the default matrices specified in the spec.

INTRA4X4_LUMA
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16

INTRA4X4_CHROMAU
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16

INTRA4X4_CHROMAV
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16

INTER4X4_LUMA
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16

INTER4X4_CHROMAU
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16

INTER4X4_CHROMAV
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16,
16, 16, 16, 16

INTRA8X8_LUMA
16, 16, 16, 16, 17, 18, 21, 24,
16, 16, 16, 16, 17, 19, 22, 25,
16, 16, 17, 18, 20, 22, 25, 29,
16, 16, 18, 21, 24, 27, 31, 36,
17, 17, 20, 24, 30, 35, 41, 47,
18, 19, 22, 27, 35, 44, 54, 65,
21, 22, 25, 31, 41, 54, 70, 88,
24, 25, 29, 36, 47, 65, 88, 115

INTRA8X8_CHROMAU
16, 16, 16, 16, 17, 18, 21, 24,
16, 16, 16, 16, 17, 19, 22, 25,
16, 16, 17, 18, 20, 22, 25, 29,
16, 16, 18, 21, 24, 27, 31, 36,
17, 17, 20, 24, 30, 35, 41, 47,
18, 19, 22, 27, 35, 44, 54, 65,
21, 22, 25, 31, 41, 54, 70, 88,
24, 25, 29, 36, 47, 65, 88, 115

INTRA8X8_CHROMAV
16, 16, 16, 16, 17, 18, 21, 24,
16, 16, 16, 16, 17, 19, 22, 25,
16, 16, 17, 18, 20, 22, 25, 29,
16, 16, 18, 21, 24, 27, 31, 36,
17, 17, 20, 24, 30, 35, 41, 47,
18, 19, 22, 27, 35, 44, 54, 65,
21, 22, 25, 31, 41, 54, 70, 88,
24, 25, 29, 36, 47, 65, 88, 115

INTER8X8_LUMA
16, 16, 16, 16, 17, 18, 20, 24,
16, 16, 16, 17, 18, 20, 24, 25,
16, 16, 17, 18, 20, 24, 25, 28,
16, 17, 18, 20, 24, 25, 28, 33,
17, 18, 20, 24, 25, 28, 33, 41,
18, 20, 24, 25, 28, 33, 41, 54,
20, 24, 25, 28, 33, 41, 54, 71,
24, 25, 28, 33, 41, 54, 71, 91

INTER8X8_CHROMAU
16, 16, 16, 16, 17, 18, 20, 24,
16, 16, 16, 17, 18, 20, 24, 25,
16, 16, 17, 18, 20, 24, 25, 28,
16, 17, 18, 20, 24, 25, 28, 33,
17, 18, 20, 24, 25, 28, 33, 41,
18, 20, 24, 25, 28, 33, 41, 54,
20, 24, 25, 28, 33, 41, 54, 71,
24, 25, 28, 33, 41, 54, 71, 91

INTER8X8_CHROMAV
16, 16, 16, 16, 17, 18, 20, 24,
16, 16, 16, 17, 18, 20, 24, 25,
16, 16, 17, 18, 20, 24, 25, 28,
16, 17, 18, 20, 24, 25, 28, 33,
17, 18, 20, 24, 25, 28, 33, 41,
18, 20, 24, 25, 28, 33, 41, 54,
20, 24, 25, 28, 33, 41, 54, 71,
24, 25, 28, 33, 41, 54, 71, 91

INTRA16X16_LUMA
16, 16, 16, 16, 17, 18, 21, 24,
16, 16, 16, 16, 17, 19, 22, 25,
16, 16, 17, 18, 20, 22, 25, 29,
16, 16, 18, 21, 24, 27, 31, 36,
17, 17, 20, 24, 30, 35, 41, 47,
18, 19, 22, 27, 35, 44, 54, 65,
21, 22, 25, 31, 41, 54, 70, 88,
24, 25, 29, 36, 47, 65, 88, 115

INTRA16X16_CHROMAU
16, 16, 16, 16, 17, 18, 21, 24,
16, 16, 16, 16, 17, 19, 22, 25,
16, 16, 17, 18, 20, 22, 25, 29,
16, 16, 18, 21, 24, 27, 31, 36,
17, 17, 20, 24, 30, 35, 41, 47,
18, 19, 22, 27, 35, 44, 54, 65,
21, 22, 25, 31, 41, 54, 70, 88,
24, 25, 29, 36, 47, 65, 88, 115

INTRA16X16_CHROMAV
16, 16, 16, 16, 17, 18, 21, 24,
16, 16, 16, 16, 17, 19, 22, 25,
16, 16, 17, 18, 20, 22, 25, 29,
16, 16, 18, 21, 24, 27, 31, 36,
17, 17, 20, 24, 30, 35, 41, 47,
18, 19, 22, 27, 35, 44, 54, 65,
21, 22, 25, 31, 41, 54, 70, 88,
24, 25, 29, 36, 47, 65, 88, 115

INTER16X16_LUMA
16, 16, 16, 16, 17, 18, 20, 24,
16, 16, 16, 17, 18, 20, 24, 25,
16, 16, 17, 18, 20, 24, 25, 28,
16, 17, 18, 20, 24, 25, 28, 33,
17, 18, 20, 24, 25, 28, 33, 41,
18, 20, 24, 25, 28, 33, 41, 54,
20, 24, 25, 28, 33, 41, 54, 71,
24, 25, 28, 33, 41, 54, 71, 91

INTER16X16_CHROMAU
16, 16, 16, 16, 17, 18, 20, 24,
16, 16, 16, 17, 18, 20, 24, 25,
16, 16, 17, 18, 20, 24, 25, 28,
16, 17, 18, 20, 24, 25, 28, 33,
17, 18, 20, 24, 25, 28, 33, 41,
18, 20, 24, 25, 28, 33, 41, 54,
20, 24, 25, 28, 33, 41, 54, 71,
24, 25, 28, 33, 41, 54, 71, 91

INTER16X16_CHROMAV
16, 16, 16, 16, 17, 18, 20, 24,
16, 16, 16, 17, 18, 20, 24, 25,
16, 16, 17, 18, 20, 24, 25, 28,
16, 17, 18, 20, 24, 25, 28, 33,
17, 18, 20, 24, 25, 28, 33, 41,
18, 20, 24, 25, 28, 33, 41, 54,
20, 24, 25, 28, 33, 41, 54, 71,
24, 25, 28, 33, 41, 54, 71, 91

INTRA32X32_LUMA
16, 16, 16, 16, 17, 18, 21, 24,
16, 16, 16, 16, 17, 19, 22, 25,
16, 16, 17, 18, 20, 22, 25, 29,
16, 16, 18, 21, 24, 27, 31, 36,
17, 17, 20, 24, 30, 35, 41, 47,
18, 19, 22, 27, 35, 44, 54, 65,
21, 22, 25, 31, 41, 54, 70, 88,
24, 25, 29, 36, 47, 65, 88, 115

INTER32X32_LUMA
16, 16, 16, 16, 17, 18, 20, 24,
16, 16, 16, 17, 18, 20, 24, 25,
16, 16, 17, 18, 20, 24, 25, 28,
16, 17, 18, 20, 24, 25, 28, 33,
17, 18, 20, 24, 25, 28, 33, 41,
18, 20, 24, 25, 28, 33, 41, 54,
20, 24, 25, 28, 33, 41, 54, 71,
24, 25, 28, 33, 41, 54, 71, 91

INTRA16X16_LUMA_DC
16

INTRA16X16_CHROMAU_DC
16

INTRA16X16_CHROMAV_DC
16

INTER16X16_LUMA_DC
16

INTER16X16_CHROMAU_DC
16

INTER16X16_CHROMAV_DC
16

INTRA32X32_LUMA_DC
16

INTER32X32_LUMA_DC
16
2014-02-13 17:47:21 +09:00
Ari Koivula c7d236c8ed Update usage information.
- Removed tabs from the README.
2014-02-11 16:33:50 +02:00
Yusuke Nakamura af25c36ac4 config: Fix fullrange option parsing and so that it matches what x264 CLI does. 2014-02-11 19:12:04 +09:00
Marko Viitanen 5f79f30b8c Added preliminary support for multiple reference frames
L0 reference list is being updated and sent to bitstream but actual usage of other than default reference might break something.
2014-02-10 11:32:48 +02:00
Yusuke Nakamura 3e96df2a81 Write Kvazaar's version and encoding options in an user data unregistered SEI. 2014-02-07 10:53:18 +09:00
Yusuke Nakamura 430e475954 config: Add --aud to use access unit delimiters. 2014-02-07 07:35:15 +09:00
Yusuke Nakamura a29b6f7c92 Add some options to specify VUI parameters. 2014-02-07 06:50:43 +09:00
Marko Viitanen 4704a6adf4 Added deblock beta/tc checking and allowed range to usage, closes issue #13 2014-02-06 14:33:13 +02:00
Ari Koivula 1d730bd248 Update usage information and version string.
- Change stderr back to text mode. Can't see what harm it should allow us to print
  correct newlines for different platforms.
- Remove copy-pasted function calls from usage printing.
2014-02-05 19:16:44 +02:00
Marko Viitanen 2438386f4b Merge pull request #10 from VFR-maniac/fix
Avoid reading one extra frame at the end of the input file.
2014-02-04 07:35:47 -08:00
Yusuke Nakamura 42908076c2 config: Add --no-sao to disable sample adaptive offset filter. 2014-02-04 23:19:17 +09:00
Yusuke Nakamura f40d9a3e2f config: Add --deblock to specify deblocking parameter offsets divided by
2.
2014-02-04 23:19:17 +09:00