]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoconfigure: fix clang on macOS 10.15
Josh de Kock [Tue, 14 Apr 2020 17:42:09 +0000 (18:42 +0100)]
configure: fix clang on macOS 10.15

Works around a bug in the newer Xcode 11's clang with -fstack-check
emitting bad code with misaligned call instructions.

This fixes Trac #8073

4 years agoavcodec/mediacodec_wrapper: fix {input,output}_buffers global reference leak
Matthieu Bouron [Thu, 9 Apr 2020 14:53:21 +0000 (16:53 +0200)]
avcodec/mediacodec_wrapper: fix {input,output}_buffers global reference leak

Fixes ticket #8607.

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
4 years agoavformat/dashdec: add attribute lang for audio and subtitle streams
Steven Liu [Tue, 31 Mar 2020 12:16:14 +0000 (20:16 +0800)]
avformat/dashdec: add attribute lang for audio and subtitle streams

There should have language in the metadata of streams which show to user

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavformat/hlsenc: add hls_fmp4_init_resend option
Steven Liu [Tue, 7 Apr 2020 09:30:18 +0000 (17:30 +0800)]
avformat/hlsenc: add hls_fmp4_init_resend option

add option for resend init file after m3u8 refresh everytime.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
4 years agoavcodec/v4l2_m2m: handle v4l2 end of stream event
Ming Qian [Wed, 1 Apr 2020 02:38:45 +0000 (10:38 +0800)]
avcodec/v4l2_m2m: handle v4l2 end of stream event

When flushing the capture buffers, the driver may send a V4L2_EVENT_EOS
to notify that draining is completed. Currently, v4l2_m2m does not
subscribe to this event, which can cause some devices (i.e. imx8qm) to
hang at the end of encoding/decoding. Support for handling the event is
added in this commit.

Some devices may not signal V4L2_EVENT_EOS. This is logged as a warning
message during initialization and not treated as a fatal error.

Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavfilter/af_amix: unbreak FATE, increase iterator when breaking from loop
Paul B Mahol [Tue, 14 Apr 2020 17:18:44 +0000 (19:18 +0200)]
avfilter/af_amix: unbreak FATE, increase iterator when breaking from loop

4 years agoavformat/filmstripenc: Use ff_raw_write_packet()
Andreas Rheinhardt [Tue, 7 Apr 2020 21:23:12 +0000 (23:23 +0200)]
avformat/filmstripenc: Use ff_raw_write_packet()

The only difference of the currently used write_packet()-function to
ff_raw_write_packet() is that the former also counts the number of
frames. Yet doing so in the muxer itself is unnecessary as this is
already done generically in write_packet() in libavformat/mux.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/rso: Don't reimplement ff_raw_write_packet()
Andreas Rheinhardt [Tue, 7 Apr 2020 20:53:42 +0000 (22:53 +0200)]
avformat/rso: Don't reimplement ff_raw_write_packet()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/amr: Don't reimplement ff_raw_write_packet()
Andreas Rheinhardt [Tue, 7 Apr 2020 20:50:47 +0000 (22:50 +0200)]
avformat/amr: Don't reimplement ff_raw_write_packet()

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/Makefile: Don't add dependency twice
Andreas Rheinhardt [Tue, 7 Apr 2020 20:30:26 +0000 (22:30 +0200)]
avformat/Makefile: Don't add dependency twice

as has happened with flac_picture.o and the Matroska demuxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/Makefile: Remove false dependencies of WebM and Matroska muxer
Andreas Rheinhardt [Tue, 7 Apr 2020 20:14:13 +0000 (22:14 +0200)]
avformat/Makefile: Remove false dependencies of WebM and Matroska muxer

These muxers don't depend on the WebM Chunk or the WebM DASH Manifest
muxers.

Furthermore, remove some #if checks in webm_chunk.c and webmdashenc.c.
They are always true now that webm_chunk.c and webmdashenc.c are only
compiled when their corresponding muxers are enabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/Makefile: Remove false dependency of WebM DASH manifest muxer
Andreas Rheinhardt [Tue, 7 Apr 2020 20:01:30 +0000 (22:01 +0200)]
avformat/Makefile: Remove false dependency of WebM DASH manifest muxer

It does not use anything from libavformat/matroska.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/webmdashenc: Remove unnecessary header
Andreas Rheinhardt [Tue, 7 Apr 2020 19:53:08 +0000 (21:53 +0200)]
avformat/webmdashenc: Remove unnecessary header

avio_internal.h has been included in this muxer since the beginning and
was never needed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/webm_chunk: Remove superfluous headers
Andreas Rheinhardt [Tue, 7 Apr 2020 19:31:27 +0000 (21:31 +0200)]
avformat/webm_chunk: Remove superfluous headers

