Commit graph

265 commits

Author SHA1 Message Date
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 b155d825be Add tests for movement vectors that are completely out of frame. 2013-10-11 14:11:49 +03:00
Ari Koivula 0df974cb0d Change sad functions to accept negative block widths.
This makes boundary checking clearer.
2013-10-11 14:11:21 +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 22262dbc98 Fix a bug in a test. 2013-10-11 12:38:14 +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 d3561146d8 Change sad-tests to use chars instead of numbers to help with debugging.
1 + 48 is ascii '1' and so on.
2013-10-10 21:50:41 +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 356a0e8a14 Change SAD-test offset.
Using 3 instead of 4 avoids having symmetric negation of the offset, like
-4 and +4. It also makes the expected result easier to calculate by hand.
2013-10-10 15:16:14 +03:00
Ari Koivula 2b4ca9b3e5 Remove tests as post build event from main project.
It wasn't supposed to be there yet.
2013-10-10 14:31:59 +03:00
Ari Koivula 24d9fd7c05 Fix wrong index in sad tests. 2013-10-10 14:04:19 +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 68aa70a49a Add tests for calculating sad outside frame. 2013-10-09 15:31:27 +03:00
Ari Koivula 8719867330 Merge branch 'hexagon' 2013-10-09 12:12:19 +03:00
Marko Viitanen 102c39a396 Bugfix for inter reconstruction: half-pel chroma reused variables 2013-10-09 11:03:38 +03:00
Ari Koivula cdcb56dd4a Add special case for the 0,0 vector to hexagon search. 2013-10-08 16:11:00 +03:00
Marko Viitanen ac0db59408 Renamed variable to fix a typo 2013-10-08 14:49:02 +03:00
Ari Koivula 8910037936 Add hexagon-based motion vector search. 2013-10-08 13:38:03 +03:00
Ari Koivula 9d02dfdd13 Make debug html more strict. 2013-10-08 12:30:57 +03:00
Marko Viitanen a477d554d5 Merge branch 'inter_deblock' 2013-10-08 12:14:20 +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
Marko Viitanen 8b9c5d129a Enabled deblocking by default 2013-10-08 12:12:43 +03:00
Marko Viitanen 40664c41d6 Fixed inter deblocking 2013-10-08 12:12:04 +03:00
Marko Viitanen e3899b8174 Fixed inter chroma deblocking 2013-10-03 11:05:00 +03:00
Marko Viitanen 2d38612e9a Inter deblocking changes, not working! 2013-10-02 18:09:22 +03:00
Marko Viitanen 13bbd2fb37 Fixed inter_get_mv_cand() candidate selection of B0 CU 2013-10-02 15:10:40 +03:00
Ari Koivula 36fe88caef Fix rounding errors in chrome half pel prediction.
The spec speaks nothing about rounding these values, but HM12 rounds the final
values. HM might be based on an old version of the spec that does all this rounding and clipping.

- Also fixes erroneous indexing when both horizontal and vertical are half pel.
2013-10-02 14:49:23 +03:00
Ari Koivula c753f6bac6 Fix boundary checking in CU visualization. 2013-10-02 11:11:21 +03:00
Ari Koivula 665b369164 Fix chroma problem in inter prediction.
There is still a separate problem, but this fixes the visible chroma problem
with motion vectors that have reference a chroma half-pixel.
2013-10-02 10:59:34 +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 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 9bd35fcdb1 Remove split attribute from cu_info.
It is no longer used.
2013-09-30 16:42:23 +03:00
Ari Koivula 4a8088be20 Update cu visualization. 2013-09-30 16:42:23 +03:00
Ari Koivula a6200860b7 Merge branch 'encoder-cleanup' 2013-09-30 10:48:39 +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
Ari Koivula 9ad8bf2915 Refactor: encoder.c full cleanup. 2013-09-28 23:31:26 +03:00
Ari Koivula aee54cdcfa Refactor: encoder.c fix [] 2013-09-28 23:29:26 +03:00
Ari Koivula 36119985b5 Refactor: encoder.c variable renaming. 2013-09-28 20:27:36 +03:00
Ari Koivula 7e6aa31c6f Refactor: encoder.h renaming and cleanup. 2013-09-28 20:20:15 +03:00
Ari Koivula 571fec7c39 Add a more general cost function to motion search. 2013-09-28 16:41:57 +03:00
Ari Koivula 562a43d541 Fix bug with initial prediction of motion vector. 2013-09-28 16:34:23 +03:00
Ari Koivula 8bce7c84a0 Disable early cutoff optimization for motion vector search.c
It probably doesn't work right and might cause issues.
2013-09-28 16:04:11 +03:00
Ari Koivula 7979a59168 Fix check for (0, 0) vector when searching for best movement vector. 2013-09-28 16:02:30 +03:00
Ari Koivula 9bad984f14 Add special case for the (0, 0) vector to the fast search. 2013-09-25 19:31:49 +03:00
Ari Koivula 224bda37e7 Make a define switch for full search vs fast search. 2013-09-25 19:20:31 +03:00