OSDN Git Service

android-x86/external-ffmpeg.git
7 years agoavcodec/xpmdec: improve comment for one function and also fix 2 identation issues
Paul B Mahol [Sun, 12 Mar 2017 21:37:53 +0000 (22:37 +0100)]
avcodec/xpmdec: improve comment for one function and also fix 2 identation issues

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoswresample/swresample: do not reset tsf on swr_alloc_set_opts
Muhammad Faiz [Sat, 11 Mar 2017 17:24:21 +0000 (00:24 +0700)]
swresample/swresample: do not reset tsf on swr_alloc_set_opts

so tsf option in aresample will have effect
previously tsf/internal_sample_format had no effect

fate is updated
s32p previously used fltp internally
dblp previously used fltp/dblp internally

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
7 years agovf_hwupload: Add missing return value check
Jun Zhao [Fri, 3 Mar 2017 01:25:53 +0000 (09:25 +0800)]
vf_hwupload: Add missing return value check

Add missing return value checks to suppress build warning and
remove noop ff_formats_unref() calling.

Note: most filters using ff_formats_ref() didn't have a suitable
error handling, it's a potential memory leak issue.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
7 years agotests/api-seek: fix memory leak on realloc() failure
James Almer [Sat, 11 Mar 2017 23:29:40 +0000 (20:29 -0300)]
tests/api-seek: fix memory leak on realloc() failure

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agotest/api-seek: clean up properly on failure
James Almer [Sun, 12 Mar 2017 13:36:44 +0000 (10:36 -0300)]
test/api-seek: clean up properly on failure

Also propagate better error values.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agotests/api-seek: make the crc array uint32_t
James Almer [Sat, 11 Mar 2017 23:24:53 +0000 (20:24 -0300)]
tests/api-seek: make the crc array uint32_t

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavcodec/xpmdec: skip everything before signature
Paul B Mahol [Sun, 12 Mar 2017 14:07:02 +0000 (15:07 +0100)]
avcodec/xpmdec: skip everything before signature

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/codec_desc: add mime type for X-BitMap
Paul B Mahol [Sun, 12 Mar 2017 13:50:33 +0000 (14:50 +0100)]
avcodec/codec_desc: add mime type for X-BitMap

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/codec_desc: add mime type for X-PixMap
Paul B Mahol [Sun, 12 Mar 2017 13:49:26 +0000 (14:49 +0100)]
avcodec/codec_desc: add mime type for X-PixMap

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/xpmdec: make convert function more picky about its input
Paul B Mahol [Sun, 12 Mar 2017 11:48:01 +0000 (12:48 +0100)]
avcodec/xpmdec: make convert function more picky about its input

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec: add XPM decoder and demuxer
Paras Chadha [Sat, 11 Mar 2017 21:01:23 +0000 (02:31 +0530)]
avcodec: add XPM decoder and demuxer

Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
7 years agoMerge commit 'ad71d3276fef0ee7e791e62bbfe9c4e540047417'
Mark Thompson [Sun, 12 Mar 2017 16:55:32 +0000 (16:55 +0000)]
Merge commit 'ad71d3276fef0ee7e791e62bbfe9c4e540047417'

* commit 'ad71d3276fef0ee7e791e62bbfe9c4e540047417':
  lavfi: add a QSV deinterlacing filter

Minor fixup for lavfi differences.

Merged-by: Mark Thompson <sw@jkqxz.net>
7 years agoMerge commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4'
Mark Thompson [Sun, 12 Mar 2017 15:21:41 +0000 (15:21 +0000)]
Merge commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4'

* commit '8e07c22e508b349d145b9f142aa3ee8b3ce1d3a4':
  qsvenc: print warnings from encode/init

Merged-by: Mark Thompson <sw@jkqxz.net>
7 years agoMerge commit '0956fd460681e8ccbdae19f135f0d3970bf95c2f'
Mark Thompson [Sun, 12 Mar 2017 15:19:52 +0000 (15:19 +0000)]
Merge commit '0956fd460681e8ccbdae19f135f0d3970bf95c2f'

* commit '0956fd460681e8ccbdae19f135f0d3970bf95c2f':
  qsvenc: do not re-execute encoding on all positive status codes

Noop, see fb240a6276fa36fe120aadd67b4ca774e354f22b.

Merged-by: Mark Thompson <sw@jkqxz.net>
7 years agoMerge commit '95414eb2dc63a6f934275b4ed33dedd4369f2c49'
Mark Thompson [Sun, 12 Mar 2017 15:19:05 +0000 (15:19 +0000)]
Merge commit '95414eb2dc63a6f934275b4ed33dedd4369f2c49'

* commit '95414eb2dc63a6f934275b4ed33dedd4369f2c49':
  qsv: print more complete error messages

Merged-by: Mark Thompson <sw@jkqxz.net>
7 years agoMerge commit 'd9ec3c60143babe1bb77c268e1d5547d15acd69b'
Mark Thompson [Sun, 12 Mar 2017 15:06:07 +0000 (15:06 +0000)]
Merge commit 'd9ec3c60143babe1bb77c268e1d5547d15acd69b'

* commit 'd9ec3c60143babe1bb77c268e1d5547d15acd69b':
  qsvenc: take only the allocated dimensions from the frames context

Merged-by: Mark Thompson <sw@jkqxz.net>
7 years agoMerge commit '37a9015ee84c15fec5247ba8f6577351a25fa8d2'
Mark Thompson [Sun, 12 Mar 2017 15:04:45 +0000 (15:04 +0000)]
Merge commit '37a9015ee84c15fec5247ba8f6577351a25fa8d2'

* commit '37a9015ee84c15fec5247ba8f6577351a25fa8d2':
  qsvenc: add support for p010

Merged-by: Mark Thompson <sw@jkqxz.net>
7 years agolavfi: add a QSV scaling filter
Anton Khirnov [Sat, 26 Mar 2016 11:39:58 +0000 (12:39 +0100)]
lavfi: add a QSV scaling filter

This merges libav commit ac7bfd69678f3966e38debdb27f4bde94dc0345c,
which was previously skipped.

(cherry picked from commit ac7bfd69678f3966e38debdb27f4bde94dc0345c)
Signed-off-by: Mark Thompson <sw@jkqxz.net>
7 years agoMerge commit '21962261c74aed4df00ae8348a5e2d1ecb67c52d'
Mark Thompson [Sun, 12 Mar 2017 14:21:37 +0000 (14:21 +0000)]
Merge commit '21962261c74aed4df00ae8348a5e2d1ecb67c52d'

