ffmpeg.git
9 months agoavformat/mxfdec: do not use sound essence descriptor quantization bits for bits_per_c...
Marton Balint [Sun, 26 Aug 2018 19:23:02 +0000 (21:23 +0200)]
avformat/mxfdec: do not use sound essence descriptor quantization bits for bits_per_coded_sample

It refers to the uncompressed quantization, therefore is not correct for AAC.

Also change mxf_set_pts to work based on current edit unit if
bits_per_coded_sample is not available.

Fixes error messages in the sample of ticket #7366.

Signed-off-by: Marton Balint <cus@passwd.hu>
9 months agoavcodec/mips: [loongson] reoptimize put and add pixels clamped functions.
Shiyou Yin [Wed, 5 Sep 2018 10:31:05 +0000 (18:31 +0800)]
avcodec/mips: [loongson] reoptimize put and add pixels clamped functions.

Simplify the usage of intermediate variable addr and remove unused variable all64
in following functions:
1. ff_put_pixels_clamped_mmi
2. ff_put_signed_pixels_clamped_mmi
3. ff_add_pixels_clamped_mmi

This optimization speed up mpeg4 decode about 2% on loongson platform(tested with 3A3000).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoffplay: add option to allow custom seek interval
Gyan Doshi [Sat, 1 Sep 2018 06:03:17 +0000 (11:33 +0530)]
ffplay: add option to allow custom seek interval

At present, left and right keys are hardcoded to seek by 10 seconds.

9 months agoavformat/dashdec: refine compute current fragment for presentation_timeoffset mode
Steven Liu [Wed, 5 Sep 2018 06:33:53 +0000 (14:33 +0800)]
avformat/dashdec: refine compute current fragment for presentation_timeoffset mode

fix ticket id: #7369 #7382.
use ((wallclock - availability_start_time) * timescale -presentation_timeoffset) / duration

Signed-off-by: Steven Liu <lq@onvideo.cn>
9 months agoavformat/dashdec: reindent code for previous commit
Steven Liu [Wed, 5 Sep 2018 06:21:33 +0000 (14:21 +0800)]
avformat/dashdec: reindent code for previous commit

Signed-off-by: Steven Liu <lq@onvideo.cn>
9 months agoavformat/dashdec: add min_buffer_time process logic
Steven Liu [Wed, 5 Sep 2018 06:20:52 +0000 (14:20 +0800)]
avformat/dashdec: add min_buffer_time process logic

if there have min_buffer_time in playlist, use the min_buffer_time
value for realtime.

Signed-off-by: Steven Liu <lq@onvideo.cn>
9 months agoavformat/dashdec: add trace message for get the logic output message
Steven Liu [Wed, 5 Sep 2018 06:19:43 +0000 (14:19 +0800)]
avformat/dashdec: add trace message for get the logic output message

Signed-off-by: Steven Liu <lq@onvideo.cn>
9 months agoavformat/dashdec: reindent code for previous commit
Steven Liu [Wed, 5 Sep 2018 06:17:03 +0000 (14:17 +0800)]
avformat/dashdec: reindent code for previous commit

Signed-off-by: Steven Liu <lq@onvideo.cn>
9 months agoavformat/dashdec: remove redundant code
Steven Liu [Wed, 5 Sep 2018 06:16:29 +0000 (14:16 +0800)]
avformat/dashdec: remove redundant code

Signed-off-by: Steven Liu <lq@onvideo.cn>
9 months agoavformat/dashdec: refine adaptionset attribute members
Steven Liu [Wed, 5 Sep 2018 06:15:47 +0000 (14:15 +0800)]
avformat/dashdec: refine adaptionset attribute members

Signed-off-by: Steven Liu <lq@onvideo.cn>
9 months agoavformat/dashdec: refine mpd element of attribute name availabilityEndTime
Steven Liu [Wed, 5 Sep 2018 06:13:56 +0000 (14:13 +0800)]
avformat/dashdec: refine mpd element of attribute name availabilityEndTime

Signed-off-by: Steven Liu <lq@onvideo.cn>
9 months agoavformat/hlsenc: rename option from use_localtime to strftime
Steven Liu [Mon, 3 Sep 2018 03:10:35 +0000 (11:10 +0800)]
avformat/hlsenc: rename option from use_localtime to strftime

fix ticket: 7393
indent option name to segment

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
9 months agoavcodec/mips: [loongson] simplify the usage of intermediate variable addr.
Shiyou Yin [Tue, 4 Sep 2018 08:05:33 +0000 (16:05 +0800)]
avcodec/mips: [loongson] simplify the usage of intermediate variable addr.

Simplify the usage of intermediate variable addr in following functions:
1. ff_put_pixels4_8_mmi
2. ff_put_pixels8_8_mmi
3. ff_put_pixels16_8_mmi
4. ff_avg_pixels16_8_mmi.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec: [loongson] fix bug of mss2-wmv failed in fate test.
Shiyou Yin [Mon, 3 Sep 2018 03:31:46 +0000 (11:31 +0800)]
avcodec: [loongson] fix bug of mss2-wmv failed in fate test.

