OSDN Git Service

android-x86/external-ffmpeg.git
7 years agoaarch64: vp9itxfm: Skip empty slices in the first pass of idct_idct 16x16 and 32x32
Martin Storsjö [Mon, 9 Jan 2017 22:15:16 +0000 (00:15 +0200)]
aarch64: vp9itxfm: Skip empty slices in the first pass of idct_idct 16x16 and 32x32

This work is sponsored by, and copyright, Google.

Previously all subpartitions except the eob=1 (DC) case ran with
the same runtime:

vp9_inv_dct_dct_16x16_sub16_add_neon:   1373.2
vp9_inv_dct_dct_32x32_sub32_add_neon:   8089.0

By skipping individual 8x16 or 8x32 pixel slices in the first pass,
we reduce the runtime of these functions like this:

vp9_inv_dct_dct_16x16_sub1_add_neon:     235.3
vp9_inv_dct_dct_16x16_sub2_add_neon:    1036.7
vp9_inv_dct_dct_16x16_sub4_add_neon:    1036.7
vp9_inv_dct_dct_16x16_sub8_add_neon:    1036.7
vp9_inv_dct_dct_16x16_sub12_add_neon:   1372.1
vp9_inv_dct_dct_16x16_sub16_add_neon:   1372.1
vp9_inv_dct_dct_32x32_sub1_add_neon:     555.1
vp9_inv_dct_dct_32x32_sub2_add_neon:    5190.2
vp9_inv_dct_dct_32x32_sub4_add_neon:    5180.0
vp9_inv_dct_dct_32x32_sub8_add_neon:    5183.1
vp9_inv_dct_dct_32x32_sub12_add_neon:   6161.5
vp9_inv_dct_dct_32x32_sub16_add_neon:   6155.5
vp9_inv_dct_dct_32x32_sub20_add_neon:   7136.3
vp9_inv_dct_dct_32x32_sub24_add_neon:   7128.4
vp9_inv_dct_dct_32x32_sub28_add_neon:   8098.9
vp9_inv_dct_dct_32x32_sub32_add_neon:   8098.8

I.e. in general a very minor overhead for the full subpartition case due
to the additional cmps, but a significant speedup for the cases when we
only need to process a small part of the actual input data.

This is cherrypicked from libav commits
cad42fadcd2c2ae1b3676bb398844a1f521a2d7b and
a0c443a3980dc22eb02b067ac4cb9ffa2f9b04d2.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoarm: vp9itxfm: Skip empty slices in the first pass of idct_idct 16x16 and 32x32
Martin Storsjö [Mon, 9 Jan 2017 22:15:15 +0000 (00:15 +0200)]
arm: vp9itxfm: Skip empty slices in the first pass of idct_idct 16x16 and 32x32

This work is sponsored by, and copyright, Google.

Previously all subpartitions except the eob=1 (DC) case ran with
the same runtime:

                                     Cortex A7       A8       A9      A53
vp9_inv_dct_dct_16x16_sub16_add_neon:   3188.1   2435.4   2499.0   1969.0
vp9_inv_dct_dct_32x32_sub32_add_neon:  18531.7  16582.3  14207.6  12000.3

By skipping individual 4x16 or 4x32 pixel slices in the first pass,
we reduce the runtime of these functions like this:

vp9_inv_dct_dct_16x16_sub1_add_neon:     274.6    189.5    211.7    235.8
vp9_inv_dct_dct_16x16_sub2_add_neon:    2064.0   1534.8   1719.4   1248.7
vp9_inv_dct_dct_16x16_sub4_add_neon:    2135.0   1477.2   1736.3   1249.5
vp9_inv_dct_dct_16x16_sub8_add_neon:    2446.7   1828.7   1993.6   1494.7
vp9_inv_dct_dct_16x16_sub12_add_neon:   2832.4   2118.3   2266.5   1735.1
vp9_inv_dct_dct_16x16_sub16_add_neon:   3211.7   2475.3   2523.5   1983.1
vp9_inv_dct_dct_32x32_sub1_add_neon:     756.2    456.7    862.0    553.9
vp9_inv_dct_dct_32x32_sub2_add_neon:   10682.2   8190.4   8539.2   6762.5
vp9_inv_dct_dct_32x32_sub4_add_neon:   10813.5   8014.9   8518.3   6762.8
vp9_inv_dct_dct_32x32_sub8_add_neon:   11859.6   9313.0   9347.4   7514.5
vp9_inv_dct_dct_32x32_sub12_add_neon:  12946.6  10752.4  10192.2   8280.2
vp9_inv_dct_dct_32x32_sub16_add_neon:  14074.6  11946.5  11001.4   9008.6
vp9_inv_dct_dct_32x32_sub20_add_neon:  15269.9  13662.7  11816.1   9762.6
vp9_inv_dct_dct_32x32_sub24_add_neon:  16327.9  14940.1  12626.7  10516.0
vp9_inv_dct_dct_32x32_sub28_add_neon:  17462.7  15776.1  13446.2  11264.7
vp9_inv_dct_dct_32x32_sub32_add_neon:  18575.5  17157.0  14249.3  12015.1

