Commit Graph

105473 Commits

Author SHA1 Message Date
Andreas Rheinhardt
c793e05381 avcodec/h264dec: Remove unnecessary headers
E.g. the inclusion of parser.h comes from a time when
the parser used a H264Context.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-26 15:30:54 +01:00
Andreas Rheinhardt
5fef87f140 avcodec/h264*: Remove unnecessary h264_mvpred.h inclusions
This is only needed by h264_cabac.c and h264_cavlc.c.
Also fix up the other headers while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-26 15:30:54 +01:00
Anton Khirnov
d0f0d61392 lavc/svq3: stop including h264dec.h
The only thing that is actually used directly from there is the
PART_NOT_AVAILABLE constant, which can be moved to h264pred.h.

Otherwise it only depends on other indirectly included headers.
2022-01-26 15:30:28 +01:00
Anton Khirnov
359912f0df lavc/x86/h264_qpel: stop unnecessarily including h264dec 2022-01-26 15:23:30 +01:00
Anton Khirnov
76b8ae2e22 lavc/vdpau: stop unnecessarily including h264dec 2022-01-26 15:23:30 +01:00
Anton Khirnov
ded77f5654 lavc/h264: move MB_TYPE defs from h264dec.h to h264_parse
Allows to stop including h264dec.h in h264data.c.
2022-01-26 15:23:30 +01:00
Anton Khirnov
2f1716dcd6 lavc/h264_parse: stop including h264dec.h
It is unnecessary and only files that are parts of the decoder (as
opposed to standalone code called by the decoder) are allowed to include
h264dec.h
2022-01-26 15:23:30 +01:00
Anton Khirnov
e1027aba68 lavc/h264data.h: stop including h264dec.h
This header does not need anything from there.
2022-01-26 15:23:30 +01:00
Anton Khirnov
d552f2535b lavc/h264: move some shared code from h264dec to h264_parse 2022-01-26 15:23:30 +01:00
Anton Khirnov
df2ee38178 lavc/h264_parser: add missing headers 2022-01-26 15:23:30 +01:00
Anton Khirnov
b6f3334a13 lavc/h264: replace MAX_DELAYED_PIC_COUNT by H264_MAX_DPB_FRAMES 2022-01-26 15:23:30 +01:00
Anton Khirnov
ef4537bd1b lavc/h264: replace MAX_DELAYED_PIC_COUNT with FF_ARRAY_ELEMS where appropriate 2022-01-26 15:23:29 +01:00
Anton Khirnov
5484c502db lavc/h264dec.h: Move MMCOOpcode to h264_parse.h
Both parser and decoder use it, so h264_parse is the proper place
for it.
2022-01-26 15:23:08 +01:00
Anton Khirnov
b05cebe602 lavc/h264: replace MAX_MMCO_COUNT with H264_MAX_MMCO_COUNT
They apparently serve the same purpose; the latter is one larger and has
a comment explaining how the value is derived, so seems more
trustworthy.
2022-01-26 15:23:08 +01:00
Andreas Rheinhardt
0ebfd64858 avcodec/h264dec: Move pack8to16 to its only user
Namely to h264_cabac.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-26 15:23:08 +01:00
Andreas Rheinhardt
b531b58b2c avcodec/h264dec: Move find_start_code() to its only user
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-26 15:23:08 +01:00
Lynne
6c8e841824
lavu/tx: do not mix declarations and code 2022-01-26 04:55:23 +01:00
Lynne
28bff6ae54
x86/tx_float: add permute-free FFT versions
These are used in the PFA transforms and MDCTs.
2022-01-26 04:13:58 +01:00
Lynne
350142560b
lavu: bump minor and add APIchanges for new lavu/tx additions 2022-01-26 04:13:57 +01:00
Lynne
af94ab7c7c
lavu/tx: add an RDFT implementation
RDFTs are full of conventions that vary between implementations.
What I've gone for here is what's most common between
both fftw, avcodec's rdft and what we use, the equivalent of
which is DFT_R2C for forward and IDFT_C2R for inverse. The
other 2 conventions (IDFT_R2C and DFT_C2R) were not used at
all in our code, and their names are also not appropriate.
If there's a use for either, we can easily add a flag which
would just flip the sign on one exptab.