* commit '21962261c74aed4df00ae8348a5e2d1ecb67c52d':
  qsv: handle the semi-packed formats in map_fourcc as well

Merged-by: Mark Thompson <sw@jkqxz.net>
7 years agoMerge commit 'f65285aba0df7d46298abe0c945dfee05cbc6028'
Clément Bœsch [Sun, 12 Mar 2017 12:21:01 +0000 (13:21 +0100)]
Merge commit 'f65285aba0df7d46298abe0c945dfee05cbc6028'

* commit 'f65285aba0df7d46298abe0c945dfee05cbc6028':
  lavc: set sw_pix_fmt for hwaccel encoding

Merged-by: Clément Bœsch <u@pkh.me>
7 years agoMerge commit 'd59641abfd25a1007bdf4723d952887b1e3619c6'
Clément Bœsch [Sun, 12 Mar 2017 12:20:57 +0000 (13:20 +0100)]
Merge commit 'd59641abfd25a1007bdf4723d952887b1e3619c6'

* commit 'd59641abfd25a1007bdf4723d952887b1e3619c6':
  lavc: initialize AVCodecContext.sw_pix_fmt properly

Merged-by: Clément Bœsch <u@pkh.me>
7 years agoMerge commit '8b7a9729aa162e2bbd571933f1aa40767f1ff47b'
Clément Bœsch [Sun, 12 Mar 2017 12:13:55 +0000 (13:13 +0100)]
Merge commit '8b7a9729aa162e2bbd571933f1aa40767f1ff47b'

* commit '8b7a9729aa162e2bbd571933f1aa40767f1ff47b':
  avconv_qsv: use the actual pixel format provided by lavc

This commit is a noop, see 03cef34aa66

Merged-by: Clément Bœsch <u@pkh.me>
7 years agoMerge commit '6f40181cad8ac04adff7bd10e1e1ab65f22bc1f0'
Clément Bœsch [Sun, 12 Mar 2017 12:13:05 +0000 (13:13 +0100)]
Merge commit '6f40181cad8ac04adff7bd10e1e1ab65f22bc1f0'

* commit '6f40181cad8ac04adff7bd10e1e1ab65f22bc1f0':
  avconv_qsv: align the surface size to 32

This commit is a noop, see 03cef34aa66

Merged-by: Clément Bœsch <u@pkh.me>
7 years agoMerge commit 'b0f36a0043d76436cc7ab8ff92ab99c94595d3c0'
Clément Bœsch [Sun, 12 Mar 2017 12:08:04 +0000 (13:08 +0100)]
Merge commit 'b0f36a0043d76436cc7ab8ff92ab99c94595d3c0'

* commit 'b0f36a0043d76436cc7ab8ff92ab99c94595d3c0':
  avconv: stop using setpts for input framerate forced with -r

Merged-by: Clément Bœsch <u@pkh.me>
7 years agoavcodec/scpr: use correct linesize for prev frame
Paul B Mahol [Sun, 12 Mar 2017 11:34:55 +0000 (12:34 +0100)]
avcodec/scpr: use correct linesize for prev frame

Signed-off-by: Paul B Mahol <onemda@gmail.com>
7 years agoavcodec/dca_xll: Fix runtime error: signed integer overflow: 2147286116 + 6298923...
Michael Niedermayer [Wed, 8 Mar 2017 20:35:51 +0000 (21:35 +0100)]
avcodec/dca_xll: Fix runtime error: signed integer overflow: 2147286116 + 6298923 cannot be represented in type 'int'

Fixes: 732/clusterfuzz-testcase-4872990070145024

See: [FFmpeg-devel] [PATCH 2/6] avcodec/dca_xll: Fix runtime error: signed integer overflow: 2147286116 + 6298923 cannot be represented in type 'int'
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/amrwbdec: Fix runtime error: left shift of negative value -1
Michael Niedermayer [Sat, 11 Mar 2017 02:55:39 +0000 (03:55 +0100)]
avcodec/amrwbdec: Fix  runtime error: left shift of negative value -1

Fixes: 763/clusterfuzz-testcase-6007567320875008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/dca_xll: Fix runtime error: signed integer overflow: 1762028192 + 698372290...
Michael Niedermayer [Sat, 11 Mar 2017 02:38:01 +0000 (03:38 +0100)]
avcodec/dca_xll: Fix runtime error: signed integer overflow: 1762028192 + 698372290 cannot be represented in type 'int'

Fixes: 762/clusterfuzz-testcase-5927683747741696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/wavpack: Fix runtime error: signed integer overflow: -2147483648 + -83886075...
Michael Niedermayer [Sat, 11 Mar 2017 02:25:41 +0000 (03:25 +0100)]
avcodec/wavpack: Fix runtime error: signed integer overflow: -2147483648 + -83886075 cannot be represented in type 'int'

Fixes: 761/clusterfuzz-testcase-5442222252097536

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavfilter/af_firequalizer: add av_restrict on convolution func
Muhammad Faiz [Sat, 11 Mar 2017 00:54:30 +0000 (07:54 +0700)]
avfilter/af_firequalizer: add av_restrict on convolution func

slightly improved speed

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
7 years agolavf/dashenc: update bitrates on dash_write_trailer
Przemysław Sobala [Fri, 3 Mar 2017 08:38:28 +0000 (09:38 +0100)]
lavf/dashenc: update bitrates on dash_write_trailer

Provides a way to change bandwidth parameter inside DASH manifest after a non-CBR H.264 encoding.
Caller now is able to compute the bitrate by itself, after all packets have been written, and then set that value in AVFormatContext->streams->codecpar->bit_rate before calling av_write_trailer. As a result that value will be set in DASH manifest.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agodoc/muxers: move hls_flags temp_file to after SECOND LEVEL hls example
Steven Liu [Sat, 11 Mar 2017 13:11:38 +0000 (21:11 +0800)]
doc/muxers: move hls_flags temp_file to after SECOND LEVEL hls example

the temp_file hls_flags describe text offset is wrong, now move it after example

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agoaarch64: vp9itxfm: Reorder iadst16 coeffs
Martin Storsjö [Sat, 31 Dec 2016 20:27:13 +0000 (22:27 +0200)]
aarch64: vp9itxfm: Reorder iadst16 coeffs

This matches the order they are in the 16 bpp version.

There they are in this order, to make sure we access them in the
same order they are declared, easing loading only half of the
coefficients at a time.

This makes the 8 bpp version match the 16 bpp version better.

