]> git.sesse.net Git - ffmpeg/log
ffmpeg
9 years agoavfilter/vf_yadif: fix extra leading dup frame when deint=1
Neil Birkbeck [Sat, 29 Nov 2014 20:23:58 +0000 (12:23 -0800)]
avfilter/vf_yadif: fix extra leading dup frame when deint=1

Logic for handling single frame in yadif (0f9f24c9), caused deint=1 (e.g., yadif=0:-1:1) to output extra duplicate leading frame:

ffmpeg -i fate-suite/ffmpeg-synthetic/vsynth1/%02d.pgm  -vf yadif=0:-1:1,showinfo -f null -y /dev/null
 [Parsed_showinfo_1 @ 0x1d967d0] n:0 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 i:P iskey:1 type:I checksum:E457EEA0 plane_checksum:[E457EEA0] mean:[126] stdev:[46.6]
 [Parsed_showinfo_1 @ 0x1d967d0] n:1 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 i:P iskey:1 type:I checksum:E457EEA0 plane_checksum:[E457EEA0] mean:[126] stdev:[46.6]
(Outputs 51 frames)

After patch, vf "yadif=0:-1:1" behaves correctly (like "yadif=0:-1:0") and outputs 50 frames, first two:

[Parsed_showinfo_1 @ 0x1e307d0] n:0 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 i:P iskey:1 type:I checksum:68E8D1EB plane_checksum:[68E8D1EB] mean:[126] stdev:[46.0]
[Parsed_showinfo_1 @ 0x1e307d0] n:1 pts:2 pts_time:0.04 pos:-1 fmt:gray sar:0/1 s:352x432 i:P iskey:1 type:I checksum:4E674BC7 plane_checksum:[4E674BC7] mean:[125] stdev:[46.0]
(Outputs 50 frames)

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/twinvq: Use avpriv_float_dsp_alloc()
Michael Niedermayer [Sat, 29 Nov 2014 18:22:54 +0000 (19:22 +0100)]
avcodec/twinvq: Use avpriv_float_dsp_alloc()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/ra288: Use avpriv_float_dsp_alloc()
Michael Niedermayer [Sat, 29 Nov 2014 18:22:32 +0000 (19:22 +0100)]
avcodec/ra288: Use avpriv_float_dsp_alloc()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/on2avc: Use avpriv_float_dsp_alloc()
Michael Niedermayer [Sat, 29 Nov 2014 18:02:19 +0000 (19:02 +0100)]
avcodec/on2avc: Use avpriv_float_dsp_alloc()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/aacenc: Use avpriv_float_dsp_alloc()
Michael Niedermayer [Sat, 29 Nov 2014 17:58:13 +0000 (18:58 +0100)]
avcodec/aacenc: Use avpriv_float_dsp_alloc()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/ac3enc: Use avpriv_float_dsp_alloc()
Michael Niedermayer [Sat, 29 Nov 2014 17:54:27 +0000 (18:54 +0100)]
avcodec/ac3enc: Use avpriv_float_dsp_alloc()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavutil/ppc/util_altivec: add () to VEC_SPLAT16 macro
Michael Niedermayer [Sat, 29 Nov 2014 12:40:33 +0000 (13:40 +0100)]
avutil/ppc/util_altivec: add () to VEC_SPLAT16 macro

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavutil/buffer: Move USE_ATOMICS to thread.h to avoid it becoming out of sync with it
Michael Niedermayer [Sat, 29 Nov 2014 11:06:03 +0000 (12:06 +0100)]
avutil/buffer: Move USE_ATOMICS to thread.h to avoid it becoming out of sync with it

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolibavutil/threads.h: correct an include to be local
Dave Yeo [Sat, 29 Nov 2014 07:36:06 +0000 (23:36 -0800)]
libavutil/threads.h: correct an include to be local

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolibavutil/thread.h: Support OS/2 threads
Dave Yeo [Sat, 29 Nov 2014 07:34:20 +0000 (23:34 -0800)]
libavutil/thread.h: Support OS/2 threads

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavutil/bprint: C++ compatible AVBPrint definition.
Vadim Kalinsky [Mon, 24 Nov 2014 15:38:05 +0000 (10:38 -0500)]
avutil/bprint: C++ compatible AVBPrint definition.

Previous version reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolavu/opt: add escaping to av_opt_serialize
Lukasz Marek [Tue, 25 Nov 2014 19:25:10 +0000 (20:25 +0100)]
lavu/opt: add escaping to av_opt_serialize

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoavfilter/vf_idet: Fixing idet for single-frame inputs.
Neil Birkbeck [Fri, 28 Nov 2014 21:41:02 +0000 (13:41 -0800)]
avfilter/vf_idet: Fixing idet for single-frame inputs.