For some unknown reason, possibly to allow reusing FFT's exp tables,
av_rdft's C2R output is 0.5x lower than what it should be to ensure
a proper back-and-forth conversion.
This code outputs its real samples at the correct level, which
matches FFTW's level, and allows the user to change the level
and insert arbitrary multiplies for free by setting the scale option.
2022-01-26 04:12:46 +01:00
Lynne
ef4bd81615
lavu/tx: rewrite internal code as a tree-based codelet constructor
This commit rewrites the internal transform code into a constructor
that stitches transforms (codelets).
This allows for transforms to reuse arbitrary parts of other
transforms, and allows transforms to be stacked onto one
another (such as a full iMDCT using a half-iMDCT which in turn
uses an FFT). It also permits for each step to be individually
replaced by assembly or a custom implementation (such as an ASIC).
2022-01-26 04:12:44 +01:00
Lynne
c14976be04
lavu/tx: improve documentation for existing transforms 2022-01-26 04:12:37 +01:00
James Almer
3c804fdd4a avcodec/h264_parser: don't alter decoder private data
Signed-off-by: James Almer <jamrial@gmail.com>
2022-01-24 14:14:24 -03:00
Jan Ekström
0a83ecbf48 tests: add test for ffmpeg's fix_sub_duration feature
This long-existing feature calculates subtitle durations by keeping
it around until the following subtitle is decoded, and then utilizes
the following subtitle's pts as the end point of the previous one.

Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2022-01-24 12:57:03 +02:00
Gyan Doshi
b635ac126f doc/filters: note format constraint for volumedetect 2022-01-24 09:51:07 +05:30
Wenbin Chen
05ba0ffca9 libavcodec/qsvenc: fix a memory leak problem
"qf->frame" ref to input frame but it isn't released. av_frame_unref()
is added before refering qf->frame to new frame to make sure the previous
reference is released.

Reported-by: Mark Samuelson <Mark.Samuelson@sonicfoundry.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-24 10:18:11 +08:00
Kyle Swanson
3d29724c00 avfilter/vf_libvmaf: update filter for libvmaf v2.0.0 2022-01-23 11:41:30 -08:00
Paul B Mahol
06a54a4ec7 avfilter/vf_v360: improve xyz_to_dfisheye() 2022-01-22 18:32:58 +01:00
Andreas Rheinhardt
741b5061ea fate/ffmpeg: Add test for autorotating video
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-22 17:01:16 +01:00
Andreas Rheinhardt
71e2825150 swscale/x86/swscale: Remove superfluous and invalid ';'
Inside a function an unnecessary ';' is just a null statement;
yet outside of it it is actually illegal (but compilers happen
to accept it without warning except when using -pedantic).
So modify the macros to always expect the user to add a ';'.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-22 17:00:45 +01:00
Andreas Rheinhardt
ed18b8d79f avformat/hls: Remove redundant cast
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 16:47:38 +01:00
Andreas Rheinhardt
c24ee7c275 avformat/mux: Peek into the muxing queue for avoid_negative_ts
Peeking into the muxing queue can improve the estimate of
the lowest timestamp needed for avoid_negative_ts in case
the lowest timestamp is in a packet other than the first packet
to be muxed.
This fixes tickets #4536 and #5784 as well as the output from
the matroska-avoid-negative-ts FATE-test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 16:47:38 +01:00
Andreas Rheinhardt
c602deb138 avformat/mux: Preserve sync even if later packet has negative ts
write_packet() has code to shift the packets timestamps
to make them nonnegative or even make them start at ts zero;
this code inspects every packet that is written and if a packet
with negative timestamp (whether this is dts or pts depends upon
another flag; basically: Matroska uses pts, everyone else dts)
is encountered, this is offset to make the timestamp zero.
All further packets will be offset accordingly (with the offset
converted according to the streams' timebases).

This is based around an assumption, namely that the timestamps
are indeed non-decreasing, so that the first packet with negative
timestamps is the first packet with timestamps. This assumption
is often fulfilled given that the default interleavement function
by default interleaves per dts; yet there are scenarios in which
it may not be fulfilled:
a) av_write_frame() instead of av_interleaved_write_frame() is used.
b) The audio_preload option is used.
c) When the timestamps that are made nonnegative/zero are pts
(i.e. with Matroska), because the packet with the smallest dts
is not necessarily the packet with the smallest pts.
d) Possibly with custom interleavement functions.
In these cases the relative sync of the first few packet(s) is offset
relative to the later packets. This contradicts the documentation
("When shifting is enabled, all output timestamps are shifted by
the same amount").

Therefore this commit changes this: As soon as the first packet
with valid timestamps is output, it is checked and recorded whether
the timestamps need to be shifted. Further packets are no longer
checked for needing to be offset; instead they are simply offset.
In the cases above this leads to packets with negative timestamps
(and the appropriate warnings) instead of desync. This will mostly
be fixed in the next commit.

This commit also factors handling the avoid_negative_ts stuff out
of write_packet() in order to be able to return immediately.

Tickets #4536 and #5784 as well as the matroska-avoid-negative-ts-test
are examples of c); as has been said, some timestamps are now negative,
yet the ref file update does not show it because ffmpeg.c sanitizes
the timestamps (-copyts disables it; ffprobe and mkvinfo also show
the original timestamps).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 16:47:38 +01:00
Andreas Rheinhardt
f6d14b1297 avformat/avformat: Add AVFMT_AVOID_NEG_TS_DISABLED
And also don't use explicit constants in the movenc test.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 16:47:38 +01:00
Andreas Rheinhardt
92ed6ea3d7 fate/matroska: Add test for avoiding negative timestamps
This tests the issue from tickets #4536, #5784;
the output of this test is currently broken.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 16:47:35 +01:00
Andreas Rheinhardt
5d5b62e595 avformat/mux: Remove assert based on faulty assumptions
This assert is based upon the wrong assumption that
the noninterleaved codepath is never used; if it is used,
max_interleave_delta is irrelevant. It furthermore
ignores audio_preload.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 16:45:43 +01:00
Diederick Niehorster
7247a6fed8 avutil/pixfmt.h: typo
Signed-off-by: Diederick Niehorster <dcnieho@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 11:58:23 +01:00
Andreas Rheinhardt
c8b11b28d1 avformat/mov: Fix endian-dependent parsing
MOVAtom.type is always read as a little-endian number
(despite MOV/ISOBMFF being big-endian).
Fixes the matroska-dovi-write-config8 FATE-test on big-endian
arches (which runs into the "index out of range" warning message).

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-21 11:52:45 +01:00
Anton Khirnov
137c808f1a lavu/hwcontext_vulkan: clear dangling pointers on map failure 2022-01-21 09:44:01 +01:00
Anton Khirnov
2f0a214a62 configure: link to libatomic when it's present
C11 atomics in some configurations (e.g. 64bit operations on ppc64 with
GCC) require linking to libatomic.

