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

340 Commits

Author SHA1 Message Date
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
Ronald S. Bultje
e5baa04281 Initialize restoration.type to RESTORATION_NONE for grayscale content
Fixes #89.
2018-10-24 18:24:21 +02:00
Ronald S. Bultje
1ccf6c1fc3 Use max value for all trailing palette entries
Otherwise, if the non-last has a max value, the ones after it can go
beyond the allowed range. Fixes #95.
2018-10-24 18:21:25 +02:00
Ronald S. Bultje
7b101d4fb3 Require refs and curpic to share the same chroma subsampling
Fixes #90.
2018-10-24 10:08:43 -04:00
James Almer
2982ef9279
libfuzzer: fix a -Wformat warning 2018-10-23 19:56:18 -03:00
Janne Grunau
aa8e9123a3 CI: add a -Werror build without checkasm
Fixes #97.
2018-10-24 00:49:27 +02:00
Janne Grunau
c3fce69fc9 fix sign compare warnings in dav1d_loopfilter_sbrow
See #97.
2018-10-24 00:49:27 +02:00
Martin Storsjö
0bb5389831 arm64: mc: Make the jump tables local symbols
For MachO, this makes sure that the label difference actually is
evaluated at assembly time (as it already was for ELF and COFF);
evaluating it at link time failed when the difference is stored in
a .hword.

This fixes linking errors like these:
ld: in section __TEXT,__text reloc 0: ARM64_RELOC_SUBTRACTOR must have r_length of 2 or 3 file 'src/src@@dav1d_bitdepth_8@sta/arm_64_mc.S.o' for architecture arm64

This adds an asm.S macro for decorating a symbol for making a
local symbol. For armasm64 with gas-preprocessor, this doesn't
actually create a local label (but neither do the local numbered
labels either currently), which might be slightly inconsistent
in it would be necessary to make the distinction for that assembler
as well.

Alternatively, the table symbol could be made into a plain local
numbered label as all the other labels.
2018-10-24 00:38:09 +02:00