Commit Graph

93969 Commits

Author SHA1 Message Date
Mark Thompson
1f8b36329f ffmpeg_hw: Mark some strings as const 2019-06-02 22:58:22 +01:00
Mark Thompson
909bcedc58 vaapi_encode: Warn if input has cropping information
Cropping is not supported by VAAPI encode.
2019-06-02 17:30:41 +01:00
Mark Thompson
ef2f89bbcc vf_scale_vaapi: Add options to configure output colour properties
The "out_color_matrix" and "out_range" properties match the same options
in vf_scale; the others attempt to follow the same pattern.
2019-06-02 17:30:41 +01:00
Mark Thompson
5051b7f898 lavfi/vaapi: Improve support for colour properties
Attempts to pick the set of supported colour properties best matching the
input.  Output is then set with the same values, except for the colour
matrix which may change when converting between RGB and YUV.
2019-06-02 17:30:41 +01:00
Mark Thompson
5fb9eb9ed2 vf_misc_vaapi: Add missing return value checks
Parameter buffer creation can fail.
2019-06-02 17:30:41 +01:00
Mark Thompson
6ed34a4379 lavfi/vaapi: Factorise out common code for parameter buffer setup
Also enables cropping on all VAAPI filters, inherited from the existing
support in scale_vaapi.
2019-06-02 17:30:41 +01:00
Mark Thompson
963c4f85fe doc/indevs: Add example using cropping to capture part of a plane 2019-06-02 17:30:41 +01:00
Mark Thompson
f1b359aaf5 vf_crop: Add support for cropping hardware frames
Set the cropping fields in the AVFrame.
2019-06-02 17:30:41 +01:00
Steven Liu
4ef0bea292 doc/muxers: fix typo of the hls var_stream_map example
And fix typo of the 1833 of hlsenc.c

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Signed-off-by: Steven Liu <lq@onvideo.cn>
2019-06-02 21:53:11 +08:00
Paul B Mahol
fcfe85220d avfilter/af_anlmdn: avoid creating frames with zero samples 2019-06-02 13:00:35 +02:00
Paul B Mahol
1a266a1ef9 avfilter/af_anlmdn: try to recover when cache becomes negative 2019-06-02 12:59:57 +02:00
Paul B Mahol
b535577465 avfilter/af_anlmdn: add smooth factor option 2019-06-02 11:58:49 +02:00
Paul B Mahol
cbaa60329a avfilter/vf_xmedian: remove limitation of only odd number of inputs 2019-06-02 11:07:46 +02:00
Marton Balint
415886588f doc/filters: move reference to framesync options from lut3d to haldclut
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-06-01 19:06:05 +02:00
Steven Liu
76ef18fd39 avutil/dynarry.h: fix comment grammar mistakes of FF_DYNARRAY_ADD
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-06-01 17:43:48 +08:00
Michael Niedermayer
5a6fc87443 avcodec/gdv: Check remaining output after decode 5/6/8/
Improves: Timeout (355sec -> 97sec)
Improves: 14709/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5704215281795072

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
2019-05-31 22:44:30 +02:00
Michael Niedermayer
710b7ec071 tools: Add fuzzer for demuxers
This is based on target_dec_fuzzer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-31 22:44:30 +02:00
Carl Eugen Hoyos
d1b4ea2f61 lavfi/showspatial: Remove two write-only variables.
Fixes two warnings:
libavfilter/avf_showspatial.c:157:26: warning: variable ‘w’ set but not used
libavfilter/avf_showspatial.c:157:23: warning: variable ‘h’ set but not used
2019-05-31 22:30:46 +02:00
Paul B Mahol
b19550367f avfilter: add showspatial multimedia filter 2019-05-31 12:53:20 +02:00
Nick Renieris
9c35285aea avcodec/tiff: Recognize DNG/CinemaDNG images
Additionally:
- Renamed TIFF_WHITE_LEVEL to DNG_WHITE_LEVEL since it is specified
  in the DNG spec.
- Added/changed some comments to be more precise in differentiating
  between TIFF, TIFF/EP and DNG values.

Related to ticket: https://trac.ffmpeg.org/ticket/4364

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-05-30 19:27:05 +02:00
Nick Renieris
661facb8a8 libavcodec/tiff: Process SubIFDs tag with multiple entries
SubIFDs that were part of more than single-sized "SubIFDs" tags were
being ignored due to existing code ignoring that case.