Failed case: mss2-wmv
In following functions, pmullh was used to multiply two 16-bit data, this will cause data overflow.
1. ff_vc1_inv_trans_8x8_dc_mmi
2. ff_vc1_inv_trans_8x8_mmi
3. ff_vc1_inv_trans_8x4_mmi
4. ff_vc1_inv_trans_4x8_mmi
5. ff_vc1_inv_trans_4x4_mmi

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavformat/libsrt: fix merge of payload_size option
Marton Balint [Sun, 2 Sep 2018 23:52:22 +0000 (01:52 +0200)]
avformat/libsrt: fix merge of payload_size option

Fixes a compile error and re-adds pkt_size as a url?option as well.

Signed-off-by: Marton Balint <cus@passwd.hu>
9 months agoavformat/av1: zero initialize the seq_params struct
James Almer [Mon, 3 Sep 2018 02:27:51 +0000 (23:27 -0300)]
avformat/av1: zero initialize the seq_params struct

Signed-off-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'e1e3a12242347dd11174b2fb9ddac8dc8df16224'
James Almer [Sun, 2 Sep 2018 22:26:00 +0000 (19:26 -0300)]
Merge commit 'e1e3a12242347dd11174b2fb9ddac8dc8df16224'

* commit 'e1e3a12242347dd11174b2fb9ddac8dc8df16224':
  libopenh264: Add support for decoding of b-frames

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'c011beda2611acfeb6f67d4fdf30d1eceed9e62f'
James Almer [Sun, 2 Sep 2018 22:25:16 +0000 (19:25 -0300)]
Merge commit 'c011beda2611acfeb6f67d4fdf30d1eceed9e62f'

* commit 'c011beda2611acfeb6f67d4fdf30d1eceed9e62f':
  avconv: make sure packets put into the muxing FIFO are refcounted

This commit is a noop, see 33580a8625c77591919b6155a48da04dccc8d398

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'c1bcd321ea2c2ae1765a1e64f03278712221d726'
James Almer [Sun, 2 Sep 2018 22:23:26 +0000 (19:23 -0300)]
Merge commit 'c1bcd321ea2c2ae1765a1e64f03278712221d726'

* commit 'c1bcd321ea2c2ae1765a1e64f03278712221d726':
  avcodec/qsv: fix async support

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'f25117a4286505b38c12466ef04459471de3c1b0'
James Almer [Sun, 2 Sep 2018 22:21:35 +0000 (19:21 -0300)]
Merge commit 'f25117a4286505b38c12466ef04459471de3c1b0'

* commit 'f25117a4286505b38c12466ef04459471de3c1b0':
  libsrt: Pass the correct pointer for the passphrase

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'b93026777aada7742583d8c5ab079e9f4dfe9a5d'
James Almer [Sun, 2 Sep 2018 22:20:36 +0000 (19:20 -0300)]
Merge commit 'b93026777aada7742583d8c5ab079e9f4dfe9a5d'

* commit 'b93026777aada7742583d8c5ab079e9f4dfe9a5d':
  libfdk-aac: Use enum names instead of literal numbers for the output format

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '52fd2afce8436c59c05765f3a6e95f9adb6f9f2f'
James Almer [Sun, 2 Sep 2018 22:19:23 +0000 (19:19 -0300)]
Merge commit '52fd2afce8436c59c05765f3a6e95f9adb6f9f2f'

* commit '52fd2afce8436c59c05765f3a6e95f9adb6f9f2f':
  configure: fix inline asm checks

This commit is a noop, see ad94f1c8abe68a2b38536cc96a31327c6be7b105

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '4ce701b4e640d4723a4005d664f31f8342fac40e'
James Almer [Sun, 2 Sep 2018 22:12:52 +0000 (19:12 -0300)]
Merge commit '4ce701b4e640d4723a4005d664f31f8342fac40e'

* commit '4ce701b4e640d4723a4005d664f31f8342fac40e':
  qsvenc: remove vcm option on Linux

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'f8060865f3e1a16c62e0d337ef0979b6ee4ba457'
James Almer [Sun, 2 Sep 2018 22:12:18 +0000 (19:12 -0300)]
Merge commit 'f8060865f3e1a16c62e0d337ef0979b6ee4ba457'

* commit 'f8060865f3e1a16c62e0d337ef0979b6ee4ba457':
  qsvenc: use the compression_level to replace private option

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'a507af97eef468238d545ff954a39d7432832e54'
James Almer [Sun, 2 Sep 2018 22:11:45 +0000 (19:11 -0300)]
Merge commit 'a507af97eef468238d545ff954a39d7432832e54'

* commit 'a507af97eef468238d545ff954a39d7432832e54':
  avformat/libsrt: add latency options and deprecate tspbdelay

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c'
James Almer [Sun, 2 Sep 2018 22:11:23 +0000 (19:11 -0300)]
Merge commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c'