Handle single frame inputs similar to yadif (e.g., https://github.com/FFmpeg/FFmpeg/commit/0f9f24c9cfd291c7ece4d3bad64fdf06d107168a and https://github.com/FFmpeg/FFmpeg/commit/681e008d06d2241d50abe6316c908a184ddc5942)

Example:
  ffmpeg -r 1 -t 1 -i fate-suite/ffmpeg-synthetic/vsynth1/%02d.pgm  -vf idet,showinfo -f null -y /dev/null

Previously:
  Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
  [Parsed_idet_0 @ 0x36389d0] Repeated Fields: Neither:     0 Top:     0 Bottom:     0

After patch:
  [Parsed_showinfo_1 @ 0x1909810] n:0 pts:0 pts_time:0 pos:-1 fmt:gray sar:0/1 s:352x432 ...
  [Parsed_idet_0 @ 0x18f9bb0] Repeated Fields: Neither:     1 Top:     0 Bottom:     0

Fate looks good.

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '491805636cef50d3f582bd345e1460eeb739ea48'
Michael Niedermayer [Fri, 28 Nov 2014 21:01:38 +0000 (22:01 +0100)]
Merge commit '491805636cef50d3f582bd345e1460eeb739ea48'

* commit '491805636cef50d3f582bd345e1460eeb739ea48':
  rtmpproto: Fix a typo in a comment

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agofix Makefile objects for pulseaudio support
Michael Stypa [Fri, 28 Nov 2014 14:54:50 +0000 (15:54 +0100)]
fix Makefile objects for pulseaudio support

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agortmpproto: Fix a typo in a comment
Martin Storsjö [Fri, 28 Nov 2014 17:39:38 +0000 (19:39 +0200)]
rtmpproto: Fix a typo in a comment

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoavcodec/pngdec: apng: fix output buffer filling when no blending is needed.
Benoit Fouet [Fri, 28 Nov 2014 15:54:09 +0000 (16:54 +0100)]
avcodec/pngdec: apng: fix output buffer filling when no blending is needed.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/ppc/h264qpel_template: protect unistd.h by #if HAVE_UNISTD_H
Michael Niedermayer [Fri, 28 Nov 2014 15:11:02 +0000 (16:11 +0100)]
avcodec/ppc/h264qpel_template: protect unistd.h by #if HAVE_UNISTD_H

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/pngdec: allow for some code path optimizations.
Benoit Fouet [Fri, 28 Nov 2014 13:03:08 +0000 (14:03 +0100)]
avcodec/pngdec: allow for some code path optimizations.

Use 'if (CONFIG_APNG_DECODER)' where needed, so that the compiler can
optimize out some portion of code.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/pngdec: do not blend on transparent black
Benoit Fouet [Fri, 28 Nov 2014 09:43:01 +0000 (10:43 +0100)]
avcodec/pngdec: do not blend on transparent black

There is no need to memset the zlib output buffer, as there is no
blending happening there. Instead, do not blend when the dispose
operation is set to 'background' (tranparent black).

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/ppc/h264qpel: POWER LE support for put_pixels16_l2_altivec() and avg_pixels16...
Rong Yan [Fri, 28 Nov 2014 06:53:35 +0000 (06:53 +0000)]
avcodec/ppc/h264qpel: POWER LE support for put_pixels16_l2_altivec() and avg_pixels16_l2_altivec()

add put_unligned_store() and avg_unligned_store() macros

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/ppc/h264qpel_template: POWER LE support for PREFIX_h264_qpel16_h_lowpass_alti...
Rong Yan [Fri, 28 Nov 2014 06:52:24 +0000 (06:52 +0000)]
avcodec/ppc/h264qpel_template: POWER LE support for PREFIX_h264_qpel16_h_lowpass_altivec() PREFIX_h264_qpel16_v_lowpass_altivec() PREFIX_h264_qpel16_hv_lowpass_altivec()

add load_alignment() macro

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/ppc/h264chroma_template: POWER LE support for PREFIX_h264_chroma_mc8_altivec...
Rong Yan [Fri, 28 Nov 2014 06:50:49 +0000 (06:50 +0000)]
avcodec/ppc/h264chroma_template: POWER LE support for PREFIX_h264_chroma_mc8_altivec() PREFIX_no_rnd_vc1_chroma_mc8_altivec() CHROMA_MC8_ALTIVEC_CORE_SIMPLE() CHROMA_MC8_ALTIVEC_CORE()

add marcos GET_VSRC1() GET_VSRC()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/ppc/h264dsp: POWER LE support for h264_idct8_add_altivec() h264_idct_dc_add_i...
Rong Yan [Fri, 28 Nov 2014 06:49:50 +0000 (06:49 +0000)]
avcodec/ppc/h264dsp: POWER LE support for h264_idct8_add_altivec() h264_idct_dc_add_internal() h264_loop_filter_luma_altivec() write16x4() VEC_1D_DCT() weight_h264_W_altivec() biweight_h264_W_altivec() VEC_LOAD_U8_ADD_S16_STORE_U8() ALTIVEC_STORE_SUM_CLIP()

add marcos GET_2PERM() dstv_load() vdst_load() dest_unligned_store()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit 'fcae9f212a6001d966c52dc22cd4b22e9851b428'
Michael Niedermayer [Fri, 28 Nov 2014 11:52:09 +0000 (12:52 +0100)]
Merge commit 'fcae9f212a6001d966c52dc22cd4b22e9851b428'

* commit 'fcae9f212a6001d966c52dc22cd4b22e9851b428':
  dashenc: Avoid a VLA-like construct

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit 'a9d8d35e4833fc4dfbf557ce73c84e9ca6224427'
Michael Niedermayer [Fri, 28 Nov 2014 11:50:38 +0000 (12:50 +0100)]
Merge commit 'a9d8d35e4833fc4dfbf557ce73c84e9ca6224427'

* commit 'a9d8d35e4833fc4dfbf557ce73c84e9ca6224427':
  dashenc: Add options to make segment names configurable

Conflicts:
libavformat/dashenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '01eac895ab350027467ffbe7278740f89ae8be75'
Michael Niedermayer [Fri, 28 Nov 2014 11:28:15 +0000 (12:28 +0100)]
Merge commit '01eac895ab350027467ffbe7278740f89ae8be75'

* commit '01eac895ab350027467ffbe7278740f89ae8be75':
  rtmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccess

Conflicts:
libavformat/rtmpproto.c

See: 60fd790f381cd404ffdafa8a86a6dc93c9d80f99
Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '44127b157e9f8acb837d4bb3a094f56b40da3ef5'
Michael Niedermayer [Fri, 28 Nov 2014 11:14:10 +0000 (12:14 +0100)]
Merge commit '44127b157e9f8acb837d4bb3a094f56b40da3ef5'

* commit '44127b157e9f8acb837d4bb3a094f56b40da3ef5':
  rtmppkt: Make pkt->data reallocable

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '3c3b8003a13d9c3668c0bb6d79d2376da3b2b352'
Michael Niedermayer [Fri, 28 Nov 2014 10:57:33 +0000 (11:57 +0100)]
Merge commit '3c3b8003a13d9c3668c0bb6d79d2376da3b2b352'

* commit '3c3b8003a13d9c3668c0bb6d79d2376da3b2b352':
  rtmpproto: Simplify code for copying data into the output packet

Conflicts:
libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '857e6667f9061ae261c0b951113e4efc4329b05e'
Michael Niedermayer [Fri, 28 Nov 2014 10:35:08 +0000 (11:35 +0100)]
Merge commit '857e6667f9061ae261c0b951113e4efc4329b05e'

* commit '857e6667f9061ae261c0b951113e4efc4329b05e':
  rtmpproto: Clarify a comment

Conflicts:
libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agodashenc: Avoid a VLA-like construct
Martin Storsjö [Fri, 28 Nov 2014 09:51:05 +0000 (11:51 +0200)]
dashenc: Avoid a VLA-like construct

This fixes the build on compilers that interpreted the earlier
code as a variable length array (which we intentionally disallow).

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agodashenc: Add options to make segment names configurable
Bryan Huh [Thu, 27 Nov 2014 09:46:02 +0000 (09:46 +0000)]
dashenc: Add options to make segment names configurable

This allows one to specify templated segment names for init-segments,
media-segments, and for the base-url in the case of single-file.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccess
Martin Storsjö [Mon, 24 Nov 2014 08:51:46 +0000 (10:51 +0200)]
rtmpproto: Only prepend @setDataFrame for onMetaData and |RtmpSampleAccess

Currently, when streaming to an RTMP server, any time a packet of type
RTMP_PT_NOTIFY is encountered, the packet is prepended with @setDataFrame
before it gets sent to the server. This is incorrect; only packets for
onMetaData and |RtmpSampleAccess should invoke @setDataFrame on the RTMP
server. Specifically, the current bug manifests itself when trying to
stream onTextData or onCuePoint invocations.

This fix addresses that problem and ensures that the @setDataFrame is
only prepended for onMetaData and |RtmpSampleAccess.

Since data is fed to the rtmp_write function in smaller pieces (depending
on the calling IO buffer size), we can't generally assume that the
whole packet (or even the whole command string) is available at once,
therefore we can only check the command string once the full packet
has been transferred to us for sending.

Based on a patch by Jeffrey Wescott.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortmppkt: Make pkt->data reallocable
Martin Storsjö [Mon, 24 Nov 2014 08:41:34 +0000 (10:41 +0200)]
rtmppkt: Make pkt->data reallocable

We try to avoid mixing av_malloc with av_realloc, since av_malloc
may be implemented with functions that can't (formally) be mixed
with the functions used in av_realloc.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortmpproto: Simplify code for copying data into the output packet
Martin Storsjö [Mon, 24 Nov 2014 08:17:20 +0000 (10:17 +0200)]
rtmpproto: Simplify code for copying data into the output packet

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agortmpproto: Clarify a comment
Martin Storsjö [Mon, 24 Nov 2014 08:02:11 +0000 (10:02 +0200)]
rtmpproto: Clarify a comment

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoavcodec/hevc_ps: Check num_long_term_ref_pics_sps
Michael Niedermayer [Fri, 28 Nov 2014 02:46:56 +0000 (03:46 +0100)]
avcodec/hevc_ps: Check num_long_term_ref_pics_sps

Fixes out of array access
Fixes: signal_sigsegv_35bd0f0_1182_cov_791726764_STRUCT_B_Samsung_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/pngdec: add support for 'over' blend operation for 'none' dispose operation.
Benoit Fouet [Thu, 27 Nov 2014 14:26:27 +0000 (15:26 +0100)]
avcodec/pngdec: add support for 'over' blend operation for 'none' dispose operation.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/pngdec: split P frames handling to a separate function.
Benoit Fouet [Thu, 27 Nov 2014 14:26:26 +0000 (15:26 +0100)]
avcodec/pngdec: split P frames handling to a separate function.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMove extralibs variables using ldl after ldl definition
Timo Rothenpieler [Thu, 27 Nov 2014 12:35:48 +0000 (13:35 +0100)]
Move extralibs variables using ldl after ldl definition

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '1973079417e8701b52ba810a72cb6c7c6f7f9a56'
Michael Niedermayer [Thu, 27 Nov 2014 23:00:06 +0000 (00:00 +0100)]
Merge commit '1973079417e8701b52ba810a72cb6c7c6f7f9a56'

* commit '1973079417e8701b52ba810a72cb6c7c6f7f9a56':
  opusdec: make sure all substreams have the same number of coded samples

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '96fda42a8f9bf84beaaf7f5991d17f2a057de86c'
Michael Niedermayer [Thu, 27 Nov 2014 22:46:12 +0000 (23:46 +0100)]
Merge commit '96fda42a8f9bf84beaaf7f5991d17f2a057de86c'

* commit '96fda42a8f9bf84beaaf7f5991d17f2a057de86c':
  vf_interlace: get rid of useless loads

See: ca59b5b6eceb1adbf96b8248128e58bfbb79c9a6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit 'fbd6c97f9ca858140df16dd07200ea0d4bdc1a83'
Michael Niedermayer [Thu, 27 Nov 2014 22:03:07 +0000 (23:03 +0100)]
Merge commit 'fbd6c97f9ca858140df16dd07200ea0d4bdc1a83'

* commit 'fbd6c97f9ca858140df16dd07200ea0d4bdc1a83':
  lavu: fix memory leaks by using a mutex instead of atomics

Conflicts:
libavutil/buffer.c

The atomics code is left in place as a fallback for synchronization in the
absence of p/w32 threads. Our ABI did not requires applications to
only use threads (and matching ones) to what libavutil was build with
Our code also was not affected by the leak this change fixes, though
no question the atomics based implementation is not pretty at all.
First and foremost the code must work, being pretty comes after that.

If this causes problems, for example when libavutil is used by multiple
applications each using a different kind of threading system then the
default possibly has to be changed to the uglier atomics.

See: cea3a63ba3d89d8403eef008f7a7c54d645cff70
Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolavu/opt: add consts where possible
Lukasz Marek [Wed, 26 Nov 2014 23:11:01 +0000 (00:11 +0100)]
lavu/opt: add consts where possible

9 years agoffmpeg_opt: make use of recommended encoder configuration
Lukasz Marek [Sun, 16 Nov 2014 20:57:54 +0000 (21:57 +0100)]
ffmpeg_opt: make use of recommended encoder configuration

So far ffmpeg used recommended configuration only for codec priv options.
ffmpeg will use now codec defaults and then apply recommended configuration
for all options. Recommended configuration possibly contains minimal
set of options to filful user configuration.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agolavf/ffmenc: store recommended encoder configuration
Lukasz Marek [Sun, 16 Nov 2014 20:55:14 +0000 (21:55 +0100)]
lavf/ffmenc: store recommended encoder configuration

ffmenc will store recommended encoder configuration if present.
This will allow the user to base on local defaults and
apply only explicitly set options.

If recommended encoder configuration is not present, then
non-default context's options are stored.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agolavf/ffmdec: add common options to recommended encoder configuration
Lukasz Marek [Sun, 16 Nov 2014 20:53:59 +0000 (21:53 +0100)]
lavf/ffmdec: add common options to recommended encoder configuration

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoMerge commit '2443e522f0059176ff8717c9c753eb6fe7e7bbf1'
Michael Niedermayer [Thu, 27 Nov 2014 21:07:53 +0000 (22:07 +0100)]
Merge commit '2443e522f0059176ff8717c9c753eb6fe7e7bbf1'

* commit '2443e522f0059176ff8717c9c753eb6fe7e7bbf1':
  lavu: add wrappers for the pthreads mutex API

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/rtpproto: Allow to specify DSCP class
Vincent Bernat [Fri, 23 May 2014 13:31:17 +0000 (15:31 +0200)]
avformat/rtpproto: Allow to specify DSCP class

By appending `?dscp=26` to the URL, IP packets will be classified as
AF31 (assured forwarding for multimedia flows with low probability of
loss). On congested network, this allows a user to assign priorities to
flows.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
9 years agoavformat/udp: Allow to specify DSCP class
Vincent Bernat [Fri, 23 May 2014 13:26:32 +0000 (15:26 +0200)]
avformat/udp: Allow to specify DSCP class

By appending `?dscp=26` to the URL, IP packets will be classified as
AF31 (assured forwarding for multimedia flows with low probability of
loss). On congested network, this allows a user to assign priorities to
flows.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
9 years agoavcodec/mjpegdec: Fix integer overflow in shift
Michael Niedermayer [Thu, 27 Nov 2014 18:27:05 +0000 (19:27 +0100)]
avcodec/mjpegdec: Fix integer overflow in shift

Fixes: signal_sigabrt_7ffff6ac7bb9_2683_cov_4120310995_m_ijpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/mov: change conjugation for "Duplicate"
Clément Bœsch [Thu, 27 Nov 2014 17:13:57 +0000 (18:13 +0100)]
avformat/mov: change conjugation for "Duplicate"

9 years agoavformat/mov: strengthen some table allocations
Clément Bœsch [Mon, 10 Nov 2014 17:21:28 +0000 (18:21 +0100)]
avformat/mov: strengthen some table allocations

9 years agoffmpeg: Print a debug message if the frame parameters mismatch the context
Michael Niedermayer [Thu, 27 Nov 2014 13:16:31 +0000 (14:16 +0100)]
ffmpeg: Print a debug message if the frame parameters mismatch the context

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/hevc_ps: More complete window reset
Michael Niedermayer [Thu, 27 Nov 2014 14:03:35 +0000 (15:03 +0100)]
avcodec/hevc_ps: More complete window reset

Fixes out of array read
Fixes: signal_sigsegv_35bcf26_471_cov_2806540268_CAINIT_A_SHARP_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolavu/imgutils: remove redundant and wrong check in av_image_fill_arrays
Stefano Sabatini [Thu, 27 Nov 2014 11:27:48 +0000 (12:27 +0100)]
lavu/imgutils: remove redundant and wrong check in av_image_fill_arrays

9 years agoopusdec: make sure all substreams have the same number of coded samples
Anton Khirnov [Mon, 24 Nov 2014 10:16:46 +0000 (11:16 +0100)]
opusdec: make sure all substreams have the same number of coded samples

Fixes invalid writes with invalid multichannel streams.

CC:libav-stable@libav.org

9 years agovf_interlace: get rid of useless loads
Kieran Kunhya [Tue, 25 Nov 2014 16:14:32 +0000 (17:14 +0100)]
vf_interlace: get rid of useless loads

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agolavu: fix memory leaks by using a mutex instead of atomics
wm4 [Fri, 14 Nov 2014 12:34:50 +0000 (13:34 +0100)]
lavu: fix memory leaks by using a mutex instead of atomics

The buffer pool has to atomically add and remove entries from the linked
list of available buffers. This was done by removing the entire list
with a CAS operation, working on it, and then setting it back again
(using a retry-loop in case another thread was doing the same thing).

This could effectively cause memory leaks: while a thread was working on
the buffer list, other threads would allocate new buffers, increasing
the pool's total size. There was no real leak, but since these extra
buffers were not needed, but not free'd either (except when the buffer
pool was destroyed), this had the same effects as a real leak. For some
reason, growth was exponential, and could easily kill the process due
to OOM in real-world uses.