libavutil/avstring.h is unnecessary since 8a632b3e. The other
unnecessary headers were never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoconfigure, libavformat/Makefile: Fix webm_chunk dependencies
Andreas Rheinhardt [Tue, 7 Apr 2020 19:25:48 +0000 (21:25 +0200)]
configure, libavformat/Makefile: Fix webm_chunk dependencies

The webm_chunk muxer requires the WebM muxer, yet it does not directly
require anything from libavformat/matroska.c (it does not even include
the corresponding header). So remove the dependency from the Makefile
and add a _select to configure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavfilter/af_amix: use av_strtod() for weights
Paul B Mahol [Tue, 14 Apr 2020 10:38:47 +0000 (12:38 +0200)]
avfilter/af_amix: use av_strtod() for weights

4 years agoavfilter/vf_telecine: avoid possible null-pointer dereference
Paul B Mahol [Tue, 14 Apr 2020 10:12:42 +0000 (12:12 +0200)]
avfilter/vf_telecine: avoid possible null-pointer dereference

4 years agofftools: fix hwaccels option dump redundancy
Jun Zhao [Thu, 9 Apr 2020 13:54:01 +0000 (21:54 +0800)]
fftools: fix hwaccels option dump redundancy

When QSV is enabled in FFmpeg, the command "ffmpeg -hwaccels" shows a
duplicate entry in acceleration methods for QSV:

Hardware acceleration methods:
vaapi
qsv
drm
opencl
qsv

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavformat/matroskaenc: Don't write elements with their default value
Andreas Rheinhardt [Tue, 14 Apr 2020 00:47:44 +0000 (02:47 +0200)]
avformat/matroskaenc: Don't write elements with their default value

This has happened when writing chapters: Both editions as well as
chapters are by default not hidden and given that we don't support
writing hidden chapters at all, we don't need to write said elements at
all. The same goes for ChapterFlagEnabled.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agotests/ref/vsynth: fix fate colr changes (again)
Michael Bradshaw [Mon, 13 Apr 2020 20:34:49 +0000 (13:34 -0700)]
tests/ref/vsynth: fix fate colr changes (again)

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
4 years agotests/ref/vsynth: fix fate colr changes
Michael Bradshaw [Mon, 13 Apr 2020 19:59:06 +0000 (12:59 -0700)]
tests/ref/vsynth: fix fate colr changes

Commit 9842fd3aaf18cd8bda82e03f099a6cea7234bbcf stopped guessing colr
values.

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
4 years agoavformat/movenc: write the mdcv atom by default
Michael Bradshaw [Fri, 27 Mar 2020 23:19:02 +0000 (17:19 -0600)]
avformat/movenc: write the mdcv atom by default

The mdcv atom isn't in ISO/IEC 14496-12:2015 but it is expected to be
added soon. See:
http://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/259529.html

The mdcv atom is already parsed in FFmpeg in mov.c.

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
4 years agoavformat/movenc: remove the write_clli mov flag
Michael Bradshaw [Mon, 13 Apr 2020 16:08:43 +0000 (10:08 -0600)]
avformat/movenc: remove the write_clli mov flag

The clli atom is expected to be standardized soon. See
http://ffmpeg.org/pipermail/ffmpeg-devel/2020-April/259529.html

We now write the clli atom by default.

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
4 years agoavformat/movenc: stop guessing colr atom values
Michael Bradshaw [Mon, 30 Mar 2020 18:23:38 +0000 (12:23 -0600)]
avformat/movenc: stop guessing colr atom values

4 years agoavformat/movenc: use enum values directly for colr atom
Michael Bradshaw [Tue, 31 Mar 2020 15:36:31 +0000 (09:36 -0600)]
avformat/movenc: use enum values directly for colr atom

The switch cases were missing:

  - Primaries: bt470m, film, smpte428, and ebu3213.
  - TRCs: gamma22, gamma28, linear, log, log_sqrt, iec61966_2_4, bt1361,
    iec61966_2_1, bt2020_10bit, and bt2020_12bit.
  - Space: rgb, fcc, ycgco, bt2020_cl, smpte2085, chroma-derived-nc,
    chroma-derived-c, and ictcp.

They also annoyingly remapped the following (which are functionally
equivalent but can be treated differently by clients):

  - smpte240m primaries to smpte170m.
  - smpte170m TRC to bt709.
  - bt470bg color space to smpte170m.