* commit 'ea8ae27a5e112d06fd5625f640e40849e6313f0c':
  avformat/libsrt: add payload size option

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '35ed7f93dbc72d733e454ae464b1324f38af62a0'
James Almer [Sun, 2 Sep 2018 22:10:49 +0000 (19:10 -0300)]
Merge commit '35ed7f93dbc72d733e454ae464b1324f38af62a0'

* commit '35ed7f93dbc72d733e454ae464b1324f38af62a0':
  qsvenc: Add an option to disable MFE mode

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'e368b0cbfa3fdc627c331e34556f8e39296d04d5'
James Almer [Sun, 2 Sep 2018 22:10:14 +0000 (19:10 -0300)]
Merge commit 'e368b0cbfa3fdc627c331e34556f8e39296d04d5'

* commit 'e368b0cbfa3fdc627c331e34556f8e39296d04d5':
  tls_mbedtls: Use non-deprecated header file

Merged-by: James Almer <jamrial@gmail.com>
9 months agoavcodec/h264_refs: Document last if() in ff_h264_execute_ref_pic_marking()
Michael Niedermayer [Fri, 17 Aug 2018 00:06:27 +0000 (02:06 +0200)]
avcodec/h264_refs: Document last if() in ff_h264_execute_ref_pic_marking()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/h264_refs: Detect more random access points which are not marked
Michael Niedermayer [Tue, 14 Aug 2018 15:12:50 +0000 (17:12 +0200)]
avcodec/h264_refs: Detect more random access points which are not marked

Fixes: nature_360-7501616eb5eafca5-1111.mp4

Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoiavcodec/zmbv: Avoid reallocating cur/prev buffers if they are large enough
Michael Niedermayer [Sun, 26 Aug 2018 22:49:00 +0000 (00:49 +0200)]
iavcodec/zmbv: Avoid reallocating cur/prev buffers if they are large enough

Fixes: Timeout
Fixes: 9721/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ZMBV_fuzzer-5650321660444672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/zmbv: remove useless zero check on dimensions
Michael Niedermayer [Sun, 26 Aug 2018 22:46:54 +0000 (00:46 +0200)]
avcodec/zmbv: remove useless zero check on dimensions

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/ffv1dec_template: do not ignore the return code of decode_line()
Michael Niedermayer [Sun, 26 Aug 2018 21:09:37 +0000 (23:09 +0200)]
avcodec/ffv1dec_template: do not ignore the return code of decode_line()

Fixes: Timeout
Fixes: 9710/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-4918894635515904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/wmv2dec: skip frames that have only skiped MBs
Michael Niedermayer [Sun, 26 Aug 2018 13:57:54 +0000 (15:57 +0200)]
avcodec/wmv2dec: skip frames that have only skiped MBs

This requires us to pre-parse the skip data, as we want to
detect this before allocating all the arrays

Fixes: Timeout
Fixes: 9708/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5729709861109760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/ra144: Fix undefined integer overflow in add_wav()
Michael Niedermayer [Sun, 26 Aug 2018 00:26:24 +0000 (02:26 +0200)]
avcodec/ra144: Fix undefined integer overflow in add_wav()

Fixes: signed integer overflow: -26884 * 91439 cannot be represented in type 'int'
Fixes: 9687/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_144_fuzzer-4995588121690112

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/indeo4: Check dimensions in decode_pic_hdr()
Michael Niedermayer [Sat, 25 Aug 2018 23:58:32 +0000 (01:58 +0200)]
avcodec/indeo4: Check dimensions in decode_pic_hdr()

Fixes: Timeout
Fixes: 9654/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-6289863463665664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoMerge commit 'ad5bbc408637cffd4cc2ba990abef529cf5fa6a3'
James Almer [Sun, 2 Sep 2018 20:45:23 +0000 (17:45 -0300)]
Merge commit 'ad5bbc408637cffd4cc2ba990abef529cf5fa6a3'

* commit 'ad5bbc408637cffd4cc2ba990abef529cf5fa6a3':
  configure: Rename require_header() --> require_headers()

This commit is a noop, see ce47f1589e9f5a6cf8372a269bdd862ff0cc3f91

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '4130e05ff496667565ff7c386a514bd46434eddf'
James Almer [Sun, 2 Sep 2018 20:44:28 +0000 (17:44 -0300)]
Merge commit '4130e05ff496667565ff7c386a514bd46434eddf'

* commit '4130e05ff496667565ff7c386a514bd46434eddf':
  libavformat: add mbedTLS based TLS

This commit is a noop, see c24d247e2c2ccd13fda09fe4194bf2ff0eb42256

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '39f3b6f3fc2b46b405b680cce3599f1b370e342d'
James Almer [Sun, 2 Sep 2018 20:35:51 +0000 (17:35 -0300)]
Merge commit '39f3b6f3fc2b46b405b680cce3599f1b370e342d'

