]> git.sesse.net Git - ffmpeg/log
ffmpeg
8 years agolibavutil/channel_layout: Check strtol*() for failure
Michael Niedermayer [Thu, 5 Nov 2015 18:24:33 +0000 (19:24 +0100)]
libavutil/channel_layout: Check strtol*() for failure

Fixes assertion failure
Fixes: 4f5814bb15d2dda6fc18ef9791b13816/signal_sigabrt_7ffff6ae7cc9_65_7209d160d168b76f311be6cd64a548eb.wv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavformat/mpegts: Only start probing data streams within probe_packets
Michael Niedermayer [Thu, 5 Nov 2015 16:04:37 +0000 (17:04 +0100)]
avformat/mpegts: Only start probing data streams within probe_packets

Fixes assertion failure
Fixes: 4321db8ac331f5967ebfbfe80ce5eb78/signal_sigabrt_7ffff6ae7cc9_7213_0d6457b9d6897fa7c78507fa5de53510.ts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/hevc_ps: Check chroma_format_idc
Michael Niedermayer [Thu, 5 Nov 2015 13:52:33 +0000 (14:52 +0100)]
avcodec/hevc_ps: Check chroma_format_idc

Fixes out of array access
Fixes: 24d05e8b84676799c735c9e27d97895e/asan_heap-oob_1b70f6a_2955_7c3652a7f370f9f3ef40642bc2c99bb2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/truemotion1: Initialize mb_change_byte only when needed
Michael Niedermayer [Thu, 5 Nov 2015 02:15:24 +0000 (03:15 +0100)]
avcodec/truemotion1: Initialize mb_change_byte only when needed

Fixes out of array read
Fixes: d92114d8c2a019b8a6e50cd2a7301b54/asan_heap-oob_26bf563_60_1d3420277533de9dbf8aba3f93af346f.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/ffv1dec: Print an error if the quant table count is invalid
Michael Niedermayer [Thu, 5 Nov 2015 00:25:50 +0000 (01:25 +0100)]
avcodec/ffv1dec: Print an error if the quant table count is invalid

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/ffv1dec: Free tables on init failure
Michael Niedermayer [Wed, 4 Nov 2015 23:40:09 +0000 (00:40 +0100)]
avcodec/ffv1dec: Free tables on init failure

Fixes memleak
Fixes: 07ec1fc3c1cbf2d3edcd7d9b52ca156c/asan_heap-oob_13624c5_491_ecd4720a03e697ba750b235690656c8f.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/ffv1dec: Check for 0 quant tables
Michael Niedermayer [Wed, 4 Nov 2015 23:36:59 +0000 (00:36 +0100)]
avcodec/ffv1dec: Check for 0 quant tables

Fixes assertion failure
Fixes: 07ec1fc3c1cbf2d3edcd7d9b52ca156c/asan_heap-oob_13624c5_491_ecd4720a03e697ba750b235690656c8f.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoswresample/resample: speed up build_filter by 50%
Ganesh Ajjanagadde [Wed, 4 Nov 2015 01:08:12 +0000 (20:08 -0500)]
swresample/resample: speed up build_filter by 50%

This speeds up build_filter by ~ 50%. This gain should be pretty
consistent across all architectures and platforms.

Essentially, this relies on a observation that the filters have some
even/odd symmetry that may be exploited during the construction of the
polyphase filter bank. In particular, phases (scaled to [0, 1]) in [0.5, 1] are
easily derived from [0, 0.5] and expensive reevaluation of function
points are unnecessary. This requires some rather annoying even/odd
bookkeeping as can be seen from the patch.

I vaguely recall from signal processing theory more general symmetries allowing even greater
optimization of the construction. At a high level, "even functions"
correspond to 2, and one can imagine variations. Nevertheless, for the sake
of some generality and because of existing filters, this is all that is
being exploited.

Currently, this patch relies on phase_count being even or (trivially) 1,
though this is not an inherent limitation to the approach. This
assumption is safe as phase_count is 1 << phase_bits, and is hence a
power of two. There is no way for user API to set it to a nontrivial odd
number. This assumption has been placed as an assert in the code.

To repeat, this assumes even symmetry of the filters, which is the most common
way to get generalized linear phase anyway and is true of all currently
supported filters.

As a side note, accuracy should be identical or perhaps slightly better
due to this "forcing" filter symmetries leading to a better phase
characteristic. As before, I can't test this claim easily, though it may
be of interest.

Patch tested with FATE.

Sample benchmark (x86-64, Haswell, GNU/Linux):

test: swr-resample-dblp-44100-2626

new:
527376779 decicycles in build_filter(loop 1000),     256 runs,      0 skips
524361765 decicycles in build_filter(loop 1000),     512 runs,      0 skips
516552574 decicycles in build_filter(loop 1000),    1024 runs,      0 skips