The enum values in FFmpeg are the same values as ITU-T H.273 and
ISO/IEC 23001-8 so we can just use them directly, which is both simpler
and preserves the user intent.

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
4 years agoavfilter/vf_mix: check if array is available
Paul B Mahol [Mon, 13 Apr 2020 14:44:01 +0000 (16:44 +0200)]
avfilter/vf_mix: check if array is available

4 years agolavc/vaapi_decode: fix the build failure when hevc_vaapi is disabled
Linjie Fu [Sun, 12 Apr 2020 15:47:00 +0000 (23:47 +0800)]
lavc/vaapi_decode: fix the build failure when hevc_vaapi is disabled

Verified with ./configure --enable-vaapi --disable-hwaccel=hevc_vaapi

Failure reported in:
http://fate.ffmpeg.org/report.cgi?time=20200401135031&slot=x86_64-archlinux-gcc-random

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agoavformat/matroskaenc: Change signature of mkv_write_track()
Andreas Rheinhardt [Sat, 18 Jan 2020 08:31:01 +0000 (09:31 +0100)]
avformat/matroskaenc: Change signature of mkv_write_track()

Up until now, mkv_write_track() received the index of the stream whose
header data it is about to write as parameter; this index has until
recently been explicitly used to generate both TrackNumber and TrackUID.
But this is no longer so and as there is no reason why the function
for writing a single TrackEntry should even know the index of the
TrackEntry it is about to write, said index is replaced in the list of
function parameters by the corresponding AVStream and mkv_track.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Automatically use right TrackNumber in Cues
Andreas Rheinhardt [Tue, 31 Dec 2019 21:05:57 +0000 (22:05 +0100)]
avformat/matroskaenc: Automatically use right TrackNumber in Cues

mkv_cuepoint (the structure used to store the index entries in the
Matroska muxer) currently contains fields for both the index of the
packet's stream in the AVFormatContext.streams array and for the
Matroska TrackNumber; correspondingly, mkv_add_cuepoint() has parameters
for both. But these two numbers can't be chosen independently, so get
rid of the TrackNumber.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Ignore AttachedFiles for track limit
Andreas Rheinhardt [Wed, 27 Nov 2019 04:00:04 +0000 (05:00 +0100)]
avformat/matroskaenc: Ignore AttachedFiles for track limit

Attachments are streams in FFmpeg, but they are not tracks in Matroska.
Yet they were counted when checking a limit for the number of tracks that
the Matroska muxer imposes. This is unnecessary and has been changed.

Also use unsigned variables for the variables denoting TrackNumbers as
negative TrackNumbers are impossible.