* commit '39f3b6f3fc2b46b405b680cce3599f1b370e342d':
  configure: Move add_fooflags() helper functions into canonical order

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '5691c746cf62e69806aae1baf0a6e8252d519444'
James Almer [Sun, 2 Sep 2018 20:33:30 +0000 (17:33 -0300)]
Merge commit '5691c746cf62e69806aae1baf0a6e8252d519444'

* commit '5691c746cf62e69806aae1baf0a6e8252d519444':
  configure: Group toolchain parameter mangling functions together

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '5cb62f9d952e24fff62737a57e89cf43d9c2333a'
James Almer [Sun, 2 Sep 2018 20:29:54 +0000 (17:29 -0300)]
Merge commit '5cb62f9d952e24fff62737a57e89cf43d9c2333a'

* commit '5cb62f9d952e24fff62737a57e89cf43d9c2333a':
  configure: Rename check_header() --> check_headers()

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '25c2a27c9ec0150210d75ee5ac8ed1bfa14c1a56'
James Almer [Sun, 2 Sep 2018 19:56:27 +0000 (16:56 -0300)]
Merge commit '25c2a27c9ec0150210d75ee5ac8ed1bfa14c1a56'

* commit '25c2a27c9ec0150210d75ee5ac8ed1bfa14c1a56':
  configure: Make require_cc() and require_cpp_condition() functions consistent

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '23be4eebf8aaa7519b12b2a49e5c5c6c4d076e6a'
James Almer [Sun, 2 Sep 2018 19:50:45 +0000 (16:50 -0300)]
Merge commit '23be4eebf8aaa7519b12b2a49e5c5c6c4d076e6a'

* commit '23be4eebf8aaa7519b12b2a49e5c5c6c4d076e6a':
  build: Group external library protocols separately

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '78149d6657302b58d5e46e8bc0a521ed009f86f7'
James Almer [Sun, 2 Sep 2018 19:42:57 +0000 (16:42 -0300)]
Merge commit '78149d6657302b58d5e46e8bc0a521ed009f86f7'

* commit '78149d6657302b58d5e46e8bc0a521ed009f86f7':
  amfenc: Retain a reference to D3D frames used as input during the encoding process

This commit is a noop, see 05f1a3face140373ae658ab1abd6bacc841a770d

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit 'abf806f7f1601c7e54de7f863bbb816af144a88c'
James Almer [Sun, 2 Sep 2018 19:41:34 +0000 (16:41 -0300)]
Merge commit 'abf806f7f1601c7e54de7f863bbb816af144a88c'

* commit 'abf806f7f1601c7e54de7f863bbb816af144a88c':
  random_seed: use bcrypt instead of the old wincrypt API

This commit is a noop, see aedbf1640ced8fc09dc980ead2a387a59d8f7f68

Merged-by: James Almer <jamrial@gmail.com>
9 months agoMerge commit '347aa8f72356124ec6b95bf8ebd1faf72db03f8d'
James Almer [Sun, 2 Sep 2018 19:39:52 +0000 (16:39 -0300)]
Merge commit '347aa8f72356124ec6b95bf8ebd1faf72db03f8d'

* commit '347aa8f72356124ec6b95bf8ebd1faf72db03f8d':
  x86: Don't declare a non-static function as inline

This commit is a noop

Merged-by: James Almer <jamrial@gmail.com>
9 months agolavf/libsmbclient: return AVERROR_EOF for EOF.
Nicolas George [Thu, 30 Aug 2018 12:42:00 +0000 (14:42 +0200)]
lavf/libsmbclient: return AVERROR_EOF for EOF.

Fix trac ticket #7387.

9 months agoavcodec/mips: [loongson] optimize memset in h264dsp.
Shiyou Yin [Fri, 31 Aug 2018 13:57:23 +0000 (21:57 +0800)]
avcodec/mips: [loongson] optimize memset in h264dsp.

Optimized memset with mmi in following functions:
1. ff_h264_add_pixels4_8_mmi.
2. ff_h264_idct_add_8_mmi.
3. ff_h264_idct8_add_8_mmi.

This optimization improved h264 decoding performance about 1.3%(tested on loongson 3A3000).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/mips: [loongson] reoptimize h264_chroma_mc8_mmi v2.
Shiyou Yin [Fri, 31 Aug 2018 13:56:05 +0000 (21:56 +0800)]
avcodec/mips: [loongson] reoptimize h264_chroma_mc8_mmi v2.

Reoptimize function ff_put_h264_chroma_mc8_mmi and ff_avg_h264_chroma_mc8_mmi.
Performance of h264 decoding improved about 5%(from 69fps to 73fps, tested on loongson 3A3000).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/mips: [loongson] reoptimize simple idct with mmi.
Shiyou Yin [Fri, 31 Aug 2018 13:41:49 +0000 (21:41 +0800)]
avcodec/mips: [loongson] reoptimize simple idct with mmi.