old:
974178658 decicycles in build_filter(loop 1000),     256 runs,      0 skips
972794408 decicycles in build_filter(loop 1000),     512 runs,      0 skips
954350046 decicycles in build_filter(loop 1000),    1024 runs,      0 skips

Note that lower level optimizations are entirely possible, I focussed on
getting the high level semantics correct. In any case, this should
provide a good foundation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavcodec/mjpegdec: Reinitialize IDCT on BPP changes
Michael Niedermayer [Wed, 4 Nov 2015 20:27:04 +0000 (21:27 +0100)]
avcodec/mjpegdec: Reinitialize IDCT on BPP changes

Fixes misaligned access
Fixes: dc9262a469f6f315f74c087a7b3a7f35/signal_sigsegv_2e95bcd_9_9c0f9f4a9ba82aa9b3ab2b91ce4d5277.jpg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
Michael Niedermayer [Wed, 4 Nov 2015 17:08:52 +0000 (18:08 +0100)]
avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it

Fixes: 04715144ba237443010554be0d05343f/asan_heap-oob_1eafc76_1737_c685b48041a563461839e4e7ab97abb8.jpg
Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/aacsbr_template: replace qsort with AV_QSORT
Ganesh Ajjanagadde [Wed, 28 Oct 2015 01:11:45 +0000 (21:11 -0400)]
avcodec/aacsbr_template: replace qsort with AV_QSORT

When sbr->reset is set in encode_frame, a bunch of qsort calls might get made.
Thus, there is the potential of calling qsort whenever the spectral
contents change.

AV_QSORT is substantially faster due to the inlining of the comparison callback.
Thus, the increase in performance should be worth the increase in binary size.

Tested with FATE.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavcodec/rawenc: Cast argument for av_image_copy_to_buffer() to const
Michael Niedermayer [Wed, 4 Nov 2015 03:41:22 +0000 (04:41 +0100)]
avcodec/rawenc: Cast argument for av_image_copy_to_buffer() to const

Fixes: libavcodec/rawenc.c:64:40: warning: passing argument 3 of av_image_copy_to_buffer from incompatible pointer type [enabled by default]
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/libzvbi-teletextdec: Remove unused variable ret
Michael Niedermayer [Wed, 4 Nov 2015 03:38:58 +0000 (04:38 +0100)]
avcodec/libzvbi-teletextdec: Remove unused variable ret

Fixes: libavcodec/libzvbi-teletextdec.c:232:9: warning: unused variable ret [-Wunused-variable]
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/vdpau: Remove CONFIG_H263_VDPAU_HWACCEL
Michael Niedermayer [Wed, 4 Nov 2015 03:29:22 +0000 (04:29 +0100)]
avcodec/vdpau: Remove CONFIG_H263_VDPAU_HWACCEL

Fixes: libavcodec/vdpau.c:320:5: warning: "CONFIG_H263_VDPAU_HWACCEL" is not defined [-Wundef]
It was removed in d15adeacf3e61cd8d2169c090bf06f6d8fc62f8b

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavformat/cache: Use int64_t to avoid int overflow in cache_read
Bryan Huh [Mon, 2 Nov 2015 18:20:39 +0000 (10:20 -0800)]
avformat/cache: Use int64_t to avoid int overflow in cache_read

Fixes an issue where an int64_t ffurl_seek return-value was being stored
in an int (32-bit) "r" variable, leading to integer overflow when seeking
into a large file (>2GB), and ultimately a "Failed to perform internal
seek" error mesage.

To test, try running `ffprobe 'cache:http://<something>'` on a file that
is ~3GB large, whose moov atom is at the end of the file

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavfilter/showcqt: remove yuv offset
Muhammad Faiz [Tue, 3 Nov 2015 15:01:55 +0000 (22:01 +0700)]
avfilter/showcqt: remove yuv offset

this makes draw_bar faster
slightly different result with old version

check result (with ~3 minutes audio file):
old:
    real    0m49.611s
    user    0m49.260s
    sys     0m0.073s
new:
    real    0m47.606s
    user    0m47.378s
    sys     0m0.068s
PSNR between old and new:
yuv444p PSNR
    y:109.519298 u:107.506485 v:104.746878
    average:106.816074 min:99.167305 max:inf
yuv422p PSNR
    y:109.519298 u:108.025801 v:104.489734
    average:107.279817 min:98.007467 max:inf
yuv420p PSNR
    y:109.519298 u:108.363875 v:105.290200
    average:108.261511 min:97.461812 max:inf

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoall: use FFDIFFSIGN to resolve possible undefined behavior in comparators
Ganesh Ajjanagadde [Sun, 1 Nov 2015 15:43:56 +0000 (10:43 -0500)]
all: use FFDIFFSIGN to resolve possible undefined behavior in comparators

FFDIFFSIGN was created explicitly for this purpose, since the common
return a - b idiom is unsafe regarding overflow on signed integers. It
optimizes to branchless code on common compilers.

