Commit graph

2157 commits

Author SHA1 Message Date
Miika Metsoila 6e00f63469 Remove unused variables from search_pu_inter_ref function 2017-09-18 15:36:37 +03:00
Miika Metsoila 7b0101ce3d Merge branch 'reflist_changes'
# Conflicts:
#	src/encoderstate.c
#	src/search_inter.c
2017-09-18 14:59:37 +03:00
Miika Metsoila 769b17768d Change max function to MAX macro for clang/gcc compatibility.
Remove couple of unnecessary comments
2017-09-15 14:21:51 +03:00
Miika Metsoila 5f7c5443a3 Remove inter.poc 2017-09-12 14:23:19 +03:00
Miika Metsoila 6bd78a3da7 Reverse L0 list sort direction 2017-09-12 14:23:18 +03:00
Miika Metsoila 83dc7e7f50 Made L0 to sort and fixed mv_ref_coded in search_pu_inter 2017-09-12 14:23:18 +03:00
Timothe FRIGNAC d3362a238e changed strtod to strtol 2017-08-31 15:14:31 +02:00
Timothe FRIGNAC 3a1ab54ff0 Fixed memory leaks 2017-08-31 11:51:41 +02:00
Timothe FRIGNAC 466297fd77 Fixed build error 2017-08-29 17:01:18 +02:00
Timothe FRIGNAC 2e130912cb Add --key opt 2017-08-28 17:15:13 +02:00
Miika Metsoila a5f4cf09b5 Switched from storing POCs in inter.poc to state->frame->refLXs array 2017-08-21 16:34:57 +03:00
Arttu Ylä-Outinen 409d2114f0 Fix motion vector constraints
Fixes integer motion vectors being constrained more than what was
necessary when using --mv-constraint or --wpp.
2017-08-11 14:41:36 +03:00
Arttu Ylä-Outinen 7144a00beb Rewrite thread queue
Changes thread queue so that only the jobs that are ready to run are
stored in the queue. Other jobs are kept track of by pointers in the
reverse dependency lists of other jobs. When a job is ready to run it is
appended to the queue. The job queue is stored as a linked list.

The definitions of threadqueue_queue_t and threadqueue_job_t are moved
to the .c file, turning them into opaque structs.

Makes thread queue code simpler. Fixes some TSan errors.
2017-08-11 14:18:12 +03:00
Arttu Ylä-Outinen bc47fe94af Drop thread queue debug code 2017-08-11 14:18:12 +03:00
Eemeli Kallio e5cbc7a205 --sao now enables full sao 2017-08-11 13:26:55 +03:00
Eemeli Kallio 4c3453d26f Fixed issue with no-sao argument 2017-08-11 13:12:22 +03:00
Eemeli Kallio 8674c0f5ee Added paremeter for band and edge sao. 2017-08-11 11:57:09 +03:00
Eemeli Kallio d9b93ea368 Added possibility to skip edge or band sao. 2017-08-11 11:51:49 +03:00
Arttu Ylä-Outinen 4b73bdd9aa Skip checked motion vectors in early termination
Changes the second iteration of early termination to skip the motion
vectors that were already checked in the first iteration.
2017-08-09 14:29:09 +03:00
Arttu Ylä-Outinen 606d441362 Skip computing MV cost twice in hexagon search
Changes the first step of hexagon search to skip the zero offset since
the cost of the motion vector has already been computed.
2017-08-09 14:29:09 +03:00
Arttu Ylä-Outinen fa4648061d Add mv, cost and bitcost to inter_search_info_t 2017-08-09 14:29:08 +03:00
Arttu Ylä-Outinen 328f051d7f Put inter search parameters in a single struct
Adds struct inter_search_info_t for holding the parameters that are used
by most function related to inter search. Passing the parameters in
a single struct greatly reduces the number of parameters for many
functions.
2017-08-09 14:27:53 +03:00
Miika Metsoila 0dd069f8af Fixed using wrong POC in add_temporal_candidate 2017-08-09 13:50:21 +03:00
Miika Metsoila 25e0a954c7 Fixed 2 bugs causing incorrect video output 2017-08-09 13:50:21 +03:00
Arttu Ylä-Outinen 24ecddd2a5 Fix wrong strides in SAO reconstruction
Functions kvz_sao_reconstruct and encoder_sao_reconstruct used
frame->width as the stride instead of frame->rec->stride when accessing
frame->rec->data. This caused errors when using tiles and SAO.
2017-08-01 15:40:49 +03:00
Arttu Ylä-Outinen f0bf959d17 Fix alignment errors in 32-bit build with MSVC
Changes the work_tree parameter in search.c functions from an array to
a pointer. Fixes "formal parameter with requested alignment of 8 won't
be aligned" errors.
2017-07-28 09:27:02 +03:00
Arttu Ylä-Outinen 9694bd2fae Fix build on 32-bit systems
Function coeff_abs_sum_avx2 that was added in e950c9b was outside the
AVX2 #if directive.
2017-07-28 09:19:29 +03:00
Arttu Ylä-Outinen ecb0275cdd Store CU arrays as pointers to the main array
Changes field state->tile->frame->cu_array->data to point to the CU
array in the main encoder state. Removes the need to copy the CU array
to the main CU array after search.
2017-07-28 08:36:45 +03:00
Arttu Ylä-Outinen e950c9b101 Add AVX2 implementation for coefficient sum 2017-07-28 07:39:36 +03:00
Arttu Ylä-Outinen d50ae6990c Add sum of absolute coefficients to strategies 2017-07-28 07:39:15 +03:00
Arttu Ylä-Outinen 59faca0646 Skip CABAC coefficient cost for --rd=0 2017-07-28 07:33:03 +03:00
Arttu Ylä-Outinen 19e051ea40 Reduce intra threshold
Reduces intra threshold for --rd=0 from 20 to 8. Threshold of 20
increased BD-Rate too much.
2017-07-25 13:26:38 +03:00
Arttu Ylä-Outinen e9cf15465e Fix inter cost in bipred
The cost of coding MV ref indices and MV direction was added to bitcost
but not inter cost. Fixed by adding the extra bits to inter as well.
2017-07-24 15:24:04 +03:00
Arttu Ylä-Outinen edbe00763e Drop extra parameter in kvz_image_calc_sad
Drops the parameter max_lcu_below which was always set to -1.
2017-07-24 15:21:19 +03:00
Arttu Ylä-Outinen ffac29061f Fix extrapolated inter SATD 2017-07-24 15:11:05 +03:00
Arttu Ylä-Outinen 631ef53d2a Fix inter cost calculations
Inter costs are computed using SAD except when fractional motion
estimation or bi-prediction is enabled. This commit changes
search_pu_inter_ref to recalculate the cost with SATD. Fixes inter/intra
cost comparisons since intra costs are always SATD costs.
2017-07-24 15:11:05 +03:00
Arttu Ylä-Outinen 6ce2fb1238 Add pixel offsets to encoder_state_config_tile_t
Adds fields offset_x and offset_y to encoder_state_config_tile_t.
2017-07-24 15:11:05 +03:00
Arttu Ylä-Outinen 2380ba0d41 Reduce copying in kvz_get_coeff_cost
Changes function kvz_get_coeff_cost to only copy the CABAC contexts and
not the whole encoder state.

