1
mirror of https://code.videolan.org/videolan/dav1d synced 2024-11-14 22:58:33 +01:00
Commit Graph

347 Commits

Author SHA1 Message Date
Marvin Scholz
ea70793450 Add option to include extra testdata tests 2018-10-30 13:39:43 +01:00
James Almer
8fbd87e504
obu: fix parsing film_grain_present and num_operating_points in Sequence Headers
Fixes a regression since d8996b181d, where
the relevant fields started being written to and read from the wrong struct.
2018-10-29 20:44:19 -03:00
Ronald S. Bultje
8fac3029f1 Don't use msac_decode_bool() for edge partition parsing
This is identical to what libaom does, and fixes #119. After
gather_left/top_partition_prob(), probabilities *can* overlap,
and in extreme cases the output CDF[0] can therefore be 0, which
will cause an assert failure when used with msac_decode_bool().
2018-10-29 22:46:38 +01:00
Janne Grunau
c52cc17a7e API: constify Dav1dData and dav1d_data_wrap()
Fix #120.
2018-10-29 21:20:28 +01:00
Janne Grunau
9f17489c4d unref reference pictures after decoding errors
Fix #115. Fix 'assert(seg_id < 8)' in
clusterfuzz-testcase-minimized-dav1d_fuzzer-5740590025670656 due to
decoding error in the primary reference picture. Credits to oss-fuzz.
2018-10-29 17:31:49 +01:00
Ronald S. Bultje
46a3fd20e0 Add a 4x4 cdef_filter AVX2 implementation
cdef_filter_4x4_8bpc_c: 2273.6
cdef_filter_4x4_8bpc_avx2: 113.6

Decoding time reduces to 15.51s for first 1000 frames of chimera 1080p,
from 23.1 before cdef_filter SIMD or 17.86 with only 8x8 cdef_filter
SIMD.
2018-10-29 17:16:56 +01:00
Ronald S. Bultje
e2c6d0295c Add 8x8 cdef_filter AVX2 implementation
cdef_filter_8x8_8bpc_c: 7913.0
cdef_filter_8x8_8bpc_avx2: 309.9

First 1000 frames of Chimera 1080p:
before: 0m23.100s
after: 0m17.863s
2018-10-29 17:16:56 +01:00
Ronald S. Bultje
3b02d3a9e5 Add CDEF filter checkasm unit test 2018-10-29 17:16:56 +01:00
Ronald S. Bultje
8007c79fee Simplify/rewrite cdef filtering code 2018-10-29 17:16:56 +01:00
Marvin Scholz
ba08e37cd2 dav1d: Fix theoretical invalid pointer dereference
Fix a theoretical bug found by the clang static analyzer:
In theory num_muxers could be smaller than res, never evaluating the
loop (as the condition would be false) but not satisfying the
i == num_muxers case, so proceeding and dereferencing the never
initialized impl pointer.

Fixing this is simple: Changed the num_muxers and index variables
to unsigned so num_muxers can never be smaller than i.
2018-10-29 02:09:46 +01:00
Ronald S. Bultje
d8996b181d Clear reference state upon sequence header change
Fixes #123.
2018-10-28 22:37:21 +01:00
Janne Grunau
e74daebe09 libfuzzer: build oss-fuzz fuzzer binaries with meson
oss-fuzz's FuzzingEngine requires libc++.
2018-10-28 21:12:20 +01:00
James Almer
5ff8504394
picture: make poc the first field in Dav1dPicture
This prevents warnings on some old compilers that don't like structs that
start with an array being initialized with { 0 }.
2018-10-28 14:17:33 -03:00
Ronald S. Bultje
0f4253f24d Backup extra 8 pixels at bottom of frame
Fixes #112.
2018-10-28 17:46:06 +01:00
Ronald S. Bultje
172f277b56 Cast masks to unsigned before upshifting
Fixes #111.
2018-10-28 13:56:53 +01:00
Janne Grunau
cacfb8d25a parse_obu: reset have_{seq,frame}_hdr on new OBU_{SEQ,FRAME}_HDR
Prevent decoding a frame with inconsistent sequence and frame headers.
Fix #124, #125. Fix negative size param in pixel_copy due to inconsistent
sb128 state between frame header (parsed with sb128 == 0) and sequence
header and frame decoding with sb128 == 1. Fix
clusterfuzz-testcase-minimized-dav1d_fuzzer-5707479116152832. Credits to
oss-fuzz.
2018-10-28 12:58:42 +01:00
Ronald S. Bultje
ba789ebfb4 Require bits/component to match between picture and references
Fixes #116.
2018-10-27 21:28:44 -04:00
Ronald S. Bultje
acde4240fe Add AVX2 SIMD implementation for cdef_dir
cdef_dir_8bpc_c: 629.3
cdef_dir_8bpc_avx2: 82.4

