Commit graph

81 commits

Author SHA1 Message Date
Laurent Fasnacht 4a9c239027 Remove g_bitdepth 2014-04-17 11:13:13 +02:00
Laurent Fasnacht 9901c38dd5 scalinglist in independent file 2014-04-16 10:25:16 +02:00
Laurent Fasnacht f47e23cd24 Allow FREE_POINTER to free const xxx * ptr without warning 2014-04-15 11:37:44 +02:00
Laurent Fasnacht 486768fc79 scalinglist privatization 2014-04-14 13:39:28 +02:00
Marko Viitanen e15a86268d Clean up tabs and whitespaces 2014-04-04 16:04:44 +03:00
Ari Koivula 27a3329dfb Remove unreferenced_parameter macro.
- It was a silly hack to selectively silence compiler warnings from VS, but
  there is no point as it causes compiler warnings in GCC.
2014-04-03 15:38:17 +03:00
Laurent Fasnacht ae5c573843 Global defines are now documented with references the specification when possible. Removes some redundancy. 2014-04-01 13:48:17 +02:00
Ari Koivula 319174258b Increment version number and update usage information. 2014-03-12 18:06:41 +02:00
Ari Koivula 409b094acf Try and get NxN to work again.
- Moved NxN search to be done on the same level as other searches, as it's
  really not any different from 2Nx2N.
- Produces working bitstream but reconstruction is different.
2014-03-11 19:19:20 +02:00
Ari Koivula 1cf03cfb37 Add --no-rdoq parameter. 2014-03-05 17:02:21 +02:00
Luca Barbato 934a4e3b88 whitespace: Drop trailing spaces 2014-02-21 15:03:35 +01:00
Luca Barbato b99a25ca89 global: Use defined() in macro checks 2014-02-21 14:59:50 +01:00
Marko Viitanen db689227f4 Increased maximum ref frame count to 16 and set default to 3 2014-02-19 15:09:17 +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 9b993de79b Increase version number.
- Also removes VERSION macro that wasn't used for anything.
2014-02-11 17:01:18 +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
Ari Koivula 4184818322 Fix compiler warnings for VS2010 /W4 in tranform.c.
- Working towards issue #11.
- Lots of implicit conversions to explicit ones.
2014-02-06 14:02:56 +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 a4cd709fc7 Fixed missing includes in MSVC caused by the deletion of stdint.h 2014-02-04 17:23:50 +02:00
Ari Koivula 478740cf21 Add missing new lines to ends of files. 2014-02-03 16:54:03 +02:00
Ari Koivula 5d12706510 Merge branch 'intra_NxN'
Conflicts:
	src/encoder.c

- Chroma RDOQ changes conflicted because I had moved the chroma
  quantization/dequantization to it's own function.
- Merged to master because I want my code to show up in github. =)
  All the old stuff still works, even though NxN doesn't work, so there
  is no reason not to merge anyway.
2014-01-29 17:04:41 +02:00
Ari Koivula 5e2f22f447 Try to fix intra prediction mode coding for NxN.
- Adjust predictor list to take modes from PUs in addition to 2Nx2N CUs.
- Change intra_get_dir_luma_predictor to take PU index instead of CU index.
- Comment prediction encoding now that I've had to look it up.
2014-01-29 13:52:17 +02:00
Marko Viitanen 7a21b9b769 Changed lambda calculation to fix RDOQ issues, RDOQ is now in use by default. 2014-01-28 12:14:43 +02:00
Marko Viitanen 9f70bf74f0 Imported and converted RDOQ from HM 12.0, NOT WORKING YET 2014-01-27 14:34:58 +02:00
Marko Viitanen f5c2292e06 Added simple Makefile and header files needed to compile on linux 2014-01-27 14:34:09 +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 a38a5fd647 Improve transform tree coding.
- Clean up code and comment.
- Change terminology to match H.265 specification where possible.
- Move transform splitting for depth==0 out of the coding part. It's not
  possible to do it here anyway because intra reconstruction is different
  if the transform is split.
