Commit Graph

101292 Commits

Author SHA1 Message Date
Paul B Mahol 51a9f487ae avformat: add Simbiosis IMX demuxer 2021-02-20 17:43:17 +01:00
Paul B Mahol 8651bf8a2e avcodec: add Simbiosis IMX video decoder 2021-02-20 17:42:00 +01:00
Andreas Rheinhardt 5a4f0d9b94 avcodec/cpia: Mark decoder as init-threadsafe
Reviewed-by: Stephan Hilb <stephan@ecshi.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-20 15:44:44 +01:00
Andreas Rheinhardt 980b5c3bb5 avcodec/dirac_vlc: Make ff_dirac_golomb_lut static
Only used here.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-20 14:46:42 +01:00
Andreas Rheinhardt d0d96674ec avcodec/ac3tab: Move ff_ac3_enc_channel_map to its only user
and make it static.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-20 14:46:25 +01:00
Michael Niedermayer 89fe1935b1 avcodec/hapdec: Change compressed_offset to unsigned 32bit
Fixes: out of array access
Fixes: 29345/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5401813482340352
Fixes: 30745/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HAP_fuzzer-5762798221131776

Suggested-by: Anton
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-02-20 14:16:00 +01:00
Wonkap Jang 029e3c1c70 avcodec/libvpxenc: optimize parsing vpx_svc_ref_frame_config
Getting rid of unnecessary use of AVDictionary object in parsing
vpx_svc_ref_frame_config.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Zern <jzern@google.com>
2021-02-19 13:54:07 -08:00
Marton Balint 9edec9206a fftools/ffplay: reindent and some minor cosmetics
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-19 21:30:13 +01:00
Marton Balint 36d671438a fftools/ffplay: use av_packet_alloc() to allocate packets
Heavily based on a patch by James Almer.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-19 21:30:13 +01:00
Marton Balint 44fb1f845d fftools/ffplay: use context AVPacket in decoder_decode_frame()
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-19 21:30:13 +01:00
Marton Balint a29928e646 fftools/ffplay: get rid of flush_pkt
The packet serial can be used instead to detect when a flush is needed.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-19 21:30:13 +01:00
Paul B Mahol 82472afe18 avcodec/cfhdenc: use pts instead of frame number
Makes encodes bitexact with different number of threads.
2021-02-19 21:15:35 +01:00
Paul B Mahol c2ca1eb2a7 avfilter/vf_ssim: add slice threading 2021-02-19 21:15:08 +01:00
Paul B Mahol 680ba23bc2 avfilter/vf_psnr: add support for slice threading 2021-02-19 21:15:08 +01:00
Paul B Mahol 59dd702990 avcodec/indeo3: add support for more dimensions
Fixes #6581
2021-02-19 21:15:08 +01:00
James Almer d52ceed9fd tests/checkasm/sw_scale: use memset() to fill dither
Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-19 16:19:11 -03:00
Alan Kelly ee18edb13a checkasm/sw_scale: properly initialize src_pixer and filter_coeff buffers
Fixes valgrind uninitialised value warnings.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-19 11:20:32 -03:00
Andreas Rheinhardt 14dc28e969 avfilter/vf_vif: Remove superfluous ';'
Inside a function a superfluous ';' is just a null-statement; yet
outside it is invalid, even though compilers happen to accept them.
They (at least GCC and Clang) only warn about this when on -pedantic.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-19 08:34:57 +01:00
Andreas Rheinhardt d150c2038d avformat/mpegenc: Forward error code
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-19 07:45:48 +01:00
Andreas Rheinhardt 4294f64d57 avformat/mpegenc: Avoid adding invalid packet to queue
Do this by moving the check before the allocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-19 07:45:48 +01:00
Andreas Rheinhardt 54987a37da avformat/mpegenc: Fix leak in case trailer is never written
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-19 07:45:48 +01:00
Andreas Rheinhardt cfce16449c avformat/mpegenc: Ensure packet queue stays valid
The MPEG-PS muxer uses a custom queue of custom packets. To keep track
of it, it has a pointer (named predecode_packet) to the head of the
queue and a pointer to where the next packet is to be added (it points
to the next-pointer of the last element of the queue); furthermore,
there is also a pointer that points into the queue (called premux_packet).

The exact behaviour was as follows: If premux_packet was NULL when a
packet is received, it is taken to mean that the old queue is empty and
a new queue is started. premux_packet will point to the head of said
queue and the next_packet-pointer points to its next pointer. If
predecode_packet is NULL, it will also made to point to the newly
allocated element.

But if premux_packet is NULL and predecode_packet is not, then there
will be two queues with head elements premux_packet and
predecode_packet. Yet only elements reachable from predecode_packet are
ever freed, so the premux_packet queue leaks.
Worse yet, when the predecode_packet queue will be eventually exhausted,
predecode_packet will be made to point into the other queue and when
predecode_packet will be freed, the next pointer of the preceding
element of the queue will still point to the element just freed. This
element might very well be still reachable from premux_packet which
leads to use-after-frees lateron. This happened in the tickets mentioned
below.

Fix this by never creating two queues in the first place by checking for
predecode_packet to know whether the queue is empty. If premux_packet is
NULL, then it is set to the newly allocated element of the queue.