First 1000 frames of Chimera 1080p:
before: 0m23.084s
after: 0m21.860s
2018-10-28 02:03:29 +02:00
Ronald S. Bultje
dd797aa20b Add CDEF unit test 2018-10-28 02:03:29 +02:00
Ronald S. Bultje
fdf780f72a Rewrite cdef_dir C code 2018-10-28 02:03:29 +02:00
Janne Grunau
c6e66595a8 fix hang in dav1d_close() with more than 31 tile threads
Fix 122.
2018-10-27 20:44:06 +02:00
James Almer
8d5a812190
tools/dav1d: don't call write_header and write_trailer when it's not needed 2018-10-27 10:50:25 -03:00
Thierry Foucu
2118bc9fa3 Add a null muxer which will just drop the packet.
This is similar to --noblit of libaom
2018-10-26 14:03:51 -07:00
Janne Grunau
31634e36e2 libfuzzer: unbreak oss-fuzz build
oss-fuzz builds the fuzzing binary out of meson. Local (quoted) includes
should be preferred for headers located in the same directory.
2018-10-26 09:20:11 +02:00
Janne Grunau
36a2d2caa0 arm: reverse jump tables
Instead of bit reverting the register subtract 24 from clz. This avoids
two empty filler values in the jump table with the same instruction
count.
2018-10-25 22:10:51 +02:00
Janne Grunau
e214351b0e rename arch specific bitdepth template files
Missed in 46e2a2d0cc. Arm asm will be hard to template so move them to
the plain source list.

Fix #96.
2018-10-25 20:07:15 +02:00
Marvin Scholz
46e2a2d0cc Build: Add suffix to templated BITDEPTH files
Fix #96
2018-10-25 18:51:31 +02:00
James Almer
367d785a4e
meson: add "-Werror=missing-prototypes" to the list of optional arguments
Add duplicate prototypes to ref_mvs.c for now, since ref_mvs.h can't
be included.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-10-25 11:58:06 -03:00
Martin Storsjö
6cb362d015 attributes: Don't align to more than what assembly needs/benefits from
For arm/arm64, there's no need to align any buffer to 32 bytes
as the assembly doesn't need it and doesn't benefit from it.

This would be much more elegant if defined like this:

    #define MAX_ALIGN 16
    #define ALIGN(align) __attribute__((aligned(MIN(align, MAX_ALIGN))))