Fix this by using a mutex to protect the list operations. The fancy
way atomics remove the whole list to work on it is not needed anymore,
which also avoids the situation which was causing the leak.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
9 years agolavu: add wrappers for the pthreads mutex API
Anton Khirnov [Sun, 23 Nov 2014 20:25:05 +0000 (21:25 +0100)]
lavu: add wrappers for the pthreads mutex API

Also add no-op fallbacks when threading is disabled.

This helps keeping the code clean if Libav is compiled for targets
without threading. Since we assume that no threads of any kind are used
in such configurations, doing nothing is ok by definition.

Based on a patch by wm4 <nfxjfg@googlemail.com>.

9 years agomsvc: Fix compilation errors due to header include order.
Matthew Oliver [Thu, 27 Nov 2014 08:00:36 +0000 (19:00 +1100)]
msvc: Fix compilation errors due to header include order.

Ensures that the header include order is such that winsock2.h is always
included before windows.h or that windows.h does not include winsock.h.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolibavutil/ppc/util_altivec.h : fix load_with_perm_vec() add marcos vcswapi2s() vcswap...
Rong Yan [Thu, 27 Nov 2014 05:45:58 +0000 (05:45 +0000)]
libavutil/ppc/util_altivec.h : fix load_with_perm_vec() add marcos vcswapi2s() vcswapc() VEC_SPLAT16() VEC_SLD16() for POWER LE

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '675ac56b7ee0f204963fde55295197c5df80aa91'
Michael Niedermayer [Thu, 27 Nov 2014 10:52:33 +0000 (11:52 +0100)]
Merge commit '675ac56b7ee0f204963fde55295197c5df80aa91'

