Commit Graph

93563 Commits

Author SHA1 Message Date
Marton Balint 3e10223385 avformat/file: add seekable option to disallow seeking
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-04-11 21:18:51 +02:00
Marton Balint 6ed7df5b20 avformat/mxfdec: export operational pattern UL as file metadata
Can be useful for API users as ffmpeg/libavformat can't properly support some
operational patterns.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-04-11 21:17:57 +02:00
James Almer c5a825dc75 configure: fix av1_frame_split bsf dependencies
Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-11 15:59:34 -03:00
James Almer 80e9f50f82 avcodec: add an AV1 frame split bitstream filter
This will be needed by the eventual native AV1 decoder.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-11 15:45:56 -03:00
Michael Niedermayer 3308e3da04 avcodec/agm: Check frame dimensions
Fixes: out of array access
Fixes: 14110/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5649184864075776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-11 19:25:42 +02:00
Paul B Mahol d0f24df648 avcodec: add ADPCM AGM decoder 2019-04-11 11:58:34 +02:00
Paul B Mahol 7be8f7ac81 avcodec/agm: add support for non-dct coding 2019-04-11 11:49:43 +02:00
Paul B Mahol 0f28355974 avcodec/agm: add support for higher compression 2019-04-11 11:49:43 +02:00
Lauri Kasanen ce92ee4b4f swscale/ppc: VSX-optimize non-full-chroma yuv2rgb_2
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags fast_bilinear \
        -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
        -cpuflags 0 -v error -

32-bit mul, power8 only.

~2x speedup:

rgb24
  24431 UNITS in yuv2packed2,   16384 runs,      0 skips
  13783 UNITS in yuv2packed2,   16383 runs,      1 skips
bgr24
  24396 UNITS in yuv2packed2,   16384 runs,      0 skips
  14059 UNITS in yuv2packed2,   16384 runs,      0 skips
rgba
  26815 UNITS in yuv2packed2,   16383 runs,      1 skips
  12797 UNITS in yuv2packed2,   16383 runs,      1 skips
bgra
  27060 UNITS in yuv2packed2,   16384 runs,      0 skips
  13138 UNITS in yuv2packed2,   16384 runs,      0 skips
argb
  26998 UNITS in yuv2packed2,   16384 runs,      0 skips
  12728 UNITS in yuv2packed2,   16381 runs,      3 skips
bgra
  26651 UNITS in yuv2packed2,   16384 runs,      0 skips
  13124 UNITS in yuv2packed2,   16384 runs,      0 skips

This is a low speedup, but the x86 mmx version also gets only ~2x. The mmx version
is also heavily inaccurate, while the vsx version has high accuracy.
2019-04-11 09:08:51 +03:00
Michael Niedermayer 3fe37033b9 avcodec/pnm_parser: Factor out next/index compensation
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-10 22:37:32 +02:00
Michael Niedermayer 1d43d72b18 avcodec/pnm_parser: Factor next initialization out
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-10 22:33:38 +02:00
Michael Niedermayer 7f3d39b21f avcodec/pnm_parser: Support concatenated ASCII images
Fixes: Timeout (8sec -> 0.1sec)
Fixes: 13864/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAM_fuzzer-5737860621139968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-10 22:26:30 +02:00
Don C. Bigler 2be7c388db avdevice/opengl_enc: fix build error using msvc compiler 2019-04-10 12:41:58 +02:00
joepadmiraal 951561b64e libavformat/dashenc : Prevent writing manifest files multiple times 2019-04-10 12:32:17 +05:30
Lynne 4d2f62150d aarch64/opusdsp: implement NEON accelerated postfilter and deemphasis
153372 UNITS in postfilter_c,   65536 runs,      0 skips
73164 UNITS in postfilter_neon,   65536 runs,      0 skips -> 2.1x speedup

80591 UNITS in deemphasis_c,  131072 runs,      0 skips
43969 UNITS in deemphasis_neon,  131072 runs,      0 skips -> 1.83x speedup

Total decoder speedup: ~15% on a Raspberry Pi 3 (from 28.1x to 33.5x realtime)

Deemphasis SIMD based on the following unrolling:
const float c1 = CELT_EMPH_COEFF, c2 = c1*c1, c3 = c2*c1, c4 = c3*c1;
float state = coeff;

for (int i = 0; i < len; i += 4) {
    y[0] = x[0] + c1*state;
    y[1] = x[1] + c2*state + c1*x[0];
    y[2] = x[2] + c3*state + c1*x[1] + c2*x[0];
    y[3] = x[3] + c4*state + c1*x[2] + c2*x[1] + c3*x[0];

    state = y[3];
    y += 4;
    x += 4;
}