This is cherrypicked from libav commit
b8f66c0838b4c645227f23a35b4d54373da4c60a.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Reorder iadst16 coeffs
Martin Storsjö [Sat, 31 Dec 2016 20:27:13 +0000 (22:27 +0200)]
arm: vp9itxfm: Reorder iadst16 coeffs

This matches the order they are in the 16 bpp version.

There they are in this order, to make sure we access them in the
same order they are declared, easing loading only half of the
coefficients at a time.

This makes the 8 bpp version match the 16 bpp version better.

This is cherrypicked from libav commit
08074c092d8c97d71c5986e5325e97ffc956119d.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Reorder the idct coefficients for better pairing
Martin Storsjö [Sat, 31 Dec 2016 12:18:31 +0000 (14:18 +0200)]
aarch64: vp9itxfm: Reorder the idct coefficients for better pairing

All elements are used pairwise, except for the first one.
Previously, the 16th element was unused. Move the unused element
to the second slot, to make the later element pairs not split
across registers.

This simplifies loading only parts of the coefficients,
reducing the difference to the 16 bpp version.

This is cherrypicked from libav commit
09eb88a12e008d10a3f7a6be75d18ad98b368e68.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Reorder the idct coefficients for better pairing
Martin Storsjö [Sat, 31 Dec 2016 12:05:44 +0000 (14:05 +0200)]
arm: vp9itxfm: Reorder the idct coefficients for better pairing

All elements are used pairwise, except for the first one.
Previously, the 16th element was unused. Move the unused element
to the second slot, to make the later element pairs not split
across registers.

This simplifies loading only parts of the coefficients,
reducing the difference to the 16 bpp version.

This is cherrypicked from libav commit
de06bdfe6c8abd8266d5c6f5c68e4df0060b61fc.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Avoid reloading the idct32 coefficients
Martin Storsjö [Mon, 2 Jan 2017 20:08:41 +0000 (22:08 +0200)]
aarch64: vp9itxfm: Avoid reloading the idct32 coefficients

The idct32x32 function actually pushed d8-d15 onto the stack even
though it didn't clobber them; there are plenty of registers that
can be used to allow keeping all the idct coefficients in registers
without having to reload different subsets of them at different
stages in the transform.

After this, we still can skip pushing d12-d15.

Before:
vp9_inv_dct_dct_32x32_sub32_add_neon: 8128.3
After:
vp9_inv_dct_dct_32x32_sub32_add_neon: 8053.3

This is cherrypicked from libav commit
65aa002d54433154a6924dc13e498bec98451ad0.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Avoid reloading the idct32 coefficients
Martin Storsjö [Mon, 2 Jan 2017 20:50:38 +0000 (22:50 +0200)]
arm: vp9itxfm: Avoid reloading the idct32 coefficients

The idct32x32 function actually pushed q4-q7 onto the stack even
though it didn't clobber them; there are plenty of registers that
can be used to allow keeping all the idct coefficients in registers
without having to reload different subsets of them at different
stages in the transform.

Since the idct16 core transform avoids clobbering q4-q7 (but clobbers
q2-q3 instead, to avoid needing to back up and restore q4-q7 at all
in the idct16 function), and the lanewise vmul needs a register in
the q0-q3 range, we move the stored coefficients from q2-q3 into q4-q5
while doing idct16.

While keeping these coefficients in registers, we still can skip pushing
q7.

Before:                              Cortex A7       A8       A9      A53
vp9_inv_dct_dct_32x32_sub32_add_neon:  18553.8  17182.7  14303.3  12089.7
After:
vp9_inv_dct_dct_32x32_sub32_add_neon:  18470.3  16717.7  14173.6  11860.8

This is cherrypicked from libav commit
402546a17233a8815307df9e14ff88cd70424537.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9lpf: Implement the mix2_44 function with one single filter pass
Martin Storsjö [Sat, 14 Jan 2017 11:22:30 +0000 (13:22 +0200)]
arm: vp9lpf: Implement the mix2_44 function with one single filter pass

For this case, with 8 inputs but only changing 4 of them, we can fit
all 16 input pixels into a q register, and still have enough temporary
registers for doing the loop filter.

The wd=8 filters would require too many temporary registers for
processing all 16 pixels at once though.

Before:                          Cortex A7      A8     A9     A53
vp9_loop_filter_mix2_v_44_16_neon:   289.7   256.2  237.5   181.2
After:
vp9_loop_filter_mix2_v_44_16_neon:   221.2   150.5  177.7   138.0

This is cherrypicked from libav commit
575e31e931e4178e9f1e24407503c9b4ec0ef9ba.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9lpf: Use dup+rev16+uzp1 instead of dup+lsr+dup+trn1
Martin Storsjö [Thu, 23 Feb 2017 21:33:58 +0000 (23:33 +0200)]
aarch64: vp9lpf: Use dup+rev16+uzp1 instead of dup+lsr+dup+trn1

This is one cycle faster in total, and three instructions fewer.

Before:
vp9_loop_filter_mix2_v_44_16_neon: 123.2
After:
vp9_loop_filter_mix2_v_44_16_neon: 122.2

This is cherrypicked from libav commit
3bf9c48320f25f3d5557485b0202f22ae60748b0.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm/aarch64: vp9lpf: Keep the comparison to E within 8 bit
Martin Storsjö [Sat, 14 Jan 2017 18:49:19 +0000 (20:49 +0200)]
arm/aarch64: vp9lpf: Keep the comparison to E within 8 bit

The theoretical maximum value of E is 193, so we can just
saturate the addition to 255.

Before:                     Cortex A7      A8      A9     A53  A53/AArch64
vp9_loop_filter_v_4_8_neon:     143.0   127.7   114.8    88.0         87.7
vp9_loop_filter_v_8_8_neon:     241.0   197.2   173.7   140.0        136.7
vp9_loop_filter_v_16_8_neon:    497.0   419.5   379.7   293.0        275.7
vp9_loop_filter_v_16_16_neon:   965.2   818.7   731.4   579.0        452.0
After:
vp9_loop_filter_v_4_8_neon:     136.0   125.7   112.6    84.0         83.0
vp9_loop_filter_v_8_8_neon:     234.0   195.5   171.5   136.0        133.7
vp9_loop_filter_v_16_8_neon:    490.0   417.5   377.7   289.0        271.0
vp9_loop_filter_v_16_16_neon:   951.2   814.7   732.3   571.0        446.7

This is cherrypicked from libav commit
c582cb8537367721bb399a5d01b652c20142b756.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: Add parentheses around the offset parameter in movrel
Martin Storsjö [Thu, 16 Feb 2017 07:18:25 +0000 (09:18 +0200)]
aarch64: Add parentheses around the offset parameter in movrel