FFDIFFSIGN also has the subjective benefit of being easier to read due
to lack of ternary operators.

Tested with FATE.

Things not covered by this are unsigned integers, for which overflows
are well defined, and also places where overflow is clearly impossible,
e.g an instance where the a - b was being done on 24 bit values.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavutil/common: add FFDIFFSIGN macro
Ganesh Ajjanagadde [Fri, 30 Oct 2015 18:21:15 +0000 (14:21 -0400)]
avutil/common: add FFDIFFSIGN macro

This is of use for defining comparator callbacks. Common approaches like
return x-y are not safe due to the risks of overflow.
Furthermore, the (x > y) - (x < y) trick is optimized to branchless
code.
This also documents this macro accordingly.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavfilter/vf_rotate: correct log message
Ganesh Ajjanagadde [Sat, 31 Oct 2015 04:38:30 +0000 (00:38 -0400)]
avfilter/vf_rotate: correct log message

There seems to be some typos in the log messages that are fixed by this.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agofate: update fate-source ref file
James Almer [Tue, 3 Nov 2015 18:05:32 +0000 (15:05 -0300)]
fate: update fate-source ref file

Signed-off-by: James Almer <jamrial@gmail.com>
8 years agoavformat: add acm demuxer
Paul B Mahol [Fri, 30 Oct 2015 16:45:33 +0000 (17:45 +0100)]
avformat: add acm demuxer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavcodec: add Interplay ACM decoder
Paul B Mahol [Fri, 30 Oct 2015 17:15:22 +0000 (18:15 +0100)]
avcodec: add Interplay ACM decoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavutil/file_open: avoid file handle inheritance on Windows
Tobias Rapp [Thu, 29 Oct 2015 08:11:37 +0000 (09:11 +0100)]
avutil/file_open: avoid file handle inheritance on Windows

Avoids inheritance of file handles on Windows systems similar to the
O_CLOEXEC/FD_CLOEXEC flag on Linux.

Fixes file lock issues in Windows applications when a child process
is started with handle inheritance enabled (standard input/output
redirection) while a FFmpeg transcoding is running in the parent
process.

Links relevant to the subject:

https://msdn.microsoft.com/en-us/library/w7sa2b22.aspx

Describes the _wsopen() function and the O_NOINHERIT flag. File handles
opened by _wsopen() are inheritable by default.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx

Describes handle inheritance when creating new processes. Handle
inheritance must be enabled (bInheritHandles = TRUE) e.g. when you want
to pass handles for stdin/stdout via lpStartupInfo.

Signed-off-by: Tobias Rapp <t.rapp@noa-audio.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agohlsenc: Only write PAT/PMT once per segment
Derek Buitenhuis [Sun, 5 Apr 2015 18:28:38 +0000 (14:28 -0400)]
hlsenc: Only write PAT/PMT once per segment

This saves a lot of muxing overhead, especially on lower bitrate
segments.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
8 years agoavfilter/vf_frei0r: use av_strtod instead of strtod for added flexibility
Ganesh Ajjanagadde [Sun, 1 Nov 2015 03:34:15 +0000 (23:34 -0400)]
avfilter/vf_frei0r: use av_strtod instead of strtod for added flexibility

This converts the usage of strtod to av_strtod in order to unify and
make number parsing more consistent. This also adds support for SI
postfixes.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoMerge commit '8161220eee152dad8b2ea9e2755c78c8e127f747'
Hendrik Leppkes [Mon, 2 Nov 2015 10:58:38 +0000 (11:58 +0100)]
Merge commit '8161220eee152dad8b2ea9e2755c78c8e127f747'

* commit '8161220eee152dad8b2ea9e2755c78c8e127f747':
  h264_parser: Rename close() to h264_close()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit '407ac22322e5ce67996ec54ef619cafa4c9ceb78'
Hendrik Leppkes [Mon, 2 Nov 2015 10:58:27 +0000 (11:58 +0100)]
Merge commit '407ac22322e5ce67996ec54ef619cafa4c9ceb78'

* commit '407ac22322e5ce67996ec54ef619cafa4c9ceb78':
  w32pthreads: Map MemoryBarrier to __sync_synchronize on mingw

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit 'a0562e531723923b632684c7b51a9dd584bf534f'
Hendrik Leppkes [Mon, 2 Nov 2015 10:58:16 +0000 (11:58 +0100)]
Merge commit 'a0562e531723923b632684c7b51a9dd584bf534f'

* commit 'a0562e531723923b632684c7b51a9dd584bf534f':
  configure: Add a SONAME entry for the android target

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit 'd35d0c723e3c8fc8cde76bf677f67928f5e179a8'
Hendrik Leppkes [Mon, 2 Nov 2015 10:58:01 +0000 (11:58 +0100)]
Merge commit 'd35d0c723e3c8fc8cde76bf677f67928f5e179a8'