Unlike the x86 version, duplication is used instead of pslldq so
the structure and tables are different.
2019-04-10 01:08:54 +02:00
Jarek Samic 1c50d61a5a libavutil/hwcontext_opencl: Fix channel order in format support check
The `opencl_get_plane_format` function was incorrectly determining the
value used to set the image channel order. This resulted in all RGB
pixel formats being set to the `CL_RGBA` pixel format, regardless of
whether or not they actually *were* RGBA.

This patch fixes the issue by using the `offset` and depth of components
rather than the loop index to determine the value of `order`.

Signed-off-by: Jarek Samic <cldfire3@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2019-04-09 22:16:01 +01:00
Tristan Matthews 1ec777dcdd avformat/matroskaenc: fix leak on error
Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-09 10:49:05 -03:00
Carl Eugen Hoyos d6a8392224 lavf/movenc: Pass correct pointer to av_log(). 2019-04-09 15:29:23 +02:00
Jun Zhao 0a347ff422 lavf/matroskaenc: Fix memory leak after write trailer
Fix memory leak after write trailer for #7827, only store a audio
packet whose buffer has size greater than zero in cur_audio_pkt.

Audio packets with size zero, but with side-data currently lead to
memleaks, in the Matroska muxer, because they are not properly freed:

They are currently put into an AVPacket in the MatroskaMuxContext to
ensure that the necessary audio is always available for a new cluster,
but are only written and freed when their size is > 0.

As the only use we have for such packets consists in updating the
CodecPrivate it makes no sense to store these packets at all and this
is how this commit solves the memleak.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-04-09 09:16:07 +08:00
Jeremy Dorfman via ffmpeg-devel bb5efd1727 avformat/av1: Initialize padding in ff_isom_write_av1c
Otherwise, AV1 encodes with FFmpeg trigger use-of-uninitialized-value
warnings under MemorySanitizer, and the output buffer potentially
changes from run to run.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-08 11:24:53 -03:00
Paul B Mahol ecdaa4b4fa avfilter/af_asetnsamples: use correct function 2019-04-07 21:15:13 +02:00
Paul B Mahol 3a2adeedaf avformat/riffdec: pass correct pointer to av_log 2019-04-07 21:09:56 +02:00
Nikolas Bowe via ffmpeg-devel 4c8e3725d9 avfilter/af_asetnsamples: fix sample queuing.
When asetnsamples uses output samples < input samples, remaining samples build up in the fifo over time.
Fix this by marking the filter as ready again if there are enough samples.

Regression since ef3babb2c7
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-07 13:17:34 +02:00
Lauri Kasanen 8607e29fa3 swscale/ppc: VSX-optimize yuv2rgb_full_X
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
                -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
                -cpuflags 0 -v error -

32-bit mul, power8 only.

~6.4x speedup:

rgb24
 214278 UNITS in yuv2packedX,   16384 runs,      0 skips
  33249 UNITS in yuv2packedX,   16384 runs,      0 skips
bgr24
 214616 UNITS in yuv2packedX,   16384 runs,      0 skips
  33233 UNITS in yuv2packedX,   16384 runs,      0 skips
rgba
 214517 UNITS in yuv2packedX,   16384 runs,      0 skips
  33271 UNITS in yuv2packedX,   16384 runs,      0 skips
bgra
 214973 UNITS in yuv2packedX,   16384 runs,      0 skips
  33397 UNITS in yuv2packedX,   16384 runs,      0 skips
argb
 214613 UNITS in yuv2packedX,   16384 runs,      0 skips
  33310 UNITS in yuv2packedX,   16384 runs,      0 skips
bgra
 214637 UNITS in yuv2packedX,   16384 runs,      0 skips
  33330 UNITS in yuv2packedX,   16384 runs,      0 skips
2019-04-07 09:20:34 +03:00
Lauri Kasanen 3256e949be swscale/ppc: VSX-optimize yuv2rgb_full_2
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags area \
            -s 1200x720 -f null -vframes 100 -pix_fmt $i -nostats \
            -cpuflags 0 -v error -

32-bit mul, power8 only.

~4x speedup:

rgb24
  52763 UNITS in yuv2packed2,   16384 runs,      0 skips
  13453 UNITS in yuv2packed2,   16384 runs,      0 skips
bgr24
  53144 UNITS in yuv2packed2,   16384 runs,      0 skips
  13616 UNITS in yuv2packed2,   16384 runs,      0 skips
