Commit graph

128 commits

Author SHA1 Message Date
Ari Koivula f6c97712b2 Add lcu_set_intra_mode. 2014-02-27 13:02:24 +02:00
Ari Koivula faea7caaf4 Remove unnecessary copying of reconstructed pixels from init_lcu_t.
The reconstructed pixels don't exist yet.
2014-02-27 11:58:32 +02:00
Ari Koivula 869ca5aa58 Add copying of LCU coefficients to search. 2014-02-27 11:56:16 +02:00
Marko Viitanen 7a1bf6b17d Intra fix: encode_transform_tree() call was missing and depth was not set 2014-02-27 10:53:01 +02:00
Marko Viitanen 8ae453551d Fixed cu type definition and reconstruction function calling
reconstruction could have been called when no search was done
2014-02-26 17:50:09 +02:00
Ari Koivula 879c355d9d Add work_tree_copy_down. 2014-02-26 17:31:26 +02:00
Ari Koivula 9faecd375a Add work_tree_copy_up. 2014-02-26 16:08:43 +02:00
Ari Koivula 1450d0edf8 Add lcu_t copying to main CU array. 2014-02-26 16:08:43 +02:00
Ari Koivula e651078e78 Fix compilation for rebase.
Conflicts:
	src/search.c
2014-02-26 16:08:15 +02:00
Marko Viitanen b4181dd398 Fixed problems with the new structure and commented out old search 2014-02-26 14:57:57 +02:00
Marko Viitanen bf21e4d019 Modified encode_transform_tree() to use new structure 2014-02-26 14:28:02 +02:00
Marko Viitanen 43abe296d0 Fixed intra headers and implemented intra search in the new structure 2014-02-26 12:45:43 +02:00
Marko Viitanen fb9e3ad1d2 Implemented proper intra mode cost calculation
This does not currently affect the search primary search defining the used block sizes, only the refining second intra search. Gain 1.9% BD-rate on All Intra 600f of BQMall QP 22,27,32,37.
2014-02-26 12:26:54 +02:00
Ari Koivula b067b2f802 Add lcu_t initialization. 2014-02-26 10:58:20 +02:00
Ari Koivula 7e520a85c4 Add skeleton/plan for LCU based search.
The plan is to replace the dumb search we are doing now with proper sequential
search that is encapsulated inside data structure that holds all temporary
search data for the LCU.
2014-02-25 13:06:22 +02:00
Luca Barbato 0cafa8105f search: Conditionally compile conditionally used functions 2014-02-21 15:07:15 +01:00
Luca Barbato e03049782c search: Staticize functions 2014-02-21 15:07:15 +01:00
Luca Barbato 934a4e3b88 whitespace: Drop trailing spaces 2014-02-21 15:03:35 +01:00
Marko Viitanen 8490ff1a9d Disabled NxN mode
Something must be done to enable better selection of NxN blocks in order to gain BD-rate with this mode.
2014-02-19 14:36:17 +02:00
Marko Viitanen 3618eab72a Added lambda cost when using reference frames with refIdx > 0
Because selecting references "far away" costs bits, this should help with the issue that multiple reference frames actually increases coded bits with no quality gain.
2014-02-19 14:34:36 +02:00
Marko Viitanen 28aa20df12 Basic search for multiple reference frames 2014-02-17 09:58:10 +02:00
Ari Koivula 8e63dd29bb Fix compiler warnings for VS2010 /W4 in intra.c.
- Working towards issue #11.
- Removed intra_get_block_mode as unused.
- Removed unused parameters from functions. Many of them were remnants from
  earlier data structures and earlier features of HEVC that have been removed.
- Lots of implicit conversions from larger types to smaller ones. I tried to
  avoid turning all of them to explicit ones this time and opted for changing
  the original data type instead. Had to do it in few cases though to stop the
  changes from propagating too widely.
2014-02-14 17:15:54 +02:00
Marko Viitanen 5c4c47b07a Fixed and enabled Intra NxN
NxN block needs reference border from previous NxN blocks and to do this, the structure was changed a bit.
2014-02-11 18:31:41 +02:00
Ari Koivula c18b6f53e1 Fix regression that disabled intra prediction in inter frames.
The intent was to remove the flag that enabled intra in inter frames, as that
is not really that usefull anymore, but it ended up disabling intra instead.
2014-02-11 11:57:54 +02:00
Marko Viitanen c202c8caac Fixed motion vector cost calculation a bit
Cost was calculated a bit wrong causing non-zero motion vectors on totally black video.
2014-02-10 20:30:55 +02:00
Ari Koivula bc3b80b9e4 Fix compiler warnings for VS2010 /W4 in intra.c.
- Working towards issue #11.
2014-02-10 16:50:10 +02:00
Marko Viitanen 27ffb98d08 Fixed an issue with NxN using uninitialized y_recdata
NxN is still disabled by default as it's being fixed.
2014-02-07 15:33:58 +02:00
Ari Koivula 0188aa8631 Fix compiler warnings for VS2010 /W4 in search.c.
- Working towards issue #11.
- Implicit conversions to explicit ones.
2014-02-06 14:40:18 +02:00
Ari Koivula 2614aa0fe4 Fix compiler warnings for VS2010 /W3.
- Working towards issue #11.
- Change lambda cost multiplier for intra NxN to from 256 to 4.
- Add 0.5 to the lambda multipliers so it's rounded instead of truncated.
2014-02-06 11:04:23 +02:00
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