* commit 'd35d0c723e3c8fc8cde76bf677f67928f5e179a8':
  vdpau: remove dysfunctional H.263 support

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit 'f53583ea6e2e3fda4e4aa363f9a62cff4285affb'
Hendrik Leppkes [Mon, 2 Nov 2015 10:55:13 +0000 (11:55 +0100)]
Merge commit 'f53583ea6e2e3fda4e4aa363f9a62cff4285affb'

* commit 'f53583ea6e2e3fda4e4aa363f9a62cff4285affb':
  omadec: Fix position of opening parenthesis

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit 'b4a82e740743744136e07054525560351e4892ae'
Hendrik Leppkes [Mon, 2 Nov 2015 10:54:34 +0000 (11:54 +0100)]
Merge commit 'b4a82e740743744136e07054525560351e4892ae'

* commit 'b4a82e740743744136e07054525560351e4892ae':
  h264: Print the complete user message

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit '8487987b87a252963b27b6adfd82887ea5933918'
Hendrik Leppkes [Mon, 2 Nov 2015 10:53:55 +0000 (11:53 +0100)]
Merge commit '8487987b87a252963b27b6adfd82887ea5933918'

* commit '8487987b87a252963b27b6adfd82887ea5933918':
  h264: Print user data SEI under normal debug verbosity

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit '1720791e36f9cc24c05efea5bb275ab52156ce50'
Hendrik Leppkes [Mon, 2 Nov 2015 10:50:35 +0000 (11:50 +0100)]
Merge commit '1720791e36f9cc24c05efea5bb275ab52156ce50'

* commit '1720791e36f9cc24c05efea5bb275ab52156ce50':
  png: read and write stereo3d frame side data information

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit '00b62968d079e63bf22028f253ac297292436ebe'
Hendrik Leppkes [Mon, 2 Nov 2015 10:43:50 +0000 (11:43 +0100)]
Merge commit '00b62968d079e63bf22028f253ac297292436ebe'

* commit '00b62968d079e63bf22028f253ac297292436ebe':
  os_support: Don't try to return the service name as a string in getnameinfo

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoMerge commit '567ca142952c5be57e52c149c815dfe5d6ac6d41'
Hendrik Leppkes [Mon, 2 Nov 2015 10:42:26 +0000 (11:42 +0100)]
Merge commit '567ca142952c5be57e52c149c815dfe5d6ac6d41'

* commit '567ca142952c5be57e52c149c815dfe5d6ac6d41':
  configure: Add -D_CRT_NONSTDC_NO_WARNINGS when building with msvc

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
8 years agoavformat/segafilm: set video stream duration
Paul B Mahol [Fri, 30 Oct 2015 11:09:48 +0000 (12:09 +0100)]
avformat/segafilm: set video stream duration

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavformat/segafilm: set audio stream duration
Paul B Mahol [Fri, 30 Oct 2015 11:07:44 +0000 (12:07 +0100)]
avformat/segafilm: set audio stream duration

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavformat/segafilm: implement seeking
Paul B Mahol [Fri, 30 Oct 2015 11:07:13 +0000 (12:07 +0100)]
avformat/segafilm: implement seeking

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavformat: unref packet after storing it in internal packet queue
Hendrik Leppkes [Sun, 1 Nov 2015 10:08:42 +0000 (11:08 +0100)]
avformat: unref packet after storing it in internal packet queue

Fixes a memory leak when using genpts

8 years agoavformat: always unref the packet after parsing
Hendrik Leppkes [Sun, 1 Nov 2015 08:47:34 +0000 (09:47 +0100)]
avformat: always unref the packet after parsing

This fixes a memory leak when side-data is present.

8 years agoavformat/ipmovie: add context to av_log()
Paul B Mahol [Mon, 2 Nov 2015 08:00:53 +0000 (09:00 +0100)]
avformat/ipmovie: add context to av_log()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavformat/ipmovie: put video decoding_map_size into packet and use it in decoder
Paul B Mahol [Sun, 1 Nov 2015 16:02:26 +0000 (17:02 +0100)]
avformat/ipmovie: put video decoding_map_size into packet and use it in decoder

The size of decoding map can differ from one calculated
internally, producing artifacts while decoding video.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agovf_boxblur: Templatize blur{8,16}
Timothy Gu [Sun, 1 Nov 2015 18:20:58 +0000 (10:20 -0800)]
vf_boxblur: Templatize blur{8,16}

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavutil/eval: minor typo
Ganesh Ajjanagadde [Sun, 1 Nov 2015 03:34:15 +0000 (23:34 -0400)]
avutil/eval: minor typo

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoh264_parser: Rename close() to h264_close()
Diego Biurrun [Sat, 31 Oct 2015 16:21:25 +0000 (17:21 +0100)]
h264_parser: Rename close() to h264_close()

At least on AIX it conflicts with the close() libc function from unistd.h.