Performance of mpeg4 decoding improved about 23%(from 128fps to 158fps, tested on loongson 3A3000).
Reoptimized following functions with mmi.
1. ff_simple_idct_put_8_mmi
2. ff_simple_idct_add_8_mmi
3. ff_simple_idct_8_mmi

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavformat/libsrt: add pkt_size parameter to libsrt
Marton Balint [Sat, 1 Sep 2018 17:02:47 +0000 (19:02 +0200)]
avformat/libsrt: add pkt_size parameter to libsrt

Also make sure we set the URL context max packet size accordingly.

Based on a patch by Tudor Suciu <tudor.suciu@gmail.com>

Signed-off-by: Marton Balint <cus@passwd.hu>
9 months agoffplay: do not drain existing filters when seeking
Marton Balint [Sat, 25 Aug 2018 18:42:55 +0000 (20:42 +0200)]
ffplay: do not drain existing filters when seeking

After a seek we drop all frames from the filter anyway. Audio filters already
had a similar approach.

Signed-off-by: Marton Balint <cus@passwd.hu>
9 months agoavformat/mov: Error on too large stsd entry counts.
Dale Curtis [Thu, 30 Aug 2018 22:18:25 +0000 (15:18 -0700)]
avformat/mov: Error on too large stsd entry counts.

Entries are always at least 8 bytes per the parsing code, so if we
see an impossible entry count avoid massive allocations. This is
similar to an existing check in mov_read_stsc().

Since ff_mov_read_stsd_entries() does eof checks, an alternative
approach could be to clamp the entry count to atom.size / 8.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoexamples: Fix use of AV_CODEC_FLAG_GLOBAL_HEADER
Michael Bunk [Thu, 30 Aug 2018 06:56:19 +0000 (08:56 +0200)]
examples: Fix use of AV_CODEC_FLAG_GLOBAL_HEADER

AV_CODEC_FLAG_GLOBAL_HEADER should be set before calling avcodec_open2() to have any effect.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/scpr: refactor repeated code into decode_units()
Paul B Mahol [Sat, 1 Sep 2018 10:38:17 +0000 (12:38 +0200)]
avcodec/scpr: refactor repeated code into decode_units()

9 months agoavcodec/dnxhdenc: stop leaking memory when initalization fails
Paul B Mahol [Thu, 30 Aug 2018 09:35:07 +0000 (11:35 +0200)]
avcodec/dnxhdenc: stop leaking memory when initalization fails

Fixes #6593.

9 months agofate: add 10-bit test for hue video filter
Tobias Rapp [Fri, 3 Aug 2018 09:29:50 +0000 (11:29 +0200)]
fate: add 10-bit test for hue video filter

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
9 months agolavc/pthread: use THREAD_SAFE_CALLBACKS() to simplifx more code
Jun Zhao [Sat, 11 Aug 2018 09:15:39 +0000 (17:15 +0800)]
lavc/pthread: use THREAD_SAFE_CALLBACKS() to simplifx more code

use THREAD_SAFE_CALLBACKS() to simplifx more code

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
9 months agoconfigure: <fflib>_deps: validate, reduce sensitivity
Avi Halachmi (:avih) [Tue, 28 Aug 2018 14:14:55 +0000 (17:14 +0300)]
configure: <fflib>_deps: validate, reduce sensitivity

- Allow to add deps in any order rather than "in linking order".
- Expand deps chains as required rather than just once.
- Validate that there are no cycles.
- Validate that [after expansion] deps are limited to other fflibs.
- Remove expectation for a specific output order of unique().

Previously when adding items to <fflib>_deps, developers were
required to add them in linking order. This can be awkward and
bug-prone, especially when a list is not empty, e.g. when adding
conditional deps.

It also implicitly expected unique() to keep the last instance of
recurring items such that these lists maintain their linking order
after removing duplicate items.

This patch mainly allows to add deps in any order by keeping just
one master list in linking order, and then reordering all the
<fflib>_deps lists to align with the master list order.

This master list is LIBRARY_LIST itself, where otherwise its order
doesn't matter.

The patch also removes a limit where these deps lists were expanded
only once. This could have resulted in incomplete expanded lists,
or forcing devs to add already-deducable deps to avoid this issue.

Note: it is possible to deduce the master list order automatically
from the deps lists, but in this case it's probably not worth the
added complexity, even if minor. Maintaining one list should be OK.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agotests/ref/fate/pixelutils: Add a newline.
Carl Eugen Hoyos [Wed, 29 Aug 2018 21:26:01 +0000 (23:26 +0200)]
tests/ref/fate/pixelutils: Add a newline.

Fixes fate-pixelutils on aix.

9 months agolavc/v4l2_m2m_enc: Add missing braces around initializers.
Carl Eugen Hoyos [Thu, 30 Aug 2018 22:43:17 +0000 (00:43 +0200)]
lavc/v4l2_m2m_enc: Add missing braces around initializers.