(The Matroska file format actually has practically no limit on the
number of tracks and this is purely what our muxer supports. But even if
this limit were removed/relaxed in the future, it still makes sense to
use small TrackNumbers as this patch does, because greater numbers need
more bytes to encode.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Make output more deterministic
Andreas Rheinhardt [Sun, 29 Dec 2019 09:20:42 +0000 (10:20 +0100)]
avformat/matroskaenc: Make output more deterministic

Using random values for TrackUID and FileUID (as happens when the
AVFMT_FLAG_BITEXACT flag is not set) has the obvious downside of making
the output indeterministic. This commit mitigates this by writing the
potentially random values with a fixed size of eight byte, even if their
actual values would fit into less than eight bytes. This ensures that
even in non-bitexact mode, the differences between two files generated
with the same settings are restricted to a few bytes in the header.
(Namely the SegmentUID, the TrackUIDs (in Tracks as well as when
referencing them via TagTrackUID), the FileUIDs (in Attachments as
well as in TagAttachmentUID) as well as the CRC-32 checksums of the
Info, Tracks, Attachments and Tags level-1-elements.) Without this
patch, there might be an offset/a size difference between two such
files.

The FATE-tests had to be updated because the fixed-sized UIDs are also
used in bitexact mode.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Remove allocations for Attachments
Andreas Rheinhardt [Sun, 29 Dec 2019 01:28:07 +0000 (02:28 +0100)]
avformat/matroskaenc: Remove allocations for Attachments

If there are Attachments to write, the Matroska muxer currently
allocates two objects: An array that contains an entry for each
AttachedFile containing just the stream index of the corresponding
stream and the FileUID used for this AttachedFile; and a structure with
a pointer to said array and a counter for said array. These uids are
generated via code special to Attachments: It uses an AVLFG in the
normal and a sha of the attachment data in the bitexact case. (Said sha
requires an allocation, too.)

But now that an uid is generated for each stream in mkv_init(), there is
no need any more to use special code for generating the FileUIDs of
AttachedFiles: One can simply use the uid already generated for the
corresponding stream. And this makes the whole allocations of the
structures for AttachedFiles as well as the structures itself superfluous.
They have been removed.

In case AVFMT_FLAG_BITEXACT is set, the uids will be different from the
old ones which is the reason why the FATE-test lavf-mkv_attachment
needed to be updated. The old method had the drawback that two
AttachedFiles with the same data would have the same FileUID.
The new one doesn't.

Also notice that the dynamic buffer used to write the Attachments leaks
if an error happens when writing the buffer. By removing the
allocations potential sources of errors have been removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Reuse random seed
Andreas Rheinhardt [Sat, 18 Jan 2020 08:27:25 +0000 (09:27 +0100)]
avformat/matroskaenc: Reuse random seed

This commit reuses the random seed generated in mkv_init() (to determine
the TrackUIDs) for the SegmentUID in order to avoid a potentially
expensive call to av_get_random_seed().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Use random TrackUID
Andreas Rheinhardt [Sun, 29 Dec 2019 00:33:36 +0000 (01:33 +0100)]
avformat/matroskaenc: Use random TrackUID

Up until now, the TrackUID of a Matroska track which is supposed to be
random was not random at all: It always coincided with the TrackNumber
which is usually the 1-based index of the corresponding stream in the
array of AVStreams. This has been changed: It is now set via an AVLFG
if AVFMT_FLAG_BITEXACT is not set. Otherwise it is set like it is set
now (the only change happens if an explicit track number has been
chosen via dash_track_number, because the system used in the normal
situation is now used, too). In particular, no FATE tests need to be
updated.

This also fixes a bug in case the dash_track_number option was used:
In this case the TrackUID was set to the provided number, but the tags
were written with a TagTrackUID simply based upon the index, so that
the tags didn't apply to the track they ought to apply to.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Don't waste bytes writing durations
Andreas Rheinhardt [Sat, 4 Apr 2020 13:35:48 +0000 (15:35 +0200)]
avformat/matroskaenc: Don't waste bytes writing durations

Tags in the Matroska file format can be summarized as follows: There is
a level 1-element called Tags containing one or many Tag elements each
of which in turn contain a Targets element and one or many SimpleTags.
Each SimpleTag roughly corresponds to a single key-value pair similar to
an AVDictionaryEntry. The Targets meanwhile contains information to what
the metadata contained in the SimpleTags contained in the containing Tag
applies (i.e. to the file as a whole or to an individual track).

The Matroska muxer writes such metadata. It puts the metadata of every
stream into a Tag whose Targets makes it point to the corresponding
track. And if the output is seekable, then it also adds another Tag for
each track whose Targets corresponds to the track and where it reserves
space in a SimpleTag to write the duration at the end of the muxing
process into.

Yet there is no reason to write two Tag elements for a track and a few
bytes (typically 24 bytes per track) can be saved by adding the duration
SimpleTag to the other Tag of the same track (if it exists).

FATE has been updated because the output files changed. (Tests that
write to unseekable output (pipes) needn't be updated (no duration tag
has ever been written for them) and the same applies to tests without
further metadata.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Ensure that ChapterUID are != 0
Andreas Rheinhardt [Tue, 26 Nov 2019 17:03:11 +0000 (18:03 +0100)]
avformat/matroskaenc: Ensure that ChapterUID are != 0

AVChapters have an int as id field and therefore this value can appear
<= 0. When remuxing from Matroska, this value actually contains
the lower 32 bits of the original ChapterUID (which can be 64 bits).

In order to ensure that the ChapterUID is always > 0, they were offset
as follows (since 07704c61): First max(0, 1LL - chapter[i].id) was computed
and stored in an uint32_t. And then the IDs were offset using this value.

This has two downsides:
1. It does not ensure that the UID is actually != 0: Namely if there is
a chapter with id == INT_MIN, then the offset will be 2^31 + 1 and a
chapter with id == INT_MAX will become 2^31 - 1 + 2^31 + 1 = 2^32 = 0,
because the actual calculation was performed in 32 bits.
2. As soon as a chapter id appears to be negative, a nontrivial offset
is used, so that not even a ChapterUID that only uses 32 bits is
preserved.

So change this by treating the id as an unsigned value internally and
only offset (by 1) if an id vanishes. The actual offsetting then has to
be performed in 64 bits in order to make sure that no UINT32_MAX wraps
around.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agodoc/filters: clarify metadata and logging for blackdetect
Gyan Doshi [Mon, 13 Apr 2020 05:53:24 +0000 (11:23 +0530)]
doc/filters: clarify metadata and logging for blackdetect

4 years agofftools/ffmpeg: also flush encoders which have a variable frame size
Marton Balint [Tue, 24 Mar 2020 23:27:45 +0000 (00:27 +0100)]
fftools/ffmpeg: also flush encoders which have a variable frame size

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavcodec/cbs: Avoid leaving the ... out in calls to variadic macros
Andreas Rheinhardt [Sun, 22 Mar 2020 19:34:21 +0000 (20:34 +0100)]
avcodec/cbs: Avoid leaving the ... out in calls to variadic macros

According to C99, there has to be at least one argument for every ...
in a variadic function-like macro. In practice most (all?) compilers also
allow to leave it completely out, but it is nevertheless required: In a
variadic macro "there shall be more arguments in the invocation than there
are parameters in the macro definition (excluding the ...)." (C99,
6.10.3.4).