* commit '675ac56b7ee0f204963fde55295197c5df80aa91':
  Revert "lavf: Don't try to update files atomically with renames on windows"

Conflicts:
libavformat/dashenc.c
libavformat/hdsenc.c
libavformat/internal.h
libavformat/smoothstreamingenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '79fd186a5035cf16fc0ab288d8f59da8b1ba2c0e'
Michael Niedermayer [Thu, 27 Nov 2014 10:35:54 +0000 (11:35 +0100)]
Merge commit '79fd186a5035cf16fc0ab288d8f59da8b1ba2c0e'

* commit '79fd186a5035cf16fc0ab288d8f59da8b1ba2c0e':
  lavf: Use MoveFileEx instead of rename/_wrename on windows

Conflicts:
configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '9326d64ed1baadd7af60df6bbcc59cf1fefede48'
Michael Niedermayer [Thu, 27 Nov 2014 10:10:26 +0000 (11:10 +0100)]
Merge commit '9326d64ed1baadd7af60df6bbcc59cf1fefede48'

* commit '9326d64ed1baadd7af60df6bbcc59cf1fefede48':
  Share the utf8 to wchar conversion routine between lavf and lavu

Conflicts:
libavformat/os_support.h
libavutil/file_open.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoRevert "lavf: Don't try to update files atomically with renames on windows"
Martin Storsjö [Tue, 25 Nov 2014 08:51:23 +0000 (10:51 +0200)]
Revert "lavf: Don't try to update files atomically with renames on windows"