- Add checking for transform hierarchy depth when coding split flag.
- Fixes bug with cu_data.tr_depth being set. The CU struct was being reused
  for inter coded CUs, which did not initialize the tr_depth.
2014-01-14 18:39:24 +02:00
Ari Koivula 73fdc35c4f Try to implement 4x4 luma transform coding.
- Doesn't work yet so it's disabled.
- Change encode_transform_coeff to accept PU (Prediction Unit) coordinates
  instead of CU coordinates because CUs are 8x8.
2014-01-09 19:30:54 +02:00
Ari Koivula 61232b466c Move types to more appropriate places. 2013-11-12 12:44:58 +02:00
Ari Koivula 181a044b86 Merge branch 'sao' 2013-11-12 11:59:04 +02:00
Marko Viitanen 93f2b75df7 Fixed a bug in flat scaling list and disabled scaling list by default 2013-11-05 09:41:14 +02:00
Ari Koivula a57b938270 Add new module sao.
- Move sao-stuff not directly related to encoding to sao-module.
- Calculate sao for all LCUs before encoding any of them. This is in
  preparation to doing the reconstruction line at a time instead of
  LCU at a time.
2013-11-04 19:41:01 +02:00
Ari Koivula b6c5c87fb7 Merge branch 'master' into sao
SAO needs to be coded before LCU data has been searched. Searching
has already been moved to happen before encoding in the master branch.

Conflicts:
	src/encoder.c
	src/picture.c
	src/picture.h
2013-11-04 12:44:01 +02:00
Ari Koivula 7bd0902727 Implement fast distortion estimation for sao.
Add function for blitting pixels from one buffer to another.

Several commits have been squashed to this one.
2013-11-04 12:37:37 +02:00
Marko Viitanen 2f53b0aa3a Enabled sign-bit-hiding by default 2013-10-29 13:14:43 +02:00
Ari Koivula 291be9507b Start adding Sample Adaptive Offset capability. 2013-10-25 10:39:42 +03:00
Marko Viitanen 4cec2963ac Fixed transform splitting to allow 64x64 inter blocks 2013-10-22 12:33:11 +03:00
Marko Viitanen c44f0ff540 Refactoring: all int16_t pixel info in intra to pixel typedef 2013-10-18 16:19:17 +03:00
Marko Viitanen dda53f48a7 Refactoring encoder transform/quant related functions, cu_info and picture 2013-10-18 11:41:52 +03:00
Ari Koivula 202aec69f2 Change more 8-bit pixels to pixel typedef. 2013-10-15 16:02:06 +03:00
Ari Koivula b8dd664026 Move all 8-bit pixels into new pixel typedef. 2013-10-15 14:36:30 +03:00
Marko Viitanen 1b2b3c19bb Added option to enable residual coding skip when residual under threshold 2013-10-10 16:31:00 +03:00
Ari Koivula 681975ad4b Fix inter reconstruction for 8x8 blocks and enable 8x8 inter blocks again.
Inter reconstruction was modifying the movement in place when it shouldn't
have. This was causing issues only for the 8x8 blocks, because for larger
blocks the modified movement vector was too far away to be seen by the blocks
below it.
2013-09-30 18:01:21 +03:00
Ari Koivula b1ada6bcd4 Take initial motion vector from last frame. 2013-09-25 19:09:08 +03:00
Ari Koivula a3f2e84587 Redo x64 detection to not rely on predefined macro. 2013-09-23 17:27:17 +03: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
Ari Koivula 19e9b95a71 Refactor: global.h renaming. 2013-09-18 14:51:24 +03:00
Ari Koivula 4f360fcb80 Split MAX_SEARCH_DEPTH to inter and intra versions. 2013-09-18 12:29:23 +03:00
Marko Viitanen c87d3870ce Fixed inter_get_mv_cand and added new define ENABLE_TEMPORAL_MVP 2013-09-18 10:15:05 +03:00