Fixes the following warnings:
libavcodec/v4l2_m2m_enc.c:51:12: warning: missing braces around initializer
libavcodec/v4l2_m2m_enc.c:71:12: warning: missing braces around initializer

9 months agoavcodec/get_bits: actually make cached reader correctly disabled
James Almer [Thu, 30 Aug 2018 20:36:55 +0000 (22:36 +0200)]
avcodec/get_bits: actually make cached reader correctly disabled

9 months agoavfilter/vf_frei0r: Remove duplicate }, fix build
Michael Niedermayer [Thu, 30 Aug 2018 15:09:23 +0000 (17:09 +0200)]
avfilter/vf_frei0r: Remove duplicate }, fix build

Fixes regression from a3c6b7ff5903b8a044e30edaaa0de00e70517538

Reported-by: qq2225936589
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/utvideodec: use cached bitstream reader everywhere except on x86_32
Paul B Mahol [Tue, 3 Apr 2018 11:32:07 +0000 (13:32 +0200)]
avcodec/utvideodec: use cached bitstream reader everywhere except on x86_32

From 100x real-time decoding to 138x real-time decoding for 320x240 video.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 months agodoc/libav-merge: bitstream reader is now merged
Paul B Mahol [Fri, 7 Jul 2017 18:47:08 +0000 (20:47 +0200)]
doc/libav-merge: bitstream reader is now merged

Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 months agoavcodec/get_bits: add cached bitstream reader
Paul B Mahol [Fri, 7 Jul 2017 14:56:10 +0000 (16:56 +0200)]
avcodec/get_bits: add cached bitstream reader

Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 months agofrei0r: handle string params
Raphael Graf [Wed, 29 Aug 2018 10:29:16 +0000 (12:29 +0200)]
frei0r: handle string params

This is needed for some of the frei0r filters (facebl0r and facedetect) which accept string parameters.

Fixes the issue described here:
http://www.ffmpeg-archive.org/Unable-to-set-ffmpeg-frei0r-facedetect-filter-parameter-td4680190.html

Signed-off-by: Raphael Graf <r@undefined.ch>
9 months agoavcodec/scpr: error out if run length is <= 0
Paul B Mahol [Wed, 29 Aug 2018 21:11:45 +0000 (23:11 +0200)]
avcodec/scpr: error out if run length is <= 0

9 months agoavformat/dashdec: Add a re-entrance check point after an interrupt operation
Colin NG [Wed, 29 Aug 2018 08:28:03 +0000 (16:28 +0800)]
avformat/dashdec: Add a re-entrance check point after an interrupt operation

9 months agoavformat/dashdec: Fix calc_cur_seg_no if availability_start_time not
Jacek Jendrzej [Wed, 29 Aug 2018 07:20:00 +0000 (15:20 +0800)]
avformat/dashdec: Fix calc_cur_seg_no if availability_start_time not

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
9 months agoffmpeg: add correct field for raw pts in -progress report
Gyan Doshi [Sun, 5 Aug 2018 07:04:21 +0000 (12:34 +0530)]
ffmpeg: add correct field for raw pts in -progress report

PTS is in microseconds, so correct field name is out_time_us.

Old field out_time_ms kept for now - will be removed after a suitable transition
period.

Fixes #7345

9 months agoatrac9dec: clean up code slightly
Rostislav Pehlivanov [Tue, 28 Aug 2018 03:25:35 +0000 (04:25 +0100)]
atrac9dec: clean up code slightly

Just remove some dead variable assignments, unneeded variables and
change the FFMAX order to something more readable. Still identical.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
9 months agoatrac9dec: implement LFE channel decoding
Rostislav Pehlivanov [Mon, 27 Aug 2018 22:15:08 +0000 (23:15 +0100)]
atrac9dec: implement LFE channel decoding

Much simpler than regular decoding, does allow for 5.1 and 7.1
streams to be decoded without desync.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
9 months agoatrac9dec: relax gradient value requirements
Rostislav Pehlivanov [Mon, 27 Aug 2018 22:12:36 +0000 (23:12 +0100)]
atrac9dec: relax gradient value requirements

Unlike the range, the gradient start value does not have to be lower
than the end value.
Does allow more files to be correctly decoded without errors.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
9 months agoconfigure: [loongson] revert no-expensive-optimizations
Shiyou Yin [Fri, 24 Aug 2018 09:22:12 +0000 (17:22 +0800)]
configure: [loongson] revert no-expensive-optimizations

Add gcc version check before add -fno-expensive-optimizations flag.
Only when gcc version is lower than 5.3.0, this flag is needed.
More bug info see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67736
https://gcc.gnu.org/ml/gcc-patches/2012-05/msg00401.html

Signed-off-by: Shiyou Yin <yinshiyou-hf@loongson.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec: add WinCAM Motion Video decoder
Paul B Mahol [Sat, 25 Aug 2018 16:51:37 +0000 (18:51 +0200)]
avcodec: add WinCAM Motion Video decoder