Fixes #9275
2022-01-21 09:28:59 +01:00
Anton Khirnov
9e4693a1cb lavf/network: log ff_listen() errors to proper contexts rather than NULL 2022-01-21 09:25:05 +01:00
Anton Khirnov
d2519e8625 lavf/network: log ff_socket() errors to proper contexts rather than NULL 2022-01-21 09:25:05 +01:00
Anton Khirnov
93b4cc38b0 lavf/udp: log net errors to proper contexts rather than NULL 2022-01-21 09:25:05 +01:00
Wenbin Chen
1fe78f8419 libavcodec/qsvenc: Add transform skip to hevc_qsv
Add transform_skip option to hevc_qsv. By enabling this option,
the transform_skip_enabled_flag in PPS will be set to 1.
This option is supported on the platform equal or newer than ICL.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-21 12:56:30 +08:00
Wenbin Chen
9d6cc6a544 libavcodec/qsvenc: Add low latency P-pyramid support to qsv
Add low latency P-pyramid support to qsv. This feature relates to
command line option "-p_strategy". To enable this flag, user also
need to set "-bf" to 0. P-strategy has two modes "1-simple" and
"2-pyramid". The details of the two models refer to
https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#preftype

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-21 12:56:30 +08:00
Wenbin Chen
812b6ee6bd libavcodec/qsvenc: Add DisableDeblockingIdc support to qsv
Add dblk_idc option to 264_qsv and hevc_qsv. Turining on this opion can
disable deblocking.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-21 12:56:30 +08:00
Wenbin Chen
ec8bc07104 libavcodec/qsvenc: Add max_frame_size support to hevc_qsv
Add max_frame_size support to hevc_qsv as well.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-21 12:56:30 +08:00
Andreas Rheinhardt
7512293cf9 avformat/matroskaenc: Fix writing AV_SPHERICAL_EQUIRECTANGULAR
According to the documentation, the ISOBMFF 'equi' box must
be present for equirectangular projections.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-20 18:31:59 +01:00
quietvoid
0f5fd44dc9 fate/matroska: Add test for reading/writing BlockAdditionMapping elements
Tests the parsing and writing of AVDOVIDecoderConfigurationRecord,
when it is present as a Dolby Vision configuration block addition mapping.

Signed-off-by: quietvoid <tcChlisop0@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-20 15:50:26 +01:00
Andreas Rheinhardt
dd17c86aa1 avformat/matroskadec: Use correct type for field_order
It is unsigned in the spec and read from an uint64_t field.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-19 23:20:05 +01:00