This fixes building with clang for linux with PIC enabled.

This is cherrypicked from libav commit
8847eeaa141898850381400000fb2b8a7adc7100.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9lpf: Fix broken indentation/vertical alignment
Martin Storsjö [Wed, 11 Jan 2017 09:58:02 +0000 (11:58 +0200)]
aarch64: vp9lpf: Fix broken indentation/vertical alignment

This is cherrypicked from libav commit
07b5136c481d394992c7e951967df0cfbb346c0b.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9lpf: Interleave the start of flat8in into the calculation above
Martin Storsjö [Tue, 10 Jan 2017 20:08:50 +0000 (22:08 +0200)]
aarch64: vp9lpf: Interleave the start of flat8in into the calculation above

This adds lots of extra .ifs, but speeds it up by a couple cycles,
by avoiding stalls.

This is cherrypicked from libav commit
b0806088d3b27044145b20421da8d39089ae0c6a.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9lpf: Interleave the start of flat8in into the calculation above
Martin Storsjö [Tue, 10 Jan 2017 14:49:13 +0000 (16:49 +0200)]
arm: vp9lpf: Interleave the start of flat8in into the calculation above

This adds lots of extra .ifs, but speeds it up by a couple cycles,
by avoiding stalls.

This is cherrypicked from libav commit
e18c39005ad1dbb178b336f691da1de91afd434e.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9lpf: Use orrs instead of orr+cmp
Martin Storsjö [Fri, 13 Jan 2017 21:42:28 +0000 (23:42 +0200)]
arm: vp9lpf: Use orrs instead of orr+cmp

This is cherrypicked from libav commit
435cd7bc99671bf561193421a50ac6e9d63c4266.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm/aarch64: vp9lpf: Calculate !hev directly
Martin Storsjö [Thu, 12 Jan 2017 14:52:33 +0000 (16:52 +0200)]
arm/aarch64: vp9lpf: Calculate !hev directly

Previously we first calculated hev, and then negated it.

Since we were able to schedule the negation in the middle
of another calculation, we don't see any gain in all cases.

Before:                     Cortex A7      A8      A9     A53  A53/AArch64
vp9_loop_filter_v_4_8_neon:     147.0   129.0   115.8    89.0         88.7
vp9_loop_filter_v_8_8_neon:     242.0   198.5   174.7   140.0        136.7
vp9_loop_filter_v_16_8_neon:    500.0   419.5   382.7   293.0        275.7
vp9_loop_filter_v_16_16_neon:   971.2   825.5   731.5   579.0        453.0
After:
vp9_loop_filter_v_4_8_neon:     143.0   127.7   114.8    88.0         87.7
vp9_loop_filter_v_8_8_neon:     241.0   197.2   173.7   140.0        136.7
vp9_loop_filter_v_16_8_neon:    497.0   419.5   379.7   293.0        275.7
vp9_loop_filter_v_16_16_neon:   965.2   818.7   731.4   579.0        452.0

This is cherrypicked from libav commit
e1f9de86f454861b69b199ad801adc2ec6c3b220.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling
Martin Storsjö [Wed, 4 Jan 2017 10:57:56 +0000 (12:57 +0200)]
aarch64: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling

This work is sponsored by, and copyright, Google.

Before:                           Cortex A53
vp9_inv_dct_dct_16x16_sub1_add_neon:   235.3
vp9_inv_dct_dct_32x32_sub1_add_neon:   555.1
After:
vp9_inv_dct_dct_16x16_sub1_add_neon:   180.2
vp9_inv_dct_dct_32x32_sub1_add_neon:   475.3

This is cherrypicked from libav commit
3fcf788fbbccc4130868e7abe58a88990290f7c1.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling
Martin Storsjö [Wed, 4 Jan 2017 11:08:51 +0000 (13:08 +0200)]
arm: vp9itxfm: Optimize 16x16 and 32x32 idct dc by unrolling

This work is sponsored by, and copyright, Google.

Before:                            Cortex A7      A8      A9     A53
vp9_inv_dct_dct_16x16_sub1_add_neon:   273.0   189.5   211.7   235.8
vp9_inv_dct_dct_32x32_sub1_add_neon:   752.0   459.2   862.2   553.9
After:
vp9_inv_dct_dct_16x16_sub1_add_neon:   226.5   145.0   225.1   171.8
vp9_inv_dct_dct_32x32_sub1_add_neon:   721.2   415.7   727.6   475.0

This is cherrypicked from libav commit
a76bf8cf1277ef6feb1580b578f5e6ca327e713c.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter
Martin Storsjö [Sat, 17 Dec 2016 11:14:38 +0000 (13:14 +0200)]
aarch64: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter

No measured speedup on a Cortex A53, but other cores might benefit.

This is cherrypicked from libav commit
388e0d2515bc6bbc9d0c9af1d230bd16cf945fe7.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter
Martin Storsjö [Sat, 17 Dec 2016 11:09:50 +0000 (13:09 +0200)]
arm: vp9mc: Calculate less unused data in the 4 pixel wide horizontal filter

Before:                    Cortex A7      A8     A9     A53
vp9_put_8tap_smooth_4h_neon:   378.1   273.2  340.7   229.5
After:
vp9_put_8tap_smooth_4h_neon:   352.1   222.2  290.5   229.5

This is cherrypicked from libav commit
fea92a4b57d1c328b1de226a5f213a629ee63754.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9mc: Simplify the extmla macro parameters
Martin Storsjö [Fri, 16 Dec 2016 22:55:41 +0000 (00:55 +0200)]
aarch64: vp9mc: Simplify the extmla macro parameters

Fold the field lengths into the macro.

This makes the macro invocations much more readable, when the
lines are shorter.

This also makes it easier to use only half the registers within
the macro.

This is cherrypicked from libav commit
5e0c2158fbc774f87d3ce4b7b950ba4d42c4a7b8.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Fix incorrect vertical alignment
Martin Storsjö [Tue, 3 Jan 2017 14:11:56 +0000 (16:11 +0200)]
aarch64: vp9itxfm: Fix incorrect vertical alignment

This is cherrypicked from libav commit
0c0b87f12d48d4e7f0d3d13f9345e828a3a5ea32.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Update a comment to refer to a register with a different name
Martin Storsjö [Tue, 3 Jan 2017 21:11:51 +0000 (23:11 +0200)]
aarch64: vp9itxfm: Update a comment to refer to a register with a different name

