Commit graph

61 commits

Author SHA1 Message Date
Ari Koivula 7bb9c25447 Remove duplicate implementation of intra_build_reference_border.
The search_buildReferenceBorder was an ugly hack and a place for bugs to hide
that should never have existed. Now it doesn't.

The change reduces PSNR a little, but also reduces the bitrate, when the
expected result was to have no change in either. I'm guessing there was still
some bug in the search_buildReferenceBorder, but the bug could also be in
intra_build_reference_border. Will have to do more testing to be sure, but
having one place to look at will be better than having two.
2014-02-03 18:35:11 +02:00
Marko Viitanen ac8141b328 Fixed a bug in intra search and some memory leaks, changed version to 0.2.1
Intra search was using faulty border data and selected modes were a bit random. Around -0.5% (LP) and -2% (AI) change in BD-rate was seen in limited testing conditions.
2014-01-31 16:54:43 +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 e33655fde5 Remove debug stuff and disable intra NxN in preparation for a merge.
- Re-enable intra search based on reconstructed image.
  - This didn't have as much of an effect as I thought it would.
- Re-enable SAO and deblocking.
- Disable NxN searching. (4x4 luma coding is still broken)
2014-01-29 16:45:37 +02:00
Ari Koivula 9f855c16db Fix building of reference border in the bottom of the frame.
- Don't write to the top-left corner during construction of left border,
  because that is handled later that is handled later.
2014-01-29 14:22:31 +02:00
Ari Koivula ca454b67df Fix intra filtering for 4x4 luma blocks. 2014-01-29 14:22:31 +02:00
Ari Koivula 81b51f17d8 Reimplement intra_build_reference_border to support NxN.
New implementation uses precalculated tables to look up number of reference
pixels available in coded CUs. Otherwise it works just like the previous
version.

- NxN mostly works. Prediction appears to be almost correct but there is a
  slight error in the exact values, probably related to filtering.
2014-01-29 14:22:30 +02:00
Ari Koivula 71a996f50f Work on reconstruction and searching.
- Set part-size for Inter.
- Change to Intra Only mode for testing.
- Many small changes here and there. Should have been separate commits probably, but too late.
- Disable SAO and deblocking to be able to see problems with reconstruction better.
2014-01-29 14:18:01 +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
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 c3f4a628af Try to fix stuff related to NxN intra transform splitting. 2014-01-03 16:47:27 +02:00
Ari Koivula 4c84a35391 Add part size to intra_set_block_mode. 2014-01-03 13:01:13 +02:00
Ari Koivula 5083e6db10 Change cu_info.intra into an array to support NxN split. 2014-01-02 15:13:20 +02:00
Marko Viitanen 601d64f04f Merge branch 'merge-mode' 2013-10-25 15:40:58 +03:00
Ari Koivula c0f06fdb9e Change intra prediction to use SAD instead of SATD.
Inter uses only SAD and we don't have mechanisms for comparing these two.
2013-10-21 17:42:55 +03:00
Marko Viitanen c44f0ff540 Refactoring: all int16_t pixel info in intra to pixel typedef 2013-10-18 16:19:17 +03:00
Ari Koivula d74d4e4ef1 Refactor intra sad calculation functions.
- Move SATD (hadamart) code to it's own functions.
- Generate functions for fixed block sizes with macros, as if using templates.
- Define new interface with function pointer cost_16bit_nxn_func that different
  cost functions can use.
- Hide fixed size block cost functions with getters.
2013-10-16 17:09:03 +03:00
Ari Koivula b8dd664026 Move all 8-bit pixels into new pixel typedef. 2013-10-15 14:36:30 +03:00
Ari Koivula 04f1dde8a1 Fix overwriting of motion vectors during search.
- Makes everything besides search to only use the bottom most layer of the
  picture.cu_array structure.
2013-09-25 16:21:51 +03:00
Ari Koivula 8d5dd67f76 Refactor: Change name of CU_info.CU to cu_array. 2013-09-20 12:47:53 +03:00
Marko Viitanen 3a9449e5e0 Refactor: intra.c full cleanup 2013-09-19 16:21:53 +03:00
Ari Koivula adf619f9dd Refactor: Update file comments. 2013-09-18 18:01:20 +03:00
Ari Koivula de447ee18b Refactoring: intra.h renaming. 2013-09-18 15:13:45 +03:00
Marko Viitanen a018567854 Refactor: picture.h renaming. 2013-09-18 14:58:46 +03:00
Marko Viitanen 0bf4f65a55 Refactor: encoder.h renaming 2013-09-18 14:49:01 +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
Ari Koivula 5acb280407 Change "ToDo" to "TODO".
Visual Studio recognized only TODO.
2013-09-09 14:22:53 +03:00
Marko Viitanen b3a724afb0 Added codes for inter coding 2013-08-02 16:35:30 +03:00
Marko Viitanen 06fd1d6fa9 Fix for sign bit hiding, not working yet 2013-06-12 15:41:57 +03:00
Marko Viitanen 4c1e015c5f Work on Deblocking filter 2013-05-22 17:27:15 +03:00
Marko Viitanen fd2e25727c Fixed transform split bug by moving intra prediction to the transform-quant loop 2013-05-21 15:57:22 +03:00
Marko Viitanen 2a70231c06 Fixed Chroma 4x4 2013-05-20 17:26:57 +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 3942bbda51 Added short-term ref list parameters to allow HM10.0 to decode it properly 2013-05-07 10:36:04 +03:00
Marko Viitanen 003093b1ef Added inter.c/.h 2013-04-24 10:35:27 +03:00
Marko Viitanen e8f04b32f1 Bug fixes, this version produces bit-perfect output 2013-04-18 14:37:56 +03:00
Marko Viitanen 58ba4b306c Fixes for search-tree, almost working, some visible errors 2013-04-18 14:04:15 +03:00
Marko Viitanen ae506ceaf5 Moved all the intra-search functionalities to search-tree, does not work completely. 2013-04-17 17:08:52 +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
Marko Viitanen 01c7f267d7 Added CPUID fetch assembly functions (x86 and x64) 2013-04-10 16:55:31 +03:00
Marko Viitanen 560917a532 Fixed 8x8 luma encoding and some of 4x4 chroma by disabling modes using different scanning order and changing 4x4 DST to DCT in chroma 2013-04-09 15:59:12 +03:00
Marko Viitanen 9888eaf9a4 Added and fixed x64 build 2013-04-05 14:55:58 +03:00
Marko Viitanen d5ab9f0437 Fixed partsize context model initialization 2013-04-04 15:08:28 +03:00
Marko Viitanen a059965855 Fixed DC-prediction (filtering) 2013-04-03 13:56:07 +03:00
Marko Viitanen d0be802ced Added filter.c/.h and deblocking functions 2013-04-03 11:05:07 +03:00
Marko Viitanen 55cc82925d Code refactoring to allow transform split (and 64x64 prediction with 32x32 transform) 2013-03-25 17:17:24 +02:00
Marko Viitanen 78894b05d1 Fixed dequantization and made preparations for smaller blocks. This version produces bit-perfect output. 2013-03-21 17:12:55 +02:00
Marko Viitanen fa4c4acbe5 Fixed transform subdiv context derivation and changed block-allocations to use LCU_WIDTH 2013-03-21 11:56:19 +02:00
Marko Viitanen 05bbd4daee Added support for 16x16 luma coeff coding and disabled PCM 2013-03-20 17:27:47 +02:00