rgba
  52796 UNITS in yuv2packed2,   16384 runs,      0 skips
  12904 UNITS in yuv2packed2,   16384 runs,      0 skips
bgra
  52732 UNITS in yuv2packed2,   16384 runs,      0 skips
  13262 UNITS in yuv2packed2,   16384 runs,      0 skips
argb
  52661 UNITS in yuv2packed2,   16384 runs,      0 skips
  12879 UNITS in yuv2packed2,   16384 runs,      0 skips
bgra
  52662 UNITS in yuv2packed2,   16384 runs,      0 skips
  12932 UNITS in yuv2packed2,   16384 runs,      0 skips
2019-04-07 09:20:33 +03:00
Lauri Kasanen 50e672bc54 swscale/ppc: VSX-optimize non-full-chroma yuv2rgb_1
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags fast_bilinear \
        -s 1200x1440 -f null -vframes 100 -pix_fmt $i -nostats \
        -cpuflags 0 -v error -

32-bit mul, power8 only.

1.8-2.3x speedup:

rgb24
  18192 UNITS in yuv2packed1,   32767 runs,      1 skips
   9983 UNITS in yuv2packed1,   32760 runs,      8 skips
bgr24
  18665 UNITS in yuv2packed1,   32766 runs,      2 skips
   9925 UNITS in yuv2packed1,   32763 runs,      5 skips
rgba
  20239 UNITS in yuv2packed1,   32767 runs,      1 skips
   8794 UNITS in yuv2packed1,   32759 runs,      9 skips
bgra
  20354 UNITS in yuv2packed1,   32768 runs,      0 skips
   8770 UNITS in yuv2packed1,   32761 runs,      7 skips
argb
  20185 UNITS in yuv2packed1,   32768 runs,      0 skips
   8761 UNITS in yuv2packed1,   32761 runs,      7 skips
bgra
  20360 UNITS in yuv2packed1,   32766 runs,      2 skips
   8759 UNITS in yuv2packed1,   32764 runs,      4 skips

This is a low speedup, but the x86 mmx version also gets only ~2x. The mmx version
is also heavily inaccurate, while the vsx version has high accuracy.
2019-04-07 09:20:31 +03:00
Jun Zhao 7c1875143d doc/examples/metadata: fix the example can't dump FLV metadata
fix the example can't dump FLV metadata.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-04-07 10:18:42 +08:00
Carl Eugen Hoyos d234ed7633 lavf/Makefile: Fix kux demuxer standalone compilation. 2019-04-07 02:00:30 +02:00
Swaraj Hota 208ae228fa lavf/flvdec: added support for KUX container
Fixes ticket #4519.

The metadata starting at 0xe00004 is encrypted
with the password "meta" but zlib does not
support decryption, so no kux metadata is read.
2019-04-06 15:54:38 +02:00
Octavio Alvarez f4f40cbb57 lavd/x11grab: fix vertical repositioning
There is a calculation error in xcbgrab_reposition() that breaks
vertical repositioning on follow_mouse. It made the bottom
reposition occur when moving the mouse lower than N pixels after
the capture bottom edge, instead of before.

This commit fixes the calculation to match the documentation.

follow_mouse: centered or number of pixels. The documentation says:

When it is specified with "centered", the grabbing region follows
the mouse pointer and keeps the pointer at the center of region;
otherwise, the region follows only when the mouse pointer reaches
within PIXELS (greater than zero) to the edge of region.
2019-04-06 15:20:36 +02:00
Derek Buitenhuis 772c73e61f FATE: Add test for HEVC files that claim to have two first slices
This makes sure we don't regress on 70c8c8a818.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2019-04-05 14:16:52 +01:00
Michael Niedermayer 2169a3f262 avcodec/agm: Fix integer overflow with w/h
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 13999/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5644405991538688

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-05 12:05:47 +02:00
Andreas Rheinhardt via ffmpeg-devel 18a851aca7 avformat/matroskadec: Improve length check
The earlier code had three flaws:

1. The case of an unknown-sized element inside a finite-sized element
(which is against the specifications) was not caught.

2. The error message wasn't helpful: It compared the length of the child
with the offset of the end of the parent and claimed that the first
exceeds the latter, although that is not necessarily true.