CBS (not the framework itself, but the macros used in the
cbs_*_syntax_template.c files) relies on the compiler allowing to leave
a variadic macro argument out. This leads to warnings when compiling in
-pedantic mode, e.g. "warning: must specify at least one argument for
'...' parameter of variadic macro [-Wgnu-zero-variadic-macro-arguments]"
from Clang.

Most of these warnings can be easily avoided: The syntax_templates
mostly contain helper macros that expand to more complex variadic macros
and these helper macros often omit an argument for the .... Modifying
them to always expand to complex macros with an empty argument for the
... at the end fixes most of these warnings: The number of warnings went
down from 400 to 0 for cbs_av1, from 1114 to 32 for cbs_h2645, from 38 to
0 for cbs_jpeg, from 166 to 0 for cbs_mpeg2 and from 110 to 8 for cbs_vp9.

These eight remaining warnings for cbs_vp9 have been fixed by switching
to another macro in cbs_vp9_syntax_template: The fixed values for the
sync bytes as well as the trailing bits for byte-alignment are now read
via the fixed() macro (this also adds a check to ensure that trailing
bits are indeed zero as they have to be).

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agolavu/mem: Make other alloc functions more similar to av_malloc().
Carl Eugen Hoyos [Sat, 11 Apr 2020 22:36:30 +0000 (00:36 +0200)]
lavu/mem: Make other alloc functions more similar to av_malloc().

Do not limit the array allocation functions and av_calloc() to allocations
of INT_MAX, instead depend on max_alloc_size like av_malloc().

Allows a workaround for ticket #7140.

4 years agoavformat/Makefile: Add missing rawenc dependency for iLBC muxer
Andreas Rheinhardt [Tue, 7 Apr 2020 17:17:19 +0000 (19:17 +0200)]
avformat/Makefile: Add missing rawenc dependency for iLBC muxer

Forgotten in ab502fab.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agotools/target_dec_fuzzer: Adjust threshold for zerocodec
Michael Niedermayer [Sat, 22 Feb 2020 23:08:19 +0000 (00:08 +0100)]
tools/target_dec_fuzzer: Adjust threshold for zerocodec

Fixes: Timeout (147sec -> 1sec)
Fixes: 20764/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZEROCODEC_fuzzer-5068274603917312
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/oggdec: Check for EOF after page header
Michael Niedermayer [Wed, 1 Apr 2020 18:58:52 +0000 (20:58 +0200)]
avformat/oggdec: Check for EOF after page header

Fixes: Infinite loop
Fixes: Ticket8594
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoswscale/yuv2rgb: Fix vertical dither offset with slices
Michael Niedermayer [Thu, 2 Apr 2020 20:38:46 +0000 (22:38 +0200)]
swscale/yuv2rgb: Fix vertical dither offset with slices

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/mips: fix get_cabac_inline_mips function name
Rosen Penev [Sun, 12 Apr 2020 01:54:33 +0000 (18:54 -0700)]
avcodec/mips: fix get_cabac_inline_mips function name

On other platforms, the functions are named get_cabac_inline_xxx but not
this one. There's also a define.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoconfigure: add mv30 blockdsp dependency
Peter Ross [Fri, 10 Apr 2020 13:05:51 +0000 (23:05 +1000)]
configure: add mv30 blockdsp dependency

fix link error introduced in 481ebb1c8b3368e2a1bb9e33bd10b50a8818dbf7

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
4 years agoavcodec/libaomenc,cosmetics: fix a typo
James Zern [Sat, 11 Apr 2020 22:22:35 +0000 (15:22 -0700)]
avcodec/libaomenc,cosmetics: fix a typo

tradeof -> trade-off