This reverts commit b9d08c77a44390b0848c06f20bc0e9e951ba6a3c.

After taking MoveFileEx into use, we can replace files with renames
on windows as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agolavf: Use MoveFileEx instead of rename/_wrename on windows
Martin Storsjö [Tue, 25 Nov 2014 09:08:59 +0000 (11:08 +0200)]
lavf: Use MoveFileEx instead of rename/_wrename on windows

This allows getting the normal unix semantics, where a rename
allows replacing an existing file.

Based on a suggestion by Reimar Döffinger.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoShare the utf8 to wchar conversion routine between lavf and lavu
Martin Storsjö [Tue, 25 Nov 2014 08:39:50 +0000 (10:39 +0200)]
Share the utf8 to wchar conversion routine between lavf and lavu

This doesn't add any dependency on library internals, since this
only is a static inline function that gets built into each of the
calling functions - this is only to reduce the code duplication.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoavcodec/hevc_ps: Check return code from pps_range_extensions()
Michael Niedermayer [Thu, 27 Nov 2014 01:31:46 +0000 (02:31 +0100)]
avcodec/hevc_ps: Check return code from pps_range_extensions()

Fixes out of array read
Fixes: asan_heap-oob_177e222_885_cov_1532528832_MERGE_D_TI_3.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/apngdec: validate frame dimensions.
Benoit Fouet [Wed, 26 Nov 2014 09:12:18 +0000 (10:12 +0100)]
avformat/apngdec: validate frame dimensions.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agolavc/options: fix leaks in avcodec_free_context
Lukasz Marek [Sat, 22 Nov 2014 19:43:47 +0000 (20:43 +0100)]
lavc/options: fix leaks in avcodec_free_context

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoffserver: dont leak pb_buffer
Lukasz Marek [Thu, 20 Nov 2014 17:59:58 +0000 (18:59 +0100)]
ffserver: dont leak pb_buffer