3. Unknown-sized elements that are not parsed can't be skipped. Given
that according to the Matroska specifications only the segment and the
clusters can be of unknown-size, this is handled by not allowing any
other units to have infinite size whereas the earlier code would seek
back by 1 byte upon encountering an infinite-size element that ought
to be skipped.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-05 12:05:47 +02:00
Michael Niedermayer 8e3b01e20e avcodec/agm: More completely check size before using it
Fixes: out of array access
Fixes: 13997/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5701427252428800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-04-04 11:31:17 +02:00
James Almer ee16d14b0a avcodec/av1_metadata: add an option to remove Padding OBUs
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-03 18:12:37 -03:00
Zhong Li 1125277bc6 lavc/qsvenc: enable hevc gpb option
GPB is the default type, just contains forward references but the
slice_type is B slice with higher encoding efficiency than regular P
slice, but lower performance.

Add an option to allow user to set regular P slice.

Fix ticket#6870

Test data on Intel Kabylake (i7-7567U CPU @ 3.50GHz):
1. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vsync passthrough
-vframes 1000  -c:v hevc_qsv -gpb 0 -bf 0 -q 25 test_gpb_off_bf0_kbl.mp4

transcoding fps: 85
encoded file size of test_gpb_off_bf0_kbl.mp4: 21960100 (bytes)

2. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vsync passthrough
-vframes 1000  -c:v hevc_qsv -gpb 1 -bf 0 -q 25 test_gpb_on_bf0_kbl.mp4

transcoding fps: 79
encoded file size oftest_gpb_on_bf0_kbl.mp4:  21211449 (bytes)

In this case, enable gpb can bring about 7% performance drop but 3.4% encoding efficiency improvment.

Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-04-03 23:00:15 +08:00
Zhong Li c745bedd18 lavc/qsvenc: enable hevc coding options configuration
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-04-03 22:57:55 +08:00
Zhong Li 6f9d7c556d lavc/qsvenc: no need to include h264.h for jpeg encoder
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-04-03 22:57:55 +08:00
Gyan Doshi 8161ac2902 lavf/movenc: fix tmcd writing for non-MP4/MOV modes
write_tmcd allows tmcd track to be created with any mode but in
mov_write_header, index for first tmcd track is only set for modes
MP4 or MOV, causing a crash if tmcd creation is attempted with other
modes.
2019-04-03 15:50:22 +05:30
Gyan Doshi b131a07e4b fate: unbreak fate with custom binary names 2019-04-03 10:05:50 +05:30
Jun Zhao ecb4398d71 lavf/hashenc: Correct the hash/MD5 muxer class name
Follow the name style to correct the hash/md5 muxer class name

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2019-04-03 10:17:22 +08:00
James Almer 0e1ea034d8 avcodec/libaomenc: fix range of values for enable-intrabc option
Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-02 19:54:34 -03:00
James Almer 461303f94a avcodec/cbs_av1: fix parsing spatial_id
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-02 16:33:48 -03:00
Matthew Fearnley b97a7dd031 libavcodec/zmbvenc: add support for 24-bit encoding, using pix_fmt BGR24.
Support is #ifdef'd out at this stage, using ZMBV_ENABLE_24BPP (like in
the zmbv.c decoder)
2019-04-02 17:14:42 +02:00
Matthew Fearnley 1046e88088 libavcodec/zmbv: change 24-bit decoder channel order, from RGB24 to BGR24
This brings the channel order in line with that used in 32-bit mode (BGR0).

24-bit decoding is disabled by default (#ifdef ZMBV_ENABLE_24BPP), and no
prior encoders or sample videos are known to exist for this bit depth, so
I consider this change in implementation is unlikely to affect anyone.

The decision has been made in agreement with the DOSBox Development Team
(dosbox.crew@gmail.com), specifically with harekiet, who wrote the original
codec.
2019-04-02 17:14:30 +02:00
Matthew Fearnley 5dcc63c1d2 libavcodec/zmbv: use PTRDIFF_SPECIFIER for `src - c->decomp_buf`.
Other bit depths saw this change in ced0d6c14d, but this instance was
presumably missed because of the #ifdef block.
2019-04-02 17:14:15 +02:00
James Almer b74e13711f avcodec/opus: make redundancy_buf 32 byte aligned
Fixes ff_opus_deemphasis_fma3 segmentation fault crashes on x86_32.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-04-02 11:36:56 -03:00
Karthick J 6aeaac3e1c avformat/dashenc: Add support for Global SIDX 2019-04-02 11:16:06 +05:30
Karthick J 3d0894990d avformat/movenc: Fix skip_trailer when global_sidx is enabled 2019-04-02 11:15:57 +05:30
Steven Liu 326cec3771 avformat/hls: make different warning message between open url and parse playlist
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-04-02 12:11:47 +08:00