1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00
Commit Graph

43409 Commits

Author SHA1 Message Date
Paul B Mahol
4aac742505 avcodec/x86/cfhddsp: try to fix build on x32 2020-08-26 23:39:58 +02:00
Paul B Mahol
389cc142fb avcodec/cfhd: add x86 SIMD
Overall speed changes for 1920x1080, yuv422p10le, 60fps from: 0.19x to 0.343x
2020-08-26 21:13:38 +02:00
Michael Niedermayer
b9ea493afe avcodec/tiff: Check jpeg context against jpeg frame parameters
Fixes: out of array access
Fixes: 24825/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6326925027704832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-26 20:31:09 +02:00
Michael Niedermayer
ad29f9e47c avcodec/tiff: Restrict tag order based on specification
"The entries in an IFD must be sorted in ascending order by Tag. Note that this is
 not the order in which the fields are described in this document."

This way various dimensions, sample and bit sizes cannot be changed at
arbitrary times which reduces the potential for bugs.
The tag reading code also on various places assumes that numerically previous
tags have already been parsed, so this needs to be enforced one way or another.

If this commit causes problems with real world files which are not easy to fix
then some other form of checks are needed to ensure the various dependencies
in the tag reading are not violated.

Fixes: out of array access
Fixes: 24825/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6326925027704832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-26 20:31:09 +02:00
Michael Niedermayer
ca47402a06 avcodec/tiff: Avoid abort with DNG RAW TIFF with YA8
Fixes: Assertion failure
Fixes: 24707/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5179910197608448

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-26 20:31:09 +02:00
Michael Niedermayer
7577f8332a avcodec/tiff: Check the linearization table size
Fixes: out of array access
Fixes: 24604/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4843529818603520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-26 20:31:09 +02:00
Derek Buitenhuis
649a6969f7 avcodec/libdav1d: Call ff_set_sar in addition to setting the frame SAR
Similar to what we do in libaomdec.c.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-08-26 16:44:03 +01:00
James Almer
98f7e0081b avcodec/cbs_av1: fix setting FrameWidth in frame_size_with_refs()
Section 5.9.7 of the spec states

    UpscaledWidth = RefUpscaledWidth[ ref_frame_idx[ i ] ]
    FrameWidth    = UpscaledWidth
    FrameHeight   = RefFrameHeight[ ref_frame_idx[ i ] ]
    RenderWidth   = RefRenderWidth[ ref_frame_idx[ i ] ]
    RenderHeight  = RefRenderHeight[ ref_frame_idx[ i ] ]

Meaning FrameWidth must not be set to RefFrameWidth[ ref_frame_idx[ i ] ]
like we're currently doing.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 18:46:06 -03:00
James Almer
0892b04509 avcodec/av1_parser: fix parsing show_existing_frame headers
Regression since c8716b5029

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 15:01:43 -03:00
James Almer
97819f15a8 avcodec/cbs_av1: use a more appropiate AV1ReferenceFrameState pointer variable name
frame is more commonly used for AV1RawFrameHeader and AV1RawFrame.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 14:53:42 -03:00
James Almer
e76b4b2a6b avcodec/cbs_av1: fix handling reference frames on show_existing_frame frames
Implement Section 7.21 "Reference frame loading process" and Section 7.20
"Reference frame update process" for show_existing_frame frames, as required by
the definition in Section 7.4 "Decode frame wrapup process".

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 14:49:33 -03:00
James Almer
afbe9ebac7 avcodec/cbs_av1: infer frame_type in show_existing_frame frames earlier
This follows the spec and will come in handy in the next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 14:49:33 -03:00
James Almer
e3ed0ce32a avcodec/cbs_av1: add OrderHint to CodedBitstreamAV1Context
This follows the spec and will come in handy in a following commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-25 14:49:33 -03:00
Jan Ekström
d6f293353c avcodec/aacdec_template: add more checks to make sure only 22.2 gets to 22.2
Validates the set channel layout as well as verifies that the received
layout to the function matches the reference layout, so that it matches
the implemented re-ordering logic.

Fixes #8845
2020-08-25 00:07:07 +03:00
Jan Ekström
de1d6aa0a3 avcodec/aacdec_template: keep tabs on layout in sniff_channel_order
This way the layout set at various points can be checked instead
of only having the layout at the end.
2020-08-25 00:06:53 +03:00
James Almer
c8716b5029 avcodec/av1_parser: read frame properties directly from AV1RawFrameHeader
Simplifies code

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-23 20:54:15 -03:00
James Almer
6c20207dce avcodec/cbs_av1: infer frame_type when parsing a show_existing_frame frame
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-23 20:53:58 -03:00
James Almer
f1e92ee36b avcodec/cbs_av1: infer frame sizes when not coded in the bitstream
This makes them available for all frames within a Temporal Unit.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-23 20:37:12 -03:00
Mark Thompson
b567cb8d0b cbs_av1: Fix test for presence of buffer_removal_time element
The frame must be in both the spatial and temporal layers for the
operating point, not just one of them.
2020-08-23 18:43:58 +01:00
Andriy Gelman
58b8541330 avcodec/v4l2_m2m_enc: reindent after previous commit
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-08-23 13:42:07 -04:00
Andriy Gelman
8bc7f69cef avcodec/v4l2_m2m_enc: buffer frame if it cannot be enqueued
Currently if the frame buffers are full, the frame is unrefed and
dropped.  Instead buffer the frame so that it is enqueued in the
next v4l2_receive_packet() call.  The behavior was observed on
DragonBoard 410c.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2020-08-23 13:42:07 -04:00
James Almer
994d2567f1 avcodec/cbs_av1: always store temporal_id and spatial_id in CodedBitstreamAV1Context
Also infer them when not coded in the bitstream.