9 years agoffserver: dont leak child arguments
Lukasz Marek [Wed, 19 Nov 2014 23:28:03 +0000 (00:28 +0100)]
ffserver: dont leak child arguments

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoffserver: export recommented encoder configuration
Lukasz Marek [Sun, 16 Nov 2014 20:51:42 +0000 (21:51 +0100)]
ffserver: export recommented encoder configuration

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoffserver: allow skip setting defaults
Lukasz Marek [Sat, 15 Nov 2014 17:43:41 +0000 (18:43 +0100)]
ffserver: allow skip setting defaults

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoffserver_config: remove ffserver_apply_stream_config function
Lukasz Marek [Sun, 16 Nov 2014 00:33:19 +0000 (01:33 +0100)]
ffserver_config: remove ffserver_apply_stream_config function

This function became very short and can be logically merged with add_codec().

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoffserver_config: map ffserver options to AVOptions
Lukasz Marek [Thu, 13 Nov 2014 17:45:43 +0000 (18:45 +0100)]
ffserver_config: map ffserver options to AVOptions

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoffserver_config: cosmetic: move line_num into FFServerConfig
Lukasz Marek [Mon, 17 Nov 2014 01:23:22 +0000 (02:23 +0100)]
ffserver_config: cosmetic: move line_num into FFServerConfig