9 months agoavcodec: add MatchWare Screen Capture Codec
Paul B Mahol [Fri, 24 Aug 2018 15:01:00 +0000 (17:01 +0200)]
avcodec: add MatchWare Screen Capture Codec

9 months agovaapi_encode: Factorise out adding global parameters
Mark Thompson [Wed, 22 Aug 2018 23:44:41 +0000 (00:44 +0100)]
vaapi_encode: Factorise out adding global parameters

9 months agovaapi_encode: Remove common priv_data and options fields
Mark Thompson [Wed, 22 Aug 2018 23:44:40 +0000 (00:44 +0100)]
vaapi_encode: Remove common priv_data and options fields

The codec-specific context now contains both the common context and the
codec-specific options directly.

9 months agovaapi_encode_vp9: Move options and common structures into context
Mark Thompson [Wed, 22 Aug 2018 23:44:39 +0000 (00:44 +0100)]
vaapi_encode_vp9: Move options and common structures into context

9 months agovaapi_encode_vp8: Move options and common structures into context
Mark Thompson [Wed, 22 Aug 2018 23:44:38 +0000 (00:44 +0100)]
vaapi_encode_vp8: Move options and common structures into context

9 months agovaapi_encode_mpeg2: Move common structure into context
Mark Thompson [Wed, 22 Aug 2018 23:44:37 +0000 (00:44 +0100)]
vaapi_encode_mpeg2: Move common structure into context

9 months agovaapi_encode_mjpeg: Move common structure into context
Mark Thompson [Wed, 22 Aug 2018 23:44:36 +0000 (00:44 +0100)]
vaapi_encode_mjpeg: Move common structure into context

9 months agovaapi_encode_h265: Move options and common structures into context
Mark Thompson [Wed, 22 Aug 2018 23:44:35 +0000 (00:44 +0100)]
vaapi_encode_h265: Move options and common structures into context

Matching previous commit for H.264.

9 months agovaapi_encode_h264: Move options and common structures into context
Mark Thompson [Wed, 22 Aug 2018 23:44:34 +0000 (00:44 +0100)]
vaapi_encode_h264: Move options and common structures into context

This will make it easier to support options in common between different
encoders.  It also cleans up some of the field naming.

9 months agoconfigure: speed up check_deps()
Avi Halachmi (:avih) [Sun, 5 Aug 2018 03:16:44 +0000 (06:16 +0300)]
configure: speed up check_deps()

x4 - x25 faster.

check_deps() recursively enables/disables components, and its loop is
iterated nearly 6000 times. It's particularly slow in bash - currently
consuming more than 50% of configure runtime, and about 20% with other
shells.

This commit applies few local optimizations, most effective first:
- Use $1 $2 ... instead of pushvar/popvar, and same at enable_deep*
- Abort early in one notable case - empty deps, to avoid costly no-op.
- Smaller changes which do add up:
  - Handle ${cfg}_checking locally instead of via enable[d]/disable
  - ${cfg}_checking: test done before inprogress - x2 faster in 50%+
  - one eval instead of several at the empty-deps early abort path.

- The "actual work" part is unmodified - just its surroundings.

Biggest speedups (relative and absolute) are observed with bash.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Tested-by: Helmut K. C. Tessarek <tessarek@evermeet.cx>
Tested-by: Dave Yeo <daveryeo@telus.net>
Tested-by: Reino Wijnsma <rwijnsma@xs4all.nl>
Signed-off-by: James Almer <jamrial@gmail.com>
9 months agoconfigure: speed up print_enabled_components()
Avi Halachmi (:avih) [Mon, 30 Jul 2018 19:48:04 +0000 (22:48 +0300)]
configure: speed up print_enabled_components()

x4 - x10 faster.

Inside print_enabled components, the filter_list case invokes sed
about 350 times to parse the same source file and extract different
info for each arg. This is never instant, and on systems where fork is
slow (notably MSYS2/Cygwin on windows) it takes many seconds.

Change it to use sed once on the source file and set env vars with the
parse results, then use these results inside the loop.

Additionally, the cases of indev_list and outdev_list are very
infrequent, but nevertheless they're faster, and arguably cleaner, with
shell parameter substitutions than with command substitutions.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Tested-by: Helmut K. C. Tessarek <tessarek@evermeet.cx>
Tested-by: Dave Yeo <daveryeo@telus.net>
Tested-by: Reino Wijnsma <rwijnsma@xs4all.nl>
Signed-off-by: James Almer <jamrial@gmail.com>
9 months agoconfigure: speed up flatten_extralibs_wrapper()
Avi Halachmi (:avih) [Mon, 30 Jul 2018 19:39:15 +0000 (22:39 +0300)]
configure: speed up flatten_extralibs_wrapper()

x50 - x200 faster.

Currently configure spends 50-70% of its runtime inside a single
function: flatten_extralibs[_wrapper] - which does string processing.