I.e. in general a very minor overhead for the full subpartition case due
to the additional loads and cmps, but a significant speedup for the cases
when we only need to process a small part of the actual input data.

In common VP9 content in a few inspected clips, 70-90% of the non-dc-only
16x16 and 32x32 IDCTs only have nonzero coefficients in the upper left
8x8 or 16x16 subpartitions respectively.

This is cherrypicked from libav commit
9c8bc74c2b40537b0997f646c87c008042d788c2.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoarm: vp9itxfm: Only reload the idct coeffs for the iadst_idct combination
Martin Storsjö [Mon, 9 Jan 2017 22:15:14 +0000 (00:15 +0200)]
arm: vp9itxfm: Only reload the idct coeffs for the iadst_idct combination

This avoids reloading them if they haven't been clobbered, if the
first pass also was idct.

This is similar to what was done in the aarch64 version.

This is cherrypicked from libav commit
3c87039a404c5659ae9bf7454a04e186532eb40b.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoaarch64: vp9itxfm: Don't repeatedly set x9 when nothing overwrites it
Martin Storsjö [Mon, 9 Jan 2017 22:15:13 +0000 (00:15 +0200)]
aarch64: vp9itxfm: Don't repeatedly set x9 when nothing overwrites it

This is cherrypicked from libav commit
2f99117f6ff24ce5be2abb9e014cb8b86c2aa0e0.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoarm: vp9itxfm: Rename a macro parameter to fit better
Martin Storsjö [Mon, 9 Jan 2017 22:15:12 +0000 (00:15 +0200)]
arm: vp9itxfm: Rename a macro parameter to fit better

Since the same parameter is used for both input and output,
the name inout is more fitting.

This matches the naming used below in the dmbutterfly macro.

This is cherrypicked from libav commit
79566ec8c77969d5f9be533de04b1349834cca62.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoarm/aarch64: vp9itxfm: Fix indentation of macro arguments
Martin Storsjö [Mon, 9 Jan 2017 22:15:11 +0000 (00:15 +0200)]
arm/aarch64: vp9itxfm: Fix indentation of macro arguments

This is cherrypicked from libav commit
721bc37522c5c1d6a8c3cea5e9c3fcde8d256c05.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoaarch64: vp9itxfm: Use w3 instead of x3 for the int eob parameter
Martin Storsjö [Mon, 9 Jan 2017 22:15:10 +0000 (00:15 +0200)]
aarch64: vp9itxfm: Use w3 instead of x3 for the int eob parameter

The clobbering tests in checkasm are only invoked when testing
correctness, so this bug didn't show up when benchmarking the
dc-only version.

This is cherrypicked from libav commit
4d960a11855f4212eb3a4e470ce890db7f01df29.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoarm: vp9itxfm: Simplify the stack alignment code
Janne Grunau [Mon, 9 Jan 2017 22:15:09 +0000 (00:15 +0200)]
arm: vp9itxfm: Simplify the stack alignment code

This is one instruction less for thumb, and only have got
1/2 arm/thumb specific instructions.

This is cherrypicked from libav commit
e5b0fc170f85b00f7dd0ac514918fb5c95253d39.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoaarch64: vp9: loop filter: replace 'orr; cbn?z' with 'adds; b.{eq,ne};
Janne Grunau [Mon, 9 Jan 2017 22:15:08 +0000 (00:15 +0200)]
aarch64: vp9: loop filter: replace 'orr; cbn?z' with 'adds; b.{eq,ne};

The latter is 1 cycle faster on a cortex-53 and since the operands are
bytewise (or larger) bitmask (impossible to overflow to zero) both are
equivalent.

This is cherrypicked from libav commit
e7ae8f7a715843a5089d18e033afb3ee19ab3057.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoaarch64: vp9: use alternative returns in the core loop filter function
Janne Grunau [Mon, 9 Jan 2017 22:15:07 +0000 (00:15 +0200)]
aarch64: vp9: use alternative returns in the core loop filter function

Since aarch64 has enough free general purpose registers use them to
branch to the appropiate storage code. 1-2 cycles faster for the
functions using loop_filter 8/16, ... on a cortex-a53. Mixed results
(up to 2 cycles faster/slower) on a cortex-a57.

