1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-12 19:18:44 +02:00
Commit Graph

105112 Commits

Author SHA1 Message Date
Andreas Rheinhardt
ab6f9d86a9 avcodec/h2645: Fix SEI->display matrix transformation
The earlier code did not account for the fact that
av_display_rotation_set() wants the angle in the anticlockwise
direction (despite what its documentation stated for a long time);
furthermore, the H.2645 spec wants the flips applied first,
whereas our code did it the other way around. This can be fixed
by negating the angle once for every flip.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-23 18:09:46 +01:00
Andreas Rheinhardt
04133eb2d5 fftools/ffmpeg_filter: Avoid inserting hflip filter
The transpose filter has modes equivalent to "rotation by 90°/270°"
followed by horizontal flips.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-23 18:09:46 +01:00
Andreas Rheinhardt
4e21fff19d fftools/ffmpeg_filter: Fix autorotation
In case of an orthogonal transformation av_display_rotation_get()
returns the (anticlockwise) degree that the unit vector in x-direction
gets rotated by; get_rotation in cmdutils.c makes a clockwise degree
out of this. So if one inserts a transpose filter corresponding to
this degree, then the x-vector gets mapped correctly and there are
two possibilities for image of the y-vector, namely the two unit
vectors orthogonal to the image of the x-vector.

E.g. if the x-vector gets rotated by 90° clockwise, then the two
possibilities for the y-vector are the unit vector in x direction
or its opposite. The latter case is a simple 90° rotation for both
vectors* whereas the former is a simple 90° clockwise rotation followed
by a horizontal flip. These two cases can be distinguished by looking
at the x-coordinate of the image of the y-vector, i.e. by looking
at displaymatrix[3]. Similarly for the case of a 270° clockwise
rotation.

These two cases were previously wrong (they were made to match
wrongly parsed exif rotation tag values).

*: For display matrices, the y-axis points downward.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-23 18:09:46 +01:00
Andreas Rheinhardt
b8a4b273be avcodec/mjpegdec: Fix exif rotation->displaymatrix conversion
The cases in which there was flipping together with a rotation
that is not a multiple of the identity were wrong.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-23 18:09:46 +01:00
Michael Niedermayer
cfa1f0e214 avcodec/tiff: Use ff_set_dimensions() for setting up mjpeg context dimensions
sets coded_width / coded_height too to keep them consistent with
width / height

Fixes: OOM
Fixes: 42263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5653333619113984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-23 15:22:06 +01:00
Michael Niedermayer
d6c16f42cc avcodec/tiff: Pass max_pixels to mjpeg context
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-23 15:22:06 +01:00
Michael Niedermayer
d8ea7a67ba avcodec/vqavideo: reset accounting on error
Fixes: Timeout (same growing chunk is decoded to failure repeatedly)
Fixes: 42582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VQA_fuzzer-6531195591065600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-23 15:22:06 +01:00
Hao Chen
60ead5cd68 avcodec: [loongarch] Optimize vc1dsp with LASX.
./ffmpeg -i 11_wmv3_720p_24fps_7Mbps.wmv -f rawvideo -y /dev/null -an
before:131fps
after :229fps

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-23 12:28:54 +01:00
Jin Bo
fea299f876 avcodec: [loongarch] Optimize vp9_lpf/idct with LSX.
ffmpeg -i ../10_vp9_1080p_30fps_3Mbps.webm -f rawvideo -y /dev/null -an
before:294fps
after :567fps

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-23 12:28:54 +01:00
Hao Chen
2fd914e079 avcodec: [loongarch] Optimize vp9_mc/intra with LSX.
ffmpeg -i ../10_vp9_1080p_30fps_3Mbps.webm -f rawvideo -y /dev/null -an
before:170fps
after :294fps

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-23 12:28:54 +01:00
yuanhecai
72bcbe216e avcodec: [loongarch] Optimize vp8_lpf/mc with LSX.
./ffmpeg -i ../9_vp8_1080p_30fps_2Mbps.webm -f rawvideo -y /dev/null -an
before: 210fps
after : 585fps

Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-23 12:28:54 +01:00
Wenbin Chen
ed6c5c13b1 libavutil/hwcontext_qsv: clean padding when upload qsv frames
Fix #7830
When we upload a frame that is not padded as MSDK requires, we create a
new AVFrame to copy data. The frame's padding data is uninitialized so
it brings run to run problem. For example, If we run the following
command serveral times we will get different outputs.