8 years agopixblockdsp: Use AV_COPY128U for get_pixels_16_c
Timothy Gu [Wed, 30 Sep 2015 01:34:28 +0000 (18:34 -0700)]
pixblockdsp: Use AV_COPY128U for get_pixels_16_c

Before:
  15543 decicycles in get_pixels, 4193214 runs,   1090 skips
After:
   5713 decicycles in get_pixels, 8387564 runs,   1044 skips

8 years agoavcodec/h264_slice: Disable slice threads if there are multiple access units in a...
Michael Niedermayer [Sat, 31 Oct 2015 20:36:00 +0000 (21:36 +0100)]
avcodec/h264_slice: Disable slice threads if there are multiple access units in a packet

Fixes null pointer dereference
Fixes Ticket4977

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavformat/icecast: Initialize .str based default for AV_OPT_TYPE_STRING types
Michael Niedermayer [Sat, 31 Oct 2015 13:43:48 +0000 (14:43 +0100)]
avformat/icecast: Initialize .str based default for AV_OPT_TYPE_STRING types

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavformat/http: Initialize .str based default for AV_OPT_TYPE_STRING types
Michael Niedermayer [Sat, 31 Oct 2015 13:42:29 +0000 (14:42 +0100)]
avformat/http: Initialize .str based default for AV_OPT_TYPE_STRING types

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/libopenh264enc: use AV_OPT_TYPE_BOOL for allow_skip_frames option
Clément Bœsch [Sat, 31 Oct 2015 16:33:22 +0000 (17:33 +0100)]
avcodec/libopenh264enc: use AV_OPT_TYPE_BOOL for allow_skip_frames option

8 years agoavutil/x86/intmath: Add missing header.
Matt Oliver [Sat, 31 Oct 2015 15:00:41 +0000 (02:00 +1100)]
avutil/x86/intmath: Add missing header.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
8 years agoavcodec/nvenc: fix potential profile error when encoding yuv444p
Agatha Hu [Sat, 31 Oct 2015 15:00:39 +0000 (16:00 +0100)]
avcodec/nvenc: fix potential profile error when encoding yuv444p

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
8 years agoavutil/opencl_internal: add av_warn_unused_result
Ganesh Ajjanagadde [Sat, 31 Oct 2015 14:36:22 +0000 (10:36 -0400)]
avutil/opencl_internal: add av_warn_unused_result

clSetKernelArg can return an error due to lack of memory (for instance):
https://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clSetKernelArg.html.
Thus this error must be propagated.

Currently should not trigger warnings, but adds robustness.
Untested.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavfilter/vf_deshake: replace qsort with AV_QSORT
Ganesh Ajjanagadde [Fri, 30 Oct 2015 23:07:13 +0000 (19:07 -0400)]
avfilter/vf_deshake: replace qsort with AV_QSORT

qsort is called indirectly in filter_frame, suggesting its performance
criticality. AV_QSORT is substantially faster due to the inlining of the
comparison callback. Thus, the increase in performance should be worth
the increase in binary size.

This optimization is just a low hanging fruit. The trac ticket 1430 is
a request for an improved deshake filter.

Sample benchmark (x86-64, Haswell, GNU/Linux):
File: original from https://trac.ffmpeg.org/ticket/1430
command: ffmpeg -stream_loop 8 -i file.webm -vf deshake=rx=64:ry=64 -f null -

Timer truncated at 1024 runs.
new:
28260 decicycles in qsort,       1 runs,      0 skips
35570 decicycles in qsort,       2 runs,      0 skips
39010 decicycles in qsort,       4 runs,      0 skips
46897 decicycles in qsort,       8 runs,      0 skips
40442 decicycles in qsort,      16 runs,      0 skips
41611 decicycles in qsort,      32 runs,      0 skips
40345 decicycles in qsort,      64 runs,      0 skips
38967 decicycles in qsort,     128 runs,      0 skips
38647 decicycles in qsort,     256 runs,      0 skips
40238 decicycles in qsort,     512 runs,      0 skips
39676 decicycles in qsort,    1024 runs,      0 skips

old:
1740280 decicycles in qsort,       1 runs,      0 skips
 923560 decicycles in qsort,       2 runs,      0 skips
 511330 decicycles in qsort,       4 runs,      0 skips
 309720 decicycles in qsort,       8 runs,      0 skips
 194900 decicycles in qsort,      16 runs,      0 skips
 142686 decicycles in qsort,      32 runs,      0 skips
 112516 decicycles in qsort,      64 runs,      0 skips
  98166 decicycles in qsort,     128 runs,      0 skips
  88147 decicycles in qsort,     256 runs,      0 skips
  88706 decicycles in qsort,     512 runs,      0 skips
  86783 decicycles in qsort,    1024 runs,      0 skips