This is cherrypicked from libav commit
d7595de0b25e7064fd9e06dea5d0425536cef6dc.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffmpeg: Add -time_base option to hint the time base
Michael Bradshaw [Wed, 28 Dec 2016 06:05:35 +0000 (22:05 -0800)]
ffmpeg: Add -time_base option to hint the time base

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/cinepakenc: remove CVID from long description
Paul B Mahol [Sat, 14 Jan 2017 15:56:47 +0000 (16:56 +0100)]
avcodec/cinepakenc: remove CVID from long description

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoCosmetics: Reindent after last commit.
Carl Eugen Hoyos [Sat, 14 Jan 2017 05:07:06 +0000 (06:07 +0100)]
Cosmetics: Reindent after last commit.

7 years agolavf/matroskaenc: Do not write two CodecID elements for rawvideo.
Carl Eugen Hoyos [Sat, 14 Jan 2017 05:06:05 +0000 (06:06 +0100)]
lavf/matroskaenc: Do not write two CodecID elements for rawvideo.

Fixes ticket #6068.

7 years agofate/psd : add test for bitmap and duotone
Martin Vignali [Wed, 11 Jan 2017 20:51:36 +0000 (21:51 +0100)]
fate/psd : add test for bitmap and duotone

The duotone file is interpreted as gray

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolibavcodec/psd : add test for channel depth/channel count in bitmap mode
Martin Vignali [Wed, 11 Jan 2017 20:47:56 +0000 (21:47 +0100)]
libavcodec/psd : add test for channel depth/channel count in bitmap mode

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoswresample/arm: cosmetic fixes
Matthieu Bouron [Mon, 9 Jan 2017 16:22:40 +0000 (17:22 +0100)]
swresample/arm: cosmetic fixes

7 years agoswresample/aarch64: add ff_resample_common_apply_filter_{x4,x8}_{float,s16}_neon
Matthieu Bouron [Mon, 9 Jan 2017 14:26:37 +0000 (14:26 +0000)]
swresample/aarch64: add ff_resample_common_apply_filter_{x4,x8}_{float,s16}_neon

7 years agoavcodec/qdrw: skip long comment for now
Paul B Mahol [Fri, 13 Jan 2017 19:18:36 +0000 (20:18 +0100)]
avcodec/qdrw: skip long comment for now

Fixes part of #5918.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agospeedhq: Align blocks variable properly.
Steinar H. Gunderson [Fri, 13 Jan 2017 18:04:25 +0000 (19:04 +0100)]
speedhq: Align blocks variable properly.

Seemingly ff_clear_block_sse assumed that the block array is aligned,
so make sure it is.

Fixes ticket #6079

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavcodec/lossless_videodsp: add missing call to ff_llviddsp_init_ppc()
James Almer [Fri, 13 Jan 2017 01:56:50 +0000 (22:56 -0300)]
avcodec/lossless_videodsp: add missing call to ff_llviddsp_init_ppc()

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agolossless_videodsp: rename add_hfyu_left_pred_int16 to add_left_pred_int16
James Almer [Sun, 8 Jan 2017 14:56:03 +0000 (11:56 -0300)]
lossless_videodsp: rename add_hfyu_left_pred_int16 to add_left_pred_int16

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agohuffyuvdsp: move functions only used by huffyuv from lossless_videodsp
James Almer [Sun, 8 Jan 2017 14:48:05 +0000 (11:48 -0300)]
huffyuvdsp: move functions only used by huffyuv from lossless_videodsp

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agohuffyuvencdsp: move shared functions to a new lossless_videoencdsp context
James Almer [Sun, 8 Jan 2017 02:13:48 +0000 (23:13 -0300)]
huffyuvencdsp: move shared functions to a new lossless_videoencdsp context

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agohuffyuvencdsp: move functions only used by huffyuv from lossless_videodsp
James Almer [Sun, 8 Jan 2017 00:10:46 +0000 (21:10 -0300)]
huffyuvencdsp: move functions only used by huffyuv from lossless_videodsp

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agolossless_videodsp: move shared functions from huffyuvdsp
James Almer [Sat, 7 Jan 2017 22:04:39 +0000 (19:04 -0300)]
lossless_videodsp: move shared functions from huffyuvdsp

Several codecs other than huffyuv use them.

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavformat/hlsenc: refine the hlsenc code
Steven Liu [Thu, 12 Jan 2017 23:59:48 +0000 (07:59 +0800)]
avformat/hlsenc: refine the hlsenc code

because the oc have been  potint to hls->avf or hls->vtt_avf
here is not needed point once again

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agoavformat/hlsenc: fix hlsenc bug at windows system
Steven Liu [Thu, 12 Jan 2017 23:57:22 +0000 (07:57 +0800)]
avformat/hlsenc: fix hlsenc bug at windows system

when hlsenc use flag second_level_segment_index,
second_level_segment_size and second_level_segment_duration,
the rename is ok but the output filename always use the old filename
so move the rename operation after the close the ts file and
before open new segment