This is cherrypicked from libav commit
8476eb0d3ab1f7a52317b23346646389c08fb57a.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Use the right lane sizes in 8x8 for improved readability
Martin Storsjö [Tue, 3 Jan 2017 14:46:17 +0000 (16:46 +0200)]
aarch64: vp9itxfm: Use the right lane sizes in 8x8 for improved readability

This is cherrypicked from libav commit
3dd7827258ddaa2e51085d0c677d6f3b1be3572f.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Use a single lane ld1 instead of ld1r where possible
Martin Storsjö [Tue, 3 Jan 2017 12:55:46 +0000 (14:55 +0200)]
aarch64: vp9itxfm: Use a single lane ld1 instead of ld1r where possible

The ld1r is a leftover from the arm version, where this trick is
beneficial on some cores.

Use a single-lane load where we don't need the semantics of ld1r.

This is cherrypicked from libav commit
ed8d293306e12c9b79022d37d39f48825ce7f2fa.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function
Martin Storsjö [Tue, 3 Jan 2017 14:39:41 +0000 (16:39 +0200)]
aarch64: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function

This is cherrypicked from libav commit
4da4b2b87f08a1331650c7e36eb7d4029a160776.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function
Martin Storsjö [Tue, 3 Jan 2017 14:38:56 +0000 (16:38 +0200)]
arm: vp9itxfm: Share instructions for loading idct coeffs in the 8x8 function

This is cherrypicked from libav commit
3933b86bb93aca47f29fbd493075b0f110c1e3f5.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Do separate functions for half/quarter idct16 and idct32
Martin Storsjö [Tue, 22 Nov 2016 20:58:35 +0000 (22:58 +0200)]
aarch64: vp9itxfm: Do separate functions for half/quarter idct16 and idct32

This work is sponsored by, and copyright, Google.

This avoids loading and calculating coefficients that we know will
be zero, and avoids filling the temp buffer with zeros in places
where we know the second pass won't read.

This gives a pretty substantial speedup for the smaller subpartitions.

The code size increases from 14740 bytes to 24292 bytes.

The idct16/32_end macros are moved above the individual functions; the
instructions themselves are unchanged, but since new functions are added
at the same place where the code is moved from, the diff looks rather
messy.

Before:
vp9_inv_dct_dct_16x16_sub1_add_neon:     236.7
vp9_inv_dct_dct_16x16_sub2_add_neon:    1051.0
vp9_inv_dct_dct_16x16_sub4_add_neon:    1051.0
vp9_inv_dct_dct_16x16_sub8_add_neon:    1051.0
vp9_inv_dct_dct_16x16_sub12_add_neon:   1387.4
vp9_inv_dct_dct_16x16_sub16_add_neon:   1387.6
vp9_inv_dct_dct_32x32_sub1_add_neon:     554.1
vp9_inv_dct_dct_32x32_sub2_add_neon:    5198.5
vp9_inv_dct_dct_32x32_sub4_add_neon:    5198.6
vp9_inv_dct_dct_32x32_sub8_add_neon:    5196.3
vp9_inv_dct_dct_32x32_sub12_add_neon:   6183.4
vp9_inv_dct_dct_32x32_sub16_add_neon:   6174.3
vp9_inv_dct_dct_32x32_sub20_add_neon:   7151.4
vp9_inv_dct_dct_32x32_sub24_add_neon:   7145.3
vp9_inv_dct_dct_32x32_sub28_add_neon:   8119.3
vp9_inv_dct_dct_32x32_sub32_add_neon:   8118.7

After:
vp9_inv_dct_dct_16x16_sub1_add_neon:     236.7
vp9_inv_dct_dct_16x16_sub2_add_neon:     640.8
vp9_inv_dct_dct_16x16_sub4_add_neon:     639.0
vp9_inv_dct_dct_16x16_sub8_add_neon:     842.0
vp9_inv_dct_dct_16x16_sub12_add_neon:   1388.3
vp9_inv_dct_dct_16x16_sub16_add_neon:   1389.3
vp9_inv_dct_dct_32x32_sub1_add_neon:     554.1
vp9_inv_dct_dct_32x32_sub2_add_neon:    3685.5
vp9_inv_dct_dct_32x32_sub4_add_neon:    3685.1
vp9_inv_dct_dct_32x32_sub8_add_neon:    3684.4
vp9_inv_dct_dct_32x32_sub12_add_neon:   5312.2
vp9_inv_dct_dct_32x32_sub16_add_neon:   5315.4
vp9_inv_dct_dct_32x32_sub20_add_neon:   7154.9
vp9_inv_dct_dct_32x32_sub24_add_neon:   7154.5
vp9_inv_dct_dct_32x32_sub28_add_neon:   8126.6
vp9_inv_dct_dct_32x32_sub32_add_neon:   8127.2

This is cherrypicked from libav commit
a63da4511d0fee66695ff4afd264ba1dbf1e812d.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Do a simpler half/quarter idct16/idct32 when possible
Martin Storsjö [Tue, 22 Nov 2016 09:07:38 +0000 (11:07 +0200)]
arm: vp9itxfm: Do a simpler half/quarter idct16/idct32 when possible

This work is sponsored by, and copyright, Google.

This avoids loading and calculating coefficients that we know will
be zero, and avoids filling the temp buffer with zeros in places
where we know the second pass won't read.

This gives a pretty substantial speedup for the smaller subpartitions.

The code size increases from 12388 bytes to 19784 bytes.

The idct16/32_end macros are moved above the individual functions; the
instructions themselves are unchanged, but since new functions are added
at the same place where the code is moved from, the diff looks rather
messy.

Before:                              Cortex A7       A8       A9      A53
vp9_inv_dct_dct_16x16_sub1_add_neon:     273.0    189.5    212.0    235.8
vp9_inv_dct_dct_16x16_sub2_add_neon:    2102.1   1521.7   1736.2   1265.8
vp9_inv_dct_dct_16x16_sub4_add_neon:    2104.5   1533.0   1736.6   1265.5
vp9_inv_dct_dct_16x16_sub8_add_neon:    2484.8   1828.7   2014.4   1506.5
vp9_inv_dct_dct_16x16_sub12_add_neon:   2851.2   2117.8   2294.8   1753.2
vp9_inv_dct_dct_16x16_sub16_add_neon:   3239.4   2408.3   2543.5   1994.9
vp9_inv_dct_dct_32x32_sub1_add_neon:     758.3    456.7    864.5    553.9
vp9_inv_dct_dct_32x32_sub2_add_neon:   10776.7   7949.8   8567.7   6819.7
vp9_inv_dct_dct_32x32_sub4_add_neon:   10865.6   8131.5   8589.6   6816.3
vp9_inv_dct_dct_32x32_sub8_add_neon:   12053.9   9271.3   9387.7   7564.0
vp9_inv_dct_dct_32x32_sub12_add_neon:  13328.3  10463.2  10217.0   8321.3
vp9_inv_dct_dct_32x32_sub16_add_neon:  14176.4  11509.5  11018.7   9062.3
vp9_inv_dct_dct_32x32_sub20_add_neon:  15301.5  12999.9  11855.1   9828.2
vp9_inv_dct_dct_32x32_sub24_add_neon:  16482.7  14931.5  12650.1  10575.0
vp9_inv_dct_dct_32x32_sub28_add_neon:  17589.5  15811.9  13482.8  11333.4
vp9_inv_dct_dct_32x32_sub32_add_neon:  18696.2  17049.2  14355.6  12089.7