During its run, nearly 20K command substitutions (subshells) are used,
including its callees unique() and resolve(), which is the reason
for its lengthy run.

This commit avoids all subshells during its execution, speeding it up
by about two orders of magnitude, and reducing the overall configure
runtime by 50-70% .

resolve() is rewritten to avoid subshells, and in unique() and
flatten_extralibs() we "inline" the filter[_out] functionality.

Note that logically, "unique" functionality has more than one possible
output (depending on which of the recurring items is kept). As it
turns out, other parts expect the last recurring item to be kept
(which was the original behavior of uniqie()). This patch preservs
its output order.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Tested-by: Helmut K. C. Tessarek <tessarek@evermeet.cx>
Tested-by: Dave Yeo <daveryeo@telus.net>
Tested-by: Reino Wijnsma <rwijnsma@xs4all.nl>
Signed-off-by: James Almer <jamrial@gmail.com>
9 months agolavc/encode: fix frame_number double-counted
Zhong Li [Thu, 28 Jun 2018 09:01:46 +0000 (17:01 +0800)]
lavc/encode: fix frame_number double-counted

Encoder frame_number may be double-counted if some frames are cached and then flushed.
Take qsv encoder (some frames are cached firsty for asynchronism) as example,
./ffmpeg -loglevel verbose -hwaccel qsv -c:v h264_qsv -i in.mp4 -vframes 100 -c:v h264_qsv out.mp4
frame_number passed to encoder is double-counted and larger than the accurate value.
Libx264 encoding with B frames can also reproduce it.

Signed-off-by: Zhong Li <zhong.li@intel.com>
9 months agoavcodec/proresdec2: add frame threading support
Paul B Mahol [Wed, 22 Aug 2018 16:46:51 +0000 (18:46 +0200)]
avcodec/proresdec2: add frame threading support

9 months agoavcodec/mscc: fix several bugs
Paul B Mahol [Sat, 22 Apr 2017 13:51:52 +0000 (15:51 +0200)]
avcodec/mscc: fix several bugs

Fixes #6342.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
9 months agolavfi/avf_concat: switch to activate.
Nicolas George [Fri, 10 Aug 2018 20:58:46 +0000 (22:58 +0200)]
lavfi/avf_concat: switch to activate.

Fix trac ticket #7351.

9 months agompeg4video: Add Studio DPCM support
Kieran Kunhya [Sun, 19 Aug 2018 01:31:42 +0000 (02:31 +0100)]
mpeg4video: Add Studio DPCM support

9 months agoavformat/mpegts: add missing null pointer checks in ff_parse_mpeg2_descriptor()
Michael Niedermayer [Thu, 16 Aug 2018 11:33:40 +0000 (13:33 +0200)]
avformat/mpegts: add missing null pointer checks in ff_parse_mpeg2_descriptor()

Fixes: null pointer dereference
Fixes: wtv-crash-75fa58662ded1c1d349f3d1df89394fd690cf92f

Found-by: Paul Ch <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/hq_hqa: Check remaining input bits in hqa_decode_mb()
Michael Niedermayer [Mon, 20 Aug 2018 20:53:32 +0000 (22:53 +0200)]
avcodec/hq_hqa: Check remaining input bits in hqa_decode_mb()

Fixes: Timeout
Fixes: 9634/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HQ_HQA_fuzzer-6267852259590144

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/vb: Check for end of bytestream before reading blocktype
Michael Niedermayer [Mon, 20 Aug 2018 20:19:23 +0000 (22:19 +0200)]
avcodec/vb: Check for end of bytestream before reading blocktype

Fixes: Timeout
Fixes: 9601/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VB_fuzzer-4550228702134272

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/snowdec: Fix integer overflow with motion vector residual
Michael Niedermayer [Mon, 20 Aug 2018 18:15:19 +0000 (20:15 +0200)]
avcodec/snowdec: Fix integer overflow with motion vector residual

Fixes: signed integer overflow: -19818 + -2147483648 cannot be represented in type 'int'
Fixes: 9545/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SNOW_fuzzer-4928769537081344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoallcodecs: reorder ff_bitpacked_decoder
Rostislav Pehlivanov [Sat, 25 Aug 2018 17:36:16 +0000 (18:36 +0100)]
allcodecs: reorder ff_bitpacked_decoder

Needs to be in alphabetical order.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
9 months agoavcodec/mpeg4videodec: Fix slice end detection in mpeg4_decode_studio_mb()
Michael Niedermayer [Sun, 19 Aug 2018 08:15:53 +0000 (10:15 +0200)]
avcodec/mpeg4videodec: Fix slice end detection in mpeg4_decode_studio_mb()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 months agoavcodec/utils: document allocation requirement of extradata
Timo Rothenpieler [Fri, 24 Aug 2018 17:57:42 +0000 (19:57 +0200)]
avcodec/utils: document allocation requirement of extradata