This works for GCC and Clang, but the MSVC alignment __declspec
needs a literal alignment value, it can't handle an expression.
2018-10-25 16:50:40 +02:00
Janne Grunau
1bb1ec21ea fix unwanted integer promotion in tile data size parsing.
Fixes an undefined left shift in
clusterfuzz-testcase-minimized-dav1d_fuzzer-5717082881130496. Credits to
oss-fuzz. Fixes #110
2018-10-25 16:45:03 +02:00
Janne Grunau
0bdd992ee1 loop restoration: maximal stripe height is 128 + 8
Due to the stripe offset of 8 rows the last stripe can have a height of
128 + 8 rows if the resolution is a multiple of 128. Fixes a
stack-buffer-overflow in
clusterfuzz-testcase-minimized-dav1d_fuzzer-5731418676658176. Credits to
oss-fuzz.
2018-10-25 16:37:26 +02:00
Luc Trudeau
305537cae9 Don't call mask_edges_chroma when !bw4 or !bh4
Fix issue #70
2018-10-25 15:15:09 +02:00
Martin Storsjö
2cce1d2615 attributes: Fix leftover mismatched else/endif comments
These went out of sync in 227b7eae7a.
2018-10-25 11:54:55 +03:00
Martin Storsjö
515e26673d arm/mc: Add 8 bit neon asm for avg, w_avg and mask
checkasm --bench numbers from a Snapdragon 835:
nop: 23.0
avg_w4_8bpc_c: 385.0
avg_w4_8bpc_neon: 34.0
avg_w8_8bpc_c: 590.5
avg_w8_8bpc_neon: 65.5
avg_w16_8bpc_c: 1304.4
avg_w16_8bpc_neon: 161.3
avg_w32_8bpc_c: 4098.4
avg_w32_8bpc_neon: 589.2
avg_w64_8bpc_c: 8405.0
avg_w64_8bpc_neon: 1367.1
avg_w128_8bpc_c: 19667.9
avg_w128_8bpc_neon: 3409.0
w_avg_w4_8bpc_c: 453.8
w_avg_w4_8bpc_neon: 50.0
w_avg_w8_8bpc_c: 749.0
w_avg_w8_8bpc_neon: 105.7
w_avg_w16_8bpc_c: 1851.2
w_avg_w16_8bpc_neon: 283.7
w_avg_w32_8bpc_c: 5991.5
w_avg_w32_8bpc_neon: 1080.9
w_avg_w64_8bpc_c: 12763.5
w_avg_w64_8bpc_neon: 2544.4
w_avg_w128_8bpc_c: 30311.3
w_avg_w128_8bpc_neon: 6350.5
mask_w4_8bpc_c: 492.9
mask_w4_8bpc_neon: 57.7
mask_w8_8bpc_c: 1108.5
mask_w8_8bpc_neon: 123.0
mask_w16_8bpc_c: 2880.3
mask_w16_8bpc_neon: 349.2
mask_w32_8bpc_c: 8996.4
mask_w32_8bpc_neon: 1368.1
mask_w64_8bpc_c: 19570.3
mask_w64_8bpc_neon: 3263.5
mask_w128_8bpc_c: 46757.4
mask_w128_8bpc_neon: 8743.1
2018-10-25 11:23:18 +03:00
Ronald S. Bultje
128715b5fd Make access into loopfilter masks safe across sb64 tile threads
Fixes #100.
2018-10-25 01:34:22 +02:00
Ronald S. Bultje
32c62b5f38 Make access into noskip_mask safe across sb64 tile threads 2018-10-25 01:34:22 +02:00
Thomas Daede
c163cbdb83 Make symbols shared with libaom static.
Fixes #104.
2018-10-24 13:56:44 -07:00
Thomas Daede
14c612d079 Convert PATENTS file from CP1252 to UTF-8. 2018-10-24 12:21:28 -07:00
Ronald S. Bultje
68f6b1775e Prevent right-shift by 32
Fixes #93.
2018-10-24 21:03:46 +02:00
Ronald S. Bultje
8e1d06df82 Revert "Add tile constraint to loopfilter mask fix-up code"
This reverts commit 6fa9df9c6f. The
behaviour shown there only happens when show_existing_frame=1, i.e.
it was the same bug as 2e991b1479.
2018-10-24 15:00:16 -04:00
Janne Grunau
7c56793acf fix debug build after 16ec105734
Remove debug code under '#if !defined(NDEBUG)' still using av_clamp_mv().
2018-10-24 20:55:17 +02:00
James Almer
18335a4da0
obu: don't abort OBU_REDUNDANT_FRAME_HDR if no frame header has been parsed
Parse and use it instead.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-10-24 15:51:49 -03:00
James Almer
5f8b6d0cb9
obu: abort parsing OBU_FRAME if show_existing_frame=1
This is more in line with the behavior from libaom.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-10-24 15:42:20 -03:00
Janne Grunau
4cfd948d66 CI: add -Werror to all warning free jobs and add clang-7 job
Fixes #97.
2018-10-24 20:38:05 +02:00
Janne Grunau
16ec105734 remove unused function av1_clamp_mv()
Refs #97.
2018-10-24 20:38:05 +02:00
Ronald S. Bultje
e6d7400b07 Don't fix chroma loopfilter masks for grayscale content
Fixes #64.
2018-10-24 20:05:25 +02:00
Ronald S. Bultje
9cdb54c51b Simplify code to fix-up the tile boundary loopfilter masks 2018-10-24 20:05:25 +02:00
Ronald S. Bultje
6fa9df9c6f Add tile constraint to loopfilter mask fix-up code
Fixes #92.
2018-10-24 19:36:59 +02:00
Ronald S. Bultje
2e991b1479 Exit frame data decoding for OBU_FRAME if show_existing_frame=1
This is identical to what libaom does for such OBUs. It prevents us
from doing block decoding, which doesn't make sense for such OBUs,
and would result in using an uninitialized frame header during the
decoding process. Fixes #94.
2018-10-24 18:39:20 +02:00
Ronald S. Bultje
a036432316 Fix compiler warning in checkasm/looprestoration.c 2018-10-24 18:32:38 +02:00