After:
vp9_inv_dct_dct_16x16_sub1_add_neon:     273.0    189.5    211.7    235.8
vp9_inv_dct_dct_16x16_sub2_add_neon:    1203.5    998.2   1035.3    763.0
vp9_inv_dct_dct_16x16_sub4_add_neon:    1203.5    998.1   1035.5    760.8
vp9_inv_dct_dct_16x16_sub8_add_neon:    1926.1   1610.6   1722.1   1271.7
vp9_inv_dct_dct_16x16_sub12_add_neon:   2873.2   2129.7   2285.1   1757.3
vp9_inv_dct_dct_16x16_sub16_add_neon:   3221.4   2520.3   2557.6   2002.1
vp9_inv_dct_dct_32x32_sub1_add_neon:     753.0    457.5    866.6    554.6
vp9_inv_dct_dct_32x32_sub2_add_neon:    7554.6   5652.4   6048.4   4920.2
vp9_inv_dct_dct_32x32_sub4_add_neon:    7549.9   5685.0   6046.9   4925.7
vp9_inv_dct_dct_32x32_sub8_add_neon:    8336.9   6704.5   6604.0   5478.0
vp9_inv_dct_dct_32x32_sub12_add_neon:  10914.0   9777.2   9240.4   7416.9
vp9_inv_dct_dct_32x32_sub16_add_neon:  11859.2  11223.3   9966.3   8095.1
vp9_inv_dct_dct_32x32_sub20_add_neon:  15237.1  13029.4  11838.3   9829.4
vp9_inv_dct_dct_32x32_sub24_add_neon:  16293.2  14379.8  12644.9  10572.0
vp9_inv_dct_dct_32x32_sub28_add_neon:  17424.3  15734.7  13473.0  11326.9
vp9_inv_dct_dct_32x32_sub32_add_neon:  18531.3  17457.0  14298.6  12080.0

This is cherrypicked from libav commit
5eb5aec475aabc884d083566f902876ecbc072cb.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function
Martin Storsjö [Sun, 5 Feb 2017 20:53:55 +0000 (22:53 +0200)]
aarch64: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function

This allows reusing the macro for a separate implementation of the
pass2 function.

This is cherrypicked from libav commit
79d332ebbde8c0a3e9da094dcfd10abd33ba7378.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function
Martin Storsjö [Sun, 5 Feb 2017 20:55:20 +0000 (22:55 +0200)]
arm: vp9itxfm: Move the load_add_store macro out from the itxfm16 pass2 function

This allows reusing the macro for a separate implementation of the
pass2 function.

This is cherrypicked from libav commit
47b3c2c18d1897f3c753ba0cec4b2d7aa24526af.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Make the larger core transforms standalone functions
Martin Storsjö [Wed, 23 Nov 2016 12:03:05 +0000 (14:03 +0200)]
aarch64: vp9itxfm: Make the larger core transforms standalone functions

This work is sponsored by, and copyright, Google.

This reduces the code size of libavcodec/aarch64/vp9itxfm_neon.o from
19496 to 14740 bytes.

This gives a small slowdown of a couple of tens of cycles, but makes
it more feasible to add more optimized versions of these transforms.

Before:
vp9_inv_dct_dct_16x16_sub4_add_neon:    1036.7
vp9_inv_dct_dct_16x16_sub16_add_neon:   1372.2
vp9_inv_dct_dct_32x32_sub4_add_neon:    5180.0
vp9_inv_dct_dct_32x32_sub32_add_neon:   8095.7

After:
vp9_inv_dct_dct_16x16_sub4_add_neon:    1051.0
vp9_inv_dct_dct_16x16_sub16_add_neon:   1390.1
vp9_inv_dct_dct_32x32_sub4_add_neon:    5199.9
vp9_inv_dct_dct_32x32_sub32_add_neon:   8125.8

This is cherrypicked from libav commit
115476018d2c97df7e9b4445fe8f6cc7420ab91f.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Make the larger core transforms standalone functions
Martin Storsjö [Wed, 23 Nov 2016 08:56:12 +0000 (10:56 +0200)]
arm: vp9itxfm: Make the larger core transforms standalone functions

This work is sponsored by, and copyright, Google.

This reduces the code size of libavcodec/arm/vp9itxfm_neon.o from
15324 to 12388 bytes.

This gives a small slowdown of a couple tens of cycles, up to around
150 cycles for the full case of the largest transform, but makes
it more feasible to add more optimized versions of these transforms.

Before:                              Cortex A7       A8       A9      A53
vp9_inv_dct_dct_16x16_sub4_add_neon:    2063.4   1516.0   1719.5   1245.1
vp9_inv_dct_dct_16x16_sub16_add_neon:   3279.3   2454.5   2525.2   1982.3
vp9_inv_dct_dct_32x32_sub4_add_neon:   10750.0   7955.4   8525.6   6754.2
vp9_inv_dct_dct_32x32_sub32_add_neon:  18574.0  17108.4  14216.7  12010.2

After:
vp9_inv_dct_dct_16x16_sub4_add_neon:    2060.8   1608.5   1735.7   1262.0
vp9_inv_dct_dct_16x16_sub16_add_neon:   3211.2   2443.5   2546.1   1999.5
vp9_inv_dct_dct_32x32_sub4_add_neon:   10682.0   8043.8   8581.3   6810.1
vp9_inv_dct_dct_32x32_sub32_add_neon:  18522.4  17277.4  14286.7  12087.9

This is cherrypicked from libav commit
0331c3f5e8cb6e6b53fab7893e91d1be1bfa979c.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoaarch64: vp9itxfm: Restructure the idct32 store macros
Martin Storsjö [Thu, 1 Dec 2016 09:10:19 +0000 (11:10 +0200)]
aarch64: vp9itxfm: Restructure the idct32 store macros