Reported-by: Christian Johannesen <chrisjohannesen@gmail.com>
Reviewed-by: Bodecs Bela <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agocmdutils_opencl: fix resource_leak cid 1396852
Steven Liu [Thu, 12 Jan 2017 23:54:49 +0000 (07:54 +0800)]
cmdutils_opencl: fix resource_leak cid 1396852

CID: 1396852
check the devices_list alloc status,
and release the devices_list when alloc devices error

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agoavutil/tests/audio_fifo.c: pass by reference for efficiency and change datatype to...
Thomas Turner [Thu, 12 Jan 2017 01:20:30 +0000 (17:20 -0800)]
avutil/tests/audio_fifo.c: pass by reference for efficiency and change datatype to const

Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavutil/reverse: move the ff_reverse declaration to a separate header
James Almer [Thu, 12 Jan 2017 22:37:16 +0000 (19:37 -0300)]
avutil/reverse: move the ff_reverse declaration to a separate header

Fixes compilation with hardcoded tables after eaff1aa09e90e2711207c9463db8bf8e8dec8178
and e71b8119e7db675dd2dac3f7fb069b0df2943c38

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agolavf/mxf: Add a universal label for ProRes used in FCP.
Carl Eugen Hoyos [Thu, 12 Jan 2017 22:24:39 +0000 (23:24 +0100)]
lavf/mxf: Add a universal label for ProRes used in FCP.

Fixes ticket #6075.

7 years agolibavfilter/af_biquads: warn about clipping only after frame with clipping
Sergey Kudryashov [Thu, 12 Jan 2017 14:38:58 +0000 (17:38 +0300)]
libavfilter/af_biquads: warn about clipping only after frame with clipping

7 years agolavfi: remove stray semicolons.
Nicolas George [Thu, 12 Jan 2017 13:43:51 +0000 (14:43 +0100)]
lavfi: remove stray semicolons.

Hopefully fix compilation with suncc.

7 years agolavf/dss: Do not fail randomly if dss_sp input contains 0xff.
Carl Eugen Hoyos [Thu, 12 Jan 2017 13:12:35 +0000 (14:12 +0100)]
lavf/dss: Do not fail randomly if dss_sp input contains 0xff.

Fixes decoding the sample from ticket #6072 with ffmpeg.

7 years agolavfi: reindent after previous commit.
Nicolas George [Thu, 12 Jan 2017 12:36:02 +0000 (13:36 +0100)]
lavfi: reindent after previous commit.

7 years agolavfi/buffersink: move to the new design.
Nicolas George [Mon, 19 Dec 2016 07:38:25 +0000 (08:38 +0100)]
lavfi/buffersink: move to the new design.

7 years agolavfi: do not call ff_filter_frame() with activate.
Nicolas George [Sat, 24 Dec 2016 12:17:21 +0000 (13:17 +0100)]
lavfi: do not call ff_filter_frame() with activate.

avfilter_graph_request_oldest() does work that should be done by
either the filter or the application.

The principle of this function, calling ff_request_frame() from
outside the filter was always shaky. This version is less elegant
since it requires making special cases for each filter, but it
is more robust since it no longer calls ff_request_frame()
directly without notifying the filter.

Eventually, avfilter_graph_request_oldest() will be deprecated
for a function to just run the graph.

7 years agolavfi: make two functions static.
Nicolas George [Sat, 24 Dec 2016 15:56:50 +0000 (16:56 +0100)]
lavfi: make two functions static.

ff_request_frame_to_filter() and ff_filter_frame_to_filter()
are only used in avfilter.c.

7 years agolavfi: disallow ff_request_frame for filters using activate.
Nicolas George [Sat, 24 Dec 2016 12:16:15 +0000 (13:16 +0100)]
lavfi: disallow ff_request_frame for filters using activate.

Having two different functions allows to have stricter tests
and detect errors earlier.

7 years agolavfi: add ff_inlink_request_frame().
Nicolas George [Sat, 24 Dec 2016 12:16:59 +0000 (13:16 +0100)]
lavfi: add ff_inlink_request_frame().

7 years agolavfi: move ff_update_link_current_pts() into the utility functions.
Nicolas George [Fri, 23 Dec 2016 15:00:57 +0000 (16:00 +0100)]
lavfi: move ff_update_link_current_pts() into the utility functions.

It does not change anything for the existing filters and makes
better code fatrorization when future code will use the utility
functions.

7 years agolavfi: cosmetic: remove forward declaration.
Nicolas George [Fri, 23 Dec 2016 14:40:27 +0000 (15:40 +0100)]
lavfi: cosmetic: remove forward declaration.

7 years agolavfi: add AVFilter.activate.
Nicolas George [Mon, 19 Dec 2016 07:38:15 +0000 (08:38 +0100)]
lavfi: add AVFilter.activate.