Reviewed-by: Nicolas George <george@nsup.org>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavutil/x86/intmath: Use tzcnt in place of bsf.
Matt Oliver [Wed, 28 Oct 2015 07:47:16 +0000 (18:47 +1100)]
avutil/x86/intmath: Use tzcnt in place of bsf.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
8 years agogdigrab: grab right desktop size if DPI in use, based on patch from Alexander Brotzge
Matt Oliver [Mon, 5 Oct 2015 09:00:37 +0000 (20:00 +1100)]
gdigrab: grab right desktop size if DPI in use, based on patch from Alexander Brotzge

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
8 years agoavutil/rational: use frexp rather than ad-hoc log to get floating point exponent
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:18:15 +0000 (00:18 -0400)]
avutil/rational: use frexp rather than ad-hoc log to get floating point exponent

This simplifies and cleans up the code.
Furthermore, it is much faster due to absence of the slow log computation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavdevice/caca: change AV_OPT_TYPE_STRING to set .str default
Michael Niedermayer [Sat, 31 Oct 2015 01:31:40 +0000 (02:31 +0100)]
avdevice/caca: change AV_OPT_TYPE_STRING to set .str default

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/libopenh264enc: AV_OPT_TYPE_STRING should use .str default
Michael Niedermayer [Sat, 31 Oct 2015 01:29:01 +0000 (02:29 +0100)]
avcodec/libopenh264enc: AV_OPT_TYPE_STRING should use .str default

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/libopenh264enc: Fix project name
Michael Niedermayer [Sat, 31 Oct 2015 01:21:58 +0000 (02:21 +0100)]
avcodec/libopenh264enc: Fix project name

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavcodec/libopenh264enc: set .i64 for AV_OPT_TYPE_INT
Michael Niedermayer [Sat, 31 Oct 2015 01:20:53 +0000 (02:20 +0100)]
avcodec/libopenh264enc: set .i64 for AV_OPT_TYPE_INT

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavfilter/avf_showcqt: Replace all fmin* and fmax* by FFMIN/FFMAX
Michael Niedermayer [Fri, 30 Oct 2015 23:16:06 +0000 (00:16 +0100)]
avfilter/avf_showcqt: Replace all fmin* and fmax* by FFMIN/FFMAX

Should fix build on x86_32-msvc2012

The alternative of emulating fmin/fmax* turns out to be non trivial

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavfilter/showcqt: fix dependency with avformat
Muhammad Faiz [Fri, 30 Oct 2015 16:35:02 +0000 (23:35 +0700)]
avfilter/showcqt: fix dependency with avformat

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoffprobe: add support for printing packet strings metadata as packet tags
Marton Balint [Sat, 24 Oct 2015 13:13:25 +0000 (15:13 +0200)]
ffprobe: add support for printing packet strings metadata as packet tags

ffprobe.xsd already contains the tag element.

Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
8 years agoall: fix enum definition for large values
Ganesh Ajjanagadde [Fri, 23 Oct 2015 18:29:35 +0000 (14:29 -0400)]
all: fix enum definition for large values

ISO C restricts enumerator values to the range of int. Thus (for instance) 0x80000000
unfortunately does not work, and throws a warning with -Wpedantic on
clang 3.7.

This fixes it by using alternative expressions that result in identical
values but do not have this issue.

Tested with FATE.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agow32pthreads: Map MemoryBarrier to __sync_synchronize on mingw
Martin Storsjö [Wed, 28 Oct 2015 20:20:43 +0000 (22:20 +0200)]
w32pthreads: Map MemoryBarrier to __sync_synchronize on mingw

This fixes building on older mingw (both mingw.org and mingw64;
mingw64 from before May 2011).

Signed-off-by: Martin Storsjö <martin@martin.st>
8 years agoavutil/wchar_filename: add av_warn_unused_result
Ganesh Ajjanagadde [Fri, 16 Oct 2015 00:01:21 +0000 (20:01 -0400)]
avutil/wchar_filename: add av_warn_unused_result

Current code is fine, this just adds robustness.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavutil/mathematics: correct documentation for av_gcd
Ganesh Ajjanagadde [Wed, 28 Oct 2015 00:11:40 +0000 (20:11 -0400)]
avutil/mathematics: correct documentation for av_gcd

av_gcd is now always defined regardless of input. This documents this
change in the "documented API". Two benefits (closely related):
1. The function is robust, and there is no need to worry about INT64_MIN, etc.

2. Clients of av_gcd, like av_reduce, can now be made fully correct. Currently,
av_reduce can trigger undefined behavior if e.g num is INT64_MIN due to
integer overflow in the FFABS. Furthermore, this undefined behavior is
completely undocumented, and could be a fuzzer's paradise. The FFABS was needed in the past as
av_gcd was undefined for negative inputs. In order to make av_reduce
robust, it is essential to guarantee that av_gcd works for all int64_t.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoconfigure: Add a SONAME entry for the android target
Luca Barbato [Thu, 29 Oct 2015 13:01:07 +0000 (14:01 +0100)]
configure: Add a SONAME entry for the android target