This avoids concatenation, which can't be used if the whole macro
is wrapped within another macro.

This is also arguably more readable.

This is cherrypicked from libav commit
58d87e0f49bcbbc6f426328f53b657bae7430cd2.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agoarm: vp9itxfm: Avoid .irp when it doesn't save any lines
Martin Storsjö [Sat, 4 Feb 2017 20:16:09 +0000 (22:16 +0200)]
arm: vp9itxfm: Avoid .irp when it doesn't save any lines

This makes it more readable.

This is cherrypicked from libav commit
3bc5b28d5a191864c54bba60646933a63da31656.

Signed-off-by: Martin Storsjö <martin@martin.st>
7 years agolibavfilter/avf_showwaves: make sqrt and cbrt scale option values available to showwa...
Moritz Barsnick [Thu, 9 Mar 2017 09:23:28 +0000 (10:23 +0100)]
libavfilter/avf_showwaves: make sqrt and cbrt scale option values available to showwavespic by name

The 'sqrt' and 'cbrt' scalers were added in commit
80262d8c86e94ff9a4bb3a9e3c2d734e04ccb399, but their symbolic option values
only made available to the showwaves filter, not showwavespic, despite
the scalers working properly by their numerical option values.

Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
7 years agoffprobe: add AVCodecContext help message into ffprobe
Steven Liu [Sat, 11 Mar 2017 03:12:23 +0000 (11:12 +0800)]
ffprobe: add AVCodecContext help message into ffprobe

because the ffprobe can use AVCodecContext parameters

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
7 years agoavcodec/vp56: Reset have_undamaged_frame on resolution changes
Michael Niedermayer [Thu, 9 Mar 2017 16:55:32 +0000 (17:55 +0100)]
avcodec/vp56: Reset have_undamaged_frame on resolution changes

Fixes: timeout in 758/clusterfuzz-testcase-4720832028868608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/h264_ps: Forward errors from decode_scaling_list()
Michael Niedermayer [Thu, 9 Mar 2017 12:54:24 +0000 (13:54 +0100)]
avcodec/h264_ps: Forward errors from decode_scaling_list()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agolibavcodec/libopenjpegenc: enable lossless option, remove layer option, and improve...
Aaron Boxer [Fri, 10 Mar 2017 04:01:48 +0000 (23:01 -0500)]
libavcodec/libopenjpegenc: enable lossless option, remove layer option, and improve defaults

1. limit to single layer, as there is no current support for setting distortion/quality of multiple layers
2. encoder mode should be kept at default setting (0)
3. remove fixed_alloc parameter from context : seldom if ever used, and no way of properly configuring at the moment
4. add irreversible setting, to allow for lossless encoding. Set to OpenJPEG default (enabled)
5. set numresolution max to 33, which is the maximum number of allowed resolutions according the J2K spec

Signed-off-by: Michael Bradshaw <mjbshaw@google.com>
7 years agoavcodec/vp8: Fix hang with slice threads
Thomas Guilbert [Thu, 9 Mar 2017 23:15:39 +0000 (00:15 +0100)]
avcodec/vp8: Fix hang with slice threads

Fixes: 447860.webm

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/movtextdec: run mov_text_cleanup() before overwriting pointers
Michael Niedermayer [Wed, 8 Mar 2017 21:54:10 +0000 (22:54 +0100)]
avcodec/movtextdec: run mov_text_cleanup() before overwriting pointers

Fixes: memleak
Fixes: 741/clusterfuzz-testcase-586996200452915

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/mpeg4videodec: Fix runtime error: signed integer overflow: -135088512 * 16...
Michael Niedermayer [Wed, 8 Mar 2017 21:25:08 +0000 (22:25 +0100)]
avcodec/mpeg4videodec: Fix runtime error: signed integer overflow: -135088512 * 16 cannot be represented in type 'int'

Fixes: 736/clusterfuzz-testcase-5580263943831552

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/h264_mvpred: Fix runtime error: left shift of negative value -1
Michael Niedermayer [Wed, 8 Mar 2017 20:53:15 +0000 (21:53 +0100)]
avcodec/h264_mvpred: Fix runtime error: left shift of negative value -1

Fixes: 734/clusterfuzz-testcase-4821293192970240

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/mjpegdec: Fix runtime error: left shift of negative value -127
Michael Niedermayer [Wed, 8 Mar 2017 20:41:34 +0000 (21:41 +0100)]
avcodec/mjpegdec: Fix runtime error: left shift of negative value -127

Fixes: 733/clusterfuzz-testcase-4682158096515072

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/mpegaudiodec_template: Check for negative e
Michael Niedermayer [Wed, 8 Mar 2017 20:25:13 +0000 (21:25 +0100)]
avcodec/mpegaudiodec_template: Check for negative e

Fixes: undefined shift
Fixes: 631/clusterfuzz-testcase-6725491035734016

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/cuvid: add support for cropping/resizing
Timo Rothenpieler [Sun, 5 Mar 2017 14:32:36 +0000 (15:32 +0100)]
avcodec/cuvid: add support for cropping/resizing

Overhauled version, original patch by Miroslav Slugeň <thunder.m@email.cz>.

7 years agoavformat/matroskaenc: add support for Spherical Video elements
James Almer [Wed, 8 Mar 2017 19:12:32 +0000 (16:12 -0300)]
avformat/matroskaenc: add support for Spherical Video elements

Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agoavcodec: clarify some decoding/encoding API details
wm4 [Mon, 6 Mar 2017 10:34:20 +0000 (11:34 +0100)]
avcodec: clarify some decoding/encoding API details

Make it clear that there is no timing-dependent behavior. In particular,
there is no state in which both input and output are denied, and where
you have to wait for a while yourself to make progress (apparently some
hardware decoders like to do this).

Avoid wording that makes references to time. It shouldn't be mistaken
for some kind of asynchronous API (like POSIX read() can return EAGAIN
if there is no new input yet). It's a state machine, so try to use
appropriate terms.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Merges Libav commit 8a60bba0ae.

7 years agohls: pass AVFormatContext flags to sub demuxer
wm4 [Thu, 9 Mar 2017 14:43:08 +0000 (15:43 +0100)]
hls: pass AVFormatContext flags to sub demuxer

7 years agoconcatdec: pass AVFormatContext flags to sub demuxer
wm4 [Thu, 9 Mar 2017 14:43:00 +0000 (15:43 +0100)]
concatdec: pass AVFormatContext flags to sub demuxer