Other threads could be simultaneously using the other parts of the
encoder state. Only copying the CABAC fixes a TSan data race warning.
2017-07-24 12:38:41 +03:00
Arttu Ylä-Outinen 24b462f801 Align coefficients to 8 bytes
Adds alignment attribute to lcu_coeff_t. The coefficients are sometimes
handled as 64-bit integers containing four coefficients so the arrays
should be aligned to 8 bytes.

Fixes a UBSan error about misaligned reads.
2017-07-24 12:37:37 +03:00
Arttu Ylä-Outinen 5ddb43c6fe Fix undefined left shifts in rdo
Replaces left shifts by multiplications when the operand may be
a negative value. Left shift of a negative value is undefined behavior.
2017-07-24 12:35:10 +03:00
Arttu Ylä-Outinen d1e64ad62b Fix undefined left shifts
Replaces left shifts by multiplications when the operand may be
a negative value. Left shift of a negative value is undefined behavior.
2017-07-20 11:15:30 +03:00
Arttu Ylä-Outinen 07b5fb9caf Fix out-of-bounds read in encoderstate
When calling encoder_state_encode_leaf with POC 0, index -1 of the GOP
array would be accessed. Fixed by skipping the code for I-frames.
2017-07-20 11:15:30 +03:00
Arttu Ylä-Outinen 8c4a3473a8 Change --owf=auto and --threads=auto selection
Changes OWF selection so that it is chosen based on the maximum number
of parallel CTUs. Number of threads is limited to prevent overhead from
extra threads.
2017-07-20 09:42:28 +03:00
Arttu Ylä-Outinen 4fc9b743c1 Drop an unnecessary pthread_cond_broadcast
Drop pthread_cond_broadcast on threadqueue->cond in function
kvz_threadqueue_waitfor. The broadcast caused threads to be woken up
more often than necessary.
2017-07-19 11:09:30 +03:00
Arttu Ylä-Outinen 14003c6a30 Disable printing PSNR with --no-psnr 2017-07-19 10:38:37 +03:00
Arttu Ylä-Outinen e90bde5c62 Clarify PSNR output
Adds letters Y, U and V to the PSNR output to make it clearer that the
printed values are the luma and chroma PSNR.
2017-07-19 10:33:43 +03:00
Arttu Ylä-Outinen fdb3480b54 Enable strategies for SAO reconstruction
Re-enables strategies for SAO reconstruction. They were disabled in
commit ec9ff42.
2017-07-11 10:35:18 +03:00
Arttu Ylä-Outinen 333dba3884 Add static to SAO strategies 2017-07-11 10:02:01 +03:00
Miika Metsoila e8cc2d8f6a Small fixes 2017-07-07 13:58:19 +03:00
Arttu Ylä-Outinen 67a60a35e3 Fix invalid calls to normalize_lcu_weights
Changes encoder_state_init_new_frame to only call normalize_lcu_weights
when the weights have been written to the array and rate control is
enabled. When rate control is disabled, the weights are not used.
2017-07-07 11:05:31 +03:00