ffmpeg -init_hw_device qsv=qsv:hw -qsv_device /dev/dri/renderD128 \
-filter_hw_device qsv -f rawvideo -s 192x200 -pix_fmt p010 \
-i 192x200_P010.yuv -vf "format=nv12,hwupload=extra_hw_frames=16" \
-c:v hevc_qsv output.265

According to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#encoding-procedures
"Note: It is the application's responsibility to fill pixels outside
of crop window when it is smaller than frame to be encoded. Especially
in cases when crops are not aligned to minimum coding block size (16
for AVC, 8 for HEVC and VP9)"

I add a function to fill padding area with border pixel to fix this
run2run problem, and also move the new AVFrame to global structure
to reduce redundant allocation operation to increase preformance.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-23 15:49:07 +08:00
Zhong Li
7e4747ec50 lavc/qsvenc: enable lookahead for hevc encoding
Update version based on the patch:
https://patchwork.ffmpeg.org/project/ffmpeg/patch/20211009015949.1510-1-haihao.xiang@intel.com/

Signed-off-by: Daniel Socek <daniel.socek@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-12-23 15:49:07 +08:00
Zhong Li
0598b38e93 lavc/qsvenc: specify codec name when print profile
It is more clear and easily to detect the issues similar to commit
3857ecbe70

Signed-off-by: Zhong Li <zhongli_dev@126.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-23 15:49:07 +08:00
rcombs
3e00b9e395 swscale/x86/init: use isSemiPlanarYUV
Fixes P210/P410 cases introduced (and broken) in 88d804b7ff
2021-12-23 01:41:03 -06:00
Haihao Xiang
ba44843f40 MAINTAINERS: add my gpg fingerprint
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2021-12-23 09:25:16 +08:00
rcombs
8e24a8e93a lavfi/metal: fix build with pre-10.11 deployment targets
- Ensure the yadif .metal compiles when targeting any Metal runtime version
- Use some preprocessor awkwardness to ensure Core Video's Metal-specific
  functionality is exposed regardless of our deployment target (this works
  around what seems to be an SDK header bug, filed as FB9816002)
- Ensure all direct references to Metal functions and classes are gated
  behind runtime version checks (this satisfies clang's deployment-target
  violation warnings provided by -Wunguarded-availability).
2021-12-22 18:43:34 -06:00
rcombs
0f77ee9d97 lavfi/metal: fix build on pre-10.15 SDKs 2021-12-22 18:43:34 -06:00
rcombs
62ad427823 configure: test the metal compiler before use
Apparently Metal.framework is included with the command line tools
(and thus may be present without Xcode), but the Metal compiler is only
included as part of Xcode.
2021-12-22 18:43:34 -06:00
rcombs
3767900860 configure: ensure we use the macOS SDK's metal compiler by default
Apparently on some OS and Xcode versions this can select an iOS SDK,
which in turn may fail on the affected versions.
2021-12-22 18:43:34 -06:00
rcombs
2d16182e7d lavfi/metal: don't use braced-include for internal headers 2021-12-22 18:43:34 -06:00
rcombs
bc63ef354a configure: fix .d generation for C++ and Obj-C files 2021-12-22 18:43:34 -06:00
rcombs
942f94e830 configure: fix setting OBJCCFLAGS
We call this OBJCFLAGS in help text, but common.mak looks for OBJCCFLAGS.
2021-12-22 18:43:34 -06:00
rcombs
4778ab2b1f lavc/videotoolboxenc: explicitly set realtime=false
On some encoders, this defaults to true, which can result in encode speed
being _limited_ to only slightly above realtime (as a power-saving measure),
so we need a way to disable it.
2021-12-22 18:43:34 -06:00
rcombs
802c051506 libavcodec/videotoolboxenc: use the correct types for options
These are all set by AV_OPT_TYPE_INT or AV_OPT_TYPE_BOOL; the only reason
they worked before was that this is only used on little-endian.
2021-12-22 18:43:34 -06:00
rcombs
b04601ed6a lavc/videotoolbox: set attachments on decoded buffers
VideoToolbox internally sets all the colorspace parameters to BT709,
regardless of what the bitstream actually indicates, so we need to
replace that with what we've parsed.
2021-12-22 18:43:34 -06:00
rcombs
5afc5661ac lavu/hwcontext_videotoolbox: use OS-provided mapping routines when available 2021-12-22 18:43:34 -06:00
rcombs
b7e1ec7bda lavu/videotoolbox: expose routine to set CVPixelBufferRef metadata 2021-12-22 18:43:17 -06:00
rcombs
69bd95dcd8 lavu/videotoolbox: expose conversion routines for color parameters
Also fixes symbol lookup errors on older macOS when built with a newer SDK,
introduced in 6cab5206b0
2021-12-22 18:42:51 -06:00
rcombs
9a890e49b6 lavc/proresdec: fix threaded hwaccel decode 2021-12-22 18:38:40 -06:00
rcombs
0e7684e554 FATE: always pass -nostdin to ffmpeg
This avoids making terminal config changes that may not be reverted properly
during parallel testing.
2021-12-22 18:38:40 -06:00
rcombs
18192166e7 lavc/videotoolboxenc: add ProRes support 2021-12-22 18:38:40 -06:00
rcombs
88d804b7ff swscale: add P210/P410/P216/P416 output 2021-12-22 18:38:40 -06:00
rcombs
310a1c25e8 lavc/Makefile: fix missing hevc_videotoolbox case 2021-12-22 18:38:40 -06:00
rcombs
2bb5edc38c lavc/videotoolboxenc: add handling for non-NAL-based codecs 2021-12-22 18:38:40 -06:00
rcombs
30539394bb lavc/videotoolboxenc: vastly simplify get_cv_pixel_info
No longer requires per-format switch cases.