Signed-off-by: James Zern <jzern@google.com>
4 years agoavcodec/libaomenc.c: Add a libaom command-line option 'tune'
Wang Cao [Fri, 3 Apr 2020 21:00:26 +0000 (05:00 +0800)]
avcodec/libaomenc.c: Add a libaom command-line option 'tune'

Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: James Zern <jzern@google.com>
4 years agolibavformat/mov: fix multiple trun per traf
John Stebbins [Sun, 29 Mar 2020 21:27:38 +0000 (14:27 -0700)]
libavformat/mov: fix multiple trun per traf

dts would start over at the beginning of each trun when they should be
computed contiguously for each trun in a traf

Fixes ticket 8070

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agomov: fix seek to next root atom in fragmented mp4
John Stebbins [Sun, 29 Mar 2020 20:32:45 +0000 (13:32 -0700)]
mov: fix seek to next root atom in fragmented mp4

If some but not all moof's are referenced in an sidx, whole fragments
were being skipped.

Fixes tickets 7377, 7389, and 8502

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/dpcm: clip exponent into supported range in XAN DPCM
Michael Niedermayer [Thu, 9 Apr 2020 13:37:55 +0000 (15:37 +0200)]
avcodec/dpcm: clip exponent into supported range in XAN DPCM

Fixes: shift exponent 32 is too large for 32-bit type 'int'
Fixes: 21200/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XAN_DPCM_fuzzer-5754704894361600
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/jpeg2000: fix precinct coordinate calculation
Gautam Ramakrishnan [Sat, 11 Apr 2020 06:40:09 +0000 (12:10 +0530)]
libavcodec/jpeg2000: fix precinct coordinate calculation

The calculation of precinct boundaries has been
fixed. The precinct boundaries were calculated
as an offset to the band boundary, but must
instead be calculated as an offset from the
reslevel. This patch fixes #4669 and #4679.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolibavcodec/jpeg2000dec.c: fix error in cod marker
Gautam Ramakrishnan [Sat, 11 Apr 2020 06:40:08 +0000 (12:10 +0530)]
libavcodec/jpeg2000dec.c: fix error in cod marker

This patch fixes an error where the COC marker
overrides all data of the SPcod field of the
COD marker. It must override only one bit of
SPcod field. This now allows p0_08.j2k to be
decoded correctly (mentioned in #4679).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ac3_tab: Zero-terminate ff_ac3_sample_rate_tab
Andreas Rheinhardt [Sat, 11 Apr 2020 14:11:01 +0000 (16:11 +0200)]
avcodec/ac3_tab: Zero-terminate ff_ac3_sample_rate_tab

This is required to use it as an AVCodec.supported_samplerates array.
Adding the sentinel has been forgotten in 4679a474.
Without it e.g. the FATE-test ffmpeg-filter_complex_audio fails with ASAN.

Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/adpcm: remove unused shift parameter from adpcm_ima_qt_expand_nibble()
Zane van Iperen [Sat, 11 Apr 2020 08:12:40 +0000 (08:12 +0000)]
avcodec/adpcm: remove unused shift parameter from adpcm_ima_qt_expand_nibble()

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
4 years agolavc/amrwbdec: Add a comment about the missing muting technique.
Carl Eugen Hoyos [Sat, 11 Apr 2020 12:23:51 +0000 (14:23 +0200)]
lavc/amrwbdec: Add a comment about the missing muting technique.

4 years agolavc/amrwbdec: Output silence for frames marked as corrupt.
Carl Eugen Hoyos [Sun, 5 Apr 2020 15:35:38 +0000 (17:35 +0200)]
lavc/amrwbdec: Output silence for frames marked as corrupt.

Fixes ticket #7113.

4 years agolavc/amrwbdec: Remove a dead comparison.
Carl Eugen Hoyos [Sat, 11 Apr 2020 12:08:49 +0000 (14:08 +0200)]
lavc/amrwbdec: Remove a dead comparison.

Modes > MODE_SID are already filtered out at this point.
Simplifies the following change.

4 years agoavcodec/aacdec: fix compilation under soft float MIPS
Rosen Penev [Mon, 6 Apr 2020 03:37:10 +0000 (20:37 -0700)]
avcodec/aacdec: fix compilation under soft float MIPS

Place HAVE_MIPSFPU further up so that functions that use floating point
ASM are defined away. Otherwise compilation failures result when soft
float in enabled on the toolchain.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years agolavfi/telecine: Mark telecined frames as interlaced.
Carl Eugen Hoyos [Sat, 4 Apr 2020 23:00:44 +0000 (01:00 +0200)]
lavfi/telecine: Mark telecined frames as interlaced.

4 years agolavf/oggparsevorbis: Use case-insensitive key compare for vorbis picture
Mattias Wadman [Sat, 11 Apr 2020 10:56:21 +0000 (12:56 +0200)]
lavf/oggparsevorbis: Use case-insensitive key compare for vorbis picture

Regression since 8d3630c5402fdda2889fe4f74f7dcdd50ebca654 where keys were changed
to not be touppered but the picture block strcmp was not changed to be case-insensitive.

Fixes ticket #8608.

4 years agolibavformat/mov: restore use of mfra time as dts
John Stebbins [Mon, 6 Apr 2020 17:42:26 +0000 (11:42 -0600)]
libavformat/mov: restore use of mfra time as dts

This was inadvertantly removed in 4a9d32baca

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
4 years agoavfilter/delogo: correct indentation for option show.
Gyan Doshi [Fri, 10 Apr 2020 19:29:18 +0000 (00:59 +0530)]
avfilter/delogo: correct indentation for option show.

4 years agoavfilter/delogo: remove deprecated options
Gyan Doshi [Fri, 10 Apr 2020 18:43:04 +0000 (00:13 +0530)]
avfilter/delogo: remove deprecated options

Deprecated in 2015 in 8bc708fcee1

4 years agolavc/xsubenc: return meaningfull error codes
John Stebbins [Fri, 10 Apr 2020 18:48:01 +0000 (12:48 -0600)]
lavc/xsubenc: return meaningfull error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/webvttenc: return more meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:36:23 +0000 (12:36 -0600)]
lavc/webvttenc: return more meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/srtenc: return more meaninful error codes
John Stebbins [Fri, 10 Apr 2020 18:34:30 +0000 (12:34 -0600)]
lavc/srtenc: return more meaninful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: return more meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:30:10 +0000 (12:30 -0600)]
lavc/movtextenc: return more meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/assenc: return more meaningful error code
John Stebbins [Fri, 10 Apr 2020 18:15:26 +0000 (12:15 -0600)]
lavc/assenc: return more meaningful error code

