Commit Graph

106635 Commits

Author SHA1 Message Date
Andreas Rheinhardt c4fcfa47df avcodec/h264_slice: Fix decoding undamaged input with slices
ff_er_frame_start() initializes ERContext.error_count
to three times the number of macroblocks to decode.
Later ff_er_add_slice() reduces this number by the amount
of macroblocks whose AC resp. DC resp. MV have been finished
(so every correctly decoded MB counts three times).
So the frame has been decoded correctly if error_count is zero
at the end.

The H.264 decoder uses multiple ERContexts when using
slice threading and therefore combines these error counts:
The first slice's ERContext is intended to be initialized
by ff_er_frame_start(), error_count of all the other
slice contexts is intended to be zeroed initially and
all afterwards all the error_counts are summed.

Yet commit 43b434210e
(probably unintentionally) changed the code to set
the first slice's error_count to zero as well.
This leads to bogus error messages in case one decodes
an input video using multiple slices with slice threading
with error concealment enabled (which is not the default)
("concealing 0 DC, 0 AC, 0 MV errors in [IPB] frame");
furthermore the returned frame is marked as corrupt as well
(ffmpeg reports "corrupt decoded frame in stream %d" for this).

This can be fixed easily given that only the first ERContext
is really used since 7be2d2a70cd20d88fd826a83f87037d14681a579:
Don't reset the error_count; and don't sum the error counts as well.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-25 19:07:13 +01:00
Paul B Mahol a660136daa avfilter/vsrc_life: set outlink frame_rate 2022-03-25 18:20:01 +01:00
Paul B Mahol 3d131545ea avfilter/vsrc_cellauto: set outlink frame_rate 2022-03-25 18:20:01 +01:00
Paul B Mahol 4fb5b0368f avfilter/vsrc_mandelbrot: set outlink frame_rate 2022-03-25 18:20:01 +01:00
Paul B Mahol ccb33caf04 avfilter/vsrc_mandelbrot: rename misleading variable 2022-03-25 18:20:01 +01:00
Paul B Mahol 38804e0e23 avfilter/vsrc_mptestsrc: set outlink frame_rate 2022-03-25 18:20:01 +01:00
Paul B Mahol 5c2d333ecf avfilter/vsrc_gradients: set outlink frame_rate 2022-03-25 18:20:01 +01:00
Paul B Mahol a45b71570a avfilter/vsrc_gradients: rename misleading variable 2022-03-25 18:20:01 +01:00
Paul B Mahol 75929ed62b avfilter/vsrc_sierpinski: set frame_rate to outlink 2022-03-25 18:20:01 +01:00
Paul B Mahol d57a213998 avfilter/vsrc_sierpinski: rename misleading variable 2022-03-25 18:20:00 +01:00
Paul B Mahol 89083142fa fate: add crystalizer test 2022-03-25 18:18:44 +01:00
James Almer cbeb827cfb avutil/tests/channel_layout: test av_channel_layout_check()
Should increase test coverage

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 12:09:21 -03:00
James Almer 95ac380252 avutil/tests/channel_layout: test the output of av_channel_layout_subset()
Should increase test coverage a bit

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 12:09:19 -03:00
James Almer 167c5a6afc avutil/tests/channel_layout: test the output of av_channel_layout_standard()
Should increase test coverage.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 11:46:51 -03:00
James Almer f9ed91abc9 avutil/tests/channel_layout: test generating a custom layout using ambisonic channels and a non diegetic channel with a custom name
Should increase test coverage a bit

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 11:46:48 -03:00
James Almer 1e24fad867 doc/utils: add missing 22.2 layout entry
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 09:26:45 -03:00
James Almer e4f6fce9e0 avutil/channel_layout: add missing check for AV_CHAN_NONE in av_channel_description
Prevents printing "user -1" on invalid channel ids.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 09:24:39 -03:00
James Almer b04f14136e fftools/opt_cmdutils: fix printing known channel layouts
Look for the generic "USR" labels instead of "?" to skip channels with no
known names, and actually print the decomposition of standard channel layouts.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 08:42:45 -03:00
James Almer 6e04ace7fe avutil/channel_layout: don't try to print NULL string pointers in av_channel_{name,description}
Instead fallback to print USR%d for channels id < 64 without a known name.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-25 08:38:19 -03:00
Gyan Doshi fa12d808d7 doc/encoders: update libwebpenc quality option
A private encoder option 'quality' was added in 716674b151, making
the doc entry obsolete.
2022-03-24 17:33:00 +05:30
Paul B Mahol 28d011516b avfilter/x86/vf_limiter: use movu, dst may not be always aligned
Happens with pad filter after limiter.
2022-03-24 09:44:09 +01:00
Andreas Rheinhardt f4098bbc3b avcodec/bsf: Add FFBitStreamFilter, hide internals of BSFs
This patch is analogous to 20f972701806be20a77f808db332d9489343bb78:
It hides the internal part of AVBitStreamFilter by adding a new
internal structure FFBitStreamFilter (declared in bsf_internal.h)
that has an AVBitStreamFilter as its first member; the internal
part of AVBitStreamFilter is moved to this new structure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-23 23:45:45 +01:00
Andreas Rheinhardt 1dcd0adedd avformat: Remove unnecessary inclusions from libavcodec
Also improve the other headers a bit while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-23 23:45:39 +01:00
Andreas Rheinhardt 33df1ba6b2 avcodec, avformat: Remove unnecessary inclusions of lavc/internal.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-23 23:45:39 +01:00
Andreas Rheinhardt ef92c352e7 avfilter/vf_vpp_qsv: Remove unnecessary lavc and lavf headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-23 23:45:38 +01:00
Andreas Rheinhardt a9cc413496 avcodec/internal: Move FF_QSCALE_TYPE_* to mpegvideodec.h
These values are only used by mpegvideo-based decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-23 23:45:38 +01:00
Andreas Rheinhardt 8abfc327bd avfilter/qp_table: Stop using FF_QSCALE_TYPE_*
All FF_QSCALE_TYPE values used by libavfilter originate
from libavfilter (namely from ff_qp_table_extract());
no value is exchanged between libavcodec and libavutil.
The values that are exchanged (and used in libavfilter)
are of type enum AVVideoEncParamsType.