Reviewed-by: jkqxz
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-23 14:34:32 -03:00
James Almer
751f2a27f7 avcodec/cbs_av1: fix storage size for render_{width,height}_minus_1
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-23 12:20:44 -03:00
Paul B Mahol
568b7b2777 avcodec/gif: fix disposal method for first frame and transparent gifs
Fixes #7902
2020-08-23 16:21:56 +02:00
Paul B Mahol
1c3a3a4ec6 avcodec/notchlc: add initial alpha support 2020-08-23 16:21:56 +02:00
Clément Bœsch
a469d29c08 avcodec/dvbsubdec: error out on unsupported coding methods 2020-08-22 19:02:01 +02:00
Clément Bœsch
b0f96f663c avcodec/dvbsubdec: request samples for missing coding methods 2020-08-22 19:02:01 +02:00
Clément Bœsch
eb4d220ae1 avcodec/dvbsubenc: fix onject/object typo 2020-08-22 19:02:01 +02:00
Clément Bœsch
80d2a33d83 avcodec/dvbsubenc: reindent after previous commit 2020-08-22 19:02:01 +02:00
Clément Bœsch
5fc075d53e avcodec/dvbsubenc: merge rectangle encode code blocks 2020-08-22 19:02:01 +02:00
Clément Bœsch
4dbd055d5a avcodec/dvbsub: add "enc" suffix to encoder 2020-08-22 19:02:01 +02:00
Clément Bœsch
346309a795 avcodec/dvbsub: remove useless indirection in dvbsub_encode. 2020-08-22 19:02:01 +02:00
Andreas Rheinhardt
01a580f141 avcodec/rzpaenc: Remove set-but-unused variable
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-08-22 09:23:30 +02:00
Derek Buitenhuis
3fc3d712a9 avcodec/libaomdec: Set SAR based on RenderWidth and RenderHeight
This is the same thing we do in libdav1d.c

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-08-21 23:58:10 +01:00
Michael Bradshaw
b97eb35308 avcodec/proresenc: infer array lengths
Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
2020-08-21 15:43:52 -07:00
Paul B Mahol
6158029dfc avcodec: add RPZA encoder 2020-08-21 22:46:07 +02:00
Michael Bradshaw
b30f737f7a avcodec/proresenc: add support for PQ and HLG
Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
2020-08-21 11:09:11 -07:00
Paul B Mahol
d2206f0c5b avcodec/qdmc: reduce insanely huge tables 2020-08-21 13:55:50 +02:00
James Almer
23bbb01077 avcodec/h2645_parse: reset the H2645NAL type value before parsing a NAL header
This will prevent reporting a bogus value in the log message when
the header parsing fails.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-20 13:50:11 -03:00
James Almer
1e41a9be34 avcodec/h2645_parse: skip empty NAL units earlier
No point in trying to parse nonexistent header bits.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-20 13:50:01 -03:00
James Almer
a4d28ea030 avcodec/h2645_parse: always return 0 on successful h{264,evc}_parse_nal_header() calls
HEVC NALs are no longer being skipped based on their nuh_layer_id
value since ad326379c6.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-20 13:17:50 -03:00
James Almer
c56d787fe3 avcodec/decode: move the ff_decode_frame_props() prototype to the proper header
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-20 13:17:50 -03:00
Harry Mallon
a606e3b339 libavcodec/proresdec2: Setup qmat_chroma according to RDD36
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-08-20 13:21:20 +02:00
Jun Zhao
d5abb11738 lavc/libkvazaar: export encoded frame stats
Export choosen pict_type and qp.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-08-20 15:06:14 +08:00
Andriy Gelman
5df9724e42 avcodec/v4l2_context: return EAGAIN to signal full buffers
Return proper error when frame buffers are full. This path is triggered
on the DragonBoard 410c since the encoding API change in commit
827d6fe73d.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Reviewed-by: Mark Thompson <sw@jkqxz.net>
2020-08-16 17:39:13 -04:00
Limin Wang
d7af6d1469 avcodec/utils: calculate frame number of HEVC if the framerate > 30FPS
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-08-16 22:51:11 +08:00
James Almer
161d7f3fee avcodec/bsf: improve the doxy for av_bsf_flush()
Mention an example scenario where the function should be used.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-15 15:55:22 -03:00
James Almer
34a385b340 avcodec/qsvenc_h264: add missing atsc_a53.h include
Regression since 0de01da1d2

Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-15 14:43:11 -03:00
James Almer
0de01da1d2 avcodec: move ff_alloc_a53_sei() to atsc_53
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-15 13:01:25 -03:00
James Almer
1ab3ae6fd5 avcodec/hevc_sei: use ff_parse_a53_cc() to parse A53 Closed Captions
Signed-off-by: James Almer <jamrial@gmail.com>
2020-08-15 13:01:19 -03:00