7 years agolavfi: use the consume helpers in ff_filter_frame_to_filter().
Nicolas George [Tue, 20 Dec 2016 22:23:29 +0000 (23:23 +0100)]
lavfi: use the consume helpers in ff_filter_frame_to_filter().

7 years agolavfi: add helpers to consume frames from link FIFOs.
Nicolas George [Tue, 20 Dec 2016 13:58:37 +0000 (14:58 +0100)]
lavfi: add helpers to consume frames from link FIFOs.

7 years agolavfi: pass min explicitly to samples_ready().
Nicolas George [Thu, 22 Dec 2016 13:21:24 +0000 (14:21 +0100)]
lavfi: pass min explicitly to samples_ready().

7 years agolavfi: add ff_inlink_evaluate_timeline_at_frame().
Nicolas George [Tue, 20 Dec 2016 16:13:04 +0000 (17:13 +0100)]
lavfi: add ff_inlink_evaluate_timeline_at_frame().

7 years agolavfi: add ff_inlink_process_commands().
Nicolas George [Tue, 20 Dec 2016 15:53:23 +0000 (16:53 +0100)]
lavfi: add ff_inlink_process_commands().

7 years agolavfi: merge two variables after a recent commit.
Nicolas George [Tue, 20 Dec 2016 14:49:17 +0000 (15:49 +0100)]
lavfi: merge two variables after a recent commit.

7 years agolavfi: implement ff_inlink_make_frame_writable().
Nicolas George [Tue, 20 Dec 2016 13:56:03 +0000 (14:56 +0100)]
lavfi: implement ff_inlink_make_frame_writable().

Unlike av_frame_is_writable(), it uses the link's alloc callback,
making direct rendering possible.

The code comes from ff_filter_frame_framed(), moved with mostly
trivial changes.

7 years agolavfi: export ff_filter_set_ready() to the library.
Nicolas George [Tue, 20 Dec 2016 14:57:19 +0000 (15:57 +0100)]
lavfi: export ff_filter_set_ready() to the library.

7 years agolavfi: add ff_inlink_acknowledge_status().
Nicolas George [Tue, 20 Dec 2016 14:56:48 +0000 (15:56 +0100)]
lavfi: add ff_inlink_acknowledge_status().

Also introduce libavfilter/filters.h for all functions needed
to implement filters.

7 years agolavfi: document that AVFilterLink is not for applications.
Nicolas George [Tue, 27 Dec 2016 16:18:33 +0000 (17:18 +0100)]
lavfi: document that AVFilterLink is not for applications.

7 years agolavfi/tests/filtfmts: include internal.h.
Nicolas George [Sun, 18 Dec 2016 11:35:50 +0000 (12:35 +0100)]
lavfi/tests/filtfmts: include internal.h.

7 years agolavd/lavfi: use buffersink accessors.
Nicolas George [Sun, 18 Dec 2016 11:35:25 +0000 (12:35 +0100)]
lavd/lavfi: use buffersink accessors.

7 years agoffplay: use buffersink accessors.
Nicolas George [Sun, 18 Dec 2016 11:35:14 +0000 (12:35 +0100)]
ffplay: use buffersink accessors.

7 years agoffmpeg: use buffersink accessors.
Nicolas George [Sun, 18 Dec 2016 11:34:35 +0000 (12:34 +0100)]
ffmpeg: use buffersink accessors.

7 years agolavfi/buffersink: add accessors for the stream properties.
Nicolas George [Sun, 18 Dec 2016 11:31:24 +0000 (12:31 +0100)]
lavfi/buffersink: add accessors for the stream properties.

av_buffersink_get_frame_rate() did already exist; its argument becomes const.

7 years agolavfi, ffmpeg: simplify filter names.
Nicolas George [Thu, 28 Apr 2016 12:47:43 +0000 (14:47 +0200)]
lavfi, ffmpeg: simplify filter names.

The names are only used for technical output and debugging.
Make them similar to C identifiers for easier quick reading
of debug dumps.

7 years agolavf/hlsenc: fix typo in last commit.
Nicolas George [Thu, 12 Jan 2017 13:01:22 +0000 (14:01 +0100)]
lavf/hlsenc: fix typo in last commit.

7 years agoavformat/hlsenc: hls_start_number_source and start_number
Bodecs Bela [Thu, 12 Jan 2017 12:43:10 +0000 (20:43 +0800)]
avformat/hlsenc: hls_start_number_source and start_number

