Laurent Fasnacht
1ba1683c05
search buffer has to be allocated tile-wise to avoid problems with wavefronts
2014-05-14 13:27:13 +02:00
Laurent Fasnacht
bb86f24000
Take advantage of the new buffers to remove uneeded item assignment
2014-05-14 13:27:13 +02:00
Laurent Fasnacht
6607c9f563
Use new buffers for search
2014-05-14 13:27:12 +02:00
Laurent Fasnacht
c257c4b863
Add const for the buffers
2014-05-14 13:27:12 +02:00
Laurent Fasnacht
1680273e80
Store search borders in a buffer for the whole picture
2014-05-14 13:27:11 +02:00
Laurent Fasnacht
0ceb1469a2
Improve decision about when to split into threads
2014-05-14 13:27:11 +02:00
Laurent Fasnacht
d4a303e7e6
Free jobs as soon as possible
2014-05-14 13:27:09 +02:00
Laurent Fasnacht
63adb54a3d
Add --threads <int> command line parameter
2014-05-14 13:27:09 +02:00
Laurent Fasnacht
e772799d5e
encoder_state_encode uses now the threadqueue
2014-05-14 13:27:08 +02:00
Laurent Fasnacht
baede7f6c4
threadqueue
2014-05-14 13:27:08 +02:00
Laurent Fasnacht
8b7774153f
Add SLEEP() define
2014-05-14 13:27:08 +02:00
Laurent Fasnacht
aac7fc55b1
Remove filter_deblock function, which is not used and somewhat dangerous, since it doesn't take into account specific stuff about subencoders.
2014-05-14 13:27:07 +02:00
Laurent Fasnacht
bc3ca90bdf
Fix tiles when SAO or deblock is enabled.
...
Was broken by previous commit.
2014-05-14 13:27:07 +02:00
Laurent Fasnacht
4815a0604b
Entropy coding sync works without parallelism, without SAO and without deblocking
2014-05-14 13:27:06 +02:00
Laurent Fasnacht
2c2a2528f3
Remove openmp stuff
2014-05-14 13:27:06 +02:00
Ari Koivula
aee9bf2875
Re-add rdo control to transformskip decision.
...
- It got left out when rewriting the function.
2014-05-14 12:39:23 +03:00
Ari Koivula
9147b7acbf
Split residual quantization to separate luma and chroma function.
2014-05-14 11:19:48 +03:00
Tapio Katajisto
cc92cfee18
Added few warnings to Makefile
...
Cleaned fme code a bit
2014-05-14 01:49:34 +00:00
Tapio Katajisto
efc43c8b3a
Added fractional pixel motion estimation
...
Added farctional mv support for inter recon
Added 1/8-pel chroma and 1/4-pel luma interpolation
2014-05-14 01:42:02 +00:00
Ari Koivula
e947bd4c0e
Clean up trskip decision code and remove old code.
...
- You can define structs inside functions! This changes everything!!
- Bitstream changes a little bit compared to old trskip decision. Bdrate
change is insignificant though.
2014-05-13 22:00:04 +03:00
Ari Koivula
a3cdee9ec5
Move new trskip decision to a function.
2014-05-13 21:59:00 +03:00
Ari Koivula
2ff713ccb2
Add new implementation for trskip decision.
2014-05-13 21:57:45 +03:00
Ari Koivula
8b8da6f493
Make luma and chroma use the same quantization function.
...
- Only thing not working was transform skip.
2014-05-13 21:57:23 +03:00
Ari Koivula
f0bfcedba2
Clean up coeff reconstruction code.
2014-05-13 21:56:10 +03:00
Ari Koivula
0c65a9b658
Remove abs_sum from coeff quantization.
...
- It's meant for checking if there are any coefficients, but we don't use it
and it's annoying to remember to initialize it and pass it around. The
benefit should be quite small anyway.
2014-05-13 21:54:34 +03:00
Ari Koivula
75042fc65d
Move luma quantization to it's own function.
2014-05-13 21:34:06 +03:00
Ari Koivula
ba3aaf3189
Expand chroma functions to parent function.
...
- This was done so that making the function work with luma would be easier.
2014-05-13 21:30:14 +03:00
Ari Koivula
637aceb495
Add TR_MAX_WIDTH.
...
- Max transform size is constrained by but independent of LCU size.
- Luma and chroma now have the same stride for transform arrays.
2014-05-13 21:22:40 +03:00
Ari Koivula
1c38209cab
Add missing include.
2014-05-13 09:33:05 +03:00
Ari Koivula
13577562e5
Revert change to definition of LCU_WIDTH.
2014-05-13 09:28:01 +03:00
Ari Koivula
fb763f7940
Move coefficient generation functions from encoder.c to transform.c.
...
- These functions probably should have been there to begin with.
2014-05-12 11:37:39 +03:00
Ari Koivula
a3478ecd20
Move transform skip decision to it's own function.
2014-05-12 11:18:27 +03:00
Ari Koivula
d9b890de6e
Remove redundant variables.
...
- Redefine LCU_WIDTH to be 64. Stuff will break horribly if it's
anything else anyway.
- Add LCU_WIDTH_C for chroma LCU width. It should be more readable than the
constant (LCU_WIDTH >> 1).
2014-05-12 10:58:07 +03:00
Ari Koivula
59e0e98523
Separate luma and chroma coefficient generation variables.
2014-05-12 10:38:24 +03:00
Ari Koivula
0ca65e7606
Move chroma coefficient generation to it's own function.
...
- It's time to chop up this monster that is encode_transform_tree.
2014-05-12 10:24:06 +03:00
Ari Koivula
3c3c9a26c6
Move scan order selection to a function.
2014-05-12 08:47:16 +03:00
Ari Koivula
623d9001a8
Reorder chroma coefficient generation.
2014-05-12 08:47:16 +03:00
Ari Koivula
93141c7d2e
Avoid unnecessary copying of predicted pixels when there are no coeffs.
...
- These are probably from a time when reconstruction happened in this
function.
2014-05-09 16:39:58 +03:00
Ari Koivula
27ab882c25
Clean up coefficient generation.
2014-05-09 16:33:10 +03:00
Ari Koivula
ce945ab4ef
Handle coefficient initialization better.
...
- Coefficients are no longer required to be pre-zeroed. The resulting zeroes
are copied in even in the case where we already know they are all zeroes.
- Move cbf clearing code to only happen at the leaves of the recursion.
2014-05-09 16:30:28 +03:00
Laurent Fasnacht
b274558139
Refactor and fix entry_points functions.
...
Seems to be OK with HM now
2014-05-09 12:42:37 +02:00
Laurent Fasnacht
43b5f84c0d
Fix sao_calc_edge_block_dims
...
It was computing wrong dimensions, which was causing out-of-bounds reads in sao_reconstruct.
2014-05-09 10:30:34 +02:00
Laurent Fasnacht
3f975e92cd
Replace line fixing symptoms by assertions, to reveal the cause
2014-05-09 08:24:03 +02:00
Laurent Fasnacht
4dbf7c7a52
Fix blit dimensions in sao_search_best_mode
2014-05-09 08:24:02 +02:00
Ari Koivula
cb5d7e6541
Fix compilation for VS2010.
2014-05-08 17:28:12 +03:00
Laurent Fasnacht
0452806ec4
Entry points
2014-05-08 15:04:56 +02:00
Laurent Fasnacht
da588af2ba
Partial support for wavefront
2014-05-08 15:04:55 +02:00
Laurent Fasnacht
4de5660254
Fix missing offset in LCU range computation for wavefronts
2014-05-08 15:04:55 +02:00
Laurent Fasnacht
dc34a5eac6
LCU borders
2014-05-08 15:04:54 +02:00
Laurent Fasnacht
24f4a8cad1
Wavefront also needs entrypoints
2014-05-08 15:04:53 +02:00
Laurent Fasnacht
d05f8b52aa
Rewrite of encoder_state_write_bitstream_leaf: handle slice + tiles + wavefronts correctly
2014-05-08 15:04:53 +02:00
Laurent Fasnacht
27f694e3e8
Some initial code to support wpp and slices
2014-05-08 15:04:52 +02:00
Laurent Fasnacht
b3d1754cc3
context_copy function
2014-05-08 15:04:51 +02:00
Laurent Fasnacht
163189c3c7
Bitstream for leaves can be computed in parallel
2014-05-08 15:04:51 +02:00
Laurent Fasnacht
be9882f5b2
Leaf bitstream write
2014-05-08 15:04:50 +02:00
Laurent Fasnacht
ae6a7a9c4b
Leaf encoder uses encoder_state->lcu_order
2014-05-08 15:04:49 +02:00
Laurent Fasnacht
b740142325
Add is_leaf to encoder_state
2014-05-08 15:04:48 +02:00
Laurent Fasnacht
8451d5b100
Move some init code to encoder_state_new_frame
2014-05-08 15:04:48 +02:00
Laurent Fasnacht
1cb3f14dfe
lcu_order_count in (leaves) encoder
2014-05-08 15:04:47 +02:00
Laurent Fasnacht
ef6ae3e723
Remove dead code
2014-05-08 15:04:46 +02:00
Ari Koivula
535b42bc9b
Fix compilation for VS2010.
2014-05-07 15:26:44 +03:00
Laurent Fasnacht
05eef82896
Remove extra [ from graphviz dump
2014-05-07 13:40:29 +02:00
Laurent Fasnacht
84e5dbee39
Remove quote from graphviz dump
2014-05-07 13:33:02 +02:00
Laurent Fasnacht
b48a687d3c
Restored parallelism, but it will be done in another way... OpenMP is not very efficient in these kind of dynamic situation
2014-05-07 11:55:56 +02:00
Laurent Fasnacht
0e6f1c99fc
Refactor picture to remove hidden dependency between slice and tiles
...
picture.type -> encoder_state->global->pictype
picture.slicetype -> encoder_state->global->slicetype
picture.slice_sao_luma_flag -> 1 (was constant)
picture.slice_sao_chroma_flag -> 1 (was constant)
This may be changed later. For now it's better to avoid having slice related stuff in picture.
2014-05-07 11:55:48 +02:00
Laurent Fasnacht
39d96e0546
Fix bug with cabac stream pointing to bad data
2014-05-07 11:55:41 +02:00
Laurent Fasnacht
e144f817ef
Works when not using tiles
2014-05-07 11:55:16 +02:00
Laurent Fasnacht
24c2bd70ca
Fix small bugs with compilation
2014-05-07 11:54:35 +02:00
Laurent Fasnacht
a03f0cba19
encoder_control_input_init near the other encoder_control_* functions
2014-05-07 11:53:21 +02:00
Laurent Fasnacht
1e2671ac30
Renamed encoder_clear_refs to encoder_state_clear_refs
2014-05-07 11:53:12 +02:00
Laurent Fasnacht
831b221cf8
Parsing seems to work now
2014-05-07 11:53:01 +02:00
Laurent Fasnacht
8b5cb62237
Debug code to generate a graph
2014-05-07 11:52:04 +02:00
Laurent Fasnacht
cee6bb0e71
Fix iteration on children
2014-05-07 11:49:14 +02:00
Laurent Fasnacht
699669ee35
fixed typo
2014-05-07 11:48:16 +02:00
Laurent Fasnacht
6c6adf18c7
Refactor encoder_state
2014-05-07 11:47:31 +02:00
Laurent Fasnacht
a23edd0339
added parent to encoder_state
2014-05-07 11:42:54 +02:00
Laurent Fasnacht
5ce518a47a
lcu_at_tile_start and lcu_at_tile_end helper functions
2014-05-07 11:42:30 +02:00
Laurent Fasnacht
c2872bd6b0
Slices and WPP in command line and encoder
2014-05-07 11:42:04 +02:00
Laurent Fasnacht
2d6f199246
reorganized encoder_state structure
2014-05-07 11:41:27 +02:00
Laurent Fasnacht
f0b076876f
Moved all the stream related stuff into substream_write_bitstream
2014-05-07 11:40:20 +02:00
Laurent Fasnacht
f30b9c2a11
Fix a buffer overflow in parse_tiles_specification
2014-05-07 11:39:45 +02:00
Ari Koivula
eaf8835bda
Add some comments and const qualifiers.
2014-05-06 19:20:38 +03:00
Ari Koivula
3910b7989a
Clear old cbf data before recursion in encode_transform_tree.
...
- Because encode_transform_tree also maintains the CBF data and assumes that
the CBFs are initially zeroed, calling the function more than once would
result in incorrect CBF data.
2014-05-06 19:03:29 +03:00
Ari Koivula
bdc16d2612
Improve cu_info coded block flag data structure a bit.
...
- It works just like the old structure except that the flags are checked with
bitmasks instead of having the flag value be propagated upwards. There isn't
really any benefit to this because the flags still have to be propagated to
parent CUs.
- Wrapped them inside a struct to make copying them easier. (Just need to copy
the struct instead of making individual copies)
2014-05-06 18:28:04 +03:00
Ari Koivula
d123b98aea
Remove unnecessary tertiary expressions from usages of CABAC_BIN.
2014-05-06 17:39:25 +03:00
Ari Koivula
380401b2eb
Have CABAC_BIN accept any >0 as binary 1.
...
It used to treat odd numbers as false.
2014-05-06 17:39:10 +03:00
Marko Viitanen
bf2c2a1330
Small changes to fix compiling on VS
...
- Added threads.h to VS project
- Included Windows.h in threads.h
2014-05-05 11:18:43 +03:00
Laurent Fasnacht
f3d4e6eb09
Move bitstream write to a separate function, and add assertions about the part which should not write to bitstream.
2014-05-05 09:24:57 +02:00
Laurent Fasnacht
0fe080ad0a
bitstream_tell
2014-05-05 08:53:06 +02:00
Laurent Fasnacht
7f6f4fe9c1
Reference count for picture
2014-05-05 08:03:24 +02:00
Laurent Fasnacht
323054d5e2
naming: alloc_yuv_t -> yuv_t_alloc dealloc_yuv_t -> yuv_t_free
2014-05-02 11:45:27 +02:00
Laurent Fasnacht
7d6d1d5536
Remove pic->pred_*
2014-05-02 11:38:07 +02:00
Laurent Fasnacht
92e14cc80d
rename picture_init to picture alloc and picture_destroy to picture_free
2014-05-02 10:58:28 +02:00
Laurent Fasnacht
b76f7377b6
Always initialize tiles data structures (even with only one tile)
2014-05-02 10:00:22 +02:00
Laurent Fasnacht
f97e60a80d
Doc for encoder state
2014-05-02 10:00:12 +02:00
Laurent Fasnacht
161fe38f5e
Remove USE_TILES define
2014-05-01 13:58:13 +02:00
Laurent Fasnacht
a84fd6486d
Add function subencoder_blit_pixels
2014-05-01 11:16:11 +02:00
Laurent Fasnacht
b8b28635ff
Iterable structure for sub-encoders (more flexibility)
2014-05-01 11:16:10 +02:00
Laurent Fasnacht
212d390003
Cleanup of encoder_state_init and encoder_state_finalize
2014-05-01 11:16:10 +02:00
Laurent Fasnacht
161053f86b
Do not allow more tiles than dimension in LCU
2014-05-01 07:11:31 +02:00
Ari Koivula
42295d3cb9
Pass preprocessor defines for supported intrinsics in VS2010 explicitly.
...
- _M_IX86_FP defines whether VS should generate code using SSE or SSE2
instructions. It isn't correct to use it to check whether optional runtime
optimizations should be compiled in. It's also not defined at all in 64-bit
mode.
- So let's just keep it simple and give a list of everything that is supported
as release optimizations. It's not clear from the documentation if all of
these are really supported. It just list a bunch of intrinsics from these
that are.
2014-04-30 17:41:15 +03:00
Ari Koivula
d1fbc6dc80
Fix a small memory leak.
...
- Malloced pointer returned by alloc_yuv_t was not being freed in
substream_encode.
- Remove use of yuv_t from encode_one_frame, as it's not used there anymore.
2014-04-30 11:15:34 +03:00
Ari Koivula
d808fe3b02
Merge branch 'strategy_selector'
2014-04-29 15:36:48 +03:00
Ari Koivula
bd7e021742
Modify strategyselector to work with VS2010.
...
- VS doesn't have snprintf.
- VS doesn't support GCC attributes.
- Add defines for __SSE__ and __SSE2__ on VS.
2014-04-29 15:29:06 +03:00
Laurent Fasnacht
bf7e755cf7
Strategies and runtime detection/choice of best algorithm
2014-04-29 11:51:41 +02:00
Ari Koivula
27b94d4b45
Address gcc -Wtype-limits errors.
...
- Fixes warnings in #19 and #16 .
2014-04-29 09:15:52 +03:00
Ari Koivula
2a17e9a7aa
Merge branch 'sse_intrinsics'
2014-04-28 19:38:08 +03:00
Ari Koivula
cecf4b0b4e
Move __USE_MINGW_ANSI_STDIO to Makefile.
...
- I'm not too clear on how this should be used, but having it in the source
file after mingw stuff was included caused a warning about redefinition of
__USE_MINGW_ANSI_STDIO.
2014-04-28 19:37:37 +03:00
Ari Koivula
4e7e40054f
Move picture-sse2.c to src/inline-optimizations/.
...
- Having it in the src dir even though it's not a module on it's own breaks
the scons build script. It's probably better to have these a little bit
separated from the normal code anyway.
2014-04-28 19:36:40 +03:00
Laurent Fasnacht
d66f809734
reg_sad implementation using SSE2/SSE4.1 intrinsics
2014-04-28 15:36:58 +02:00
Ari Koivula
4490e8afd6
Remove depth dimension from picture->cu_array.
...
- It isn't used for anything anymore.
- It was used in the past to hold information during search, but now that
information is held in lcu_t structs.
2014-04-28 10:18:22 +03:00
Laurent Fasnacht
76ec605b72
SAO works with tiles now
2014-04-28 06:29:21 +02:00
Yusuke Nakamura
0214d4ffcc
Makefile: Remove unneeded arguments in CCFLAGS.
...
This fixes a compilation on clang.
2014-04-27 00:41:10 +09:00
Yusuke Nakamura
03da39e229
config: Use built-in getopt on non-MSVC environments.
2014-04-27 00:40:52 +09:00
Yusuke Nakamura
c5a4e7b52c
encmain: Remove a warning on MinGW.
2014-04-26 23:56:50 +09:00
Ari Koivula
145816cfb5
Move printing of CLI stuff to stderr.
...
- Printing to stdout corrupts the stream when used with "-o -".
2014-04-26 12:56:39 +03:00
Laurent Fasnacht
5e7945888a
Inter-frame prediction with tiles works.
...
Many thanks to Jean-Hugues Recolin for the insightful comments about shifts!
2014-04-25 09:28:00 +02:00
Laurent Fasnacht
7719837f17
Simple OpenMP parallelization
2014-04-25 09:11:10 +02:00
Laurent Fasnacht
4e34859e66
Fix compilation error with USE_TILES=1 and -Werror=maybe-uninitialized
2014-04-24 08:41:05 +02:00
Laurent Fasnacht
59392c4a62
Fix compilation issue with USE_TILES=0
2014-04-24 08:38:24 +02:00
Laurent Fasnacht
571a373f69
Use tile offset in search
2014-04-24 08:38:24 +02:00
Laurent Fasnacht
2e7d958af3
Picture and reference may have different sizes
2014-04-24 08:38:24 +02:00
Laurent Fasnacht
af9a1c0fbb
Use same reference images for all subencoders
2014-04-24 08:38:23 +02:00
Laurent Fasnacht
73c574fb45
P-frame: first try...
2014-04-24 08:38:22 +02:00
Laurent Fasnacht
03361dcf2c
sao try... still not working
2014-04-24 08:38:22 +02:00
Laurent Fasnacht
3db4c59478
Recontruct full frame from tiles
2014-04-24 08:38:21 +02:00
Laurent Fasnacht
35d5d22ccc
Fix tile size not to go outside of the original picture
2014-04-24 08:38:20 +02:00
Laurent Fasnacht
985630b8b2
Add a check to fix picture_blit_pixels when width > orig_stride
2014-04-24 08:38:20 +02:00
Laurent Fasnacht
b36e154c38
Some cleanup
2014-04-24 08:38:19 +02:00
Laurent Fasnacht
01580a93c3
Encoding with tiles now more or less works with -p 1 --no-sao --no-deblock
2014-04-24 08:38:19 +02:00
Laurent Fasnacht
fd89b9af76
New functions: bitstream_append and bitstream_clear
2014-04-24 08:38:18 +02:00
Laurent Fasnacht
356c17e0de
Add missing break in bitstream_writebyte
2014-04-24 08:38:18 +02:00
Laurent Fasnacht
5fb4d9c36e
substream_encode function
2014-04-24 08:38:17 +02:00
Laurent Fasnacht
e292b2c274
allocate subencoders
2014-04-24 08:38:17 +02:00
Laurent Fasnacht
12e3900fd1
( ) for preprocessor directives...
2014-04-24 08:38:16 +02:00
Laurent Fasnacht
fba4f5432a
Fix debug code
2014-04-24 08:38:16 +02:00
Laurent Fasnacht
b255133460
Debug for tiles
2014-04-24 08:38:15 +02:00
Laurent Fasnacht
066ce6c9f4
Remove unused prototype
2014-04-24 08:38:15 +02:00
Laurent Fasnacht
11629ce811
Use tile scan order in encode_one_frame()
2014-04-24 08:38:14 +02:00
Laurent Fasnacht
0036afa056
Write tiles related information picture parameter set and slice header
2014-04-24 08:38:14 +02:00
Laurent Fasnacht
1e9c894eba
Coding tree block raster and tile scanning conversion process, according to ITU-T Rec. H.265 (04/2013) 6.5.1
2014-04-24 08:38:13 +02:00
Laurent Fasnacht
7bd6aa2e9c
encoder_control_input_init call moved to encoder_control_init
2014-04-24 08:38:13 +02:00
Laurent Fasnacht
ff318ae0e9
Tiles in encoder_control
2014-04-24 08:38:12 +02:00
Laurent Fasnacht
9353f14792
Parameters for using tiles in command line arguments.
...
--tiles-width-split
--tiles-height-split
2014-04-24 08:38:11 +02:00
Laurent Fasnacht
61c67dc485
Allow -DUSE_TILES=1 to be specified in Makefile; define MAX_TILES_PER_DIM.
2014-04-24 08:38:11 +02:00
Laurent Fasnacht
19b1642aa2
Removed all cabac parameters (cabac is part of encoder_state)
2014-04-22 11:46:53 +02:00
Ari Koivula
a539ae7e08
Address clang-analyzer warning.
...
- The assert needs to be before the initialization.
2014-04-22 11:55:28 +03:00
Laurent Fasnacht
5fea5875a5
Huge refactoring
...
Split some parts of encoder_control into encoder_state
(idea: encoder_control is immutable)
Goal is to allow multiple substreams in the future.
2014-04-22 10:39:12 +02:00
Ari Koivula
88a67a4e49
Fix faulty assert that stops the program from working with inter frames.
...
- The assert would be true after the next if block, but in it's current place
it's false.
2014-04-22 10:57:38 +03:00
Ari Koivula
54270f271d
Fix c89 problem to allow compilation with VS2010.
2014-04-17 19:12:39 +03:00
Ari Koivula
1b437a5989
Address clang-analyzer warnings about garbage values.
...
- False alarm, but surprisingly difficult to convince clang of that. It
doesn't seem to understand bit shifts very well.
- Only assert and changing LCU_WIDTH>>depth to width was necessary to satisfy
clang.
- Closes #35 .
2014-04-17 18:43:09 +03:00
Ari Koivula
11509c68dc
Address clang-analyzer warnings about unused values.
...
- Related to issue #35 .
2014-04-17 18:43:08 +03:00
Ari Koivula
0704c43836
Address clang-analyzer warning about undefined behavior in intra.
...
- Related to issue #35 .
2014-04-17 18:43:08 +03:00
Ari Koivula
32da12f653
Address a clang-analyzer warning about undefined behavior in filter.
...
- Analyzer didn't see that code is never called with MAX_DEPTH as it doesn't
know the properties of width, height, x and y. Following would also
silence the error:
assert(cur_pic->width > 0 && cur_pic->height > 0);
assert(cur_pic->width % 8 == 8 && cur_pic->height % 8 == 0);
assert(x > 0 && y > 0);
assert(x % 8 == 0 && y % 8 == 0);
- Related to issue #35 .
2014-04-17 18:43:08 +03:00
Laurent Fasnacht
3396264f3c
Moved g_cur_lambda_cost into encoder_control.cur_lambda_cost
2014-04-17 12:00:21 +02:00
Laurent Fasnacht
534013be77
Remove g_lambda_cost
2014-04-17 11:49:27 +02:00
Laurent Fasnacht
83360918ba
Removed table generation from main code, moved it to tools.
2014-04-17 11:13:15 +02:00
Laurent Fasnacht
4a9c239027
Remove g_bitdepth
2014-04-17 11:13:13 +02:00
Laurent Fasnacht
7a2b883059
Remove encoder_input width, height, height_in_lcu, and width_in_lcu
2014-04-17 11:13:12 +02:00
Laurent Fasnacht
d01e3ae67f
bitstream is a union, and is statically in encoder_control structure
2014-04-17 11:13:12 +02:00
Laurent Fasnacht
122576fe8b
some const in cabac.c
2014-04-17 11:13:11 +02:00
Laurent Fasnacht
94a48fc153
added const in bitstream
2014-04-17 11:13:11 +02:00
Laurent Fasnacht
9ac3b7bf2b
encoder->in.cur_pic --> cur_pic
2014-04-17 11:13:10 +02:00
Laurent Fasnacht
21d34613c2
Replace encoder->stream by stream
2014-04-17 11:13:09 +02:00
Laurent Fasnacht
2286175378
nal are now written to a bitstream, not a FILE*
2014-04-17 11:13:09 +02:00
Laurent Fasnacht
677fc2ec7d
Fix prototype of create_bitstream in bitstream.h
2014-04-17 11:13:08 +02:00
Ari Koivula
51ba80513b
Centralize resource deallocation for encmain.
...
- CppCheck was complaining about unreleased resources for FILE*. They weren't
really because they get flushed and closed when program exits normally, but
let's close them anyway.
2014-04-17 11:58:03 +03:00
Ari Koivula
b35f33b3da
Address warnings about unused values.
...
- Related to issue #35 .
2014-04-16 18:05:03 +03:00
Ari Koivula
9229e5d11b
Fix undefined behavior of EO_IDX.
...
- Move the whole eo_cat thing to it's own function.
- Casting pixel values to int should solve issues with SIGN3. Not casting them
was detected as undefined behavior by CLANG. Probably because the result of
two unsigned might be treated as unsigned (but isn't on VS2010).
2014-04-16 14:50:19 +03:00
Laurent Fasnacht
ec9d70f70c
Moved scalinglist_process into init_encoder_control
2014-04-16 11:45:51 +02:00
Ari Koivula
6e24ba0a5f
Merge branch 'sao-mode-cost'
2014-04-16 12:25:05 +03:00
Laurent Fasnacht
e06253d437
scalinglist changes missing in previous commit
2014-04-16 11:00:29 +02:00
Laurent Fasnacht
9901c38dd5
scalinglist in independent file
2014-04-16 10:25:16 +02:00
Ari Koivula
051484f8d8
Remove unused old mode cost estimation from SAO.
2014-04-16 11:19:23 +03:00
Laurent Fasnacht
9112cbb58c
Generate and use static tables
2014-04-16 09:49:09 +02:00
Ari Koivula
a982800e1b
Merge remote-tracking branch 'remotes/lfasnacht/const'
2014-04-16 10:28:31 +03:00
Ari Koivula
df5af669f9
Merge remote-tracking branch 'remotes/lfasnacht/makefile_deps'
2014-04-16 10:28:04 +03:00
Ari Koivula
33b9594fec
Take into account the coding cost of not using SAO.
2014-04-15 21:32:24 +03:00
Ari Koivula
880d09b27a
Add sao_type_idx to SAO mode cost estimation.
2014-04-15 21:29:09 +03:00
Ari Koivula
280a946269
Apply bit cost fixes to edge band band sao search.
...
- Increases bdrate slightly. It's still a cleaner solution though and further
improvements to bit cost estimation might improve things.
2014-04-15 21:28:16 +03:00
Ari Koivula
c968253eb3
Estimate SAO merge coding costs better.
...
- This doesn't seem to have very much of an effect. I guess the difference
between 1 and 2 bits isn't that important.
2014-04-15 21:27:16 +03:00
Ari Koivula
ef7840c623
Add SAO coding costs for sao_eo_class, band position and offset sign.
...
- This reduces bdrate a little bit.
- It seems like increasing the bit cost of using SAO in general
increases bdrate.
2014-04-15 21:24:44 +03:00
Ari Koivula
9ff32c566c
Adjust SAO mode coding cost for zero offsets.
...
- Coding zero with TR only takes one bit.
- Even though offset 0 should be fairly common, this doesn't seem to help very
much and actually increases bdrate on some sequences.
2014-04-15 21:21:31 +03:00
Ari Koivula
67a3d5542c
Add better delta distortion calculation to sao.
2014-04-15 21:17:29 +03:00
Ari Koivula
8c4796e56e
Calculate edge and band sao separately.
2014-04-15 21:16:55 +03:00
Ari Koivula
1017c6639c
Move band and edge sao to their own functions.
2014-04-15 21:14:59 +03:00
Laurent Fasnacht
960f2cb4b0
g_sig_last_scan -> const uint32_t*
2014-04-15 16:09:52 +02:00
Laurent Fasnacht
288a4537ba
const bit_table for exp_golomb
2014-04-15 16:09:52 +02:00
Laurent Fasnacht
763b775d3e
encoder_control->cfg is const
2014-04-15 16:09:52 +02:00
Laurent Fasnacht
ae2d79c954
Remove encoder_control.cqmfile
2014-04-15 16:09:51 +02:00
Laurent Fasnacht
86c1cf339f
Add Makefile to dependencies
2014-04-15 15:47:40 +02:00
Laurent Fasnacht
e135a88fb5
Remove encoder_control.cqmfile
2014-04-15 14:21:25 +02:00
Laurent Fasnacht
29c93d8f3f
Automatic generation of build dependencies
2014-04-15 13:52:31 +02:00
Laurent Fasnacht
7897f7d5cd
Remove counter from debug version of WRITE_*
...
It's not very useful, and create unneeded noise when trying to make diffs
2014-04-15 11:37:45 +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
52ae027b3a
Avoid undefined behavior in memcpy calls
...
"The memcpy() function shall copy n bytes from the object pointed to by s2 into the object pointed to by s1. If copying takes place between objects that overlap, the behavior is undefined."
2014-04-15 06:30:21 +02:00
Laurent Fasnacht
317a3f87a4
Initialize scaling_list_dc (avoids branching on uninitialized value)
2014-04-15 06:19:12 +02:00
Laurent Fasnacht
9f3aeed6be
Fix pixel access in sao
2014-04-14 15:40:06 +02:00
Laurent Fasnacht
486768fc79
scalinglist privatization
2014-04-14 13:39:28 +02:00
Laurent Fasnacht
78c579053a
encoder_control should be const in nearly all the code
2014-04-14 10:56:06 +02:00
Marko Viitanen
0e7a5057d1
Merge pull request #26 from lfasnacht/warnings_fix
...
Fix warnings and compile with -Werror
2014-04-14 11:30:37 +03:00
Marko Viitanen
04f09a2bc8
Merge pull request #25 from lfasnacht/memory_bitstream
...
Changed bitstream handling to allow in-memory bitstream.
2014-04-14 11:29:25 +03:00
Laurent Fasnacht
13398e011b
Fix create_bitstream()
2014-04-14 10:23:09 +02:00
Laurent Fasnacht
64f3f57af3
Compile with -Werror
2014-04-14 09:38:37 +02:00
Laurent Fasnacht
89ef1161c4
Fix warnings
2014-04-14 09:37:39 +02:00
Laurent Fasnacht
baba299bb8
Obviously a void function cannot return NULL
2014-04-14 09:11:15 +02:00
Laurent Fasnacht
418e6eae51
Changed bitstream handling to allow in-memory bitstream.
2014-04-14 08:13:00 +02:00
Laurent Fasnacht
520dbdd86d
Change return type of free_exp_golomb to be void, and add it to bitstream.h
2014-04-14 06:41:27 +02:00
Ari Koivula
29787efbbc
Fix whitespace.
...
Fix some whitespace issues from a merge.
2014-04-11 17:06:21 +03:00
Ari Koivula
83d5a4753d
Move input resolution to the same line as internal resolution.
...
The \n must have been left there by accident.
2014-04-11 16:55:08 +03:00
Ari Koivula
0b5c357795
Move all output to stderr.
...
It has to be in stderr to allow piping bitstream from stdout.
2014-04-11 16:50:59 +03:00
Ari Koivula
115872b300
Add total running time to output.
2014-04-11 12:42:37 +03:00
Marko Viitanen
de1c0b7e8d
Fixed intra RDO to include mode bitcost
2014-04-10 16:28:41 +03:00
Marko Viitanen
a657cf84d9
Insert most probable (predicted) intra modes to RDO search
2014-04-10 15:59:36 +03:00
Marko Viitanen
05169d9476
Added more modes to RDO mode selection in intra search
...
Now 8 best modes for sizes 4x4 and 8x8 are added to RDO checking and 3 for other block sizes as before, only applies when --rd 2
2014-04-10 15:20:49 +03:00
Ari Koivula
5fa5e01e05
Merge branch 'intra-cleanup'
...
Conflicts:
src/intra.c
src/intra.h
src/search.c
2014-04-10 13:51:14 +03:00
Ari Koivula
40c2fa4d46
Change intra reconstruction to use the same prediction function as search.
...
- This fixes a bug with intra search. It sometimes used filtered reference
pixels for 4x4 blocks leading to inaccurate cost estimate.
2014-04-10 12:09:19 +03:00
Ari Koivula
d5c3ad7a2b
Move intra prediction generation to its own function.
2014-04-10 11:27:15 +03:00
Ari Koivula
088dd9ab96
Clean up intra mode search.
...
- This changes the bitstream a little bit, because it changes the order in
which the modes are tried and when two modes have the same cost the first
one is chosen.
- Dst buffer was removes as it was no longer used.
2014-04-10 10:25:57 +03:00
Marko Viitanen
43ae0a3b9a
Implemented RDO cost calculation to Intra modes
2014-04-10 10:25:20 +03:00
Marko Viitanen
c38ec1aa10
Added commandline option for RDO (--rd)
2014-04-09 12:29:15 +03:00
Marko Viitanen
6558c92020
Clean up get_coeff_cost()
...
Since contexts were moved to cabac struct, there's no need to store contexts one by one
2014-04-09 11:50:17 +03:00
Ari Koivula
92ac5025f9
Take intra mode based coeff scan mode into account for coeff bit cost.
...
- Previously only diagonal scan mode, the most common one, would be used.
- This improved bdrate by 0.1-0.5 % for p0 and 0-0.2 % for p60.
2014-04-09 10:44:44 +03:00
Ari Koivula
c5dfcdf3aa
Simplify scan mode selection.
...
- The scan mode selection for chroma was a bit complicated so I checked it
and it was all unnecessary. The mode selection is the same as for luma.
2014-04-09 10:36:39 +03:00
Ari Koivula
3764688f84
Fix lambda initialization.
...
- Lambda was initialized before slice type was set in encoder_control.
2014-04-08 16:58:36 +03:00
Ari Koivula
0251bf5a1a
Improve calculation of chroma coding cost for 4x4 blocks.
...
- Adds calculation of chroma coefficient cost for 4x4 blocks.
- Previously there was no cost. Now the cost is added to the first prediction
block for NxN.
- This fix should improve bdrate by about 1%.
2014-04-08 12:43:26 +03:00
Ari Koivula
3c0977c7f3
Fix buffer overflow on copying of reference pixels.
...
- Valgrind noticed this.
- Shouldn't affect anything as the buffer overflowed to pixel buffers which
were initialized later.
2014-04-04 17:28:56 +03:00
Ari Koivula
6e0bc655e2
Resolve unused variable warning.
...
- This unexpectedly changes bitstream, but as that makes no sense, it must be
because some part of the program uses uninitialized memory.
2014-04-04 17:28:50 +03:00
Marko Viitanen
e15a86268d
Clean up tabs and whitespaces
2014-04-04 16:04:44 +03:00
Laurent Fasnacht
816ae13b1d
Moved context information inside cabac_data.
...
This is required in order to be able to work on parallelism.
2014-04-04 14:28:50 +02:00
Laurent Fasnacht
8a14bd3b7b
Remove cabac global variable
2014-04-04 14:26:40 +02:00
Laurent Fasnacht
946c815932
init_context directly has a QP parameter, instead of passing an encoder_control*
...
This makes context less tightly coupled with encoder.
2014-04-04 14:26:39 +02:00
Laurent Fasnacht
1e03cf8ac1
Add a function to free g_exp_table.
...
Even though g_exp_table has to be global (used in #define), it's better to avoid requiring other module to directly access it.
2014-04-04 14:26:39 +02:00
Marko Viitanen
7484dafd82
Fix for get_coeff_cost() scan mode selection
...
Small BD-rate improvement with this fix
2014-04-04 15:16:04 +03:00
Marko Viitanen
c5ba5eb3c8
Use RDO in final_cost
2014-04-04 14:10:49 +03:00
Marko Viitanen
b83559d3f3
Use RDO to check for transform skip mode
2014-04-04 13:09:42 +03:00
Marko Viitanen
b09854d964
Implemented RDO function to calculate bits used for coefficient coding
2014-04-04 13:09:42 +03:00
Ari Koivula
61256fc31a
Enable -Wall by default.
2014-04-04 13:02:08 +03:00
Ari Koivula
69ac9176a5
Disable warnings for extras/getopt.
...
- This isn't our code so we don't care about these warnings.
2014-04-04 13:02:08 +03:00
Ari Koivula
7239b59e94
Resolve constant conditional expression warning.
...
- Working towards issue #11 .
- I felt that the macro was a little bit too clever in hiding the if-else
statements so I removed that aspect, which also has the minor benefit of not
requiring the starting if (0) statement.
2014-04-04 13:02:07 +03:00
Ari Koivula
b19e4f3f2d
Resolve possible uninitialized variable warnings.
...
- Working towards issue #11 .
- Neither variable was actually used as uninitialized.
2014-04-04 13:02:06 +03:00
Ari Koivula
61ae195af7
Resolve warnings about assignments within conditions.
...
- Working towards issue #11 .
2014-04-04 13:02:06 +03:00
Ari Koivula
d44d1837bb
Remove unreferenced parameters.
...
- Working towards issue #11 .
2014-04-04 12:56:24 +03:00
Ari Koivula
46d33d3945
Resolve unsigned/signed mismatch warnings.
...
- Working towards issue #11 .
2014-04-04 12:56:23 +03:00
Ari Koivula
c142cbba21
Fix typo.
...
- Obvious typo. This g_bitdepth - 8 used to be g_bitincrement. Doesn't affect
anything yet as we don't actually support bitdepth > 8 yet.
2014-04-04 12:56:22 +03:00
Laurent Fasnacht
b371a8bb59
Use realloc correctly
...
Quote from MALLOC(3) manpage:
The realloc() function returns a pointer to the newly allocated memory, which is suitably aligned for any kind of
variable and may be different from ptr, or NULL if the request fails.
2014-04-04 06:37:35 +02:00
Ari Koivula
0074cd1a98
Add extra parenthesis to suppress compiler warnings.
2014-04-03 15:38:18 +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
Ari Koivula
f380e7d4b0
Check for malloc failure.
2014-04-03 15:38:17 +03:00
Ari Koivula
313466fdff
Remove unused variables.
...
- Working towards issue #11 .
- Either removed or redefined variables to not cause a warning.
2014-04-03 15:37:59 +03:00
Marko Viitanen
0da8071300
Changed final cost (and transform skip) error function from SAD to SSD
2014-04-02 14:51:39 +03:00
Marko Viitanen
a14fb14e33
Added new commandline parameter --no-transform-skip
2014-04-02 14:49:48 +03:00
Marko Viitanen
21e02e2d7d
Added 4x4 SATD (Hadamard)
...
Taken from HM 13.0
2014-04-02 11:12:42 +03:00
Marko Viitanen
cfb21c0e4c
Implemented transform skipping (for 4x4 blocks)
...
transform skip vs. normal transform selection criteria might need more work, currently both are calculated for each 4x4 block and SAD+coeff_SSE is compared.
2014-04-02 10:54:03 +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
Panu Sjövall
c8f629495d
Remove unnecessary buffer from bitstream.
...
- Writing encoded data to file is done in bitstream_put one byte at a time and nal_write only writes the packet headers
2014-03-25 11:46:56 +02:00
Ari Koivula
953aef0379
Move rest of LCU encoding inside the LCU loop.
...
- Move SAO search inside the LCU loop.
- Move CU coding inside the LCU loop.
- Move SAO frame reconstruction loop to sao module.
2014-03-21 12:41:44 +02:00
Ari Koivula
746eaa3671
Move deblocking code to filter module.
2014-03-21 11:57:12 +02:00
Ari Koivula
4d34377c42
Clean up deblocking code a bit.
...
- Change guards to use the same method of checking for coordinate alignment.
- Move variables to reduce their scope.
2014-03-21 10:50:47 +02:00
Ari Koivula
0f492c7680
Fix deblocking of transform boundaries.
...
This fixes issues with inter. Deblocking works now.
2014-03-21 10:42:41 +02:00
Ari Koivula
c42b25054a
Modify deblocking to be done per-LCU in the encoding loop.
...
- Intra works. There is still something wrong in inter.
- Avoid horizontal deblocking of the rightmost 4 pixels in the LCU.
This is because vertical deblocking must be done for all pixels
before horizontal, but vertical deblocking can't be done for those
pixels before the next LCU is finished.
- Add separate deblocking of the rightmost pixels of the last LCU
after the LCU edge has been deblocked.
- This is a pretty ugly hack but will have to do for now.
2014-03-20 18:14:43 +02:00
Ari Koivula
bbd1202f90
Replace old LCU reference pixels initialization with new ones.
...
In the future we might even have just a const pointer to reference pixels.
2014-03-19 16:01:31 +02:00
Ari Koivula
7328fc2897
Add special handling for bottom right LCU pixel.
...
I didn't take into account that the reference pixel on the top-left of the
LCU gets over written if we just replace the top reference pixels for
current LCU with the bottom reference pixels after doing the search.
To handle this I copy the pixel that gets overwritten to the vertical
reference pixels.
2014-03-19 16:01:31 +02:00
Ari Koivula
57ce7e990b
Add new reference pixel buffer management to encoding loop.
...
- This is necessary because after we add in-loop filters to be done per LCU,
the reconstruction buffer will have the deblocked pixels. We only need the
edge-pixels for intra prediction though so we just save those.
- Right now it only copies the pixels and passes them on to search, where
the copied pixels are asserted to be the same ones we copy from
reconstruction buffer.
- New yuv_t struct added for arrays of dynamic length. We might want to change
other buffers to use it or something like it in the future.
2014-03-19 16:01:30 +02:00
Ari Koivula
eacad83ff9
Fix encoder reconstruction output for non multiple of 8 sized input.
...
Output changed so that only pixels within the conformance window are output.
2014-03-19 13:24:01 +02:00
Ari Koivula
34e453c880
Clean up encode_one_frame.
...
There is a lot of duplicated code due to handling random access and trailing
pictures separately. I merged the code for these two branches so it would be
easier to modify.
2014-03-17 18:04:41 +02:00
Ari Koivula
b1596eb76c
Refactor coding of end_of_slice_segment_flag.
...
According to spec the end_of_slice_segment_flag is always coded, but in the
code it looked like it was not coded for the last LCU in picture. This was
due to the end_of_slice_segment_flag being coded inside cabac_flush, like it
is in HM. This is a bit silly so I moved it out of cabac_flush.
2014-03-17 18:04:41 +02:00
Ari Koivula
6a384112cc
Remove old unnecessary functions from search module.
...
- As we move to per-LCU encoding only search_lcu will be necessary.
- Function search_best_mode is no longer used.
2014-03-17 18:04:41 +02:00
Marko Viitanen
c7ee176480
Removed unused function search_best_mode()
2014-03-17 12:56:04 +02:00
Ari Koivula
9563b50a34
Refactor coefficient group scan mapping lists.
...
The relation between coefficients positions and coefficient group positions
was a big confusing due to the use of 16x16 diagonal coefficient mappings
also as coefficient group mappings.
- Moved all coefficient group mappings to their own const arrays and added
a new array the select the correct coefficient group mapping. This removes
special cases for 8x8 and 32x32 transform sizes.
- Removed all coefficient group mapping initialization from init_sig_last_scan.
- Removed 128x128 and 64x64 from regular coefficient group array as those
transform sizes don't exist anymore in HEVC.
2014-03-14 16:56:49 +02:00
Ari Koivula
319174258b
Increment version number and update usage information.
2014-03-12 18:06:41 +02:00
Ari Koivula
34d4e74cd6
Fix selection of bitcost for NxN mode intra CUs.
2014-03-12 18:05:42 +02:00
Marko Viitanen
17b9c9d0b7
Unified all uses of --input-res to use 'x' as delimiter
...
Addresses issue #20
2014-03-12 15:20:57 +02:00
Ari Koivula
462b75f0f3
Merge branch 'intra-NxN'
...
Conflicts:
src/search.c
2014-03-12 15:08:39 +02:00
Ari Koivula
e93ae54e70
Fix bug with selecting wrong coeff scan mode for 4x4 blocks.
2014-03-12 14:56:05 +02:00
Marko Viitanen
e6985eeb08
Terminate search when any block is found with no coefficients to code
2014-03-12 14:14:42 +02:00
Marko Viitanen
362fc6c5a5
Reduced bit cost when skip mode is selected
2014-03-12 14:13:38 +02:00
Ari Koivula
aa59605392
Set correct max depth for search work-tree copying.
...
The copy up and down functions had wrong max depth so they didn't work with
4x4 blocks.
2014-03-12 14:02:13 +02:00
Marko Viitanen
b5756821dd
Tuned cost calculations for "final cost"
...
By adding chroma cost and using 1.5x coeff cost instead of 0.5x, additional 3% (LP) and 1.8% (AI) drop in BD-rate noticed.
2014-03-12 10:35:56 +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
Marko Viitanen
75dd1f48ef
Bugfix: calculate "final cost" only when block is inter or intra
2014-03-11 17:09:08 +02:00
Marko Viitanen
3b59d7c3a3
Implemented "final cost" calculation for best CU on each depth in search
...
Take SAD between reconstruction and original and add cost from coding and cost for coding coefficients.
2014-03-11 15:01:50 +02:00
Marko Viitanen
aa0fb6ccad
Store intra coding bit costs to CU structure
2014-03-11 12:15:50 +02:00
Marko Viitanen
bdf8166e5c
Store inter coding bit costs to CU structure
...
To be used for calculating better coding cost later
2014-03-11 11:40:39 +02:00
Marko Viitanen
d2d877933a
bugfix: only fclose recout if it was opened
2014-03-11 09:09:43 +02:00
Marko Viitanen
eaf4434ae9
Removed unused parameter cur_cu from inter_get_merge_cand()
2014-03-11 09:04:17 +02:00
Marko Viitanen
f2e722fed8
Implemented early search termination when skip mode is used
2014-03-11 08:55:38 +02:00
Ari Koivula
1b2705a042
Add video dimensions to the filename of encoder reconstruction.
2014-03-10 18:10:50 +02:00
Ari Koivula
965d8c377a
Make encoder reconstruction obey --debug.
2014-03-10 18:10:49 +02:00
Ari Koivula
7e507fd615
Add --input-res CLI parameter.
...
- Also set default width and height to 0 because it makes no sense to assume
dimensions. It's kind of like defaulting to the most common altitude when
the altimeter is broken.
- Add config_validate to have a place for checks on overall cfg state.
2014-03-10 16:09:33 +02:00
Ari Koivula
a644848b36
Add --seek CLI parameter.
...
Related to issue #12 .
Motivation for adding this is that the syntax for frame accurate seeking in
ffmpeg is a little cumbersome. Also it's kind of a standard feature I guess.
2014-03-10 15:14:56 +02:00
Marko Viitanen
a935aa5d96
Untabified encmain.c and nal.c
2014-03-10 12:10:40 +02:00
Marko Viitanen
a7dade5069
Tuned inter MV coding costs to achieve BD-rate reduction
...
Compared to version with no inter costs, around -2% BD-rate in LP configuration
2014-03-10 12:08:09 +02:00
Marko Viitanen
1bd79c719e
Fixed MV candidate derivation in search
2014-03-10 10:16:30 +02:00
Marko Viitanen
9a4b0d2cc7
Added newline after printing of real video frame size
2014-03-10 10:16:30 +02:00
Marko Viitanen
c7e4861dbf
Added coding cost calculations to MV search
2014-03-10 10:16:30 +02:00
Ari Koivula
9dde96f25e
Refactor search_cu_intra.
...
- Formatted.
- Renamed and consolidated variables.
- Removed unused x and y pos from intra_prediction function.
2014-03-07 16:25:25 +02:00
Ari Koivula
470f36ce34
Remove left-over commented out code.
2014-03-07 12:44:45 +02:00
Ari Koivula
5d9aa3409b
Merge branch 'new-search-wip'
...
Conflicts:
src/encoder.c
src/intra.c
src/intra.h
src/search.c
2014-03-06 19:00:53 +02:00
Ari Koivula
47af5207c5
Remove dead code and fix white space.
2014-03-06 18:35:17 +02:00
Marko Viitanen
877e156cb8
Fixed the case where transform split is used (always on depth 0)
...
After this fix, inter coding should be working.
2014-03-06 14:52:58 +02:00
Marko Viitanen
c9d35aeacf
Removed unused block data setting functions from picture.c/.h
2014-03-05 17:22:36 +02:00
Marko Viitanen
c3e47c6a8d
Removed redundant coeff_y/u/v variables from CU
2014-03-05 17:18:03 +02:00
Marko Viitanen
b00f4c8dbf
Fixed transform offset value and set tr_depth to correct value when depth 0
2014-03-05 17:10:17 +02:00
Ari Koivula
1cf03cfb37
Add --no-rdoq parameter.
2014-03-05 17:02:21 +02:00
Ari Koivula
ca51f660d5
Fix fluctuation of coefficients on identical frames when RDOQ is on.
...
Moves CABAC context initialization to take place before search. This fixes
an issue with RDOQ returning different coefficients for identical adjacent
frames.
- This actually probably worsens BD-rate a little for all frames except the
first one because we were using last frames final CABAC context for every
LCU and now we are using initialized CABAC contexts. The fix is to encode
the LCU before we start compressing the next LCU so we can update CABAC
contexts.
2014-03-05 17:02:13 +02:00
Ari Koivula
8f3d5045b0
Add --no-rdoq parameter.
2014-03-05 17:00:08 +02:00
Ari Koivula
139e00f064
Fix fluctuation of coefficients on identical frames when RDOQ is on.
...
Moves CABAC context initialization to take place before search. This fixes
an issue with RDOQ returning different coefficients for identical adjacent
frames.
- This actually probably worsens BD-rate a little for all frames except the
first one because we were using last frames final CABAC context for every
LCU and now we are using initialized CABAC contexts. The fix is to encode
the LCU before we start compressing the next LCU so we can update CABAC
contexts.
2014-03-05 17:00:08 +02:00
Marko Viitanen
c5842e1769
More fixes to B0 mv candidate selection
...
After this fix, inter coding works in depth != 0
2014-03-05 12:53:35 +02:00
Marko Viitanen
278042aaac
Fixed top-right CU copy to lcu structure
2014-03-04 16:32:31 +02:00
Marko Viitanen
91e83db3c6
Bugfix for inter_get_spatial_merge_candidates() b2 block checking
...
Wrong variable was used to check for x-border
2014-03-04 15:34:32 +02:00
Marko Viitanen
df669ca7df
Added skip mode checking to the new lcu search
2014-03-04 12:48:19 +02:00
Marko Viitanen
bddadbb4ed
Inter coding fixed and added call to encode_transform_tree()
2014-03-03 17:42:44 +02:00
Marko Viitanen
09d4b47395
Fixed CU array calculations in inter_get_spatial_merge_candidates()
2014-03-03 16:25:33 +02:00
Marko Viitanen
17b256b5e3
Converted inter mv candidate functions to use lcu structure
...
Implemented merge and mvd candidate search
Added initialization of the whole work_tree
2014-03-03 16:08:35 +02:00
Marko Viitanen
1f82239367
Implemented inter search and reconstruction with lcu structure
2014-03-03 14:51:36 +02:00
Marko Viitanen
b5fca8b206
Added missing chroma ref pixel init and fixed pic width/height in intra ref border
...
intra_build_reference_border() was given wrong picture width and height on chroma.
Chroma top-left reference pixels were not copied on init_lcu_t()
2014-03-03 12:21:55 +02:00
Ari Koivula
448285a56a
Fix bug in intra mode coding.
2014-02-28 17:36:04 +02:00
Marko Viitanen
f1882a0d82
Fixed CU type initialization and PU index calculations
2014-02-28 15:56:27 +02:00
Ari Koivula
c05e91472d
Fix intra reference border construction on LCU boundary.
2014-02-28 15:43:59 +02:00
Marko Viitanen
83e2079587
Fixed chroma stride in intra_build_reference_border()
2014-02-28 15:24:47 +02:00
Ari Koivula
19f67d4466
Fix LCU reference pixel indexing in reference border construction.
2014-02-28 14:22:13 +02:00
Ari Koivula
768d54ff4c
Fix wrong array offset in intra search.
2014-02-28 14:22:13 +02:00
Marko Viitanen
0a6d9bda41
Fixed stride values in transform_chroma()
2014-02-27 17:47:00 +02:00
Marko Viitanen
4027de6e1f
Fixed reconstruct_chroma() stride values
2014-02-27 16:48:51 +02:00
Ari Koivula
6e11eda133
Fix coeff flag initialization.
...
They should be initialized, even if none exist.
2014-02-27 16:43:20 +02:00
Marko Viitanen
9968fd46b0
Fixed chroma array index calculations in transform_tree() and intra_recon_lcu()
2014-02-27 16:42:32 +02:00
Ari Koivula
71d9ab7e26
Fix copying-up of coefficients during search.
2014-02-27 15:58:47 +02:00
Ari Koivula
526fdfc078
Fix erroneous indexing of pixel arrays.
2014-02-27 15:51:21 +02:00
Ari Koivula
5f75753f85
Set coeff flags correctly.
...
The coeff flags are no longer propagated upwards because encode_transform_tree
is being called from depth > 0. The fix is to initialize the whole coeff flag
array when the coeff flag is set.
2014-02-27 15:45:07 +02:00
Ari Koivula
eda5ade06d
Add missing offsets for lcu_t.cu pointers.
...
Also changes alternate ways of doing the offset to use LCU_CU_OFFSET macro.
2014-02-27 14:22:01 +02:00
Ari Koivula
a8237bcb1e
Remove duplicated defines.
2014-02-27 14:03:33 +02:00
Marko Viitanen
b58c5b872a
Fixed cu coordinate derivation in lcu_set_intra_mode()
2014-02-27 13:53:26 +02:00
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
117f74b481
Fixed allocated size for coefficient arrays
2014-02-27 11:05:21 +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
Marko Viitanen
f788661a54
Fixed coeff flag derivation from NxN blocks
2014-02-26 16:54:49 +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
40138f082e
Modified intra_get_dir_luma_predictor() to use the new structure
...
Also fixed intra_pred_ratecost() parameters and usage of intra_build_reference_border()
2014-02-26 12:38:30 +02:00
Marko Viitanen
1197e24b3f
Modified intra_prediction() to use new structure and renamed intra_merge_cost()
2014-02-26 12:34:22 +02:00
Marko Viitanen
68b4e9e3db
Modified intra_build_reference_border() to work on the new structure
2014-02-26 12:30:12 +02:00