Commit graph

99 commits

Author SHA1 Message Date
Ari Koivula 355340067f Modify search_tree to take a pixel coordinate instead of CU coordinate.
I need at least 4x4 resolution for NxN. It's simpler to just use pixel
coordinates.
2014-02-05 18:43:34 +02:00
Ari Koivula ea312082a4 Simplify the prediction mode search recursion.
No need to be so clever for something this simple.

I moved the cost initialization outside the recursing function because it
relied on the clever recursion to work. It should eventually be moved to its
own function that also initializes all the other fields just to be safe. I
didn't do that yet because I want to do it per-LCU and these functions are
still working on per-frame basis.
2014-02-05 18:43:34 +02:00
Marko Viitanen 337a565232 Better lambda cost implementation (from HM12)
- Lambda array changed to double as in HM
 - Needs updating when GOP / B-pictures are used
2014-02-05 15:57:16 +02:00
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 80da15df4d Adjusted cost calculation of CU split
Quick testing shows BD-rate change of -14% (LP) and -4% (AI) with 600 frames of BQMall using QP 22,27,32,37.
2014-01-31 12:31:51 +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 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 77339efa57 Add COPYING file and add boilerplate for copyright and GPLv2 to every file. 2014-01-24 12:48:48 +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 b897562ef8 Enable NxN. 2014-01-03 16:46:02 +02:00
Ari Koivula 4c84a35391 Add part size to intra_set_block_mode. 2014-01-03 13:01:13 +02:00
Ari Koivula d9cdab052b Add NxN mode selection to search_intra. 2014-01-03 10:21:59 +02:00
Ari Koivula 5083e6db10 Change cu_info.intra into an array to support NxN split. 2014-01-02 15:13:20 +02:00
Ari Koivula ee92fc341c Move intra and inter search into their own functions. 2013-12-17 11:32:28 +02:00
Marko Viitanen 06ab158c55 Enable using intra blocks in inter frame by default 2013-11-13 08:46:32 +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
Marko Viitanen 601d64f04f Merge branch 'merge-mode' 2013-10-25 15:40:58 +03:00
Ari Koivula 2d26175293 Fix bug that causes lambda_cost to be ignored in search_best_mode. 2013-10-22 19:02:00 +03:00
Ari Koivula 8f5567ba6f Add full motion vector search back. 2013-10-22 19:00:36 +03:00
Marko Viitanen b20b583d9b Moved all residual/coeff functionality to encode_block_residual() 2013-10-22 16:27:50 +03:00
Ari Koivula ecf10a9717 Add an estimate of the cost of the motion vector to motion search. 2013-10-22 14:09:20 +03:00
Ari Koivula a81cc45b97 Comment and clean up hexagon search. 2013-10-22 12:28:43 +03:00
Ari Koivula 27f5555b1c Change hexacon_search to take const pointers. 2013-10-18 17:51:53 +03:00
Ari Koivula c7ca3a6b44 Clarify parameter passing for hexagon_search.
Handling mv as a local struct instead of pointer had no performance impact,
but it makes the parameter passing clearer so I'm keeping it.
2013-10-18 17:45:42 +03:00
Ari Koivula afc84b4ef8 Change motion vectors search to accept vector2d structs. 2013-10-18 17:33:18 +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 f9a99b9111 Clean up inter search. 2013-10-18 15:57:43 +03:00
Ari Koivula 0f95bec907 Clean up control flow of best search.
Conflicts:

	src/search.c
2013-10-18 15:23:17 +03:00
Ari Koivula 2fa2098236 Remove unnecessary guards against 0 cost. 2013-10-18 15:20:45 +03:00
Ari Koivula 99d4a669c3 Fix bug with partitioning search. 2013-10-18 10:45:38 +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
Ari Koivula 0c3bd7e223 Move SAD calculations to picture module. 2013-10-11 15:37:58 +03:00
Ari Koivula 69d1f6d1e2 Clean up the code.
- Rename get_block_sad to calc_sad and handle special cases in general_sad.
- Remove old search functions because I don't want to update or test them.
2013-10-11 15:19:21 +03:00
Ari Koivula be501f720c Reorder conditions. 2013-10-11 14:11:49 +03:00
Ari Koivula 235b1ec0bc Add rest of the quadrants for sad calculation.
- All tests pass.
- Movement vectors that don't overlap with the frame aren't handled yet.
2013-10-11 12:41:07 +03:00
Ari Koivula b58a6387ee Clean up the code a bit. 2013-10-11 11:04:49 +03:00
Ari Koivula 7e6c9aefe8 Add handling of more cases to sad calculation. 2013-10-10 21:51:27 +03:00
Ari Koivula 4e36992752 Move basic SAD functions to picture-module. 2013-10-10 21:49:41 +03:00
Ari Koivula 0e078b2d18 Rethink SAD-calculation. 2013-10-10 21:49:20 +03:00
Ari Koivula 1fcb452479 Simplify reference buffer calculation. 2013-10-10 21:48:55 +03:00
Ari Koivula 684f6d548c Start adding sad calculation outside frame.
Works for top-left corner. 2/9 tests pass.
2013-10-10 16:11:07 +03:00
Ari Koivula ea30bf0126 Fix SAD calculation to return correct value in non-overlapping case. 2013-10-09 16:08:56 +03:00
Ari Koivula cdcb56dd4a Add special case for the 0,0 vector to hexagon search. 2013-10-08 16:11:00 +03:00
Ari Koivula 8910037936 Add hexagon-based motion vector search. 2013-10-08 13:38:03 +03:00
Marko Viitanen 351817d008 Fixed intra block selection (always selected 64x64 which was not in search) 2013-10-08 12:13:52 +03:00
Ari Koivula 61eb3b3b71 Improve cu-visualization by arranging them to picture dimensions and colors. 2013-10-01 20:46:10 +03:00
Ari Koivula 9bd35fcdb1 Remove split attribute from cu_info.
It is no longer used.
2013-09-30 16:42:23 +03:00
Ari Koivula f58e418a1a Fix out-of-bounds detection in mv-search.
All blocks were intra because no movement vectors could be found.
2013-09-30 10:47:05 +03:00