In order to load libraries in Android they need to be unversioned.
The android target section was derived from the BSD ones, and they
that simply drop the SONAME

Android M requires to have a SONAME entry but unversioned.

8 years agovdpau: remove dysfunctional H.263 support
Rémi Denis-Courmont [Wed, 28 Oct 2015 19:21:51 +0000 (21:21 +0200)]
vdpau: remove dysfunctional H.263 support

The VDPAU API never explicitly supported H.263 in the first place.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agoomadec: Fix position of opening parenthesis
Vittorio Giovara [Thu, 29 Oct 2015 13:06:06 +0000 (14:06 +0100)]
omadec: Fix position of opening parenthesis

8 years agoh264: Print the complete user message
Vittorio Giovara [Thu, 22 Oct 2015 12:13:29 +0000 (14:13 +0200)]
h264: Print the complete user message

Previously the message was cut off at 256th byte.
This will allow dumping the complete x264 encode info when needed.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agoh264: Print user data SEI under normal debug verbosity
Vittorio Giovara [Thu, 22 Oct 2015 12:13:28 +0000 (14:13 +0200)]
h264: Print user data SEI under normal debug verbosity

Drop the need of setting -debug bugs since it's not a bug, and the
message is already under a AV_LOG_DEBUG log level. Instead only print
it when there is an actual string in it.

8 years agopng: read and write stereo3d frame side data information
Kirill Gavrilov [Tue, 27 Oct 2015 17:27:03 +0000 (18:27 +0100)]
png: read and write stereo3d frame side data information

Use optional sTER chunk defining side-by-side stereo pair
within "Extensions to the PNG 1.2 Specification", version 1.3.0.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
8 years agoffmpeg_filter: check encoder before using it to set frame size.
Nicolas George [Sun, 25 Oct 2015 18:48:10 +0000 (19:48 +0100)]
ffmpeg_filter: check encoder before using it to set frame size.

Fix a segfault when no encoder is found for a default codec
with a complex filter graph.

8 years agoos_support: Don't try to return the service name as a string in getnameinfo
Martin Storsjö [Wed, 28 Oct 2015 20:19:12 +0000 (22:19 +0200)]
os_support: Don't try to return the service name as a string in getnameinfo

Some systems may be lacking getservbyport; the previous ifdef wasn't
quite enough since it still assumed that struct servent was defined,
as pointed out by Clément Gregoire.

Simply remove the possibility to return non-numeric services in
getnameinfo; no caller of getnameinfo within libavformat
currently try to use getnameinfo for retrieving the port number without
NI_NUMERICSERV, and falling back on getservbyport may be non-threadsafe.

Signed-off-by: Martin Storsjö <martin@martin.st>
8 years agovf_lut: Add support for RGB48 and RGBA64.
Steven Robertson [Sun, 11 Oct 2015 01:27:17 +0000 (18:27 -0700)]
vf_lut: Add support for RGB48 and RGBA64.

Signed-off-by: Steven Robertson <steven@strobe.cc>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavformat/3dostr: Remove redundant ;
Michael Niedermayer [Fri, 30 Oct 2015 02:02:41 +0000 (03:02 +0100)]
avformat/3dostr: Remove redundant ;

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agoavformat/oggparseogm: Enable parser for mpeg4
Michael Niedermayer [Thu, 29 Oct 2015 23:31:13 +0000 (00:31 +0100)]
avformat/oggparseogm: Enable parser for mpeg4

Fixes regression with iJi.ogv

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
8 years agolavc/proresdec2: Fix slice_count for very high resolutions.
Carl Eugen Hoyos [Fri, 30 Oct 2015 00:32:39 +0000 (01:32 +0100)]
lavc/proresdec2: Fix slice_count for very high resolutions.

QT ignores the value written in the frame header.
Issue reported by forum user Koracas.

8 years agolavc/cdg: Add transparency support.
Carl Eugen Hoyos [Fri, 30 Oct 2015 00:24:50 +0000 (01:24 +0100)]
lavc/cdg: Add transparency support.

8 years agoavutil/mathematics: make av_gcd more robust
Ganesh Ajjanagadde [Thu, 29 Oct 2015 02:02:25 +0000 (22:02 -0400)]
avutil/mathematics: make av_gcd more robust

This ensures that no undefined behavior is invoked, while retaining
identical return values in all cases and at no loss of performance
(identical asm on clang and gcc).
Essentially, this patch exchanges undefined behavior with implementation
defined behavior, a strict improvement.