This patch makes is so the first entry is read, which is not ideal
but enough for some DNG images present in the wild to be decodeable
More specifically, the first SubIFD which we would process with this
patch is the main image and the second one is a second thumbnail,
which is not as important to decode.

In DNG images with the .tiff extension, it solves the issue where
the TIFF thumbnail in IFD 0 was incorrectly parsed (related
confusion: [1]).

Embedded thumbnails for DNG images can still be decoded with the
"-thumbnail" option.

Related to ticket: https://trac.ffmpeg.org/ticket/4364

[1]: https://superuser.com/questions/546879/creating-video-from-dng-images-with-ffmpeg

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-05-30 19:27:05 +02:00
Nick Renieris
a7e018b05e avcodec/tiff: Option to decode embedded thumbnail
Adds the "-thumbnail" option, that works like the current "-subifd"
option, but only for non-full-sized images.

This is particularly useful for DNG images (see next commit) that
have SubIFDs that are not necessarily thumbnails.

Signed-off-by: Nick Renieris <velocityra@gmail.com>
2019-05-30 19:27:05 +02:00
Linjie Fu
6895b350c3 lavf/qsvvpp: avoid the double-free when working in sys memory mode
Currently, picref will be freed by calling av_frame_free(&picref) in
submit_frame() in qsvvpp.c when working in system memory mode,and normally it
is freed in filter_frame() in vf_vpp_qsv.c when working in other modes.

Double free happens when working in system memory mode, remove to
fix the memory issue.

Reproduce:
ffmpeg -init_hw_device qsv=foo -filter_hw_device foo -f rawvideo -pix_fmt nv12 -s:v 852x480 \
-i 852x480.nv12 -vf 'vpp_qsv=w=500:h=400' -f rawvideo -pix_fmt nv12 qsv.nv12

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-05-30 09:33:21 +08:00
Paul B Mahol
02333fe394 avformat/gif: abort early if nothing was written yet
Fixes crash when writting trailer without any previous packets.
2019-05-29 10:57:18 +02:00
James Almer
d903c09d9a avcodec/cbs_mpeg2: fix leak of extra_information_slice buffer in cbs_mpeg2_read_slice_header()
cbs_mpeg2_free_slice() calls av_buffer_unref() on extra_information_ref,
meaning allocating with av_malloc() was not the intention.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-05-29 00:16:41 +01:00
Andreas Rheinhardt
1759a9e5b5 cbs_mpeg2: Correct error codes
Up until now, things that are merely unsupported by cbs_mpeg2 have been
declared to be invalid input. This has been changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-05-29 00:16:26 +01:00
Andreas Rheinhardt
de58803839 cbs_mpeg2: Fix storage type for frame_centre_*_offset
The frame_centre_horizontal/vertical_offset values contained in picture
display extensions are actually signed values (i.e. it is possible to
indicate that the display device should add black bars/pillars).

The files sony-ct3.bs and tcela-6.bits (which are both used in fate
tests for mpeg2_metadata) contain picture display extensions; the former
even contains a negative frame_centre_vertical_offset. Fortunately, the
old code did not damage the picture display extensions when one did a
cycle of reading and writing. For the same reason the fate tests needn't
be updated either.

Furthermore these fields now use the trace output for matrices.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-05-29 00:16:26 +01:00
Andreas Rheinhardt
9c3f2a8894 cbs_mpeg2: Improve checks for invalid values
MPEG-2 contains several elements that mustn't be zero according to the
specifications: horizontal/vertical_size_value, aspect_ratio_information,
frame_rate_code, the quantiser matrices, the colour_description
elements, picture_coding_type, the f_code[r][s] values and
quantiser_scale_code. It is now checked that the invalid values don't
occur.

The colour_description elements are treated specially in this regard:
Given that there are files in the wild which use illegal values for the
colour_description elements (some of them created by mpeg2_metadata),
they will be corrected to the value meaning "unknown" (namely 2) during
reading. This has been done in such a way that trace_headers will
nevertheless report the original value, together with a message about
the fixup.