The frame==0 path was unused (and would've crashed anyway).
2021-12-22 18:38:40 -06:00
rcombs
c8323350f4 lavc/videotoolboxenc: config-gate ATSC CC support 2021-12-22 18:38:40 -06:00
rcombs
7644c6224f lavc/videotoolboxenc: fix RGB support 2021-12-22 18:38:40 -06:00
rcombs
e55db79612 lavc/videotoolboxenc: detect alpha more generically
Fixes support for alpha in hardware input frames
2021-12-22 18:38:40 -06:00
rcombs
2acb13cb93 lavc/videotoolboxenc: don't access int64_t member as int 2021-12-22 18:38:40 -06:00
rcombs
028a6ed1a1 lavc/videotoolboxenc: use common routine for pixfmt conversion 2021-12-22 18:38:40 -06:00
James Almer
131dbb9a7a ffprobe: add missing separator when printing side data in compact output
Should fix ticket #7153

Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-22 09:41:13 -03:00
Gerard Sole
18ad360648 libavformat: add side_data copy in concat demuxer
Adds support for concat demuxer to copy the side data information
from the input file to the resulting file. It will behave like the
metadata copy, where the metadata of the first file is kept in the
the output file.

Extract the current code that already performs the stream side_data
copy into a separate method and reuse the method in the concat demuxer.

Signed-off-by: Gerard Sole <g.sole.ca@gmail.com>
2021-12-22 12:05:41 +01:00
Limin Wang
2ac8bcec63 avcodec/v210enc: suppport frame thread for v210
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-22 09:27:30 +08:00
Limin Wang
8ecd7cdb46 avcodec/rawenc: suppport frame thread for rawvideo
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-22 09:27:30 +08:00
Limin Wang
0e1f5f8871 fate: use single thread for rawvideo
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-12-22 09:27:30 +08:00
James Almer
e1d3ef9217 avutil/tests/cpu: add slowgather
Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-21 17:52:09 -03:00
James Almer
e68e379e0c avutil/cpu: add slowgather to av_parse_cpu_caps()
Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-21 17:51:27 -03:00
James Almer
8c2d2fd6cc avutil/cpu: move slow gather checks below in the function
Put them together with other similar slow flag checks.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-12-21 17:51:17 -03:00
Alan Kelly
eebe406c80 libswscale: Test AV_CPU_FLAG_SLOW_GATHER for hscale functions.
This is instead of EXTERNAL_AVX2_FAST so that the avx2 hscale functions
are only used where they are faster.
2021-12-21 17:44:53 -03:00