start_number option starts the playlist sequence number
(#EXT-X-MEDIA-SEQUENCE) from the specified number. Unless hls_flags
single_file is set, it also specifies starting sequence numbers of
segment and subtitle filenames. Sometimes it is usefull to have unique
starting numbers at each run, but currently it is only achiveable by
setting this parameter manually.
This patch enables to specify start_number source parameter by
introducing hls_start_number_source with 3 possible values:
generic/epoch/datetime. This ensures to set start sequence number
automatically for practically unique numbers. Generic option is the
default and this is the curent behaviour: start_number option value
specifies the start sequence number. (start_number default value is 0)
If hls_start_number_source is set to epoch, then the start number will
be the seconds since epoch (1970-01-01 00:00:00). If set to datetime,
then the start sequence number will be based on the current date/time
value as YYYYmmddHHMMSS. e.g. 20161231235659.
Hls speficication allows 64 bit integers as sequence numbers. This patch
also changes some code where only 32 bit integer values were handled
correctly.

Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agolavfi: use an audio frame pool for each link of the filtergraph
Matthieu Bouron [Tue, 3 Jan 2017 16:44:14 +0000 (17:44 +0100)]
lavfi: use an audio frame pool for each link of the filtergraph

7 years agolavfi/framepool: cosmetic style fixes
Matthieu Bouron [Tue, 3 Jan 2017 16:46:24 +0000 (17:46 +0100)]
lavfi/framepool: cosmetic style fixes

7 years agolavfi/framepool: re-indent after previous commit
Matthieu Bouron [Tue, 3 Jan 2017 16:44:55 +0000 (17:44 +0100)]
lavfi/framepool: re-indent after previous commit

7 years agolavfi/framepool: add audio support
Matthieu Bouron [Tue, 3 Jan 2017 16:44:07 +0000 (17:44 +0100)]
lavfi/framepool: add audio support

7 years agolavfi/framepool: rename FFVideoFramePool to FFFramePool
Matthieu Bouron [Tue, 10 May 2016 15:45:59 +0000 (17:45 +0200)]
lavfi/framepool: rename FFVideoFramePool to FFFramePool

7 years agoavcodec/mathops: add missing header for ff_reverse
James Almer [Thu, 12 Jan 2017 00:17:52 +0000 (21:17 -0300)]
avcodec/mathops: add missing header for ff_reverse

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agofate/psd : add test for 256 color
Martin Vignali [Mon, 9 Jan 2017 22:03:42 +0000 (23:03 +0100)]
fate/psd : add test for 256 color

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffmpeg: Add an option "qsv_device" to choose proper node for QSV child device (vaapi...
Zhengxu [Thu, 5 Jan 2017 06:48:06 +0000 (14:48 +0800)]
ffmpeg: Add an option "qsv_device" to choose proper node for QSV child device (vaapi or dxva2)

Reason: For some cases, such as 2 or more graphics cards existing, the
default command line may fail because ffmpeg does not open the correct
device node:
    ffmpeg -hwaccel qsv -c:v h264_qsv -i test.264 -c:v h264_qsv out.264
Let user choose the proper one by running like below:
    ffmpeg -hwaccel qsv -qsv_device /dev/dri/renderD128 -c:v h264_qsv \
-i test.264 -c:v h264_qsv out.264

Signed-off-by: ChaoX A Liu <chaox.a.liu@gmail.com>
Signed-off-by: Huang, Zhengxu <zhengxu.maxwell@gmail.com>
Signed-off-by: Andrew, Zhang <huazh407@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
7 years agolavf/dss: Support version 3 files / files with larger header.
Carl Eugen Hoyos [Wed, 11 Jan 2017 12:23:13 +0000 (13:23 +0100)]
lavf/dss: Support version 3 files / files with larger header.

Fixes ticket #6072.

7 years agohevc: Mark as having threadsafe init
Derek Buitenhuis [Tue, 10 Jan 2017 18:24:27 +0000 (13:24 -0500)]
hevc: Mark as having threadsafe init

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
7 years agoavcodec: add Newtek SpeedHQ decoder
Steinar H. Gunderson [Sun, 8 Jan 2017 11:07:09 +0000 (12:07 +0100)]
avcodec: add Newtek SpeedHQ decoder

This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9),
including correct decoding of the alpha channel.

1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell),
about evenly split between bitstream reader and IDCT. There is currently
no attempt at slice or frame threading, even though the format trivially
supports both.

NewTek very helpfully provided a full set of SHQ samples, as well as
source code for an SHQ2 encoder (not included) and assistance with
understanding some details of the format.

7 years agoavcodec: move bitswap_32() into a header file
Steinar H. Gunderson [Sun, 8 Jan 2017 13:14:54 +0000 (14:14 +0100)]
avcodec: move bitswap_32() into a header file

Allows more codecs than mpeg12video to make use of it.

7 years agoavcodec/wmaprodec: do not force extradata presence for XMA
Paul B Mahol [Wed, 11 Jan 2017 10:38:56 +0000 (11:38 +0100)]
avcodec/wmaprodec: do not force extradata presence for XMA