Fixes tickets #6887, #8188 and #8266.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-19 07:45:48 +01:00
Andreas Rheinhardt c9d9c60746 avutil/video_enc_params: Check for truncation before creating buffer
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-19 07:45:39 +01:00
Andreas Rheinhardt 39df279c74 avutil/video_enc_params: Combine overflow checks
This patch also fixes a -Wtautological-constant-out-of-range-compare
warning from Clang and a -Wtype-limits warning from GCC on systems
where size_t is 64bits and unsigned 32bits. The reason for this seems
to be that variable (whose value derives from sizeof() and can therefore
be known at compile-time) is used instead of using sizeof() directly in
the comparison.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-19 07:45:39 +01:00
James Almer 1a555d3c60 swscale/x86/yuv2yuvX: use the movsxdifnidn helper macro
Simplifies code

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-18 18:47:43 -03:00
James Almer ebb48d85a0 swscale/x86/yuv2yuvX: use movq to load 8 bytes in all non-AVX2 functions
mova expands to movq on non-XMM functions

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-18 18:47:43 -03:00
James Almer d512ebbaed swscale/x86/yuv2yuvX: use the SPLATW helper macro
Simplifies code

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-18 18:47:43 -03:00
James Almer c00567647e swscale/x86/swscale: fix mix of inline and external function definitions
This includes removing pointless static function forward declarations.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-18 18:47:42 -03:00
Josh Dekker 7ac41e0db2 lavc/aarch64: add HEVC sao_band NEON
Only works for 8x8.

Signed-off-by: Josh Dekker <josh@itanimul.li>
2021-02-18 14:12:01 +01:00
Josh Dekker 75c2ddfa61 lavc/aarch64: add HEVC idct_dc NEON
Signed-off-by: Josh Dekker <josh@itanimul.li>
2021-02-18 14:12:01 +01:00
Reimar Döffinger 00c916ef61 lavc/aarch64: port HEVC add_residual NEON
Speedup is fairly small, around 1.5%, but these are fairly simple.

Signed-off-by: Josh Dekker <josh@itanimul.li>
2021-02-18 14:11:57 +01:00
Reimar Döffinger 30f80d855b lavc/aarch64: port HEVC SIMD idct NEON
Makes SIMD-optimized 8x8 and 16x16 idcts for 8 and 10 bit depth
available on aarch64.
For a UHD HDR (10 bit) sample video these were consuming the most time
and this optimization reduced overall decode time from 19.4s to 16.4s,
approximately 15% speedup.
Test sample was the first 300 frames of "LG 4K HDR Demo - New York.ts",
running on Apple M1.

Signed-off-by: Josh Dekker <josh@itanimul.li>
2021-02-18 14:11:53 +01:00
Paul B Mahol 67c8c863c7 avcodec: add initial exr image encoder 2021-02-18 13:00:40 +01:00
Ting Fu b0d75a8de9 dnn_backend_openvino.c: allow out_frame as NULL for analytic case 2021-02-18 09:59:37 +08:00
Guo, Yejun 2da3a5c10f dnn: add color conversion for analytic case
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-18 09:59:37 +08:00
Guo, Yejun 0884063f88 dnn_interface.h: add enum DNNColorOrder
the data type and order together decide the color format, we could
not use AVPixelFormat directly because not all the possible formats
are covered by it.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-18 09:59:37 +08:00
Guo, Yejun 76fc6879e2 dnn: add function type for model
So the backend knows the usage of model is for frame processing,
detect, classify, etc. Each function type has different behavior
in backend when handling the input/output data of the model.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-18 09:59:37 +08:00
Guo, Yejun bdce636100 dnn: extract common functions used by different filters
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-18 09:59:37 +08:00
Guo, Yejun 995c33a046 dnn_backend_openvino.c: fix multi-thread issue for async execution
once we mark done for the task in function infer_completion_callback,
the task is possible to be release in function ff_dnn_get_async_result_ov
in another thread just after it, so we need to record request queue
first, instead of using task->ov_model->request_queue later.

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-18 09:59:37 +08:00
Guo, Yejun 51c105a62d dnn_backend_openvino.c: fix mismatch between ffmpeg(NHWC) and openvino(NCHW)
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-18 09:59:37 +08:00
James Almer c2bf1dcace swscale/x86/swscale: fix compilation with old yasm
Where AVX2 may not be supported.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-17 21:09:36 -03:00
James Almer 1371647fc3 checkasm/sw_scale: use av_free() instead of free()
Fixes crashes on Win64

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-17 20:57:33 -03:00
Mark Thompson 5a9aebac91 avfilter/vf_pseudocolor: Add missing braces
The array inside a structure needs two levels of braces.
2021-02-17 23:09:40 +00:00
Alan Kelly 554c2bc708 swscale: move yuv2yuvX_sse3 to yasm, unrolls main loop
And other small optimizations for ~20% speedup.
2021-02-17 21:21:03 +01:00
James Almer 1628409b18 x86/vf_gblur: fix reg name in UNIX64 prologue
Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-17 15:51:28 -03:00
James Almer 3c77584be8 avfilter/vf_gblur: add missing arch check
Removed by mistake in 2b4da1cb8c where it
should have been replaced instead.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-17 15:45:40 -03:00
James Almer bea7c51307 checkasm/vf_gblur: add a test for postscale_slice
Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-17 13:39:31 -03:00
James Almer 2df3c2ed9b checkasm/vf_gblur: split off the horiz_slice test into its own function
Will come in handy for the following commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-17 13:39:11 -03:00
James Almer 2b4da1cb8c x86/vf_gblur: fix postscale_slice prologue
x86_32 ABI does not pass float arguments directly on xmm regs, and the Win64
ABI uses only the first four regs for this purpose.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-17 13:33:20 -03:00
Nicolas George 670051b524 lavfi/drawtext: ignore final LF of textfile.
A standard text file ends with a final LF.
Without this change, it is interpreted as an empty final line,
and visible with the box option.
The current behavior can be achieved by actually having
an empty line at the end of the file.

Fix trac ticket #7948.
2021-02-17 11:53:51 +01:00