Rationale:
1. The ideal solution is to have the return type a uint64_t. This
unfortunately requires an API change.
2. The only pathological behavior happens if both arguments are
INT64_MIN, to the best of my knowledge. In such a case, the
implementation defined behavior is invoked in the sense that UINT64_MAX
is interpreted as INT64_MIN, which any reasonable implementation will
do. In any case, any usage where both arguments are INT64_MIN is a
fuzzer anyway.
3. Alternatives of checking, etc require branching and lose performance
for no concrete gain - no client cares about av_gcd's actual value when
both args are INT64_MIN. Even if it did, on sane platforms (e.g all the
ones FFmpeg cares about), it produces a correct gcd, namely INT64_MIN.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavfilter/avf_showvolume: use log10 instead of log()/M_LN10
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:15:25 +0000 (00:15 -0400)]
avfilter/avf_showvolume: use log10 instead of log()/M_LN10

This is likely more precise and conveys the intent better.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoffmpeg: use log10 instead of log()/log(10)
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:01:43 +0000 (00:01 -0400)]
ffmpeg: use log10 instead of log()/log(10)

This is more concise and conveys the intent better.
Furthermore, it is likely more precise as well due to lack of floating
point division.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavfilter/vf_ssim: use log10 instead of log()/log(10)
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:17:19 +0000 (00:17 -0400)]
avfilter/vf_ssim: use log10 instead of log()/log(10)

This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavfilter/avf_showspectrum: use log10 instead of log()/...
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:14:39 +0000 (00:14 -0400)]
avfilter/avf_showspectrum: use log10 instead of log()/...

This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavfilter/vf_psnr: use log10 instead of log()/log(10)
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:16:34 +0000 (00:16 -0400)]
avfilter/vf_psnr: use log10 instead of log()/log(10)

This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoswscale: rename sws_rgb2rgb_init to ff_sws_rgb2rgb_init
Andreas Cadhalpun [Tue, 27 Oct 2015 21:56:56 +0000 (22:56 +0100)]
swscale: rename sws_rgb2rgb_init to ff_sws_rgb2rgb_init

It is an internal swscale function and thus should not be exported.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
8 years agoswscale: rename sws_context_class to ff_sws_context_class
Andreas Cadhalpun [Tue, 27 Oct 2015 21:56:53 +0000 (22:56 +0100)]
swscale: rename sws_context_class to ff_sws_context_class

It is an internal swscale symbol and thus should not be exported.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
8 years agoavformat: stop exporting ffurl_read_complete, ffurl_seek and ffurl_size
Andreas Cadhalpun [Tue, 27 Oct 2015 20:29:47 +0000 (21:29 +0100)]
avformat: stop exporting ffurl_read_complete, ffurl_seek and ffurl_size

They are not in public headers and not used outside of libavformat.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
8 years agoavfilter/af_volume: use log10 instead of log()/M_LN10
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:11:44 +0000 (00:11 -0400)]
avfilter/af_volume: use log10 instead of log()/M_LN10

This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavcodec/zmbvenc: use log2 instead of log()/M_LN2
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:10:45 +0000 (00:10 -0400)]
avcodec/zmbvenc: use log2 instead of log()/M_LN2

This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavcodec/nellymoserenc: use log2 instead of log()/M_LN2
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:06:00 +0000 (00:06 -0400)]
avcodec/nellymoserenc: use log2 instead of log()/M_LN2

This is likely more precise and conveys the intent better.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agoavcodec/snowenc: use log2 instead of log() / log(2...)
Ganesh Ajjanagadde [Thu, 29 Oct 2015 04:08:32 +0000 (00:08 -0400)]
avcodec/snowenc: use log2 instead of log() / log(2...)

This is likely more precise and conveys the intent better.
The expression has also been accordingly simplified.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
8 years agodoc/general.texi: fix SDX2 description
Paul B Mahol [Thu, 29 Oct 2015 20:29:47 +0000 (21:29 +0100)]
doc/general.texi: fix SDX2 description

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agodoc/general.texi: move Screenpresso to right section
Paul B Mahol [Thu, 29 Oct 2015 20:20:09 +0000 (21:20 +0100)]
doc/general.texi: move Screenpresso to right section

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavformat: add DC STR demuxer
Paul B Mahol [Wed, 28 Oct 2015 13:10:01 +0000 (14:10 +0100)]
avformat: add DC STR demuxer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavcodec: add ADPCM AICA decoder
Paul B Mahol [Wed, 28 Oct 2015 13:51:27 +0000 (14:51 +0100)]
avcodec: add ADPCM AICA decoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavformat: add 3dostr demuxer
Paul B Mahol [Tue, 27 Oct 2015 19:58:23 +0000 (20:58 +0100)]
avformat: add 3dostr demuxer

Signed-off-by: Paul B Mahol <onemda@gmail.com>
8 years agoavfilter/tremolo: fix wavetable buffer size
Kyle Swanson [Thu, 29 Oct 2015 02:29:59 +0000 (21:29 -0500)]
avfilter/tremolo: fix wavetable buffer size

Signed-off-by: Kyle Swanson <k@ylo.ph>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>