Mainly useful for supporting decoding of headerless files.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/psd: fix ugly typo
Paul B Mahol [Wed, 11 Jan 2017 10:42:50 +0000 (11:42 +0100)]
avcodec/psd: fix ugly typo

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/vf_libopencv: fix resource leak in read_shape_frame_filter
Steven Liu [Wed, 11 Jan 2017 01:59:55 +0000 (09:59 +0800)]
avfilter/vf_libopencv: fix resource leak in read_shape_frame_filter

CID: 1324298
add a label when error goto the label to release resource

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agolibavcodec/psd : add support for psd bitmap mode
Martin Vignali [Tue, 10 Jan 2017 23:18:29 +0000 (00:18 +0100)]
libavcodec/psd : add support for psd bitmap mode

Fixes ticket #6044

Based on patch by Carl Eugen Hoyos

7 years agolavc/psd: Interpret DUOTONE as GRAYSCALE.
Carl Eugen Hoyos [Tue, 10 Jan 2017 23:17:59 +0000 (00:17 +0100)]
lavc/psd: Interpret DUOTONE as GRAYSCALE.

This is what gimp, ImageMagick and FreeImage do and what the
Adobe Photoshop file format specification suggests.
Fixes a sample from ticket #6045.

Reviewed-by: Martin Vignali
7 years agoavformat/hlsenc: fix the bug when the largest segment duration pointer right value...
Steven Liu [Tue, 10 Jan 2017 20:38:34 +0000 (04:38 +0800)]
avformat/hlsenc: fix the bug when the largest segment duration pointer right value is 0

when the segments largest duration value is look like 4.000000, the
EXT-X-TARGETDURATION value should equ 4.
it's wrong when hlsenc use ceil, so fix it.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agoavformat/hlsenc: fix hls start and tail segment duration
Steven Liu [Tue, 10 Jan 2017 20:33:13 +0000 (04:33 +0800)]
avformat/hlsenc: fix hls start and tail segment duration
 problem

fix ticket: #6067

Tested-by: Pero
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agoavcodec/bsf: fix resource leak in av_bsf_list_parse_str
Steven Liu [Tue, 10 Jan 2017 20:09:47 +0000 (04:09 +0800)]
avcodec/bsf: fix resource leak in av_bsf_list_parse_str

cid: 1396268
when av_strdup(str) error, the lst need release

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agoavcodec/tiff: Perform multiply in tiff_unpack_lzma() as 64bit
Michael Niedermayer [Sun, 8 Jan 2017 15:37:56 +0000 (16:37 +0100)]
avcodec/tiff: Perform multiply in tiff_unpack_lzma() as 64bit

This should make no difference as the value should not be able to be that large
but its more correct this way

Fixes CID1348138

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agodoc/scaler: mention default scaling algorithm
Lou Logan [Fri, 23 Dec 2016 00:27:49 +0000 (15:27 -0900)]
doc/scaler: mention default scaling algorithm

Default is "bicubic".

Signed-off-by: Lou Logan <lou@lrcd.com>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/qdm2: make use of bytestream2
Paul B Mahol [Sun, 8 Jan 2017 18:59:06 +0000 (19:59 +0100)]
avcodec/qdm2: make use of bytestream2

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavfilter/af_sofalizer: speed and clean up fast convolution a little
Paul B Mahol [Mon, 9 Jan 2017 17:15:03 +0000 (18:15 +0100)]
avfilter/af_sofalizer: speed and clean up fast convolution a little

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agox86inc: Avoid using eax/rax for storing the stack pointer
Henrik Gramner [Tue, 20 Dec 2016 20:33:12 +0000 (21:33 +0100)]
x86inc: Avoid using eax/rax for storing the stack pointer

When allocating stack space with an alignment requirement that is larger
than the current stack alignment we need to store a copy of the original
stack pointer in order to be able to restore it later.

If we chose to use another register for this purpose we should not pick
eax/rax since it can be overwritten as a return value.

7 years agoavutil/tile: check clock_gettime at runtime for apple platforms
Wang Bin [Mon, 9 Jan 2017 03:52:06 +0000 (11:52 +0800)]
avutil/tile: check clock_gettime at runtime for apple platforms

clock_gettime is avalible since macOS 10.12 and iOS 10.0. Because of
weak linking, clock_gettime can be build without error with new
macOS/iOS sdk, but the symbol may not exist on the target system.
Explicitly checking the symbol is required.
https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html

Signed-off-by: Wang Bin <wbsecg1@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agolavc/vaapi_encode_h264: disable B frames in baseline profile
Jun Zhao [Sun, 8 Jan 2017 03:01:32 +0000 (11:01 +0800)]
lavc/vaapi_encode_h264: disable B frames in baseline profile

Disable B frames when using baseline/constrained baseline profile,
following H.264 spec Annex A.2.1.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Yi A Wang <yi.a.wang@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
7 years agoavfilter/af_dynaudnorm: fix hang with too short input
Paul B Mahol [Sun, 8 Jan 2017 19:41:36 +0000 (20:41 +0100)]
avfilter/af_dynaudnorm: fix hang with too short input