7 years agoaacdec: do not mutate input packet metadata
wm4 [Wed, 8 Mar 2017 11:36:05 +0000 (12:36 +0100)]
aacdec: do not mutate input packet metadata

Apparently the demuxer outputs the wrong padding for HE-AAC (based on
the raw sample rate, or so). aacdec contains a hack to adjust the muxer
padding accordingly before it's used to trim the decoder output. This
modified the packet side data, which in combination with the old
decoding API would change the packet the user passed to the decoder.
This is clearly not allowed, and it breaks running some gapless fate
tests with "-fflags +keepside" applied (without keepside, the packet
metadata is typically newly allocated, essentially making a copy and not
modifying the user's input packet).

This should probably be fixed in the demuxer (and consequently also the
muxer), but for now only fix the immediate problem.

Regression since 946ed78f5f8 (2012).

7 years agoswresample/resample: do not allow odd filter_length
Muhammad Faiz [Wed, 8 Mar 2017 15:21:34 +0000 (22:21 +0700)]
swresample/resample: do not allow odd filter_length

except filter_length == 1

odd filter_length gives worse frequency response,
even when compared with shorter filter_length

also makes build_filter simpler

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
7 years agoavcodec/wavpack: Fix runtime error: left shift of negative value -5
Michael Niedermayer [Mon, 6 Mar 2017 20:52:36 +0000 (21:52 +0100)]
avcodec/wavpack: Fix runtime error: left shift of negative value -5

Fixes: 729/clusterfuzz-testcase-5154831595470848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/pictordec: Fix runtime error: left shift of 64 by 25 places cannot be represe...
Michael Niedermayer [Mon, 6 Mar 2017 20:33:18 +0000 (21:33 +0100)]
avcodec/pictordec: Fix runtime error: left shift of 64 by 25 places cannot be represented in type 'int'

Fixes: 724/clusterfuzz-testcase-6738249571631104

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agofate/swresample: fix FUZZ typo
Muhammad Faiz [Wed, 8 Mar 2017 14:51:02 +0000 (21:51 +0700)]
fate/swresample: fix FUZZ typo

unintentionally changed to 0.01 at
'61926b6c3e560283ef6c015d6d85c32716942833'

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
7 years agoavutil/tests/lfg: Remove debugging start/stop timer
Michael Niedermayer [Wed, 8 Mar 2017 10:29:40 +0000 (11:29 +0100)]
avutil/tests/lfg: Remove debugging start/stop timer

Fixes code with qemu ARM

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavutil/tests/lfg.c: added proper normality test
Thomas Turner [Wed, 8 Mar 2017 00:36:15 +0000 (16:36 -0800)]
avutil/tests/lfg.c: added proper normality test

The Chen-Shapiro(CS) test was used to test normality for
Lagged Fibonacci PRNG.

Normality Hypothesis Test:

The null hypothesis formally tests if the population
the sample represents is normally-distributed. For
CS, when the normality hypothesis is True, the
distribution of QH will have a mean close to 1.

Information on CS can be found here:

http://www.stata-journal.com/sjpdf.html?articlenum=st0264
http://www.originlab.com/doc/Origin-Help/NormalityTest-Algorithm

Signed-off-by: Thomas Turner <thomastdt@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoswresample/resample: use uniform normalization
Muhammad Faiz [Wed, 1 Mar 2017 15:18:36 +0000 (22:18 +0700)]
swresample/resample: use uniform normalization

this gives better frequency response

update swresample fate and other fates
that depend on resampling

Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
7 years agoRevert "lavu/atomic: add support for the new memory model aware gcc built-ins"
James Almer [Tue, 7 Mar 2017 03:23:07 +0000 (00:23 -0300)]
Revert "lavu/atomic: add support for the new memory model aware gcc built-ins"

This reverts commit faa9d2982969c999ab0e443a226eff116f7f8e4b.

This change became superfluous when support for C11 atomics was introduced.
Reverting it will make the removal of this implementation in an upcoming
merge conflict free.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
7 years agolsws/slice: Move a misplaced const.
Carl Eugen Hoyos [Sun, 26 Feb 2017 10:18:25 +0000 (11:18 +0100)]
lsws/slice: Move a misplaced const.

Fixes a gcc warning:
libswscale/slice.c:178:56: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]

7 years agolsws/input: Do not define unused functions.
Carl Eugen Hoyos [Tue, 7 Mar 2017 08:28:00 +0000 (09:28 +0100)]
lsws/input: Do not define unused functions.

Fixes warnings like the following:
libswscale/input.c:951:13: warning: ‘planar_rgb14be_to_a’ defined but not used

7 years agolavc/libx265: Add gray10 and gray12 encoding support.
Carl Eugen Hoyos [Tue, 7 Mar 2017 23:25:33 +0000 (00:25 +0100)]
lavc/libx265: Add gray10 and gray12 encoding support.

7 years agomatroskadec: cosmetics: Rearrange checks for projection-depedendent properties
Vittorio Giovara [Tue, 7 Mar 2017 22:34:32 +0000 (17:34 -0500)]
matroskadec: cosmetics: Rearrange checks for projection-depedendent properties

7 years agomov: Fix checking layout and loading padding for cubemaps
Vittorio Giovara [Tue, 7 Mar 2017 22:29:52 +0000 (17:29 -0500)]
mov: Fix checking layout and loading padding for cubemaps

7 years agoavcodec/vp8: Check for the bitstream end per MB in decode_mb_row_no_filter()
Michael Niedermayer [Tue, 7 Mar 2017 18:09:39 +0000 (19:09 +0100)]
avcodec/vp8: Check for the bitstream end per MB in decode_mb_row_no_filter()

Fixes: timeout in 730/clusterfuzz-testcase-5265113739165696 (part 2 of 2)

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/vp568: Check that there is enough data for ff_vp56_init_range_decoder()
Michael Niedermayer [Tue, 7 Mar 2017 18:09:38 +0000 (19:09 +0100)]
avcodec/vp568: Check that there is enough data for ff_vp56_init_range_decoder()

Fixes: timeout in 730/clusterfuzz-testcase-5265113739165696 (part 1 of 2)

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: BBB
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agoavcodec/vp8: remove redundant check
Michael Niedermayer [Mon, 6 Mar 2017 23:53:52 +0000 (00:53 +0100)]
avcodec/vp8: remove redundant check

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
7 years agomkv: Export bounds and padding from spherical metadata
Vittorio Giovara [Fri, 10 Feb 2017 21:02:22 +0000 (16:02 -0500)]
mkv: Export bounds and padding from spherical metadata

Update the fate test as needed.