Moving line_num into FFServerConfig as parser state,
saves many passes of it aside of FFServerConfig pointer.

9 years agoffserver_config: cosmetic: simplify functions calls.
Lukasz Marek [Thu, 13 Nov 2014 17:45:17 +0000 (18:45 +0100)]
ffserver_config: cosmetic: simplify functions calls.

ffserver_save_avoption() and ffserver_opt_preset() have
redundant arguments. They can be obtained basing on media type.
This simplifies uses and reduce chance for a mistake.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
9 years agoavfilter/signalstats: re-use yuv/yuvu/yuvv vars in diff
Clément Bœsch [Sat, 22 Nov 2014 23:33:19 +0000 (00:33 +0100)]
avfilter/signalstats: re-use yuv/yuvu/yuvv vars in diff

9 years agoavfilter/signalstats: localize a few variables
Clément Bœsch [Sat, 22 Nov 2014 23:29:50 +0000 (00:29 +0100)]
avfilter/signalstats: localize a few variables

9 years agoavfilter/signalstats: add threading in compute_sat_hue_metrics
Clément Bœsch [Sat, 22 Nov 2014 23:10:19 +0000 (00:10 +0100)]
avfilter/signalstats: add threading in compute_sat_hue_metrics

9 years agoavfilter/signalstats: isolate sat hue computation metrics in a function
Clément Bœsch [Sat, 22 Nov 2014 22:50:10 +0000 (23:50 +0100)]
avfilter/signalstats: isolate sat hue computation metrics in a function

This will be useful for the following commit

9 years agoavfilter/signalstats: add slice threading for subfilters
Clément Bœsch [Sun, 16 Nov 2014 20:12:55 +0000 (21:12 +0100)]
avfilter/signalstats: add slice threading for subfilters

9 years agoavfilter/signalstats: fix repitition/repetition typo
Clément Bœsch [Sun, 16 Nov 2014 20:12:54 +0000 (21:12 +0100)]
avfilter/signalstats: fix repitition/repetition typo

9 years agoavfilter/signalstats: reindent after previous commit
Clément Bœsch [Sun, 16 Nov 2014 20:12:54 +0000 (21:12 +0100)]
avfilter/signalstats: reindent after previous commit

9 years agoavfilter/signalstats: integrate height loop into subfilters
Clément Bœsch [Sun, 16 Nov 2014 20:12:53 +0000 (21:12 +0100)]
avfilter/signalstats: integrate height loop into subfilters

9 years agoavfilter/signalstats: remove pointless sub filter init system
Clément Bœsch [Sun, 16 Nov 2014 20:12:52 +0000 (21:12 +0100)]
avfilter/signalstats: remove pointless sub filter init system

9 years agoavfilter/signalstats: fix different buffers for out frame if burn is enabled
Clément Bœsch [Sun, 16 Nov 2014 20:12:50 +0000 (21:12 +0100)]
avfilter/signalstats: fix different buffers for out frame if burn is enabled