The only thing we can do at such point is return samples unchanged.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/bsf: Fix av_bsf_list_free()
Michael Niedermayer [Mon, 26 Dec 2016 22:45:53 +0000 (23:45 +0100)]
avcodec/bsf: Fix av_bsf_list_free()

Negate null check
Fixes CID1396248

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/omx: Do not pass negative value into av_malloc()
Michael Niedermayer [Thu, 29 Dec 2016 01:19:27 +0000 (02:19 +0100)]
avcodec/omx: Do not pass negative value into av_malloc()

Fixes CID1396849

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoffserver: local OOB write with custom program name
Tobias Stoeckmann [Fri, 6 Jan 2017 22:33:16 +0000 (23:33 +0100)]
ffserver: local OOB write with custom program name

When the command line for children is created, it is assumed that
my_program_name always ends with "ffserver", which doesn't have to
be true if ffserver is called through a symbolic link.

In such a case, it could be that not enough space for "ffmpeg" is
available at the end, leading to a buffer overflow.

One example would be:

$ ln -s /usr/bin/ffserver ~/f; ~/f

As this is only a local buffer overflow, i.e. is based on a weird
program call, this has NO security impact.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavformat/riff: extend MagicYUV fourcc list
Paul B Mahol [Sat, 7 Jan 2017 11:29:32 +0000 (12:29 +0100)]
avformat/riff: extend MagicYUV fourcc list

Newer version of encoder can create such files.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/dca: add support for 20-bit XLL
foo86 [Sat, 7 Jan 2017 09:26:43 +0000 (12:26 +0300)]
avcodec/dca: add support for 20-bit XLL

Fixes ticket #6063.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavformat/matroskaenc: Regression fix for invalid MKV headers
softworkz [Thu, 5 Jan 2017 00:24:03 +0000 (01:24 +0100)]
avformat/matroskaenc: Regression fix for invalid MKV headers

The following three commits created a regression by writing initially
invalid mkv headers:

650e17d88b63b5aca6e0a43483e89e64b0f7d2dd avformat/matroskaenc: write a
CRC32 element on Tags
3bcadf822711720ff0f8d14db71ae47cdf97e652 avformat/matroskaenc: write a
CRC32 element on Info
ee888cfbe777cd2916a3548c750e433ab8f8e6a5 avformat/matroskaenc: postpone
writing the Tracks master

Symptoms:

- You can no longer playback a file that is still processed by ffmpeg,
e.g. VLC fails playback
- You can no longer stream a file to a client while if is still being
processed
- Various diagnosing tools show header errors or incomplete headers
(e.g. ffprobe, mediainfo, mkvalidator)

Note: The symptoms do not apply to completed files or ffmpeg runs that
were interrupted with 'q'

Cause:

The mentioned commits made changes in a way that some header elements
are only partially written in
mkv_write_header, leaving the header in an invalid state. Only in
mkv_write_trailer, these elements
are finished correctly, but that does only occur at the end of the
process.

Regression:

Before these commits were applied, mkv headers have always been valid,
even before completion of ffmpeg.
This has worked reliably over many versions of ffmpeg, to it was an
obvious regression.

Bugtracker:

This issue has been recorded as #5977 which is resolved by this patch

Patch:

The patch adds a new function 'end_ebml_master_crc32_preliminary' that
preliminarily finishes the ebml
element without destroying the buffer. The buffer can be used to update
the ebml element later during
mkv_write_trailer. But most important: mkv_write_header finishes with a
valid mkv header again.

Signed-off-by: James Almer <jamrial@gmail.com>
7 years agolavfi/selectivecolor: add a link to algorithm explanations
Clément Bœsch [Sat, 7 Jan 2017 13:25:57 +0000 (14:25 +0100)]
lavfi/selectivecolor: add a link to algorithm explanations

7 years agolibavformat/avio: Add avio_get_dyn_buf function
softworkz [Thu, 5 Jan 2017 00:33:26 +0000 (01:33 +0100)]
libavformat/avio: Add avio_get_dyn_buf function

This commit adds the avio_get_dyn_buf function which allows accessing
the
content of a DynBuffer without destroying it.

This is required in matroskaenc for preliminary writing (correct) mkv
headers.

Context for this change is fixing regression bug #5977.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec: add QDMC decoder
Paul B Mahol [Mon, 26 Dec 2016 15:58:46 +0000 (16:58 +0100)]
avcodec: add QDMC decoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/iff: add support for vertical word compression in ILBM
Paul B Mahol [Fri, 6 Jan 2017 20:44:14 +0000 (21:44 +0100)]
avcodec/iff: add support for vertical word compression in ILBM

Signed-off-by: Paul B Mahol <onemda@gmail.com>