Furthermore, the trace_headers output of user_data has been beautified.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-05-28 23:59:29 +01:00
Andreas Rheinhardt
cfe4389d47 cbs_mpeg2: Correct and use enum values
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2019-05-28 23:59:26 +01:00
Paul B Mahol
819ed1df94 avfilter/avf_aphasemeter: make use of av_rescale 2019-05-28 11:10:51 +02:00
Paul B Mahol
62c8707e2a avfilter/avf_showwaves: make use of av_rescale_q 2019-05-28 11:07:47 +02:00
Paul B Mahol
cd75396897 avfilter/avf_ahistogram: make use of av_rescale 2019-05-28 10:51:57 +02:00
Paul B Mahol
d2e76a1f96 avfilter/avf_showvolume: make use of av_rescale 2019-05-28 10:49:09 +02:00
Paul B Mahol
618f8bb0a4 avfilter/avf_abitscope: make use of av_rescale 2019-05-28 10:46:38 +02:00
Paul B Mahol
b16806b09d avfilter/avf_avectorscope: make use of av_rescale 2019-05-28 10:43:25 +02:00
Gyan Doshi
eae251ead9 avformat/segment: populate empty outer stream extradata from packet
At present, if the outer stream extradata is empty but first packet
has extradata as a side data element, then only the first segment's
muxer instance may be able to extract this side data and use it.
For all other segments, extradata in packet side data could be missing
and generated segments may be invalid or unplayable in some apps
e.g. for an ADTS AAC stream segmented to MP4, the adtstoasc BSF will
add extradata to the first packet. The MOV muxer for the first segment
will add this to codecpar for the inner stream and write
Decoder Specific Information within the esds box. For other segments,
their esds' will not have this decSpecificInfo and they can't be opened
in Quicktime player or by services like nginx-vod-module.
2019-05-28 12:30:29 +05:30
Jun Zhao
9b069eb14e lavfi/sr: Change the backend type from flags to int
native and tensorflow is exclusive, so change the type from
flags to int.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-28 09:13:36 +08:00
Jun Zhao
b983e71bde lavfi/sr: Remove slice thread flag
sr didn't enable the slice threading, so remove the flag

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-28 09:13:36 +08:00
Jun Zhao
b63df9b527 doc/encoders: Document eld_v2 option for libfdk_aac encoder.
Document eld_v2 option for libfdk_aac encoder.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-28 09:12:17 +08:00
Jun Zhao
3ba09704fa doc/build_system: Document checkheaders/alltools and consistency fixes
Document checkheaders/alltools and consistency fixes

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-05-28 09:12:17 +08:00
Michael Niedermayer
bf3ee6a130 avformat/mp3enc: Avoid SEEK_END as it is unsupported
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-27 19:01:38 +02:00
Michael Niedermayer
90db25a16e avcodec/diracdec: Check for arith decoder errors in dirac_unpack_block_motion_data()
Fixes: Timeout (54sec -> 188ms)
Fixes: 14585/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5649933052411904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-27 19:01:38 +02:00
Michael Niedermayer
8eecf761a6 avcodec/truemotion2: Fix several integer overflows in tm2_update_block()
Fixes: signed integer overflow: -1877966852 + -469491713 cannot be represented in type 'int'
Fixes: 14561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5167608359288832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-27 19:01:38 +02:00
Michael Niedermayer
e6f4d5dc38 avcodec/ffv1dec_template: Optimize common case in run mode
Fixes: Timeout (14sec -> 9sec)
Fixes: 13398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5664106709778432

decode_line() becomes 1% faster for fate/vsynth2-ffv1.avi
for another fate sample there is a 0.5% speedup
the effect should be bigger for files with "flat" colored areas
the new faster branch is used in 97-100% of the cases in fate samples
compared to the older more complex (which i tested)

vsynth3-ffv1-v3-bgr0.avi had the lowest percentual useage of about 97%

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-05-27 19:01:38 +02:00
Paul B Mahol
5ddaedcaec avfilter/avf_showvolume: switch to activate 2019-05-27 18:44:19 +02:00
James Almer
f78172b29a avcodec/libdav1d: add support for RGB streams
Signed-off-by: James Almer <jamrial@gmail.com>
2019-05-27 13:21:52 -03:00
Werner Robitza
7458fa119c doc/swscaler: explain default Lanczos parameter
Explain that the default Lanczos filter parameter is 3 and that it can be
changed by the param0 option.

Signed-off-by: Werner Robitza <werner.robitza@gmail.com>
2019-05-27 21:32:33 +05:30
James Almer
254da41531 avcodec/libdav1d: assert Dav1dPicture allocator_data is set before referencing its data
To ensure the custom allocator is effectively used.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-05-27 12:49:01 -03:00
James Almer
0e07b767c8 avcodec/libdav1d: export level from the Sequence Header
Signed-off-by: James Almer <jamrial@gmail.com>
2019-05-27 12:47:33 -03:00
Paul B Mahol
293489d835 avfilter/af_superequalizer: switch to activate 2019-05-27 17:36:30 +02:00