Therefore this patch stops using said FF_QSCALE_TYPE_*
in libavfilter and uses enum AVVideoEncParamsType
directly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-23 23:45:38 +01:00
Andreas Rheinhardt e142153bd7 avcodec/internal, avfilter/qp_table: Remove unused FF_QSCALE_TYPEs
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-23 23:45:38 +01:00
Jaakko Perttilä b1cbeabf5e ffmpeg: add packet duration to AVPacket logging
Especially useful when debugging subtitle output, but also shows
if values are set or not for demux and encoding.

Co-authored-by: Jan Ekström <jan.ekstrom@24i.com>

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2022-03-23 17:26:20 +02:00
James Almer b65ce7bed8 Revert "avcodec/av1dec: Check tile_cols"
This reverts commit 4fdfe430c1.

The previous commit ensures this field will never be zero.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-23 12:03:57 -03:00
James Almer 5670eddf8c avcodec/av1: only set the private context pix_fmt field if get_pixel_format() succeeds
Otherwise get_pixel_format() will not be called when parsing a subsequent Sequence
Header in non hwaccel enabled scenarios, allowing frame parsing when it shouldn't.

This prevents the scenario seqhdr -> frame_hdr/redundant_frame_hdr -> seqhdr ->
redundant_frame_hdr from having the latter redundant frame header parsed as if it
was a frame header by the decoder because the former was discarded.
Since CBS did not discard it, the latter redundant frame header is output with a
zeroed AV1RawFrameHeader struct, which can have undesired results, like division
by zero with fields normally guaranteed to be anything else.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-23 12:03:57 -03:00
Christopher Degawa 51c0b9e829 avcodec/libsvtav1: pass color description info
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
2022-03-23 16:28:15 +02:00
Oneric 66901ce162 avfilter/vf_subtitles: pass storage size to libass
Due to a quirk of the ASS format some tags depend on the exact storage
resolution of the video, so tell libass via ass_set_storage_size.

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-23 09:08:49 -03:00
Anton Khirnov 1728ad8293 fftools/cmdutils: drop redundant code
It allocates a dummy sws/swr context and tries setting options on it,
apparently to check if they are valid. This is redundant, since the
options will be checked if/when they are later applied on a context that
is actually used for conversion.
2022-03-22 18:49:43 +01:00
Anton Khirnov bd0cbebf3e fftools: drop the fake "default" option from ffplay/ffprobe
It tries to process any unhandled options as AVOptions. Handle this
directly in cmdutils.c, without resorting to a confusing fake option
definition (which is currently visible to the users in -help output).
2022-03-22 18:49:43 +01:00
Anton Khirnov 1dd6363581 fftools/ffprobe: drop -show_format_entry
Deprecated since 2012.
2022-03-22 18:49:43 +01:00
Anton Khirnov 6fd1cd6053 fftools/ffplay: drop options deprecated since 2011 2022-03-22 18:49:43 +01:00
Anton Khirnov 8d293918b5 fftools/ffmpeg: drop mistakenly added empty line 2022-03-22 18:49:43 +01:00
Anton Khirnov 00da464658 fftools: move opt_timelimit from cmdutils to ffmpeg
This option is only supported by ffmpeg.
2022-03-22 18:49:43 +01:00
Anton Khirnov a545cb2b9d fftools/cmdutils: split common option handlers into their own file 2022-03-22 18:49:43 +01:00
Anton Khirnov c99b93c5d5 fftools: drop useless indirection 2022-03-22 18:49:43 +01:00
Anton Khirnov 5e51f5af33 fftools/cmdutils: drop extern declarations for nonexistent variables 2022-03-22 18:49:43 +01:00
Anton Khirnov e46d8c53a3 fftools/cmdutils: drop prototypes for nonexistent functions 2022-03-22 18:49:43 +01:00
Anton Khirnov 1b7ecb3eef avfilter: handle duplicates in the options string
Use the same logic as fftools/cmdutils - when a flag-type option starts
with [+-], append it to the existing value.
2022-03-22 18:49:43 +01:00
Anton Khirnov a0f04433f4 avfilter: simplify processing child context options
THe call to av_opt_set() is redundant, since the option is written in
the options dict, which is later passed to avfilter_init_dict().
2022-03-22 18:49:43 +01:00
Zhao Zhili 303ddab7ea avfilter/video: fix shadowed variable
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2022-03-22 18:49:30 +01:00
Limin Wang 42f1be4461 avformat/movenc: use warning log level and small adjustment for the log
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2022-03-22 23:00:53 +08:00
Limin Wang fc8a6a6f4c avformat/movenc: initialize pts/dts of timecode packet
Fix below error message when timecode packet is written.
"Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format"

try to reproduce by:
ffmpeg -y -f lavfi -i color -metadata "timecode=00:00:00:00" -t 1 test.mov

Note although error message is printed, the timecode packet will be written anyway. So
the patch 2/2 will try to change the log level to warning.

Fixes ticket #9488

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2022-03-22 23:00:53 +08:00
James Almer e78173557d ffmpeg: make the ac option set the demuxer's ch_layout AVOption
channels is deprecated on all supported raw demuxers.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:39 -03:00
James Almer 639c2f0049 ffmpeg: add a ch_layout option as an alias to channel_layout
This ensures it's parsed as a CLI option instead of the AVCodecContext AVOption.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-03-22 08:45:38 -03:00