When the buffer is too small, return AVERROR_BUFFER_TOO_SMALL

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/dvbsub: return meaningful error codes
John Stebbins [Fri, 10 Apr 2020 18:08:46 +0000 (12:08 -0600)]
lavc/dvbsub: return meaningful error codes

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/dvbsub: fix potential encode buffer overflow
John Stebbins [Fri, 10 Apr 2020 18:07:59 +0000 (12:07 -0600)]
lavc/dvbsub: fix potential encode buffer overflow

encode buffer size was ignored

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agoChangelog: Add entry for expanded styling support in movtext
Philip Langdale [Fri, 10 Apr 2020 16:30:53 +0000 (09:30 -0700)]
Changelog: Add entry for expanded styling support in movtext

4 years agolavc/movtextenc: handle changes to hilight alpha
John Stebbins [Thu, 9 Apr 2020 19:12:39 +0000 (13:12 -0600)]
lavc/movtextenc: handle changes to hilight alpha

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add option to scale fontsize with height
John Stebbins [Sun, 5 Apr 2020 21:02:27 +0000 (15:02 -0600)]
lavc/movtextenc: add option to scale fontsize with height

If the video dimensions are different than the ASS play_res then the
font sizes need to be adjusted to get the same apparent render size.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add font name handling
John Stebbins [Sun, 5 Apr 2020 20:26:02 +0000 (14:26 -0600)]
lavc/movtextenc: add font name handling

Initializes the mov text sample description from the ASS header and
creates an mov font table from the fonts available in the ASS Styles.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: simplify initialization of new style record
John Stebbins [Sun, 5 Apr 2020 14:44:24 +0000 (08:44 -0600)]
lavc/movtextenc: simplify initialization of new style record

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: handle cancel overrides callback
John Stebbins [Sun, 5 Apr 2020 14:34:45 +0000 (08:34 -0600)]
lavc/movtextenc: handle cancel overrides callback

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add font size tag handling
John Stebbins [Sat, 4 Apr 2020 22:46:40 +0000 (16:46 -0600)]
lavc/movtextenc: add font size tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add alpha tag handling
John Stebbins [Sat, 4 Apr 2020 22:34:16 +0000 (16:34 -0600)]
lavc/movtextenc: add alpha tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: add color tag handling
John Stebbins [Sat, 4 Apr 2020 22:05:18 +0000 (16:05 -0600)]
lavc/movtextenc: add color tag handling

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: init style record from ASS dialog style
John Stebbins [Sat, 4 Apr 2020 21:23:34 +0000 (15:23 -0600)]
lavc/movtextenc: init style record from ASS dialog style

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: fix unclosed style records
John Stebbins [Sat, 4 Apr 2020 20:52:00 +0000 (14:52 -0600)]
lavc/movtextenc: fix unclosed style records