This was the original intend.

9 years agov210enc: Add SIMD optimised 8-bit and 10-bit encoders
Kieran Kunhya [Wed, 26 Nov 2014 15:59:14 +0000 (15:59 +0000)]
v210enc: Add SIMD optimised 8-bit and 10-bit encoders

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/rawdec: Check the return code of avpicture_get_size()
Michael Niedermayer [Wed, 26 Nov 2014 17:56:39 +0000 (18:56 +0100)]
avcodec/rawdec: Check the return code of avpicture_get_size()

Fixes out of array access
Fixes: asan_heap-oob_22388d0_3435_cov_3297128910_small_roll5_FlashCine1.cine
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms
Michael Niedermayer [Wed, 26 Nov 2014 17:16:15 +0000 (18:16 +0100)]
avformat/mov: Fix memleaks for duplicate STCO/CO64/STSC atoms

Also see [FFmpeg-devel] [PATCH] avformat/mov: strengthen some table allocations
which contains more fixes but is unfinished

Fixes: signal_sigabrt_7ffff6ac7bb9_3484_cov_1830000177_starfox2.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/pngdec: Fix paeth prediction with small images
Michael Niedermayer [Wed, 26 Nov 2014 16:00:17 +0000 (17:00 +0100)]
avcodec/pngdec: Fix paeth prediction with small images

Fixes out of array read
Fixes: asan_heap-oob_20b0a06_1962_cov_1907976991_delete_node_small.png
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavcodec/pngdec: Check IHDR/IDAT order
Michael Niedermayer [Wed, 26 Nov 2014 14:45:47 +0000 (15:45 +0100)]
avcodec/pngdec: Check IHDR/IDAT order

Fixes out of array access
Fixes: asan_heap-oob_20a6c26_2690_cov_3434532168_mail.png
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoavformat/apngdec: use packet pts and duration instead of altering stream framerate.
Benoit Fouet [Wed, 26 Nov 2014 10:22:45 +0000 (11:22 +0100)]
avformat/apngdec: use packet pts and duration instead of altering stream framerate.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit '234fb81e3145e9c9aec4ec16266676fab7dc21fa'
Michael Niedermayer [Wed, 26 Nov 2014 11:26:44 +0000 (12:26 +0100)]
Merge commit '234fb81e3145e9c9aec4ec16266676fab7dc21fa'

* commit '234fb81e3145e9c9aec4ec16266676fab7dc21fa':
  movenc: Expose the fragment index as an avoption

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agoMerge commit 'ee37620b6ae4783cda637408422044b2d14a688c'
Michael Niedermayer [Wed, 26 Nov 2014 10:27:17 +0000 (11:27 +0100)]
Merge commit 'ee37620b6ae4783cda637408422044b2d14a688c'

* commit 'ee37620b6ae4783cda637408422044b2d14a688c':
  movenc: Add a flag for indicating a discontinuous fragment

Conflicts:
libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
9 years agomovenc: Expose the fragment index as an avoption
Martin Storsjö [Mon, 3 Nov 2014 20:38:09 +0000 (22:38 +0200)]
movenc: Expose the fragment index as an avoption

This allows setting the right fragment number if doing
random-access writing of fragments, and also allows reading the
current sequence number.

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agomovenc: Add a flag for indicating a discontinuous fragment
Martin Storsjö [Thu, 20 Nov 2014 07:51:05 +0000 (09:51 +0200)]
movenc: Add a flag for indicating a discontinuous fragment

This allows creating a later mp4 fragment without sequentially
writing the earlier ones before (when called from a segmenter).

Normally when writing a fragmented mp4 file sequentially, the
first timestamps of a fragment are adjusted to match the
end of the previous fragment, to make sure the timestamp is the
same, even if it is calculated as the sum of previous fragment
durations. (And for the first packet in a file, the offset of
the first packet is written using an edit list.)

When writing an individual mp4 fragment discontinuously like this
(with potentially writing the earlier fragments separately later),
there's a risk of getting a gap in the timeline if the duration
field of the last packet in the previous fragment doesn't match up
with the start time of the next fragment.

Using this requires setting -avoid_negative_ts make_non_negative
(or -avoid_negative_ts 0).

Signed-off-by: Martin Storsjö <martin@martin.st>
9 years agoavcodec/flacdec: fix off by 1 error
Michael Niedermayer [Wed, 26 Nov 2014 03:07:34 +0000 (04:07 +0100)]
avcodec/flacdec: fix off by 1 error

Fixes assertion failure
Fixes: signal_sigsegv_324b284_1980_dilvie___the_dragonfly.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>