The last record at the end of each dialog was never closed

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: simplify style record updates
John Stebbins [Sat, 4 Apr 2020 20:43:25 +0000 (14:43 -0600)]
lavc/movtextenc: simplify style record updates

Makes style update code easier to extend for style types not yet handled

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: keep values in native byte order till written
John Stebbins [Sat, 4 Apr 2020 19:52:44 +0000 (13:52 -0600)]
lavc/movtextenc: keep values in native byte order till written

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextenc: use correct color component order
John Stebbins [Sat, 4 Apr 2020 19:36:51 +0000 (13:36 -0600)]
lavc/movtextenc: use correct color component order

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/ass_split: fix parsing utf8 scripts
John Stebbins [Sat, 4 Apr 2020 19:17:33 +0000 (13:17 -0600)]
lavc/ass_split: fix parsing utf8 scripts

The [Script Info] section was skipped if starts with UTF8 BOM

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: allow setting subtitle frame dimensions
John Stebbins [Sat, 4 Apr 2020 18:33:54 +0000 (12:33 -0600)]
lavc/movtextdec: allow setting subtitle frame dimensions

Font sizes are relative to the subtitle frame dimensions. If the
expected frame dimensions are not known, the font sizes will most
likely be incorrect.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: restore active style color after hilite
John Stebbins [Sat, 4 Apr 2020 18:14:48 +0000 (12:14 -0600)]
lavc/movtextdec: restore active style color after hilite

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: add color and alpha style tags
John Stebbins [Sat, 4 Apr 2020 18:06:39 +0000 (12:06 -0600)]
lavc/movtextdec: add color and alpha style tags

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: add alpha default to ass header colors
John Stebbins [Sat, 4 Apr 2020 17:53:59 +0000 (11:53 -0600)]
lavc/movtextdec: add alpha default to ass header colors

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: make sure default font name is set
John Stebbins [Sat, 4 Apr 2020 17:45:20 +0000 (11:45 -0600)]
lavc/movtextdec: make sure default font name is set

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: only write fontsize, fontID tags if not default
John Stebbins [Sat, 4 Apr 2020 17:40:57 +0000 (11:40 -0600)]
lavc/movtextdec: only write fontsize, fontID tags if not default

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: handle changes to default style flags
John Stebbins [Sat, 4 Apr 2020 17:29:53 +0000 (11:29 -0600)]
lavc/movtextdec: handle changes to default style flags

Style flags were only being turned on.  If the default was on and style
record turned off, style flag remained on.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: fix bold, italic, underline flags
John Stebbins [Sat, 4 Apr 2020 17:21:16 +0000 (11:21 -0600)]
lavc/movtextdec: fix bold, italic, underline flags

They should be 0 or 1 so that 0 or -1 is written to the ass header

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: simplify style record walk
John Stebbins [Sat, 4 Apr 2020 17:01:43 +0000 (11:01 -0600)]
lavc/movtextdec: simplify style record walk

It's not necessary to walk the style record list twice per subtitle
character.  style records are in order and do not overlap.

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc/movtextdec: fix ass header colors
John Stebbins [Sat, 4 Apr 2020 16:51:04 +0000 (10:51 -0600)]
lavc/movtextdec: fix ass header colors

A conversion from rgb to bgr is necessary

Signed-off-by: Philip Langdale <philipl@overt.org>
4 years agolavc: install codec_desc.h
Anton Khirnov [Fri, 10 Apr 2020 15:06:15 +0000 (17:06 +0200)]
lavc: install codec_desc.h

Forgotten in 672946c7fe6de56ccf5d2271ad1bfeb2290f394f

4 years agoh264dec: do not set picture_structure on init
Anton Khirnov [Sun, 30 Jul 2017 12:43:33 +0000 (14:43 +0200)]
h264dec: do not set picture_structure on init

This has been cargo culted from mpegvideo and serves no useful purpose.
It will be initialize correctly in h264_field_start()

4 years agoh264dec: rename flush_dpb()
Anton Khirnov [Sat, 29 Jul 2017 19:21:50 +0000 (21:21 +0200)]
h264dec: rename flush_dpb()

The name is misleading, this function does a lot more than just flushing
the DPB.

4 years agoh264_ps: make the PPS hold a reference to its SPS
Anton Khirnov [Mon, 1 May 2017 19:42:54 +0000 (21:42 +0200)]
h264_ps: make the PPS hold a reference to its SPS

It represents the relationship between them more naturally and will be
useful in the following commits.

Allows significantly more frames in fate-h264-attachment-631 to be
decoded.