Compare commits

...

631 Commits

Author SHA1 Message Date
Michael Niedermayer
9f09bfe681 Update for 2.2.11
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:27:19 +01:00
Michael Niedermayer
7390c2629d avcodec/motion_est: use 2x8x8 for interlaced qpel
Fixes out of array read
Fixes Ticket4121

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b50e003e1cb6a215df44ffa3354603bf600b4aa3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Stypa
3d9860f68a fix Makefile objects for pulseaudio support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb58c771ade66afcc623250e1c7ac8191381d991)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
4fde30ba9d 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>
(cherry picked from commit ea38e5a6b75706477898eb1e6582d667dbb9946c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
a06432b6c3 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>
(cherry picked from commit 1d3a3b9f8907625b361420d48fe05716859620ff)

Conflicts:

	libavcodec/rawdec.c
2014-12-08 19:08:30 +01:00
Michael Niedermayer
d7470271c7 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>
(cherry picked from commit 79ceaf827be0b070675d4cd0a55c3386542defd8)

Conflicts:

	libavcodec/pngdec.c
2014-12-08 19:08:30 +01:00
Michael Niedermayer
d41010b895 avcodec/flacdec: Call ff_flacdsp_init() unconditionally
Fixes out of array access
Fixes: signal_sigsegv_324b135_3398_cov_246853371_short.flac
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e5c01ccdf5a9a330d4c51a9b9ea721fd8f1fb70b)

Conflicts:

	libavcodec/flacdec.c
2014-12-08 19:08:30 +01:00
Michael Niedermayer
a63941eec2 avcodec/utils: Check that the data is complete in avpriv_bprint_to_extradata()
Fixes out of array read
Fixes: asan_heap-oob_4d2250_814_cov_2745172097_JACOsub_capability_tester.jss
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3d5d95db3f5d8e2093e9e19d0c46e86f54ed2a5d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
5d6f8bab02 avcodec/mjpegdec: Fix context fields becoming inconsistent
Fixes out of array access
Fixes: asan_heap-oob_1ca4f85_2760_cov_144449187_miss_congeniality_pegasus_ljpg.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0eecf40935b22644e6cd74c586057237ecfd6844)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
de7671e4c4 swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
This avoids out of array accesses
Should fix Ticket3451

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4388e78a0f022c8572996f9ab568a39b5f716f9d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
217f781adc avformat/hlsenc: Free context after hls_append_segment
Fixes reading uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 530eb6acf8ee867bf00728bf7efaf505da107e17)

Conflicts:

	libavformat/hlsenc.c
(cherry picked from commit 0ac22f043bee2f1c4daf5e1044b014326325d929)

Conflicts:

	libavformat/hlsenc.c
(cherry picked from commit 134d3e1c0331462ea94c78a5e13a63b20d283653)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Lukasz Marek
9440079216 lavu/opt: fix av_opt_get function
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
(cherry picked from commit 173d51c982f1ecaa8d28cd0d8611164be0c9d36d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
d054ec868d avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
Fixes out of array read
Fixes: asan_heap-oob_2aec5b0_1828_classical_22_16_2_16000_v3c_0_exclusive_0_29.wma
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5dcb99033df16eccc4dbbc4a099ad64457f9f090)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
4d8b82160d avcodec/utvideodec: fix assumtation that slice_height >= 1
Fixes out of array read
Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7656c4c6e66f8a787d384f027ad824cc1677fda1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
84fdfcab99 avcodec/options_table fix min of audio channels and sample rate
Found-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 206c98f303e833c9e94427c9e3f9867f85265f78)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Carl Eugen Hoyos
cd01611d7b lavc/utils: Make pix_fmt desc pointer const.
Fixes an "initialization discards qualifiers from pointer target type" warning.
(cherry picked from commit f05855414ed4cce97c06ba2a31f4987af47e6d4e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 19:08:30 +01:00
Michael Niedermayer
8b8d794800 avcodec/h264_slice: Clear table pointers to avoid stale pointers
Might fix Ticket3889

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 547fce95858ef83f8c25ae347e3ae3b8ba437fd9)

Conflicts:

	libavcodec/h264_slice.c
2014-12-08 19:08:30 +01:00
wm4
9a02be3122 avformat/matroskadec: fix handling of recursive SeekHead elements
When matroska_execute_seekhead() is called, it goes through the list of
seekhead entries and attempts to read elements not read yet. When doing
this, the parser can find further SeekHead elements, and will extend the
matroska->seekhead list. This can lead to a (practically) infinite loop
with certain broken files. (Maybe it can happen even with valid files.
The demuxer doesn't seem to check correctly whether an element has
already been read.)

Fix this by ignoring elements that were added to the seekhead field
during executing seekhead entries.

This does not fix the possible situation when multiple SeekHead elements
after the file header (i.e. occur after the "before_pos" file position)
point to the same elements. These elements will probably be parsed
multiple times, likely leading to bugs.

Fixes ticket #4162.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6551acab6877addae815decd02aeca33ba4990c8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-07 23:04:33 +01:00
Michael Niedermayer
223ae2467e swscale/x86/rgb2rgb_template: fix crash with tiny size and nv12 output
Fixes Ticket4151

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8524558858b7e14bc50afa10233e0194f591ab9d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 20:39:03 +01:00
Michael Niedermayer
9e65065080 avformat/rmdec: Check codec_data_size
Fixes infinite loop
Fixes Ticket4154

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a6f730730b82645a9d31aad0968487cb77d6946c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-03 20:07:56 +01:00
Michael Niedermayer
5111c78eab Merge commit 'd1c2f86b21b96c27fac200209f52c98dcb2b3194' into release/2.2
* commit 'd1c2f86b21b96c27fac200209f52c98dcb2b3194':
  Replace lena.pnm

Conflicts:
	tests/Makefile
	tests/ref/seek/vsynth2-ffv1
	tests/ref/seek/vsynth2-flv
	tests/ref/seek/vsynth2-h261
	tests/ref/seek/vsynth2-h263
	tests/ref/seek/vsynth2-h263p
	tests/ref/seek/vsynth2-ljpeg
	tests/ref/seek/vsynth2-mjpeg
	tests/ref/seek/vsynth2-mpeg1
	tests/ref/seek/vsynth2-mpeg1b
	tests/ref/seek/vsynth2-mpeg2-422
	tests/ref/seek/vsynth2-mpeg2-idct-int
	tests/ref/seek/vsynth2-mpeg2-ilace
	tests/ref/seek/vsynth2-mpeg2-ivlc-qprd
	tests/ref/seek/vsynth2-mpeg2-thread
	tests/ref/seek/vsynth2-mpeg2-thread-ivlc
	tests/ref/seek/vsynth2-mpeg4
	tests/ref/seek/vsynth2-mpeg4-adap
	tests/ref/seek/vsynth2-mpeg4-error
	tests/ref/seek/vsynth2-mpeg4-nr
	tests/ref/seek/vsynth2-mpeg4-qpel
	tests/ref/seek/vsynth2-mpeg4-qprd
	tests/ref/seek/vsynth2-mpeg4-rc
	tests/ref/seek/vsynth2-mpeg4-thread
	tests/ref/seek/vsynth2-msmpeg4
	tests/ref/seek/vsynth2-msmpeg4v2
	tests/ref/seek/vsynth2-rv10
	tests/ref/seek/vsynth2-rv20
	tests/ref/seek/vsynth2-svq1
	tests/ref/seek/vsynth2-wmv1
	tests/ref/seek/vsynth2-wmv2
	tests/ref/vsynth/vsynth2-cljr
	tests/ref/vsynth/vsynth2-dnxhd-1080i
	tests/ref/vsynth/vsynth2-dnxhd-720p
	tests/ref/vsynth/vsynth2-dnxhd-720p-10bit
	tests/ref/vsynth/vsynth2-dnxhd-720p-rd
	tests/ref/vsynth/vsynth2-dv
	tests/ref/vsynth/vsynth2-dv-411
	tests/ref/vsynth/vsynth2-dv-50
	tests/ref/vsynth/vsynth2-ffv1
	tests/ref/vsynth/vsynth2-ffvhuff
	tests/ref/vsynth/vsynth2-flashsv
	tests/ref/vsynth/vsynth2-flv
	tests/ref/vsynth/vsynth2-h261
	tests/ref/vsynth/vsynth2-h263
	tests/ref/vsynth/vsynth2-h263-obmc
	tests/ref/vsynth/vsynth2-h263p
	tests/ref/vsynth/vsynth2-huffyuv
	tests/ref/vsynth/vsynth2-jpegls
	tests/ref/vsynth/vsynth2-ljpeg
	tests/ref/vsynth/vsynth2-mjpeg
	tests/ref/vsynth/vsynth2-mpeg1
	tests/ref/vsynth/vsynth2-mpeg1b
	tests/ref/vsynth/vsynth2-mpeg2
	tests/ref/vsynth/vsynth2-mpeg2-422
	tests/ref/vsynth/vsynth2-mpeg2-ilace
	tests/ref/vsynth/vsynth2-mpeg2-thread
	tests/ref/vsynth/vsynth2-mpeg2-thread-ivlc
	tests/ref/vsynth/vsynth2-mpeg4
	tests/ref/vsynth/vsynth2-mpeg4-adap
	tests/ref/vsynth/vsynth2-mpeg4-error
	tests/ref/vsynth/vsynth2-mpeg4-nr
	tests/ref/vsynth/vsynth2-mpeg4-qpel
	tests/ref/vsynth/vsynth2-mpeg4-qprd
	tests/ref/vsynth/vsynth2-mpeg4-rc
	tests/ref/vsynth/vsynth2-mpeg4-thread
	tests/ref/vsynth/vsynth2-msmpeg4
	tests/ref/vsynth/vsynth2-msmpeg4v2
	tests/ref/vsynth/vsynth2-prores
	tests/ref/vsynth/vsynth2-qtrle
	tests/ref/vsynth/vsynth2-rgb
	tests/ref/vsynth/vsynth2-rv10
	tests/ref/vsynth/vsynth2-rv20
	tests/ref/vsynth/vsynth2-svq1
	tests/ref/vsynth/vsynth2-wmv1
	tests/ref/vsynth/vsynth2-wmv2
	tests/ref/vsynth/vsynth2-yuv

See: c4abee734dcbdb589925dd6da98041dcf663ce49
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 14:46:51 +01:00
Andreas Cadhalpun
394d3c937a Remove non-free tests/lena.pnm and adapt FATE tests to depend on lena.pnm in the SAMPLES directory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4abee734dcbdb589925dd6da98041dcf663ce49)

Conflicts:

	tests/fate/vcodec.mak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 14:17:39 +01:00
Michael Niedermayer
afcd152b97 Merge commit '2bcd8f22f2fae253d87b11a5c9f8805d79253180' into release/2.2
* commit '2bcd8f22f2fae253d87b11a5c9f8805d79253180':
  Treat all '*.pnm' files as non-text file

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 14:14:39 +01:00
Michael Niedermayer
dad7beaceb avutil/buffer_internal: leave the buffer pool entries volatile
Theres no reason to remove the volatile keyword in a release branch

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0e216ed40789e382eb6725d1cd0941927bfd1400)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:50:46 +01:00
Michael Niedermayer
93360af0d7 avutil/buffer: use the old atomics based code for the release branch
the old code worked fine for a long time and was not affected by
the bug the new code fixes and the new is not widely tested yet.
This can be reverted once the code received more testing in
master

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f783259fdb37e288643fe54ac162d723b1bec548)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:50:29 +01:00
Michael Niedermayer
4ed83378bf Merge commit 'c790e31ae46d4304af893d04806ec9e3bff5ae28' into release/2.2
* commit 'c790e31ae46d4304af893d04806ec9e3bff5ae28':
  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>
2014-12-02 13:48:18 +01:00
Dave Yeo
1579f14632 libavutil/threads.h: correct an include to be local
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32eadfe453c32788ea57968e6e80f673f434739d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:37:37 +01:00
Dave Yeo
7394e53f30 libavutil/thread.h: Support OS/2 threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 090a7801a8817c1fbc6db0ed39070bf82255d8f2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:37:32 +01:00
Michael Niedermayer
9bbed55b10 Merge commit '7fe5d0a78df537542732aa7bd45962f7505255d0' into release/2.2
* commit '7fe5d0a78df537542732aa7bd45962f7505255d0':
  lavu: add wrappers for the pthreads mutex API

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:36:31 +01:00
Michael Niedermayer
9181faab68 Merge commit '871d99ef77336069e5a8ece947c8160d9bc4d5ea' into release/2.2
* commit '871d99ef77336069e5a8ece947c8160d9bc4d5ea':
  mp3enc: fix a triggerable assert

Conflicts:
	libavformat/mp3enc.c

No change, the faulty assert was not in FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 13:14:06 +01:00
Reinhard Tartler
d1c2f86b21 Replace lena.pnm
The new reference.pnm is a freely licensed replacement. The photo has
been taken by Reinhard Tartler on August 28 2014, and is licensed under
the expat license as stated at http://www.jclark.com/xml/copying.txt

(cherry picked from commit e38231007e19e5f27b0e77e72bcd26fb3d76edfb)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-12-01 17:43:32 -08:00
Reinhard Tartler
2bcd8f22f2 Treat all '*.pnm' files as non-text file
This convinces the pre-receive hook to not consider all *.pnm files as
text files to reduce the patch sizes and avoids triggering whitespace
checks,

Contains a correction by Janne Grunau <janne-libav@jannau.net>

(cherry picked from commit b877814e09b9f25308ec205cf48bb9554b33e95c)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-12-01 17:36:05 -08:00
wm4
c790e31ae4 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>
(cherry picked from commit fbd6c97f9ca858140df16dd07200ea0d4bdc1a83)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 517ce1d09b5e6b72afc2ef9490b5f8ca42fa6a65)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:45:36 +01:00
Anton Khirnov
7fe5d0a78d 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>.

(cherry picked from commit 2443e522f0059176ff8717c9c753eb6fe7e7bbf1)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 46a17d886b8559723c40b9f5cdf0e0c6b1c95180)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-27 13:45:28 +01:00
Michael Niedermayer
bf219a564c avformat/avidec: fix handling dv in avi
Fixes Ticket4086

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0ae0354d3f04c369257c2a28557524d28c5df15)
2014-11-21 10:01:31 +01:00
Anton Khirnov
871d99ef77 mp3enc: fix a triggerable assert
We have to check against the number of bytes actually needed, not the
theoretical maximum size.

(cherry picked from commit 12700b0219521a5f20c8ba47b3ad7857ea9e0554)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-11-15 08:46:48 +01:00
Michael Niedermayer
418e9a6113 Revert "v4l2: setting device parameters early"
This reverts commit b1ad9312331759679a9c956233716a67ae681d89.

Fixes Ticket #3517

Requested-by: Giorgio Vazzana <mywing81@gmail.com>
Merged-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f21fb793238ab6a790b94b86084148d99373ddf)

Conflicts:
	libavdevice/v4l2.c
2014-11-08 14:27:14 +01:00
Michael Niedermayer
e25e0903ab avcodec/mpegaudio_parser: fix off by 1 error in bitrate calculation
Fixes Ticket3918

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 817663897e59f45f60016fa9d3d16e325b803967)
2014-11-06 01:10:12 +01:00
Michael Niedermayer
969aee07e6 avcodec/h264_parser: rewrite the parse_nal_units() loop logic based on h264.c
Fixes Ticket4011

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 69a9a90d2ef795162074be24e3ad2182a8676af2)

Conflicts:

	libavcodec/h264_parser.c
2014-11-01 18:27:12 +01:00
Michael Niedermayer
76587eea64 avcodec/h264: simplify find_start_code()
this also uses avpriv_find_start_code(), though no speed change is expected as
the area searched is generally small

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3b678da5e386c138316954e867d595f946666051)

Conflicts:

	libavcodec/h264.h
2014-11-01 18:26:22 +01:00
Michael Niedermayer
667fe8c75b Move get_avc_nalsize() and find_start_code() to h264.h
This allows sharing them with the h264 parser

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4898440f6bd19152373969159fff057b532c6374)

Conflicts:

	libavcodec/h264.c
	libavcodec/h264.h
2014-11-01 18:25:47 +01:00
Michael Niedermayer
64624c5678 avformat/matroskadec: do not trust the default duration to be the real 1/timebase if its less than 5fps
Fixes Ticket3980

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be695ee389724d713e1b8a61ef899fe1795193ce)
2014-11-01 16:12:52 +01:00
Michael Niedermayer
114e4b970e avformat/mp3dec: Improve seeking frame sync code
Fixes Ticket3884

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1b5ccae0f2045ac86bc9e1257cec1b3fba81315f)
2014-11-01 16:12:52 +01:00
Michael Niedermayer
c9659dfd29 avformat/mpeg: increase score for short mpeg-ps by 1
Fixes Ticket 3855

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5109ce2017c15202275b33bce58ec9d88044eeb5)

Conflicts:
	libavformat/mpeg.c
2014-11-01 16:12:52 +01:00
Michael Niedermayer
41ee9a4495 update for 2.2.10
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 16:01:28 +01:00
Michael Niedermayer
e812a089f5 avcodec/svq3: Dont memcpy AVFrame
This avoids out of array accesses

Fixes: asan_heap-uaf_21f42e4_9_asan_heap-uaf_21f42e4_278_gl2.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 075a165d2715837d125a9cc714fb430ccf6c9d6b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:51:16 +01:00
Michael Niedermayer
9b8b35910f avcodec/svq1dec: zero terminate embedded message before printing
Fixes out of array access
Fixes: asan_stack-oob_49b1e5_10_009.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e91ba2efa949470e9157b652535d207a101f91e0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
f00ec3307b avcodec/cook: check that the subpacket sizes fit in block_align
Fixes out of array read
Fixes: asan_heap-oob_fb5c50_19_018.rmvb
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 10e32618acce9c3fc64c061eb7907e8a8d2749ae)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
f6499563c3 avcodec/g2meet: check tile dimensions to avoid integer overflow
Fixes out of array access
Fixes: asan_heap-oob_12a55d3_30_029.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32e666c354e4a3160d8cf1d303cb51990b095c87)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
16a4aef345 avcodec/utils: Align dimensions by at least their chroma sub-sampling factors.
Fixes: out of array accesses
Fixes: asan_heap-oob_112c6b3_13_012.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit df74811cd53e45fcbbd3b77a1c42416816687c5c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
6352153811 avcodec/dnxhddec: treat pix_fmt like width/height
Fixes out of array accesses
Fixes: asan_heap-oob_22c9a39_16_015.mxf
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3c0e0bf6f53df0977f3878d4f5cec99dff8de9e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
557e8bd589 avcodec/dxa: check dimensions
Fixes out of array access
Fixes: asan_heap-oob_11222fb_21_020.dxa
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e70312dfc22c4e54d5716f28f28db8f99c74cc90)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
45361d8aa3 avcodec/dirac_arith: fix integer overflow
Fixes: asan_heap-oob_1078676_9_008.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 39680caceebfc6abf09b17032048752c014e57a8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
81e1b5f5fe avcodec/diracdec: Tighter checks on CODEBLOCKS_X/Y
Fixes very long but finite loop
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5145d22b88b9835db81c4d286b931a78e08ab76a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
6505eb45bc avcodec/diracdec: Use 64bit in calculation of codeblock coordinates
Fixes integer overflow
Fixes out of array read
Fixes: asan_heap-oob_107866c_42_041.drc
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 526886e6069636a918c8c04db17e864e3d8151c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
17f0581e0d postproc: fix qp count
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0b7e5d0d75e7d8762dd04d35f8c0821736164372)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
13b7962aae postproc/postprocess: fix quant store for fq mode
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 941aaa39e8cd78ba4d16dfcec767290aec9a0136)

Conflicts:

	tests/ref/fate/filter-pp3
2014-11-01 15:40:38 +01:00
Christophe Gisquet
aa40f11b81 utvideoenc: properly set slice height/last line
Mimic decoder and obey sampling.

Does not affect fate tests for utvideo.
Fixes ticket #3949.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb530dda7d76790b08ee3b7f67e251f3ce48c359)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:40:38 +01:00
Michael Niedermayer
3bb4c3e74d Merge commit '72ed4166a64714952777fb028b546a52e5b4e2c2' into release/2.2
* commit '72ed4166a64714952777fb028b546a52e5b4e2c2':
  resample: Avoid off-by-1 errors in PTS calcs.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:26:51 +01:00
Michael Niedermayer
7ac50d846c Merge commit '787a6156a2d887bb1d65c1233a94a61741e7af7c' into release/2.2
* commit '787a6156a2d887bb1d65c1233a94a61741e7af7c':
  imc: fix order of operations in coefficients read

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:26:20 +01:00
Michael Niedermayer
0f4c03cd63 Merge commit '0989a120f1dec400c54fcb54670cb84bba36d99b' into release/2.2
* commit '0989a120f1dec400c54fcb54670cb84bba36d99b':
  mpeg12: Always invoke the get_format() callback

Conflicts:
	libavcodec/mpeg12dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:25:42 +01:00
Michael Niedermayer
2d1d053c5d Merge commit 'c7caed88a03567e8777a606f4bd42f093c6b302c' into release/2.2
* commit 'c7caed88a03567e8777a606f4bd42f093c6b302c':
  h264: Always invoke the get_format() callback

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 15:08:51 +01:00
Timothy B. Terriberry
72ed4166a6 resample: Avoid off-by-1 errors in PTS calcs.
The rounding used in the PTS calculations in filter_frame() does
not actually match the number of samples output by the resampler.
This leads to off-by-1 errors in the timestamps indicating gaps and
underruns, even when the input timestamps are all contiguous.

Bug-Id: 753

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 6cbbf0592f4f3940aac7f687850d1b726a2ea836)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit ca8c62d187fdca13979379fb2ab172ed662aa2f8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-18 05:15:48 +02:00
Vittorio Giovara
787a6156a2 imc: fix order of operations in coefficients read
Reported-by: Ruoyu <liangry@ucweb.com>
2014-10-15 14:54:20 +01:00
Michael Niedermayer
b05d355040 Update for 2.2.9
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 03:47:59 +02:00
James Almer
f253fa9552 x86/synth_filter: add missing HAVE_YASM guard
Should fix compilation failures with --disable-yasm on some compilers

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 206167a295a5c28cec3c38f7308835b0b7e0618f)

Conflicts:

	libavcodec/x86/dcadsp_init.c
2014-10-06 01:50:01 +02:00
Michael Niedermayer
a28c276b8d swresample/swresample: fix sample drop loop end condition
Fixes Ticket3985

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f9fefa499f0af48f47ea73c8ce0b25df0976c315)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-06 01:31:18 +02:00
Michael Niedermayer
26da47a09b avcodec/h264: Check mode before considering mixed mode intra prediction
Fixes out of array read
Fixes: asan_heap-oob_e476fc_2_asan_heap-oob_1333ec6_61_CAMACI3_Sony_C.jsv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9734a7a1de3043f012ad0f1ef11027d9488067e6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:09 +02:00
Michael Niedermayer
23fdcd3b0a avformat/mpegts: Check desc_len / get8() return code
Fixes out of array read
Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c3d7f00ee3e09801f56f25db8b5961f25e842bd2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:08 +02:00
Michael Niedermayer
653329dfcb avcodec/vorbisdec: Fix off by 1 error in ptns_to_read
Fixes read of uninitialized memory
Fixes: asan_heap-uaf_18dac2b_9_asan_heap-uaf_22eb375_208_beta3_test_small.ogg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8c50704ebf1777bee76772c4835d9760b3721057)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:22:08 +02:00
Michael Niedermayer
b0964918d8 avcodec/smc: fix off by 1 error
Fixes out of array access
Fixes: asan_heap-oob_1685bf0_5_asan_heap-oob_1f35116_430_smc.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c727401aa9d62335e89d118a5b4e202edf39d905)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
d8fda618d0 avcodec/qpeg: fix off by 1 error in MV bounds check
Fixes out of array access
Fixes: asan_heap-oob_153760f_4_asan_heap-oob_1d7a4cf_164_VWbig6.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dd3bfe3cc1ca26d0fff3a3baf61a40207032143f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
43881c7732 avcodec/gifdec: factorize interleave end handling out
also change it to a loop
Fixes out of array access
Fixes: asan_heap-oob_ca5410_8_asan_heap-oob_ca5410_97_ID_LSD_Size_Less_Then_Data_Inter_3.gif

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f1457864be8fb9653643519dea1c6492f1dde57)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
42bdcebf33 avcodec/cinepak: fix integer underflow
Fixes out of array access
Fixes: asan_heap-oob_4da0ba_6_asan_heap-oob_4da0ba_241_cvid_crash.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e7e5114c506957f40aafd794e06de1a7e341e9d5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
d1e71ecbb0 avcodec/pngdec: Calculate MPNG bytewidth more defensively
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e830902934a29df05c7af65aef2a480b15f572c4)

Conflicts:

	libavcodec/pngdec.c
2014-10-05 14:20:32 +02:00
Michael Niedermayer
64be1a45eb avcodec/pngdec: Check bits per pixel before setting monoblack pixel format
Fixes out of array accesses
Fixes: asan_heap-oob_14dbfcf_4_asan_heap-oob_1ce5767_179_add_method_small.png

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3e2b745020c2dbf0201fe7df3dad9e7e0b2e1bb6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
f8bd98ae4d avcodec/tiff: more completely check bpp/bppcount
Fixes pixel format selection
Fixes out of array accesses
Fixes: asan_heap-oob_1766029_6_asan_heap-oob_20aa045_332_cov_1823216757_m2-d1d366d7965db766c19a66c7a2ccbb6b.tif

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e1c0cfaa419aa5d320540d5a1b3f8fd9b82ab7e5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
f2c6e2c3b4 avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
Fixes out of array access
Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
8acfae6901 avcodec/h263dec: Fix decoding messenger.h263
Fixes http://samples.mplayerhq.hu/V-codecs/h263/h263-raw/messenger.h263
Fixes regression since b239f3f6

Found-by: Josh Allmann
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d225b0f7aaa65eafccc87165130e1c4bab71708b)

Conflicts:

	libavcodec/h263dec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
e5ccd894d1 avcodec/utils: Add case for jv to avcodec_align_dimensions2()
Fixes out of array accesses
Fixes: asan_heap-oob_12304aa_8_asan_heap-oob_4da4f3_300_intro.jv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 105654e376a736d243aef4a1d121abebce912e6b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
6287107eae avcodec/mjpegdec: check bits per pixel for changes similar to dimensions
Fixes out of array accesses
Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5c378d6a6df8243f06c87962b873bd563e58cd39)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
53330b30fd avcodec/jpeglsdec: Check run value more completely in ls_decode_line()
previously it could have been by 1 too large
Fixes out of array access
Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8c1e3.jls
Fixes: asan_heap-oob_12240f5_1_asan_heap-oob_12240f5_448_t8nde0.jls
Fixes: asan_heap-oob_12240fa_1_asan_heap-oob_12240fa_448_t16e3.jls

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 06e7d58410a17dc72c30ee7f3145fcacc425f4f2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Reimar Döffinger
9726c1a5f8 configure: add noexecstack to linker options if supported.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
(cherry picked from commit b7082d953fda93f7841ffffe7d15a6c3cd15bdee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Michael Niedermayer
f1dd343007 avcodec/ac3enc_template: fix out of array read
Found-by: Andreas Cadhalpun
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d85ebea3f3b68ebccfe308fa839fc30fa634e4de)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
lvqcl
be894938c4 avutil/x86/cpu: fix cpuid sub-leaf selection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e58fc44649d07d523fcd17aa10d9eb0d3a5ef3f4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Philip DeCamp
fe0fd3de22 libavutil/opt: fix av_opt_set_channel_layout() to access correct memory address
Signed-off-by: Philip DeCamp <decamp@mit.edu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 857fc0a71f1b52fbba3281ba64b5a35195458622)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Benoit Fouet
fe12b3a7a6 avformat/riffenc: Filter out "BottomUp" in ff_put_bmp_header()
Fixes Ticket1304

Commit message and extradata size bugfix by commiter
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6843b9dc78bc966bb30121828ef4f6b6755cf877)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Pascal Massimino
a1605af9b5 avcodec/webp: fix default palette color 0xff000000 -> 0x00000000
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e5b3112996c3da45aa03b39c5ade375d40d4407d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:32 +02:00
Gianluigi Tiesi
b0937dd61d avcodec/libilbc: support for latest git of libilbc
in the latest git commits of libilbc developers removed WebRtc_xxx typedefs

This commit uses int types instead,
it's safe to apply also for previous versions since
WebRtc_Word16 was always a typedef of int16_t and
WebRtc_UWord16 a typedef of uint16_t

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59af5383c18c8cf3fe2a4b5cc1ebf2f3300bdfe5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 14:20:31 +02:00
Michael Niedermayer
ac0dea5dd7 Merge commit 'f13f5a7d4b6c57a11c63ba5e4f972f0bff5f306a' into release/2.2
* commit 'f13f5a7d4b6c57a11c63ba5e4f972f0bff5f306a':
  Add some bug references to the changelog

Conflicts:
	Changelog

no changes as this does not match FFmpeg releases

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-05 13:48:33 +02:00
Rémi Denis-Courmont
0989a120f1 mpeg12: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-27 15:49:06 +02:00
Rémi Denis-Courmont
c7caed88a0 h264: Always invoke the get_format() callback
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-27 15:49:06 +02:00
Michael Niedermayer
5df02760dd update for 2.2.8
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-21 01:18:16 +02:00
Michael Niedermayer
014dee89d0 avcodec: fix aac/ac3 parser bitstream buffer size
Buffers containing copies of the AAC and AC3 header bits were not padded
before parsing, violating init_get_bits() buffer padding requirement,
leading to potential buffer read overflows.
This change adds FF_INPUT_BUFFER_PADDING_SIZE bytes to the bit buffer
for parsing the header in each of aac_parser.c and ac3_parser.c.

Based on patch by: Matt Wolenetz <wolenetz@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fccd85b9f30525f88692f53134eba41f1f2d90db)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Christophe Gisquet
da1a8191c5 wavpackenc: proper buffer allocation
The allocation didn't account for headers, that can be easily 79 bytes.
As a result, buffers allocated for a few samples (e.g. 5 in the original
bug) could be undersized.

Fixed ticket #2881.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2ba58bec20b0039ccc40cfba59af6d56de16e8b1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Christophe Gisquet
dd9b24a488 wavpack: report if there is no bits left
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 11a39bdf534a4ead634b4a593c66ebf756910b9b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
James Almer
16b5df17ea x86/dsputil: add emms to ff_scalarproduct_int16_mmxext()
Also undo the changes to ra144enc.c from previous commits.
Should fix ticket #3429

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9e0e1f9067430de1655a7b28536b5afed48bded5)

Conflicts:

	libavcodec/ra144enc.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Pascal Massimino
99af97ea11 libavcodec/webp: treat out-of-bound palette index as translucent black
See https://code.google.com/p/webp/issues/detail?id=206
for a description of the problem/fix.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

This patch makes the decoder follow the recommendation of the spec.
There is some disagreement (see "[FFmpeg-devel] [PATCH]: libavcodec/webp")
about what would be best to be written in the spec, so in case the spec
is changed again, this potentially would need to be amended or reverted
(cherry picked from commit 4fd21d58a72c38ab63c3a4483b420db260fa7b8d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
6c66ea5e73 avcodec/x86/vp9lpf: Always include x86util.asm
Fixes executable stack

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 41d82b85ab0ee8bb2931c1f783e30c38c2fb5206)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
252356cf06 tools/crypto_bench: fix build when AV_READ_TIME is unavailable
Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4a99134f1a71994a0dc4542a0d6bee8e36146b60)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
56fb830c30 avformat/m4vdec: Check for non startcode 00 00 00 sequences in probe
Fixes miss detection of PCM as m4v
Fixes Ticket 3928

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7c1835c52a4be2e4e996f83c91a8d5a147b01100)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
d19b55649c avcodec/mpegvideo: Set err on failure in ff_mpv_common_frame_size_change()
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cfce6f7efd28130bf0dd409b2367ca0f8c9b2417)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
fd6230e8f0 avcodec/mpegvideo: check that the context is initialized in ff_mpv_common_frame_size_change()
The function otherwise would initialize the context without setting context_initialized
alternatively we could set context_initialized

Fixes valgrind anomalies related to ticket 3928

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0d0f7f0ba43f64312ae4a05d97afecf1b7b1330c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
9406d3c910 avcodec/mpegvideo: Use "goto fail" for all error paths in ff_mpv_common_frame_size_change()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2762323c37511fbbc98b164c07620b9ebc59ec68)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
9e1ce9a8ee avcodec/h264: Allow partial escaping
Fixes Ticket3923

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 033a5334badd8af48f13c6fd1e6827f8e3f2c2f3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
b4d2888ce8 avformat/swfdec: Do not change the pixel format
This is currently not supported
Fixes part of Ticket 3539

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2430304dfb3cc0e3a59ce6d1b59ebdcc934a0c2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:33 +02:00
Michael Niedermayer
b3f30cb6d6 avformat/swfdec: Use side data to communicate w/h changes to the decoder
Fixes reading from freed data
Fixes part of Ticket3539

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c55d0ff3202a04ebc67a72d72391104e9bdb633)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a9734e7d3017ffc9539eaac2a8acce3ad427f746)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
Mika Raento
0484d7ad7e segment: don't access outside seg->frames array
Fixes wrong number of segments output and undefined memory access.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 58e0402e02ae5e466c33b9465c1465fdee68d342)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
Mark Harris
85b829bff9 doc/filters.texi: fix filter name in examples
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1b3a98f137900b6c3eb9a4c177d0b25684d6d144)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
wm4
f1685bd31a oggdec: fix invalid free on error
The read_packet callback passes a pointer to a stack-allocated AVPacket.
Attempting to free it with av_free() makes no sense.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b173f5c15572cc82f68128599722e689df4ff137)

Conflicts:

	libavformat/oggdec.c
2014-09-20 18:40:32 +02:00
Michael Niedermayer
8d10d6e127 avcodec/snow: check coeffs for validity
Fixes deadlock
Fixes integer overflow
Fixes Ticket 3892

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 596636a474ab201badaae269f3a2cef4824b8c1f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 18:40:32 +02:00
Michael Niedermayer
f93f739eca avcodec/utils: add GBRP16 to avcodec_align_dimensions2()
Fixes Ticket3869

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3fe9e7be4c70c8fccdcd56fd19276e668cfb7de8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:46:41 +02:00
Michael Niedermayer
1a6218954a avcodec/proresenc_kostya: allocate 1 slice more to avoid triggering the reallocation warning when the used space is actually less than the allocated
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f0e51be8d0273679d379a95de14727b982b9549f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:46:41 +02:00
Michael Niedermayer
1f8e0f7e06 avcodec/proresenc_kostya: set initial max_slice_size based on frame_size_upper_bound
If the initial max_slice_size is 0 then reallocation is disabled for the first
slice.

Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 76a8cb9d7bcc12a8f1cedcb4c23bbb6391a4c56c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:46:41 +02:00
Michael Niedermayer
6dd718e416 Merge commit 'd14696c99ccac12a052ce10e70859ffc0293ed6a' into release/2.2
* commit 'd14696c99ccac12a052ce10e70859ffc0293ed6a':
  apetag: Fix APE tag size check

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 17:42:05 +02:00
Michael Niedermayer
1aab060996 Merge commit 'd0af7d5745f3e228293633faa9e57994f3308c31' into release/2.2
* commit 'd0af7d5745f3e228293633faa9e57994f3308c31':
  Update Changelog for v10.5
  Prepare for 10.5 release

Conflicts:
	Changelog
	RELEASE

no change as FFmpeg releases dont match this

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:49:12 +02:00
Michael Niedermayer
3bc5aa65bb Merge commit '40c7613ecf2f3f7565309f9780183228605c3684' into release/2.2
* commit '40c7613ecf2f3f7565309f9780183228605c3684':
  doc: Fix syntax and logical errors in avconv stream combination example

Conflicts:
	doc/ffmpeg.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:48:28 +02:00
Michael Niedermayer
da1dfea076 Merge commit '1a7d1793d6d2de4201c2d9fc7056e7c9e202c5fe' into release/2.2
* commit '1a7d1793d6d2de4201c2d9fc7056e7c9e202c5fe':
  license: Mention that vf_interlace is GPL, not LGPL

Conflicts:
	LICENSE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:46:53 +02:00
Michael Niedermayer
e940d15a98 Merge commit '9fcc632249be3080836a3afce25b3092939743ac' into release/2.2
* commit '9fcc632249be3080836a3afce25b3092939743ac':
  pulse: Add a wallclock option to be compatible with other other captures

Conflicts:
	libavdevice/pulse_audio_dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:40:54 +02:00
Michael Niedermayer
481118615c ffmpeg_opt: reduce diff to libav in opt_target() by 16 lines
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7a67ab5cba8ed5509be5d058fe9e5612ef39d3b0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:29:47 +02:00
Michael Niedermayer
4b6e46c427 Merge commit 'f7395926f204051af9ad459a6d876b96ee6179ee' into release/2.2
* commit 'f7395926f204051af9ad459a6d876b96ee6179ee':
  avconv: fix parsing the AVOptions for -target

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:29:23 +02:00
Michael Niedermayer
516ba41f05 Merge commit '7bc37641e3e6c24d472ae06fcbecaba4c863829b' into release/2.2
* commit '7bc37641e3e6c24d472ae06fcbecaba4c863829b':
  avconv: fix the muxrate values for -target

Conflicts:
	ffmpeg_opt.c

No change, as ffmpegs muxrate is in bits/sec

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:28:57 +02:00
Michael Niedermayer
1a642b7217 Merge commit '3ac0638d573fc483ba6be3444858b26711c5d67d' into release/2.2
* commit '3ac0638d573fc483ba6be3444858b26711c5d67d':
  mpegenc: limit the maximum muxrate

Conflicts:
	libavformat/mpegenc.c

See: 28d35dbe9f570025c220c08997bc11e21b3c1a66
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:27:55 +02:00
Michael Niedermayer
58b5b062b8 Merge commit '051ac5c0f51c119b33a57f3e137d7344eb1c2b26' into release/2.2
* commit '051ac5c0f51c119b33a57f3e137d7344eb1c2b26':
  mpegvideo: Use the current_picture pts

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 14:26:15 +02:00
Diego Biurrun
f13f5a7d4b Add some bug references to the changelog 2014-09-17 07:18:39 -07:00
Katerina Barone-Adesi
d14696c99c apetag: Fix APE tag size check
The size variable is (correctly) unsigned, but is passed to several functions
which take signed parameters, such as avio_read, sometimes after having
numbers added to it. So ensure that size remains within the bounds that
these functions can handle.

(cherry picked from commit b45ab61b24a8f2aeafdd4451491b1b30b7875ee5)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-17 07:18:39 -07:00
Diego Biurrun
d0af7d5745 Update Changelog for v10.5 2014-09-10 13:24:18 -07:00
Diego Biurrun
f2abf8df7a Prepare for 10.5 release 2014-09-10 13:24:13 -07:00
Diego Biurrun
40c7613ecf doc: Fix syntax and logical errors in avconv stream combination example
Bug-Id: 661
CC: libav-stable@libav.org
(cherry picked from commit 775a0b04f0cf8102fe322b2ee03fe1a0633dea04)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-10 12:02:24 -07:00
Diego Biurrun
1a7d1793d6 license: Mention that vf_interlace is GPL, not LGPL
(cherry picked from commit 9e8bbe7d4d1dcd5fec491dbfbb98ed2038a7bed5)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-28 10:52:55 -07:00
Luca Barbato
9fcc632249 pulse: Add a wallclock option to be compatible with other other captures
alsa and x11grab use av_gettime() to report timestamps.

Have it on by default.

Bug-Id: 647
(cherry picked from commit 424b929b5cb9ca4094099f25179829260d4b0fa3)
(cherry picked from commit 404731bd20e1df5880e6fe381e975ba48afc75b2)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-28 12:09:53 +02:00
Anton Khirnov
f7395926f2 avconv: fix parsing the AVOptions for -target
CC: libav-stable@libav.org
(cherry picked from commit f5245a9c6206878b892adf3ccbccc9311c202af5)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-27 06:31:05 +00:00
Anton Khirnov
7bc37641e3 avconv: fix the muxrate values for -target
The mpegenc private option values are in 50-byte units.

CC: libav-stable@libav.org
(cherry picked from commit 1688eef25385089026aba55da1885f70a57815ab)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-27 06:31:02 +00:00
Anton Khirnov
3ac0638d57 mpegenc: limit the maximum muxrate
It is written to the file as a 22-bit value.

CC: libav-stable@libav.org
(cherry picked from commit 75bbaf2493a71ee66eaabe3c21fadd84d07888de)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavformat/mpegenc.c
2014-08-27 06:30:52 +00:00
Michael Niedermayer
051ac5c0f5 mpegvideo: Use the current_picture pts
The picture slot can be recycled by select_input_picture and
only current_picture is populated with the valid pts.

Unbreak timestamps when in cbr mode.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 1c7b71a5bdb88ebb69734100405bbb5441b871e8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>

Conflicts:
	libavcodec/mpegvideo_enc.c
2014-08-26 06:33:07 +00:00
Michael Niedermayer
5ac46a0969 Merge commit '37e2d574ddcedc25e32bd963737b033354543789' into release/2.2
* commit '37e2d574ddcedc25e32bd963737b033354543789':
  setpts: Add missing inttypes.h #include for PRId64

Conflicts:
	libavfilter/setpts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 03:15:51 +02:00
Michael Niedermayer
8b55f67e3e Merge commit 'f25f5f8c62ec7728ee7f5dcc8f1abd0dc6235735' into release/2.2
* commit 'f25f5f8c62ec7728ee7f5dcc8f1abd0dc6235735':
  proresenc: Properly account for alpha plane

Conflicts:
	libavcodec/proresenc_kostya.c

See: 1578986a0da41ab417ddddf5964fa192d27b759f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 03:04:37 +02:00
Michael Niedermayer
bb1d75e6c5 Merge commit 'a437298de55c6a6a4f06b12335b3891bf4459082' into release/2.2
* commit 'a437298de55c6a6a4f06b12335b3891bf4459082':
  proresenc: Realloc if buffer is too small

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:58:21 +02:00
Michael Niedermayer
459a84ada3 Merge commit 'e912b0777b24133df27836b6c529faa89af588dc' into release/2.2
* commit 'e912b0777b24133df27836b6c529faa89af588dc':
  proresenc: Report buffer overflow

Conflicts:
	libavcodec/proresenc_kostya.c

See: 1ad1723c24cd2683df6d00a83b6f28d3ff45fb96
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:48:24 +02:00
Michael Niedermayer
35fe089dd9 Merge commit 'b3f48a5044fd04539337e91d28022207c9d3b9e8' into release/2.2
* commit 'b3f48a5044fd04539337e91d28022207c9d3b9e8':
  proresenc: Remove unneeded parameters from encode_alpha_plane()

Conflicts:
	libavcodec/proresenc_kostya.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:45:00 +02:00
Michael Niedermayer
9e6d8c309f Merge commit 'ee9e966296d74ca3836be5b5adc839cfc73d8c98' into release/2.2
* commit 'ee9e966296d74ca3836be5b5adc839cfc73d8c98':
  Update Changelog for v10.4
  Prepare for 10.4 Release

Conflicts:
	Changelog
	RELEASE

Not merged as these dont apply to FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:43:40 +02:00
Michael Niedermayer
afbaf6b367 Merge commit '7788297a59656ececd84f602292bfeb79f7eedd7' into release/2.2
* commit '7788297a59656ececd84f602292bfeb79f7eedd7':
  mpegts: Do not try to write a PMT larger than SECTION_SIZE

Conflicts:
	libavformat/mpegtsenc.c

See: 842b6c14bcfc1c5da1a2d288fd65386eb8c158ad
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:32:04 +02:00
Michael Niedermayer
f1da6691a4 Merge commit '23376ae2f0247ff659724b6a5313639db0c991ad' into release/2.2
* commit '23376ae2f0247ff659724b6a5313639db0c991ad':
  mpegts: Define the section length with a constant

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:17:42 +02:00
Michael Niedermayer
5b1a953960 Merge commit '8231764784a405f546e9c427a6de22d3f4de5c35' into release/2.2
* commit '8231764784a405f546e9c427a6de22d3f4de5c35':
  ffv1dec: check that global parameters do not change in version 0/1

Conflicts:
	libavcodec/ffv1dec.c

See: b05cd1ea7e45a836f7f6071a716c38bb30326e0f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-23 02:16:10 +02:00
Diego Biurrun
37e2d574dd setpts: Add missing inttypes.h #include for PRId64
Also convert a debug av_log() to av_dlog().

(cherry picked from commit a89dd9a72c6e9c3111d6f34d9b08cd624fe76358)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-20 10:07:09 -07:00
Christophe Gisquet
f25f5f8c62 proresenc: Properly account for alpha plane
The packet buffer allocation considers the alpha channel as DCT-coded,
while it is actually run-coded and thus requires a larger buffer.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 41e1354c101004ccd46dc08d3dd6e956e83a6b51)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 19:03:37 +02:00
Christophe Gisquet
a437298de5 proresenc: Realloc if buffer is too small
The buffer allocation may be incorrect (e.g. with an alpha plane),
and currently causes the buffer to be set to NULL by init_put_bits,
causing a crash later on.

So, detect that situation, and if detected, reallocate the buffer
and ask for a sample that shows the problem.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 45ce880a9b3e50cfa088f111dffaf8685bd7bc6b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 19:03:34 +02:00
Christophe Gisquet
e912b0777b proresenc: Report buffer overflow
If the allocated size, despite best efforts, is too small, exit
with the appropriate error.

CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 58b68e4fdea22e22178e237bda950b09cc6f363a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 19:03:30 +02:00
Christophe Gisquet
b3f48a5044 proresenc: Remove unneeded parameters from encode_alpha_plane()
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit b16699f2da9c1d41eff852ec3a0c81f74fd44421)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-18 19:03:22 +02:00
Reinhard Tartler
ee9e966296 Update Changelog for v10.4 2014-08-17 10:23:20 -04:00
Reinhard Tartler
493a92313f Prepare for 10.4 Release 2014-08-17 10:20:00 -04:00
Christophe Gisquet
1578986a0d proresenc_kostya: properly account for alpha
The packet buffer allocation considered as dct-coded, while it is
actually run-coded and thus requires a larger buffer.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 117bc8e6ffc744fedcf77edf2fdb33c964b83370)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 15:44:59 +02:00
Luca Barbato
7788297a59 mpegts: Do not try to write a PMT larger than SECTION_SIZE
Prevent out of array writes.

Similar to what Michael Niedermayer did to address the same issue.

Bug-Id: CVE-2014-2263
CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit e8049af1325dd59a51546c15b2e71a0f578e9d27)

Conflicts:
	libavformat/mpegtsenc.c
2014-08-13 13:57:47 -07:00
Luca Barbato
23376ae2f0 mpegts: Define the section length with a constant
The specification says the value is expressed in 10 bits including
the 4-byte CRC.

(cherry picked from commit 89616408e38ac7257e36976723df0e23d6ee1157)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavformat/mpegtsenc.c
2014-08-13 13:53:20 -07:00
Michael Niedermayer
8231764784 ffv1dec: check that global parameters do not change in version 0/1
Such changes are neither allowed nor supported

Found-by: ami_stuff
Bug-Id: CVE-2013-7020
CC: libav-stable@libav.org
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit da7d839a0d3ec40423a665dc85e0cfaed3f92eb8)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-12 10:34:09 +00:00
Michael Niedermayer
49fa398858 Changelog: add entry for proresenc 2014-08-12 05:18:21 +02:00
Christophe Gisquet
1ad1723c24 proresenc_kostya: report buffer overflow
If the allocated size, despite best efforts, is too small, exit
with the appropriate error.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52b81ff4635c077b2bc8b8d3637d933b6629d803)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 02:40:23 +02:00
Christophe Gisquet
7740b111dd proresenc_kostya: remove unneeded parameters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bf10f09bccdcfdb41b9f5bbae01d55961bfd0693)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-12 02:40:19 +02:00
Michael Niedermayer
c0ad5f9333 Update for 2.2.7
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 20:16:12 +02:00
Michael Niedermayer
bb7f236c7f avcodec/snow: fix null pointer dereference in cleanup after allocation failure
Fixes: snowf.avi
Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9a162146ca6cc12ef7ad4a15164349482885962c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 19:07:11 +02:00
Michael Niedermayer
0397d43405 avcodec/iff: check pixfmt for rgb8 / rgbn
Fixes out of array access

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3539d6c63a16e1b2874bb037a86f317449c58770)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 19:07:11 +02:00
Michael Niedermayer
ffc66ac0d6 avutil/cpu: add aarch64 entries to 2nd table
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit efc4fe9d74a5040e465dbff80b29468dbc227c19)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 19:07:11 +02:00
Michael Niedermayer
588e7226ed ffmpeg_opt: Use av_guess_codec() instead of AVOutputFormat->*codec
Fixes part of ticket2236

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 956f4087c6eb717e31f3b92fe03fd56a3747eccf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:59:43 +02:00
Michael Niedermayer
0dc5868f14 Merge commit '67134ad31f1f3bc1515eae129e4368401f7c3342' into release/2.2
* commit '67134ad31f1f3bc1515eae129e4368401f7c3342':
  h264: fix interpretation of interleaved stereo modes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:51:29 +02:00
Michael Niedermayer
723512ac71 avcodec/svq1dec: Fix multiple bugs from "svq1: do not modify the input packet"
Add padding, clear size, use the correct pointer.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4213fc5b9eebec53c7d22b770c3f1ceecca1c113)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:50:29 +02:00
Michael Niedermayer
963514ea1a Merge commit 'd513c6a0ee582d22b6e793286774abbde01f6680' into release/2.2
* commit 'd513c6a0ee582d22b6e793286774abbde01f6680':
  svq1: do not modify the input packet

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:50:11 +02:00
Michael Niedermayer
c11b3010c2 Merge commit '18f48e05a22a73a389fb3ab4b3eaf78903bab5ef' into release/2.2
* commit '18f48e05a22a73a389fb3ab4b3eaf78903bab5ef':
  cdgraphics: do not return 0 from the decode function

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:49:37 +02:00
Michael Niedermayer
3301b248b0 Merge commit '5bf5a35fb5d452ea4b30cd7b853d92df6705d250' into release/2.2
* commit '5bf5a35fb5d452ea4b30cd7b853d92df6705d250':
  cdgraphics: switch to bytestream2

Conflicts:
	libavcodec/cdgraphics.c

See: ad002e1a13a8df934bd6cb2c84175a4780ab8942
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:41:07 +02:00
Michael Niedermayer
7b67ce9ade Merge commit '6598aaea1ad2cf82d40abb191ac26a5e4e5147ba' into release/2.2
* commit '6598aaea1ad2cf82d40abb191ac26a5e4e5147ba':
  jpeg2000: enable 4 component pixel formats

See: f0358dc1d30cd4f4862489ab95c4d408b00a8b0d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:40:20 +02:00
Michael Niedermayer
90a1c5e95c Merge commit 'a5992a274ff5f6c4bec3445cb410da0adce8ef70' into release/2.2
* commit 'a5992a274ff5f6c4bec3445cb410da0adce8ef70':
  stereo3d: add missing include guards

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:38:27 +02:00
Michael Niedermayer
45a529d805 Merge commit 'aa943bd31fada23db5cb9611215656ab9ebe5b94' into release/2.2
* commit 'aa943bd31fada23db5cb9611215656ab9ebe5b94':
  huffyuvdec: check width size for yuv422p

Conflicts:
	libavcodec/huffyuvdec.c

See: 6abb9a901fca27da14d4fffbb01948288b5da3ba
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:02:36 +02:00
Michael Niedermayer
97cbad3d2c Merge commit 'bea14966e2a37019cb4e38420868c5bb0542d487' into release/2.2
* commit 'bea14966e2a37019cb4e38420868c5bb0542d487':
  mmvideo: check horizontal coordinate too

See: 8d3c99e825317b7efda5fd12e69896b47c700303
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:01:44 +02:00
Michael Niedermayer
6419569a9d Merge commit '6be5a3c0451e8f199ef1da09961aa76c08c87afd' into release/2.2
* commit '6be5a3c0451e8f199ef1da09961aa76c08c87afd':
  wmalosslessdec: fix mclms_coeffs* array size

See: ec9578d54d09b64bf112c2bf7a34b1ef3b93dbd3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-11 18:01:05 +02:00
Felix Abecassis
67134ad31f h264: fix interpretation of interleaved stereo modes
Column and row frame packing arrangements were inverted.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-08-07 11:40:08 +01:00
Anton Khirnov
d513c6a0ee svq1: do not modify the input packet
The input data must remain constant, make a copy instead. This is in
theory a performance hit, but since I failed to find any samples
using this feature, this should not matter in practice.

Also, check the size of the header, avoiding invalid reads on truncated
data.

CC:libav-stable@libav.org
(cherry picked from commit 7b588bb691644e1b3c168b99accf74248a24e3cf)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 19:05:34 +00:00
Anton Khirnov
18f48e05a2 cdgraphics: do not return 0 from the decode function
0 means no data consumed, so it can trigger an infinite loop in the
caller.

CC:libav-stable@libav.org
(cherry picked from commit c7d9b473e28238d4a4ef1b7e8b42c1cca256da36)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 18:41:44 +00:00
Anton Khirnov
5bf5a35fb5 cdgraphics: switch to bytestream2
Fixes possible invalid memory accesses on corrupted data.

CC:libav-stable@libav.org
Bug-ID: CVE-2013-3674
(cherry picked from commit a1599f3f7ea8478d1f6a95e59e3bc6bc86d5f812)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-06 18:41:42 +00:00
Vittorio Giovara
6598aaea1a jpeg2000: enable 4 component pixel formats
Bug-Id: 721
CC: libav-stable@libav.org
Sample-Id: 31230.mov
2014-08-06 12:44:35 +01:00
Vittorio Giovara
a5992a274f stereo3d: add missing include guards 2014-08-06 12:44:35 +01:00
Michael Niedermayer
1b99667005 Changelog: fix typo
Found-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 22:27:53 +02:00
Michael Niedermayer
1f4d779e87 version.sh: Print versions based on the last git tag for release branches
release branches are detected by checking if "git" is not in RELEASE
This changes "N-64706-g2f71aeb" to "n2.3-8-g2f71aeb"
for git master theres no change

This should improve the readability of lists of versions which come from
more than 1 release branch or master + release. fate.ffmpeg.org is
one possible example

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ee606fd0317df202b59946cf9b738c0a01056316)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 22:18:00 +02:00
Michael Niedermayer
f543d32455 remove VERSION file
it overrides what version.sh prints and thus makes its output
from release branches rather useless

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2f71aeb30161edb5cb0fea5d3080094a22cc3038)

Conflicts:

	VERSION
2014-08-05 22:16:42 +02:00
Michael Niedermayer
2cbdbc3670 update for 2.2.6
Changelog by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 22:07:12 +02:00
Michael Niedermayer
aa943bd31f huffyuvdec: check width size for yuv422p
Avoid out of array accesses.

CC: libav-stable@libav.org
Bug-Id: CVE-2013-0848
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit a7153444df9040bf6ae103e0bbf6104b66f974cb)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 20:06:53 +00:00
Michael Niedermayer
bea14966e2 mmvideo: check horizontal coordinate too
Fixes out of array accesses.

Bug-Id: CVE-2013-3672
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 70cd3b8e659c3522eea5c16a65d14b8658894a94)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 19:21:40 +00:00
Michael Niedermayer
6be5a3c045 wmalosslessdec: fix mclms_coeffs* array size
Fixes corruption of context

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
Bug-Id: CVE-2014-2098
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 849b9d34c7ef70b370c53e7af3940f51cbc07d0f)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-05 14:59:29 +00:00
Michael Niedermayer
119131fcbf ffserver: initialize pbuffer in prepare_sdp_description()
also check pbuffer before use

Found-by: CSA
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1d8d21b90ab91aa471f369e0f9d1ea20fb40733b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:45:56 +02:00
Michael Niedermayer
c13e38bac7 avcodec/wavpackenc: Fix log2sample() result value
Found-by: CSA
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e706fe764049b3f1ccf10ba9f686426a4c007906)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:45:56 +02:00
Michael Niedermayer
01c4fe7ee7 avformat/tee: flip assigment direction
Found-by: CSA
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e6fdcb7f3c86491408a3699f0aa9dc52b7c5686)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:45:56 +02:00
Michael Niedermayer
ad13a5c8fa avcodec/dvdsub_parser: print message if packet is smaller than the packet size field
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bcc898dd2643c883522ffa565be4b226ce798c78)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
ce248bf7ee avcodec/dvdsub_parser: Check buf_size before reading 32bit packet size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81c1657a593b1c0f8e46fca00ead1d30ee1cd418)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
8eaefbe1be avcodec/dvdsub_parser: never return 0 when the input isnt 0
Fixes a infinite loop
Fixes Ticket3804

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cfdb30d2f1241de9354a8efdbf8252d0f1a6f933)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
81d8bad786 avcodec/mpeg12dec: fix support for interlaced mpeg2 with missing last slice
Fixes Ticket3809

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f95298c913899207344d668a6d5624cb2d2e480c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Anshul Maheswhwari
0aee436728 v4l2enc: adding AVClass
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fcb11ec291e9b3e3f352fa4d3e9026c0f7f64aa8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
cdaf9fb2a0 libavcodec/h264_parser: Increase parse_history, fix huge resolutions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0782fb6bcb32fe3ab956a99af4cc472ff81da0c2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Benoit Fouet
cf41ff4889 h264_mp4toannexb_bsf: account for consecutive IDR pictures.
If there are consecutive IDR pictures, then SPS/PPS should be prepended
to all of them, not only the first one.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bf428bb3145c4f0eef32f8ef00de0ee222b3e414)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Chris \"Koying\" Browet
6120ad315b avcodec/h264_mp4toannexb_bsf: fix issue when sps/pps are already in the bistream
(cherry picked from commit ad91bf854b559f1afc42fc06f8a7dfbb75def5c8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:14:02 +02:00
Michael Niedermayer
2105f046f5 avformat/dv: implement fallback in dv_extract_pack()
Fixes Ticket2340
Fixes Ticket2341

Based-on mail from Dave Rice <dave@dericed.com>
Tested-by: Dave Rice <dave@dericed.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 88f038ac97a875f25c2eceac6d2107a09314984c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
815d3225e3 avcodec/hevc: treat current_sps like sps_list
This simplifies the management of current_sps
Fixes Ticket3458

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 880dbe43ca71982ecdfe1c73446137d6b2fd24d5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
51dd23c448 avcodec/hevc_ps: prevent stale pointer in malloc failure case
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0fc2045d5f4eab35d943a79c3d965a2f31361f48)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
a4e1532ee7 avcodec/hevc_ps: do not loose all reference to pointers still in use
Fixes leaving a pointer to unreferenced memory
Fixes Ticket 3115

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ccd6911c189d2f974dcc4095c963dfad14d703d2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Nicolas George
f7b147548e ffmpeg_filter: refuse to configure input without a decoder.
The decoder is necessary in order to filter frames.
This makes the error message clearer in this case:
currently, it will usually fail because the pixel or sample
format is not defined and is converted into "(null)"
(non-portable).

Enhance trac ticket #3779.
(cherry picked from commit 91244073fd8b983e7cd1f97da83daf956fbbddc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
f99b17bd32 avfilter/f_select: avoid double->int in debug output
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f622e5fcbe8484af194436b8dd4ff01f092ab99)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
21f6b07a97 avfilter/f_select: Set var_values[VAR_KEY] correctly
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bcbfb95b0e327679337eaca59c247a2580ea4105)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
c9f1456a41 avfilter/f_select: avoid using doubles for equals checks and casts to enums
This might silence some warnings.

Issue found from: a8d803a320fb08b3ad5db4fffc79abd401206905
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 887d8d293fc31c949427f971f37c126b3812b451)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:13:38 +02:00
Michael Niedermayer
77b789b406 Merge commit '07015d9f913d63bdc4495e75f4603c586553796e' into release/2.2
* commit '07015d9f913d63bdc4495e75f4603c586553796e':
  Update Changelog for v10.3

Conflicts:
	Changelog

Not merged as it does not match our release

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:05:48 +02:00
Michael Niedermayer
9ed1aa0465 Merge commit '744b406ff3474e77543bcf86125a2f7bc7deaa18' into release/2.2
* commit '744b406ff3474e77543bcf86125a2f7bc7deaa18':
  huffyuv: Check and propagate function return values

Conflicts:
	libavcodec/huffyuvdec.c

See: f67a0d115254461649470452058fa3c28c0df294
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 04:04:01 +02:00
Michael Niedermayer
188ce941ec Merge commit '2273e5ed992661e0c4b37208e792e2253d5a0b5b' into release/2.2
* commit '2273e5ed992661e0c4b37208e792e2253d5a0b5b':
  h264: prevent theoretical infinite loop in SEI parsing

Conflicts:
	libavcodec/h264_sei.c

See: 9decfc17bb76da34734296048d390b176abf404c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 03:55:15 +02:00
Michael Niedermayer
7fc9c7c35b Merge commit 'a1f7844a11010d8552c75424d1a831b37a0ae5d9' into release/2.2
* commit 'a1f7844a11010d8552c75424d1a831b37a0ae5d9':
  pgssubdec: Check RLE size before copying

See: c0d68be555f5858703383040e04fcd6529777061
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 03:54:50 +02:00
Reinhard Tartler
07015d9f91 Update Changelog for v10.3 2014-08-03 21:30:46 -04:00
Diego Biurrun
744b406ff3 huffyuv: Check and propagate function return values
Bug-Id: CVE-2013-0868

inspired by a patch from Michael Niedermayer <michaelni@gmx.at>
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Diego Biurrun <diego@biurrun.de>

CC: libav-stable@libav.org
(cherry picked from commit d0393d79bc3d61c9f2ff832c0e273b7774ff0269)
Signed-off-by: Diego Biurrun <diego@biurrun.de>

Conflicts:
	libavcodec/huffyuvdec.c
2014-08-03 15:53:38 -07:00
Vittorio Giovara
2273e5ed99 h264: prevent theoretical infinite loop in SEI parsing
Properly address CVE-2011-3946 and parse bitstream as described in the spec.

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-08-01 13:15:07 +01:00
Michael Niedermayer
a1f7844a11 pgssubdec: Check RLE size before copying
Make sure the buffer size does not exceed the expected
RLE size.

Prevent an out of array bound write.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Bug-Id: CVE-2013-0852

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit d98e6c5d5d80c1dfe0c30f2e73d41a3aea0b920d)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-01 01:04:13 -07:00
Michael Niedermayer
3ef8b4322c Merge commit 'd396987c303bdc4eea7d1a1ff6776475d9bbd9ea' into release/2.2
* commit 'd396987c303bdc4eea7d1a1ff6776475d9bbd9ea':
  fate: Add dependencies for dct/fft/mdct/rdft tests

Conflicts:
	libavcodec/fft-test.c
	tests/fate/fft.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:35:23 +02:00
Michael Niedermayer
9dc112e277 Merge commit 'b20a8ad619ac0e2631391b6311cc000de85d22bf' into release/2.2
* commit 'b20a8ad619ac0e2631391b6311cc000de85d22bf':
  video4linux2: Avoid a floating point exception

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:34:13 +02:00
Michael Niedermayer
75ff0e8c50 Merge commit '01a550bda29eb05fb230576e5223034974aa3396' into release/2.2
* commit '01a550bda29eb05fb230576e5223034974aa3396':
  vf_select: Drop a debug av_log with an unchecked double to enum conversion

Conflicts:
	libavfilter/f_select.c

See: 7994c1cd760838ca5b92401caa1994bc035d08b5
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:33:48 +02:00
Michael Niedermayer
f02221d651 Merge commit 'f6b3dce952d66f87883a50d90d6e98416ee397df' into release/2.2
* commit 'f6b3dce952d66f87883a50d90d6e98416ee397df':
  librtmp: Don't free the temp url at the end of rtmp_open

Conflicts:
	libavformat/librtmp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:32:53 +02:00
Michael Niedermayer
92c4973752 Merge commit 'b8e57113ecba5494d4bf47c29634392ea5fdb17b' into release/2.2
* commit 'b8e57113ecba5494d4bf47c29634392ea5fdb17b':
  arm: Avoid using the 'setend' instruction on ARMv7 and newer

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:18:14 +02:00
Michael Niedermayer
f4e0869560 Merge commit '407912d17870a53e8a8cc072f192cadf358bc155' into release/2.2
* commit '407912d17870a53e8a8cc072f192cadf358bc155':
  avplay: Handle pixel aspect ratio properly

See: 32fdfdfbdac64c57b12910521af1379a24d01f73
See: 99b01e458c268cf18ac0981e644e0f835957498a
See: 825ec16da955fd9c726d8e6c846cf9257a781a87
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:14:33 +02:00
Michael Niedermayer
6135baa85b Merge commit '12bbd819cbdfdd2b41286c5ccabee7f5e5b6612a' into release/2.2
* commit '12bbd819cbdfdd2b41286c5ccabee7f5e5b6612a':
  Prepare for 10.3 Release

Conflicts:
	RELEASE

Not merged, as FFmpeg has different version numbers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 20:13:20 +02:00
Michael Niedermayer
3573256037 Merge commit 'f9204ec56a4cf73843d1e5b8563d3584c2c05b47' into release/2.2
* commit 'f9204ec56a4cf73843d1e5b8563d3584c2c05b47':
  eamad: use the bytestream2 API instead of AV_RL

Conflicts:
	libavcodec/eamad.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-30 19:59:38 +02:00
Diego Biurrun
d396987c30 fate: Add dependencies for dct/fft/mdct/rdft tests
(cherry picked from commit 24f45c16224d4c5d482e928676714766ffdda4fc)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 10:12:17 -07:00
Bernhard Übelacker
b20a8ad619 video4linux2: Avoid a floating point exception
This avoids a segfault in avconv_opt.c:opt_target when trying to
determine the norm.

(cherry picked from commit dc71f1958846bb1d96de43a4603983dc8450cfcc)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 10:12:17 -07:00
Diego Biurrun
01a550bda2 vf_select: Drop a debug av_log with an unchecked double to enum conversion
CC: libav-stable@libav.org
(cherry picked from commit a8d803a320fb08b3ad5db4fffc79abd401206905)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-30 10:12:17 -07:00
Martin Storsjö
f6b3dce952 librtmp: Don't free the temp url at the end of rtmp_open
librtmp can keep pointers to this string internally, and may
use them at shutdown as well.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 865461099e062de5a3a109c2a5be98004c11d8bd)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavformat/librtmp.c
2014-07-27 10:14:33 -04:00
Martin Storsjö
b8e57113ec arm: Avoid using the 'setend' instruction on ARMv7 and newer
This instruction is deprecated on ARMv8, and it is serializing on
some ARMv7 cores as well [1].

[1] http://article.gmane.org/gmane.linux.ports.arm.kernel/339293

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 79fce1ec8abd017593c003917fc123f7119a78d6)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-07-27 10:14:33 -04:00
Martin Storsjö
407912d178 avplay: Handle pixel aspect ratio properly
This was broken (left half-implemented) in 354468fc12.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit cf280ed004b5c618560f8f43d14ff264bd1e4c3d)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-07-27 10:14:33 -04:00
Reinhard Tartler
12bbd819cb Prepare for 10.3 Release 2014-07-27 10:14:33 -04:00
Anton Khirnov
f9204ec56a eamad: use the bytestream2 API instead of AV_RL
This is safer and possibly fixes invalid reads on truncated data.
(cherry-picked from commit 541427ab4d5b4b6f5a90a687a06decdb78e7bc3c)

CC:libav-stable@libav.org

Conflicts:
	libavcodec/eamad.c
2014-07-27 09:59:01 -04:00
Alessandro Ghedini
4ddac7199b vc1: Do not return an error when skipping b frames
This caused mpv (and possibly others) to fallback to software decoding after
seeking a VC1 stream.

Bug-Id: 667

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit cdf6eb5a9710566be217a3f17d3d94ac4e4d2662)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-23 10:42:35 +02:00
Michael Niedermayer
3e78f86891 Merge commit '68fd80ee1ca22c39b6ef4e6641b5b2e0d4d89a14' into release/2.2
* commit '68fd80ee1ca22c39b6ef4e6641b5b2e0d4d89a14':
  g2meet: allow size changes within original sizes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-23 10:42:11 +02:00
Vittorio Giovara
68fd80ee1c g2meet: allow size changes within original sizes 2014-07-15 20:10:21 -04:00
James Almer
0edc799626 x86/scale: fix xmm register count for hscale*_sse2
xmm6 was being clobbered in ff_hscale8to{15,19}_8_sse2 on Win64

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 345f2234d1717d6128b2f90a7839c4906bf203ec)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15 02:14:55 +02:00
Michael Niedermayer
3cf6135729 Update for FFmpeg 2.2.5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-15 02:01:06 +02:00
Michael Niedermayer
160e91de89 ffmpeg: Use av_stream_get_parser() to avoid ABI issues
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8bbadc9b6ec71abbd9dab854c47027b949997af0)

Conflicts:

	ffmpeg.c
2014-07-14 23:26:06 +02:00
Michael Niedermayer
9f8e3e6d12 avformat: add av_stream_get_parser() to access avformat AVParser
The AVStream.parser field is considered private and its location cannot be
preserved while preserving also ABI compatibility to libav, as libav added fields
before it.
Some tools like ffmpeg.c access this field though

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 62227a70f0a4c07d7ead5775d8bad64797f8ef80)

Conflicts:

	RELEASE_NOTES
	doc/APIchanges
	libavformat/utils.c
	libavformat/version.h
2014-07-14 23:26:06 +02:00
Michael Niedermayer
9752ab6b9e avformat/utils: do not wait for packets from discarded streams for genpts
Fixes long loop
Fixes Ticket3208

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8202c49b43621c04e26d4a3aa83a10e1e5cc1836)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:26:06 +02:00
Michael Niedermayer
64e069efac avfilter/f_ebur128: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a97137e9486964918a71f1a760cdcc297bf61b59)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:44 +02:00
Michael Niedermayer
e064cce972 avcodec/hevc: Use av_malloc(z)_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7faa7d3d42af12a60a4db7ecba165369ec5795d7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:44 +02:00
Michael Niedermayer
b8102ce56d cmdutils_opencl: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 80da227c660e7bef7400f602a9817a897f07022b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:44 +02:00
Michael Niedermayer
f38c42b913 avfilter/x86/vf_pullup: fix old typo
This makes C and MMX match, no change to fate as the differences where
apparently not sufficient to show up in fate

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b8255a4c7096ecddea68e12e067c7a9b2e14ed8d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:44 +02:00
Michael Niedermayer
a770a61e6d avfilter/vf_pullup: use ptrdiff_t as stride argument for dsp functions
This should avoid issues on x86_64

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6dffc8f5aaab6b20385f0a0d9ef95cec7d6cdd4b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 23:04:43 +02:00
Michael Niedermayer
b2111ad4df Merge commit '95e91aaf335dd9c26a9101c38d4926e5271e7e00' into release/2.2
* commit '95e91aaf335dd9c26a9101c38d4926e5271e7e00':
  af_compand: make sure request_frame always outputs at least one frame

See: 6b68e2a43b3407522080be50a2a19cff2f9715ef
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:58:44 +02:00
Michael Niedermayer
7c81afdba5 Merge commit '40dd29653ab85812d21fa64e9a665ceb316701ad' into release/2.2
* commit '40dd29653ab85812d21fa64e9a665ceb316701ad':
  Prepare for 10.2 Release
  Update Changelog for v10.2

Conflicts:
	Changelog
	RELEASE

Not merged as these dont align with our releases

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:57:48 +02:00
Michael Niedermayer
65b839e43a Merge commit '564c023eba807b162527b17af40424de275fc795' into release/2.2
* commit '564c023eba807b162527b17af40424de275fc795':
  adpcm: Write the proper predictor in trellis mode in IMA QT

See: fa8f060b75bf9074792a0f9ff4ed002652ef62b8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:48:29 +02:00
Michael Niedermayer
d47e96090c Merge commit '771564945aa9aebe2f30192b925fcf4909225eca' into release/2.2
* commit '771564945aa9aebe2f30192b925fcf4909225eca':
  adpcm: Avoid reading out of bounds in the IMA QT trellis encoder

See: a32765c4252eb106a2ade543026ef6f59e699bfa
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:46:48 +02:00
Michael Niedermayer
0bbd46c690 Merge commit '16f7cbef5610a878317596134607d2a89da66ecf' into release/2.2
* commit '16f7cbef5610a878317596134607d2a89da66ecf':
  oggenc: Set the right AVOption size for the pref_duration option

See: 536baf6cc5d1db789c9f903776dccb7a41b62a6e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:40:29 +02:00
Michael Niedermayer
5f1f1868b5 Merge commit '4ec1acc6e4f4d0bd28617bbb30ebfb779ce7df92' into release/2.2
* commit '4ec1acc6e4f4d0bd28617bbb30ebfb779ce7df92':
  avpacket: fix copying side data in av_packet_copy_props()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:39:25 +02:00
Michael Niedermayer
ebf381168a Merge commit '74f6df745a05d3d8b3dcfc28992c69a70ae87957' into release/2.2
* commit '74f6df745a05d3d8b3dcfc28992c69a70ae87957':
  jpeg2000: fix dereferencing invalid pointers during cleanup

Conflicts:
	libavcodec/jpeg2000.c

See: 09927f3eaa93e31dd90ab8ee66dc1ad867b3365f
See: 912ce9dd2080c5837285a471d750fa311e09b555
See: 9e477a37703318cb86d8ed1d426929235aa02b67
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:38:22 +02:00
Michael Niedermayer
0d90143972 Merge commit '46c477c2a14b04a63ab11d31003b48fab6146a96' into release/2.2
* commit '46c477c2a14b04a63ab11d31003b48fab6146a96':
  Check mp3 header before calling avpriv_mpegaudio_decode_header().

Conflicts:
	libavformat/mp3enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:26:06 +02:00
Michael Niedermayer
00049f193d Merge commit 'fcbcc561e0fdc95a7dd48b92db53846726aec27e' into release/2.2
* commit 'fcbcc561e0fdc95a7dd48b92db53846726aec27e':
  Check if an mp3 header is using a reserved sample rate.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:25:23 +02:00
Michael Niedermayer
d832020bd8 Merge commit '6d899d0206e91a3a74680b47ec06ef1dbc151c21' into release/2.2
* commit '6d899d0206e91a3a74680b47ec06ef1dbc151c21':
  lzo: Handle integer overflow

Conflicts:
	libavutil/lzo.c

This is basically not merging changes due to this being fixed differently
in FFmpeg

See: d6af26c55c1ea30f85a7d9edbc373f53be1743ee
See: cf2b7c01f81c1fb3283a1390c0ca9a2f81f4f4a8

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 22:24:36 +02:00
Andrew Kelley
95e91aaf33 af_compand: make sure request_frame always outputs at least one frame
This fixes a segmentation fault because request_frame in fifo.c assumes
that the call to ff_request_frame will populate fifo->root.next.
Before, it was possible for request_frame in af_compand to not do this,
resulting in a null pointer access. Now, request_frame in af_compand
always will return at least one frame or an error, as per the API
specifications in avfilter.h for request_frame.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit d3cfd7aff86ee3d449ca68aba21d67b9b2136a9b)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-07-08 17:40:07 +00:00
Reinhard Tartler
40dd29653a Prepare for 10.2 Release 2014-06-26 21:14:55 -04:00
Reinhard Tartler
52dd1a933e Update Changelog for v10.2 2014-06-26 21:11:20 -04:00
Martin Storsjö
564c023eba adpcm: Write the proper predictor in trellis mode in IMA QT
The actual predictor value, set by the trellis code, never
was written back into the variable that was written into
the block header. This was accidentally removed in b304244b.

This significantly improves the audio quality of the trellis
case, which was plain broken since b304244b.

Encoding IMA QT with trellis still actually gives a slightly
worse quality than without trellis, since the trellis encoder
doesn't use the exact same way of rounding as in
adpcm_ima_qt_compress_sample and adpcm_ima_qt_expand_nibble.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0776e0ef6ba4160281ef3fabea43e670f3792b4a)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:59:00 +02:00
Martin Storsjö
771564945a adpcm: Avoid reading out of bounds in the IMA QT trellis encoder
This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3d79d0c93e5b37a35b1b22d6c18699c233aad1ba)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:58:46 +02:00
Martin Storsjö
16f7cbef56 oggenc: Set the right AVOption size for the pref_duration option
On big endian machines, the default value set via the faulty
AVOption ended up as 2^32 times too big.

This fixes the fate-lavf-ogg test which currently is broken on
big endian machines, broken since 3831362. Since that commit,
a final zero-sized packet is written to the ogg muxer in that test,
which caused different flushing behaviour on little and big endian
depending on whether the pref_duration option was handled as it
should or not.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 103243ca649cc305129ed0352bf4d97e5ddf4d80)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:58:28 +02:00
Anton Khirnov
4ec1acc6e4 avpacket: fix copying side data in av_packet_copy_props()
Side data count is incremented by by calling av_packet_new_side_data()
in the following loop, setting it explicitly results in the resulting
value being twice what it should be.

CC: libav-stable@libav.org
(cherry picked from commit cdf58f0599c39852ee3beafe5f64af7d57d4215b)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:58:16 +02:00
Vittorio Giovara
74f6df745a jpeg2000: fix dereferencing invalid pointers during cleanup
CC: libav-stable@libav.org
Found-by: Laurent Butti <laurentb@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-06-26 12:37:36 +02:00
Justin Ruggles
46c477c2a1 Check mp3 header before calling avpriv_mpegaudio_decode_header().
As indicated in the function documentation, the header MUST be
checked prior to calling it because no consistency check is done
there.

CC:libav-stable@libav.org
(cherry picked from commit f2f2e7627f0c878d13275af5d166ec5932665e28)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:37:16 +02:00
Justin Ruggles
fcbcc561e0 Check if an mp3 header is using a reserved sample rate.
Fixes an invalid read past the end of avpriv_mpa_freq_tab.
Fixes divide-by-zero due to sample_rate being set to 0.

Bug-Id: 705

CC:libav-stable@libav.org
(cherry picked from commit 44127546b0a81dc9dd6190739a62d48f0044c6f3)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-26 12:36:55 +02:00
Luca Barbato
6d899d0206 lzo: Handle integer overflow
get_len can overflow for specially crafted payload.

Reported-By: Don A. Baley <donb@securitymouse.com>
CC: libav-stable@libav.org
(cherry picked from commit ccda51b14c0fcae2fad73a24872dce75a7964996)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-06-25 15:37:01 +02:00
Michael Niedermayer
e0a03d1f9c update for FFmpeg 2.2.4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
d07be523f5 avformat/mpc: attempt to allocate a packet that is not smaller than the data inside it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86a9370e2b91d67375e66a06d6eb573b5a017775)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
e4cdde96b3 avformat/cavsvideodec: Fix probing when the file extension is avs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52e563bb2f7897d615391520c3c4acba1ee7dcb4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
252a0ccb80 cavsdec: fix qp fixed slice handling
Fixes Ticket3400

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0accf24b15ac5a01a67768f41c896ef4e4b8b4a2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
dad0c9d686 avcodec/alsdec: Clear MPEG4AudioConfig so that no use of uninitialized memory is possible
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e6bd5481cf42a9765c492c77754d4633092cece)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
e173834af8 avformat/flvenc: Do not allow creating h263/mpeg4 in flv without unofficial format extensions being enabled.
Found-by: Jean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 74760883fcb4443d105814ed246b3cf51d7e9dca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
63e3a97815 avcodec/aic: fix quantization table permutation
Fixes Ticket3700

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0a2004b6d11ff962361420c3150fe760cf1f7115)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:56:15 +02:00
Michael Niedermayer
61796a8999 avutil/lzo: add asserts to be double sure against overflows
These asserts cannot fail since d6af26c55c1ea30f85a7d9edbc373f53be1743ee

Based-on: ccda51b14c0fcae2fad73a24872dce75a7964996
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf2b7c01f81c1fb3283a1390c0ca9a2f81f4f4a8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:04:07 +02:00
Michael Niedermayer
7d9c059a35 avutil/lzo: Fix integer overflow
Embargoed-till: 2014-06-27 requested by researcher, but embargo broken by libav today (git and mailing list)

Fixes: LMS-2014-06-16-4
Found-by: "Don A. Bailey" <donb@securitymouse.com>
See: ccda51b14c0fcae2fad73a24872dce75a7964996
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d6af26c55c1ea30f85a7d9edbc373f53be1743ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 15:04:05 +02:00
Carl Eugen Hoyos
52572ca1b3 Show duration for large asf files as written in the file header.
Fixes ticket #3428.
(cherry picked from commit e3fd263f0b73e4425192d6dd1ab18027ecaa35db)
2014-06-21 21:52:05 +02:00
Michael Niedermayer
220bbc44c2 Merge commit '6672f672d98cf4887e13321b6f67682cfd1273b4' into release/2.2
* commit '6672f672d98cf4887e13321b6f67682cfd1273b4':
  avconv: make -shortest work with streamcopy

Conflicts:
	ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-20 00:06:36 +02:00
Michael Niedermayer
f378636d90 avformat/mp3enc: drop redundant and uninitialized variable
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eccec203978e53f897a3c6105d011bbdff2a978b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19 21:05:12 +02:00
Ronald S. Bultje
98f33430a2 vp9/x86: fix overwrite in ipred_vl_4x4_ssse3.
Fixes track ticket 3717.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 385a3420d1da2f6812dda56750b41edd469c6079)
2014-06-12 08:52:24 +02:00
Anton Khirnov
6672f672d9 avconv: make -shortest work with streamcopy
CC: libav-stable@libav.org
(cherry picked from commit 48e50921337984ba4ec2c1cafe45d43787f84498)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-12 08:34:40 +02:00
Martin Storsjö
3002e5976d adpcm: Write the proper predictor in trellis mode in IMA QT
The actual predictor value, set by the trellis code, never
was written back into the variable that was written into
the block header. This was accidentally removed in b304244b.

This significantly improves the audio quality of the trellis
case, which was plain broken since b304244b.

Encoding IMA QT with trellis still actually gives a slightly
worse quality than without trellis, since the trellis encoder
doesn't use the exact same way of rounding as in
adpcm_ima_qt_compress_sample and adpcm_ima_qt_expand_nibble.

Fixes part of Ticket3701

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fa8f060b75bf9074792a0f9ff4ed002652ef62b8)

Conflicts:
	tests/ref/acodec/adpcm-ima_qt-trellis
2014-06-09 23:54:20 +02:00
Martin Storsjö
1e8ff7d21d adpcm: Fix trellis encoding of IMA QT
This was broken in 095be4fb - samples+ch (for the previous
non-planar case) equals &samples_p[ch][0]. The confusion
probably stemmed from the IMA WAV case where it originally
was &samples[avctx->channels + ch], which was correctly
changed into &samples_p[ch][1].

Fixes part of Ticket3701

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a32765c4252eb106a2ade543026ef6f59e699bfa)
2014-06-09 23:53:45 +02:00
Michael Niedermayer
dae6c19995 avcodec/mjpegdec: Improve intel jpeg flip heuristic
Fixes Ticket3698

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0545ef7116db1e87894d978bfa400578652c716d)
2014-06-09 23:51:24 +02:00
Michael Niedermayer
989adf5ee5 avcodec/h264: in the absence of recovery points, be more tolerant on accepting plain I frames
Fixes: Ticket3652
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 19c9d1e8e71da04c3ac940206619c0a2d01e5193)
2014-06-09 23:50:12 +02:00
Carl Eugen Hoyos
09d406eec8 avcodec/utvideodec: Increase vlc len
Fixes a regression since fb3e380 similar to ticket #2661,
reported by fluffrabbit at aol dot com.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 673716c54b39eba9579a38ad222130e3f9549167)
2014-06-09 23:49:18 +02:00
Carl Eugen Hoyos
d1b62a9a07 Do not limit blocksize when reading PCM from aiff.
Fixes ticket #3695.
(cherry picked from commit 763e714442e07f6430b003c8a9f4b62deaa7b3a5)
2014-06-09 23:48:10 +02:00
Michael Niedermayer
29c8fac3f7 avformat/avidec: allow rounding errors between scale/rate and timebase
Fixes Ticket3670

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 571ab8344a9a2864d22d01af41283cee9328b927)
2014-06-09 23:47:35 +02:00
Michael Niedermayer
8c33d40a7b ffmpeg: prevent pts < dts to be passed through to the muxer on stream copy
Fixes Ticket3658

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 27856b2fe9cdbcf48ad996647cb104667b373fa4)
2014-06-09 23:46:48 +02:00
Michael Niedermayer
f406bf3fa9 Update for 2.2.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 23:08:27 +02:00
Michael Niedermayer
54bec22a6e avformat/h263dec/h263_probe: Check TR
Fixes missdetection of Misdetection_345.mp3
Fixes missdetection of Misdetection_421.mp3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cd20b93e2f5171054d6b3dd9daee1e832c1f9090)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
e1b2c93a23 avformat/h263dec/h263_probe: Check PSC bit 9 and 13 in
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ad21c50af042ab17bedf755ff8245392425c259)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
e529ff52a0 avformat/h263dec: shift data in state to make more bits available to probe
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 04b15a6055fc230a655091ce21303f9d2a996ed9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
fb7e76d1cf avcodec/svq3: Fix "incompatible pointer type" warnings
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 89d2fc62db985263fdbfb1f44b23e98d24d77c9e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
96047b3150 avformat/utils: Call ff_rfps_add_frame() only for video
This avoids some unneeded computations

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6f6edfe1c0ede584ea4edf5bb0fc9b961f299631)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
2545defeac avformat/flvenc: fix assertion failure after 4h muxing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e532aa82d2b938a3cd913a363a79bf92ddf1a33)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
2d97ad38ed avcodec/mss4: Fix () in MKVAL() macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf7ff0146c76b93c32edf5230a28b9590acf5105)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
f6c628f029 avcodec/mss34dsp: fix () in SOP* macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e720c5c815e510188a0bda654662383f2c48050)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
3f743e3e4c avcodec/mlpdec: fix () in MSB_MASK() macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fa160af08b6f42f17e93124aef86e3f6eec70d51)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
f2dbd64bde avcodec/ivi_dsp: add some missing () to macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f276bf303cbb7a8fed3c388135007bc29f45f8d5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
7bce659e18 avcodec/hevc: fix () in macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 70f671c39e53f0e54914185dd3ed5afa6b66708b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:50 +02:00
Michael Niedermayer
cb9379065f avcodec/h264: fix () in macros
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit af62b42736c00332d39965168b5cc966a06f07d6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
4261778dbd avcodec/golomb-test: fix () in EXTEND() macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 97e6b5ee3a16fee7d130f19f4dcee030f14d91cf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
ba88a6e4e4 avcodec/aac: fix () in IS_CODEBOOK_UNSIGNED macro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fa915d4193e13187773c500b80c7df6baeb22c3b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
e0407a7bf7 avcodec/libvorbisenc: dont add the duration to AV_NOPTS_VALUE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 19e66c7232d96e4ae8f05b52da2b84dfaa4e4da3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
d575984dfc avutil/cpu: force mmx on selection of higher x86 SIMD features
Fixes various runtime failures with manually set flags that represent no
existing CPU

Fixes Ticket3653

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6310eb8010b7a3b3016e297132380cbd4e3d2d10)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:59:49 +02:00
Michael Niedermayer
9ea1e82d68 avcodec/diracdec: move mc buffer allocation to per frame
Fixes out of array accesses for non default buffers with large strides

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4a30f08505a4e85718896ff233c97be41a9754ca)
2014-06-02 22:59:49 +02:00
Michael Niedermayer
5cd2cdf33f Merge commit '0ec75a04e5fc714bc3cd6e2a6b783e6df834ad01' into release/2.2
* commit '0ec75a04e5fc714bc3cd6e2a6b783e6df834ad01':
  ppc: Fix compilation for ppc64le (ELFv2)
  aarch64: Use the correct syntax for relocations

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 22:34:22 +02:00
Michael Niedermayer
a5a6f6fec3 avformat/mov: allow seeking back to the begin even if nothing is marked as keyframe
Fixes Ticket 3663

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 96470ca22b3b46677de0e2df64e87c5ec80d752b)
2014-05-31 12:22:20 +02:00
Andreas Cadhalpun
88544e8ceb Fix spelling error 'Inconsistant -> Inconsistent'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eeb3baf7f7257ea5586bf857cc668f6aff81d556)
2014-05-31 12:20:51 +02:00
Andreas Cadhalpun
f183eaa3ad Fix spelling errors in texi files: accomodate -> accommodate allows to -> allows one to choosen -> chosen compability -> compatibility explictly -> explicitly overriden -> overridden specifed -> specified Trasmission -> Transmission
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9898bd9a82ad16f7ef2dcc26542827ff92255821)
2014-05-31 12:20:02 +02:00
Andreas Cadhalpun
d773d7775a Correct the FSF address for two avisynth files to '51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA'
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 64b6164b721c77cbb28b381af31bd8ea753818c5)
2014-05-31 12:18:31 +02:00
Andreas Cadhalpun
f15f4cefd7 Improve the detection of architecture x86.
This fixes building on Debian GNU/Hurd.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0f17bc644c4af0f9e0fab714fadf4f4f02140a0e)
2014-05-31 12:14:48 +02:00
Thierry Fauck
0ec75a04e5 ppc: Fix compilation for ppc64le (ELFv2)
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d6d767d93e532246cacf3567e6bcad76a821f838)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-05-30 22:56:02 +03:00
Martin Storsjö
34fb994d93 aarch64: Use the correct syntax for relocations
This fixes building in PIC mode with gas. The examples in the gas
manual showed using a # here even though gas itself actually didn't
support that syntax (and the gas test suite only tests it without
the extra hash sign).

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 08cd92144e73195eecc28ed0348e66e255516b82)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-05-29 14:48:13 +03:00
Anshul
acafd1814e ffprobe: fix crash happening because of new streams occuring
Fix trac ticket #3603.

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
(cherry picked from commit 73a60633143b7c51333a0772b45a47282ac445b6)
2014-05-21 22:53:49 +02:00
Carl Eugen Hoyos
bb01956d67 Use Matroska document version 2 for WebM files if possible.
Google's plugin for the Internet Explorer refuses to play
files with another document version.

Fixes ticket #3583.
(cherry picked from commit ab21acecc72a0299895583cf83347ab5e2444b71)
2014-05-12 23:20:05 +02:00
Michael Niedermayer
bc0c49b83e avformat/avidec: remove unused variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc8b45c0ce35465fd0efee7103e41bcc28251f99)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 18:18:31 +02:00
Michael Niedermayer
0008a87cb1 Merge commit 'e780c3daafe0588e035e752c771ebfcd2201746a' into release/2.2
* commit 'e780c3daafe0588e035e752c771ebfcd2201746a':
  pcm-dvd: Fix 20bit decoding

Conflicts:
	Changelog

See: 5db49fc38d9132e134de92584f296559bec3b789
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 18:10:47 +02:00
Michael Niedermayer
2aa6592338 Merge commit '7f954ca502a16feeca44d4e9a7d450b404dabc94' into release/2.2
* commit '7f954ca502a16feeca44d4e9a7d450b404dabc94':
  avi: Improve non-interleaved detection

Conflicts:
	Changelog
	libavformat/avidec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:59:58 +02:00
Michael Niedermayer
2b14d98086 avformat/avidec: Check required demuxing buffer sizes in guess_ni_flag()
Fixes Ticket3421

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5d75730c58f72918a41bb5abda4b448ecdd4273c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:59:50 +02:00
Michael Niedermayer
a05f86ec10 Merge commit '8e9e57ed0c7f40741da1ca83e52c851263e0c168' into release/2.2
* commit '8e9e57ed0c7f40741da1ca83e52c851263e0c168':
  Update Changelog

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:31:57 +02:00
Michael Niedermayer
9bdb254b98 Merge commit '1bd6372cd34935815c0a061adbf3bc68ca68ff73' into release/2.2
* commit '1bd6372cd34935815c0a061adbf3bc68ca68ff73':
  arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:31:24 +02:00
Michael Niedermayer
358d1f6e01 Merge commit '40ffa99dfa39c574d8784a3c4eaf6406198d675d' into release/2.2
* commit '40ffa99dfa39c574d8784a3c4eaf6406198d675d':
  arm: hpeldsp: prevent overreads in armv6 asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:24:43 +02:00
Michael Niedermayer
ea28034f5d Merge commit 'ff79f6b35a94dde69b3d52bd2abdfdb793f525c3' into release/2.2
* commit 'ff79f6b35a94dde69b3d52bd2abdfdb793f525c3':
  avfilter: Add missing emms_c when needed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:10:07 +02:00
Michael Niedermayer
6452b31599 Merge commit 'e2a83d72da866a29f5307a56f66c469966f02473' into release/2.2
* commit 'e2a83d72da866a29f5307a56f66c469966f02473':
  Update Changelog for v10.1

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:09:47 +02:00
Michael Niedermayer
a14969253a Merge commit '6c3985713b77c5c1155f31c3fbb8236f9b4cdfb5' into release/2.2
* commit '6c3985713b77c5c1155f31c3fbb8236f9b4cdfb5':
  Add missing changelog entries for v10

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:03:53 +02:00
Michael Niedermayer
fab9a7be76 Merge commit '7d97cc8d87ebf6ebe7ec1865d6f932c652dbce3a' into release/2.2
* commit '7d97cc8d87ebf6ebe7ec1865d6f932c652dbce3a':
  rtmpproto: Check the buffer sizes when copying app/playpath strings

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 17:03:09 +02:00
Michael Niedermayer
3a67865963 Merge commit 'a56a9e65c6a17dd8b6303dd45bdc3e3368093092' into release/2.2
* commit 'a56a9e65c6a17dd8b6303dd45bdc3e3368093092':
  swscale: Fix an undefined behaviour

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 16:44:08 +02:00
Michael Niedermayer
3fb754712c Merge commit '428b629eb28907738ae98331b9f6c25cc9a8f3c8' into release/2.2
* commit '428b629eb28907738ae98331b9f6c25cc9a8f3c8':
  vp9: Read the frame size as unsigned

Conflicts:
	libavcodec/vp9.c

See: c72f587353d9f88c7fbbbf6ef78b1d9ba3d38fd7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 16:43:45 +02:00
Michael Niedermayer
e5294f407a Merge commit '194d12345d86c15b20b7e44a3679c9df3075d7f6' into release/2.2
* commit '194d12345d86c15b20b7e44a3679c9df3075d7f6':
  dcadec: Use correct channel count in stereo downmix check

Conflicts:
	libavcodec/dcadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 16:23:49 +02:00
Michael Niedermayer
ed1ad2f5eb Merge commit 'b3d8276d2dc913d708d187fb15f6e98869d00500' into release/2.2
* commit 'b3d8276d2dc913d708d187fb15f6e98869d00500':
  dcadec: Do not decode the XCh extension when downmixing to stereo

Conflicts:
	libavcodec/dcadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-11 16:23:29 +02:00
nu774
e780c3daaf pcm-dvd: Fix 20bit decoding
Increment the pointer as needed.

Bug-Id: 592

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 9880a0d4b131ef36694d62f78060350a81f08b80)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-10 12:03:46 -04:00
Michael Niedermayer
7f954ca502 avi: Improve non-interleaved detection
Additional fixes by Nigel Touati-Evans <nigel.touatievans@gmail.com>.

Check the index for streams with a time drift of 2s or a buffer drift
of 64MB.

Bug-Id: 666
CC: libav-stable@libav.org
Sample-Id: yet-another-broken-interleaved-avi.avi

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 9d599e3f6e61438772d8cddd6c9b7c495251f51e)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-10 12:00:40 -04:00
John Stebbins
8e9e57ed0c Update Changelog 2014-05-10 11:43:08 -04:00
Janne Grunau
1bd6372cd3 arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
The overread avoidance fix in cbddee1cca0ebd01e8c5aa694d31228eb4de4b41
broke the computation for the last row since it prevented the safe
reading from the height+1-th row.

CC: libav-stable@libav.org
(cherry picked from commit 61985ad72c47bbb668f2d3923bf5c9df83e79323)
2014-05-10 11:11:50 -04:00
Janne Grunau
40ffa99dfa arm: hpeldsp: prevent overreads in armv6 asm
Based on a patch by Russel King <rmk+libav@arm.linux.org.uk>

Bug-Id: 646
CC: libav-stable@libav.org
(cherry picked from commit cbddee1cca0ebd01e8c5aa694d31228eb4de4b41)
2014-05-10 11:11:43 -04:00
Luca Barbato
ff79f6b35a avfilter: Add missing emms_c when needed
Arch specific calls should have an emms_c following to keep the cpu
state consistent.

Reported-By: wm4
CC: libav-stable@libav.org
(cherry picked from commit e995cf1bccc6e91bbaa6a8771e23fb3ab259c110)
2014-05-10 11:11:21 -04:00
Reinhard Tartler
e2a83d72da Update Changelog for v10.1 2014-05-10 10:05:03 -04:00
Reinhard Tartler
6c3985713b Add missing changelog entries for v10 2014-05-10 10:01:37 -04:00
Martin Storsjö
7d97cc8d87 rtmpproto: Check the buffer sizes when copying app/playpath strings
As pointed out by Reimar Döffinger.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 0bacfa8d37710b904897e7cbeb8d6f96fbf75e2e)

Conflicts:
	libavformat/rtmpproto.c
2014-05-08 20:00:47 -04:00
Luca Barbato
a56a9e65c6 swscale: Fix an undefined behaviour
Prevent a division by zero down the codepath.

Sample-Id: 00001721-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 3a177a9cca924e097265b32f9282814f6b653e08)
2014-05-08 19:56:00 -04:00
Luca Barbato
428b629eb2 vp9: Read the frame size as unsigned
Sample-Id: 00001723-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 925c37874b617816b6f460c6f229c18b46548b46)
2014-05-08 19:56:00 -04:00
Tim Walker
194d12345d dcadec: Use correct channel count in stereo downmix check
s->prim_channels is greater than num_core_channels
when an XCh extension is present in the bitstream.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 801c39e1e3058fc4ba822bfb5d8612d777111e32)
2014-05-07 23:51:01 +02:00
Tim Walker
b3d8276d2d dcadec: Do not decode the XCh extension when downmixing to stereo
This is neither necessary nor currently supported.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit c8cf461c19e8e35df4b7364d9b90aa42f1ab4560)
2014-05-07 23:50:53 +02:00
Michael Niedermayer
c2eb668617 Update for 2.2.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:41:34 +02:00
Lukasz Marek
c9c223ba00 lavd/opengl_enc: fix pixel data alignment
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8ff72924cfeb3c8fa8fc57cfea3f78ca0caaec0f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
9d0ff6436e ffmpeg: print an error at the end if conversion failed
Fixes Ticket3477

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fed0acebade8d27c428da5cad483cd6a5b64b354)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
02b7b125b5 avfilter/graphdump: Fix pointer to local outside scope
Fixes CID1194435
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 18af0ce62da322176f7bd283b85314d2f41bee2c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
5643668308 ffmpeg_filter: fix pointer to local outside scope
Fixes CID1206652
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 09b16619d33ddf93005060d0782f28a1c1cbb7f6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
2d18e7f3ef avcodec/mjpegdec: Fix undefined shift
Fixes CID1194388

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b4329605289e25bb071ec1c1182bf25fc83b09aa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
f1b5830182 avformat/h263dec: Fix h263 probe
The code was missing 1 bit in the src format

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc145e576a443bfc89efdf35b91fd3c9ca0d8388)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
c588316555 avfilter/filtfmts: Support dynamically allocated in/outputs
Fixes crash
Fixes Ticket3468

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 59c7615d58b5b7ea9caff2c8c774677973eb4f1c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
afd1f61944 iavcodec/vc1dec: Fix missing {}
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb53beb81a5b9192c79de401f1e1e13fadddc429)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
16a9c5ea9e avfilter/vf_deshake: fix loss of precission with odd resolutions
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 73734282e0e4df92269984ee1671424e39249481)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
83fb31a76d avfilter/f_select: fix loss of precission in SAD calculation
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5a8ef3c66b762f265b05aa096105555f1d26879c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
fc5b32877a avcodec/g723_1: add assert to help static code analyzers
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1457f3fd90e17745791354fbb87899fc4803085a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
10e023c4fa avcodec/diracdec: fix undefined behavior with shifts
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b8598f6ce61ccda3f2ff0c730b009fb650e42986)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
27a3a59428 avformat/mpegts: Remove redundant check
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ff6fa0b4b980fc5b9f7653d7b159ae02c3d95210)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
8ab849cddc avcodec/fic: Fix return value check
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 230db1426d127a25c03b457fec25900653de2721)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
5191b00155 avcodec/dcadec: fix error message suppression code
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f202af29c93f3e9b4103c3c254a8974d7c662315)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
1131e7a1a4 avcodec/mjpegen: Fix declared argument size
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 256f530603ef3838a712a4fcd737b46b7bce455e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
26becbcd2a swscale/swscale: fix srcStride/srcSlice typo
Fixes part of Ticket3466
Found by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 14fa7fc6a81d5e59e05243cdc92108eab1b138ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
366cdd3548 avcodec/x86/idct_sse2_xvid: fix non C99 inline function
Found-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 46d5625f44185271862337d61cd246fd569c42a4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Stephan Soller
e3b08b3ad4 avformat/rtmpproto: Added handling of an initial RTMP chunk size packet.
Fixes ticket #2911.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 36b9c27dae452e10b4fff3d10f836160a5b8fbbd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-05 00:09:17 +02:00
Michael Niedermayer
fa16440659 Merge commit '79041d92ee7421853ee8c57fc13891cb0c272e0e' into release/2.2
* commit '79041d92ee7421853ee8c57fc13891cb0c272e0e':
  matroska: add the Opus mapping

Conflicts:
	libavformat/matroska.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 21:25:27 +02:00
Michael Niedermayer
c36fd16aaa Merge commit '82cebc0e0544dce507749dd9b1c2983f083de836' into release/2.2
* commit '82cebc0e0544dce507749dd9b1c2983f083de836':
  matroskadec: read the CodecDelay element

Conflicts:
	libavformat/matroska.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 21:01:38 +02:00
Michael Niedermayer
8c5897632a Merge commit 'c4e764aa6980dd9dc7c423921b415ff7261c944a' into release/2.2
* commit 'c4e764aa6980dd9dc7c423921b415ff7261c944a':
  rtmpproto: Make sure to pass on the error code if read_connect failed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 20:54:43 +02:00
Michael Niedermayer
b34fce9c54 Merge commit '9d02e38d3f03100784348ff75fd181d2aaad7e43' into release/2.2
* commit '9d02e38d3f03100784348ff75fd181d2aaad7e43':
  lavr: allocate the resampling buffer with a positive size

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 20:14:18 +02:00
Michael Niedermayer
742f9aa879 Merge commit '0f6e309b97e3da83a0fa75fbf1c4b50cd72047eb' into release/2.2
* commit '0f6e309b97e3da83a0fa75fbf1c4b50cd72047eb':
  mp3enc: Properly write bitrate value in XING header

Conflicts:
	libavformat/mp3enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 20:13:41 +02:00
Anton Khirnov
79041d92ee matroska: add the Opus mapping
(cherry picked from commit 141fdc763c2841b572d29a2ad78513e8d5325870)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-05-03 16:22:58 -04:00
Anton Khirnov
82cebc0e05 matroskadec: read the CodecDelay element
(cherry picked from commit eb3b5501e8b85bfea09d533314cb6920efc42639)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>

Conflicts:
	libavformat/matroskadec.c
2014-05-03 13:50:26 -04:00
Michael Niedermayer
09abca6802 sws: dont use the optimized 410->420 unscaled conversion when height%4
Fixes Ticket3594
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 421b21ca8a02a346ba03cea3bb2ecc33f791fc30)
2014-05-01 18:23:30 +02:00
Michael Niedermayer
43d64829e6 avcodec/vorbisdec: try to workaround libvorbisenc bug
Fixes Ticket3590

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0a266cb55af9794fc5cff695d35cae4111e4334f)
2014-05-01 18:22:19 +02:00
Michael Niedermayer
4a479fd3e6 swresample: fix AV_CH_LAYOUT_STEREO_DOWNMIX input
Fixes Ticket 3542

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 291d464161a5bf3b566bc147f83e4242b0c18d74)
2014-04-24 08:59:56 +02:00
Michael Niedermayer
4f41717d01 avformat/mux: Check for and remove invalid packet durations
Fixes assertion failure
Fixes Ticket3575

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dc6a17cf74a90e41d70ea1753cdb70c0a5b2ced8)
2014-04-24 08:56:58 +02:00
Michael Niedermayer
6896dcbf5f avformat/avidec: Speed up keyframe detection code
Fixes Ticket3531

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 57fb570908df2e84b11635f12b5be1fb27f053eb)
2014-04-23 17:11:23 +02:00
Stefano Sabatini
14404170b9 ffprobe: fix scaling of vali in value_string() in case -prefix is selected
Fix trac ticket #3523.
(cherry picked from commit 1ba59b1cbeafe7cd28db04f772abd89eb7e4ce1e)
2014-04-23 17:11:16 +02:00
Michael Niedermayer
e9e42beed2 avformat/asfenc: dont allow non interleaved packets
The muxer does not support this currently

Fixes ticket #3547.
Fixes ticket #3555.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 369cdf917aaa5d7fbc61d57f87e638772e806716)
(cherry picked from commit 514ec9bece86fed440ac829c10e82c4a0569c3a5)
2014-04-23 17:10:26 +02:00
Michael Niedermayer
abd6decd55 avformat/pmpdec: remove cur_dts timestamp hack
It appears the demuxer works fine without it

Fixes Ticket3534

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5b19fc7aae986d6fa3d689f581b37e4bfba4f2d0)
2014-04-23 17:01:36 +02:00
Michael Niedermayer
0385c824f1 avformat: Fix decoder search in find stream info
Fixes Ticket3548

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3743901d7df906342f99b179382b19d8a4d9716)
2014-04-23 16:58:23 +02:00
Martin Storsjö
c4e764aa69 rtmpproto: Make sure to pass on the error code if read_connect failed
Previously, if read_connect failed, the ret variable was unmodified
and had the value 0, indicating success, which then was returned from
the rtmp_open function, even though it actually failed.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6477139721f559b26eafd415e23e13ea2b0c27e1)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-04-19 22:03:57 -04:00
Anton Khirnov
9d02e38d3f lavr: allocate the resampling buffer with a positive size
This fixes cases where very few input samples (fewer than needed for one
output sample) are passed to lavr at the beginning.
CC:libav-stable@libav.org

(cherry picked from commit ac976ed91e323754e9a84509873ebdb437372797)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-04-19 22:03:29 -04:00
Peter Ross
30cf47c6f0 ff_id3v2_read: add option to limit ID3 magic number search
Several chunked formats (AIFF, IFF,DSF) store ID3 metadata within an 'ID3 '
chunk tag. If such chunks are stored sequentially, it is possible for the
ID3v2 parser to confuse the chunk tag for the ID3 magic number. e.g.

[1st chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]
[2nd chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]

Fixes ticket #3530.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5331773cc33ba26b9e26ace643d926219e46a17b)

Conflicts:
	libavformat/dsfdec.c
2014-04-19 13:00:57 +02:00
Peter Ross
b45cd17d29 ff_id3v2_free_extra_meta: set the pointer pointing to extra_meta to NULL
Fixes ticket #3530.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c94305ae23318c8956a30485cd5642829f4f16a9)
2014-04-19 12:59:18 +02:00
Carl Eugen Hoyos
26b6d70c72 Do not overwrite VDPAU structures in ff_MPV_frame_start().
Fixes crashes with VDR and MPlayer as reported by irc user crow.
(cherry picked from commit 941b2240f2ce59c41f4a9ffec88c512f64c75613)
2014-04-18 10:32:43 +02:00
Anh
32919db4fb Fix compilation with --disable-everything --enable-muxer=avi --disable-network.
Fixes ticket #3568.
(cherry picked from commit c150e2cf324ce0572bb8b9b3501c45465cfbf360)
2014-04-16 20:07:51 +02:00
Michael Niedermayer
56f44c26f0 avutil/avstring: do not lose ascii characters when decoding non utf-8 with av_utf8_decode()
Fixes Ticket3363

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a31547ce2e5c46d7a7005fe70dcf9b3a7c5fc4ac)
2014-04-16 19:20:20 +02:00
Michael Niedermayer
fe87a40de6 ffprobe: do not lose non ascii characters in non utf8 strings
Fixes Ticket3363

Using U+FFFD REPLACEMENT CHARACTER as suggested by nicolas

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ca6dd53a734d6fc453de425340d7e9ec4ef385b5)
2014-04-16 19:20:03 +02:00
Michael Niedermayer
0f6e309b97 mp3enc: Properly write bitrate value in XING header
Instead of using a fixed bitrate_idx, calculate a matching bitrate for
the XING header.

Using a fixed bitrate_idx causes tools such as file(1) and mediainfo(1)
to report wrong bitrate and bitrate mode when using CBR.

Bug-Id: https://bugs.debian.org/736088

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 617a1a98a6be3e59db6fbfc21afab2fb9a049c03)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2014-04-12 10:49:30 -04:00
Derek Buitenhuis
96e13c9897 libx265: Use x265_param_parse to set the SAR
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
(cherry picked from commit 8945dcbb52b6b87e1e6479912cce89c7da54ec43)

Conflicts:
	libavcodec/libx265.c
2014-04-11 16:45:33 -03:00
Michael Niedermayer
e72c0a0466 update for 2.2.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 05:09:51 +02:00
Anthoine Bourgeois
dfddefa13a avcodec/dirac_arith: Fix build with PIC and stack-check options
Fixes Ticket3540

The function dirac_get_arith_bit in libavcodec/dirac_arith.h can't be
built with PIC and check-stack because the asm code needs 6 registers
and PIC and check-stack options take 1 each and x86 is quite limited
in this area.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d8ab7f31dd819f7b3e0d460a2fa4261aaae87b98)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
ce94955b3c swscale/x86/swscale_template: loose hardcoded dstw_offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f6759d9ad4a8b71e6f212ca4f1e7da9fa56d3298)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
dde95268cc swresample/resample: use av_malloc_array() where appropriate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5027f39712fdce25b9008e72d52e5abfeefd5fe6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
d20ac551a8 swresample/dither: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a5290cb1ac047851563da7aca06569e3ada55f79)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
352b0969e2 swresample/resample: Limit filter length
Related to CID1197063

The limit choosen is arbitrary and much larger than what makes sense.
It avoids the need for checking arithmetic operations with the length for overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f9158b01d0f3effb58e87fb07db0382bc1e47de5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
b479b42b26 avcodec/msrle: check return code for success before use
The check is possibly redundant, but better to check for errors
that dont occur than to skip the check and crash

Fixes CID1197060

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 754f84663e8b3a88fa2e953b195d59230393fb8d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
36cab9c408 avcodec/pthread_frame: fix missing unlock on error
Fixes CID1197057
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f87b3d552394cd03c1e9f180553d41600c575c69)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
34592d04fb examples/avio_reading: fix null dereference on error
Fixed CID1197052
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 419800acc46afc0c3b7319d6e216d0da207ebbb7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
544accc895 avformat/omadec: fix probetest failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a84f9c75bc3f55fed4f68d2503a08ab70c76ecbe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
f41622ecb4 avcodec/wma: use av_freep(), do not leave stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d167faafe9dfa0b82bebb267c3c4e5fa5286bd67)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Lukasz Marek
fc8eb4c1f9 lavu/opt: validate range before dereference
This change make error handling simplier.
av_opt_freep_ranges may be called when some ranges are NULL,
for example after memory allocation fail.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3aac5fcfa9d3748659d78ab2a66d0ccce22cfd4f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
02bae9f013 avcodec/h264: clear cur_pic structure instead of duplicating it in ff_h264_update_thread_context()
Fixes crash

Found-by: iive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8710ee11d75eebc17e7d63bc6ffb91766933bd68)

Conflicts:

	libavcodec/h264_slice.c
2014-04-10 04:53:00 +02:00
Michael Niedermayer
5cb2a1c3f0 avfilter/vf_pullup: fix gray8
Fixes segfault
Fixes Ticket3469

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e818ee090ac53d1b333a7d6a45274f75cf1a71a1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
a221c9bd76 avcodec/libx264: move where x264opts is applied down so it isnt overridden by avctx & defaults
fixes x264opts opengop=1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 64b79141bdfdffaa9fda69eecce140473d0a9a18)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:53:00 +02:00
Michael Niedermayer
b2583c2b62 Merge commit 'e0aa76d38a02090245284fc157afb9074e9ff073' into release/2.2
* commit 'e0aa76d38a02090245284fc157afb9074e9ff073':
  golomb: Fix the implementation of get_se_golomb_long

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:46:00 +02:00
Michael Niedermayer
bd553941ae Merge commit 'a014b9614e6165fb8df9e756f46a95d516794678' into release/2.2
* commit 'a014b9614e6165fb8df9e756f46a95d516794678':
  Prepare for 10.1 Release

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-10 04:35:35 +02:00
Martin Storsjö
e0aa76d38a golomb: Fix the implementation of get_se_golomb_long
This was only used in hevc muxing code so far.

This makes the return values match what get_se_golomb returns for
the same bitstream reader instances.

The logic for producing a signed golomb code out of an unsigned one
was based on the corresponding code in get_se_golomb, which operated
directly on the bitstream reader buffer - not on the equivalent
return value from get_ue_golomb.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 508a84e6726ab94a740c160b30fd8162265d1fef)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-03-30 12:45:40 +03:00
Reinhard Tartler
a014b9614e Prepare for 10.1 Release 2014-03-29 13:03:59 -04:00
Andreas Cadhalpun
31c21d2f69 Fix spelling errors in texi files: more informations --> more information allows to --> allows one to
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d473f2d18aef6731526324d28008874fac05f593)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Andreas Cadhalpun
3cd1c8653b Fix texinfo error due to wrong @subsubsection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf3bfc970c7a567763aef4bf7ce827f84d692fd6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
194485cfba avfilter/vf_pullup: zero freed memory for saftey
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a44409e692e8f369368215fb16b34749cff0d35c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
wm4
81cfe39113 vf_pullup: simplify, fix double free error
The memory allocation for f->diffs was freed multiple times in some
corner cases. Simplify the code so that this doesn't happen.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5b0ce5d4e3660fb0fc86779cbd027b47b1758c9f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
ef0c503d37 avcodec/h264_mp4toannexb_bsf: prepend global headers before any in stream parameter sets
Fixes h264_mp4toannexb_bsf_failure.mkv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 289b149cecb381522cc9ccdf382825330169c655)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
James Almer
1103aec1df x86/cpu: check for OS support before enabling AVX2
AV_CPU_FLAG_AVX is enabled at this point only if there's OS support.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d9821a2081aff5dca253386c6e7e71a04509cff)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
b40ab81d1f avcodec/x86/mpegvideoenc_template: fix integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
314f055c29 dox/scaler:fix bicubiclin typo
See Ticket3486

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 575b957758670d6094e9095acfcc24e4e32fc4a7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
2c566744c4 avcodec/vorbis: fix decoding of single element huffman trees
Fixes Ticket2893

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 742d8601031fc69748f62fe7c5164a22a0751021)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
adad1ba5d8 avcodec/vorbisdec: use the stored previous window type only when the actual previous is not known
Fixes Ticket3432

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5171ae781a240cac3860c20f9aefc6d1b2c61cac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Michael Niedermayer
a80a7131d1 swscale/swscale: fix integer overflow
Should fix fate failure with clang ftrapv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c9c0451224fd7bc38b4e135e99f114f80c1ae67f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-27 11:20:56 +01:00
Carl Eugen Hoyos
3ab63abbd4 Do not set swscale sizeFactor to -1.
Fixes ticket #3495.
(cherry picked from commit e6fe804bdd6272de633ecf3fc73e1aba6746f641)
2014-03-26 11:05:41 +01:00
Michael Niedermayer
d2c76782e0 update for 2.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 21:13:49 +01:00
Andrey Myznikov
4dc8b4d7d0 Fix pthread-related compile errors in iec61883.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9deecdf85f0c1cebcc0a157114bf6dbc02a0a120)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 21:01:50 +01:00
Michael Niedermayer
9ff0467566 Move avpriv_find_pix_fmt() to utils.c
Fixes build with --disable-everything

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 82a90e7764ad04afd3679e4e4e89d85c7e4d4b53)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
4407b38b28 swscale/x86/swscale: fix missing xmm clobbers in yuv2yuvX_sse3()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6c47a4e972485e5f0c812159373f703c6f1d089f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
8caaf260a6 avformat/utils: detect MPEG streams with faulty DTS and discard affected DTS
Fixes issue2.ts

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2dcaa1b9d142ae113b28bffdbf7f8f8900b5e770)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
e1f51bbd1f avcodec/g2meet: also reset local got_header when reseting the context got_header
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8b8ae298afb32979c81310ffdc9904d29497db5f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
4b7c149306 avcodec/g2meet: fix error returns
Fixes out of array accesses

This should not affect any release

Fixes: 8ab69af9e5a7a7e20fe04cdd25c0d6e7-asan_heap-oob_e72b82_5505_cov_2278389485_g2m4.wmv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b53c1aa822e9c92be52a462dd0aef1c2010ce73)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
e8919d6522 Revert "mpegts: do not set pts for missing dts in video streams"
This reverts commit f65afef1df49f53e14c8d4173ff960fff8d44ecb.

If only pts is coded then dts must be equal pts
See Rec. ITU-T H.222.0 (06/2012) / ISO/IEC 13818-1:2013 (E) 2.7.5

Found-by: Baptiste Coudurier
(cherry picked from commit 0bf882864ecd228d53555c57595eeca048662991)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
b017785fa5 avformat/mp3dec: optimize mp3_seek() for dir < 0
this minimizes the amount of protocol seeks and reading needed in that case

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 171dd67520b649a5b7a0f4fbff72ac88bbedfeab)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
01507eb1f8 avformat/aviobuf: optimize sequential backward seeking
This reduces the number of protocol seeks

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9600486d10a9728f1503363334268ecfafa9b0e5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
938ff93710 avformat/aviobuf: factorize buffer_size out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2adf422ce24bd8038d5d2f50549d0d3fb4170171)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
0c88d539f8 avcodec: Add padding after the remaining AVFrames
This limits ABI issues in case libavcodec is linked to a libavutil with larger AVFrame
Which can happen if they are shiped in seperate binary packages and libavutil is upgraded

A cleaner alternative would be to replace them by pointers but this would likely cause
a small speedloss

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc567ac49e17151f00f31b59030cd10f952612ef)

Conflicts:

	libavcodec/h264.h
(cherry picked from commit 618d062bd553a7d7fad194d4236913f2b0a0251e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
e39a992bd1 avformat/mp3enc: use av_copy_packet()
Fixes double free
Fixes Ticket3476

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d003a0cd2e587a47627fd328f9fc5a484adc29f2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
72a12f61ef avcodec/snowenc: allow larger mb variances
Fixes assertion failure
Fixes Ticket3463

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2fd14f062cfc52db1529a46b53a26b06cb418f55)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
30ae080e9d avcodec/ratecontrol: make (mc_)mb_var_sum(_last) 64bit
This avoids hypothetical integer overflows
(cherry picked from commit b4356c9cc28197bb8da626ece08d4a062b62afc8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
dca463b728 avcodec/mpegvideo: make mc_mb_var_sum / mb_var_sum 64bit
This avoids a hypothetical integer overflow with very high resolution video

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e92a78a4095d69d876bef189225608a35166dc4a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
25b462cab9 avcodec/mpegvideo: make mc_mb_var_sum_temp / mb_var_sum_temp 64bit
This avoids a hypothetical integer overflow with very high resolution video

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c3272674c943474ec6bfcd75e0d9b4b4ca95ff32)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
7c6a8afa7e ffmpeg: dont call exit_program() from a signal hander
This is unsafe and can deadlock amongth other things

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9dca02ee541120de2a96c387faed9a4e033a60fd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
b052525f9b avcodec/mjpegdec: Switch default interlaced polarity for MJPG to 1
Fixes Ticket3229

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dde16f5aaed327e15049b40a8dfae1f59647e4ec)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
90c7bfb9be avcodec/mjpegdec: parse avid data from extradata
Makes no difference for any file tested but is needed
for following bug-fix

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 493296800c4cfd76561f71ded5f0893108063e67)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:05 +01:00
Michael Niedermayer
7bdd348e58 avcodec/mjpeg: print info from parse_avid() if requested
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 046a75eea091e7d079bd3e5c9f5f028d7b920c32)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Michael Niedermayer
af3d003658 avcodec/mjpegdec: switch interlaced_polarity to 0 for PAL AVID
0 should have been the default, this change should make no difference
but this is needed for the following bugfix

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 98f9aa389b2de69118cd599235b2208b3c311c4c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Michael Niedermayer
c00beff5e0 avcodec/mjpegdec: factorize parse_avid out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1083c479eb6e5bcd5220fdd165cf9312f29a0985)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Michael Niedermayer
57a43142ba avcodec/utils: fix sizeof(AVFrame) dependence in avcodec_encode_audio2()
This is a bit tricky, we allocate a correctly sized AVFrame but then only
copy the compile time AVFrame size, this is to ensure that user applications
which do not use the correct av frame API dont end with out of array reads.
Note, applications using the correct API have set extended_data and the
changed code will never be executed for them.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8ab80707841a73ca7708e1e1aa97f3513fff3d35)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Nicolas George
99905118a8 lavd/xv: take aspect ratio into account.
(cherry picked from commit c37bbe54f400edc8cb0070138328048943e90b1a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Nicolas George
dcf560204c lavc/pthread: copy packet side data.
(cherry picked from commit ea6825fd090ef3f8edbce506d2fbf6e187f585fa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:31:04 +01:00
Michael Niedermayer
5b0e2eb041 Merge commit 'f25e6e0c255a6d81971fe66f6c32d29be0706f3d' into release/2.2
* commit 'f25e6e0c255a6d81971fe66f6c32d29be0706f3d':
  RELEASE_NOTES: mention new filters

Conflicts:
	doc/RELEASE_NOTES

Not merged as these things where in past ffmpeg releases already.
    Or at least some of them where, volunteers to checks this and update
    our release notes are welcome

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 20:29:23 +01:00
Carl Eugen Hoyos
d461e077a5 Always pass the configure option sysroot to --sysroot and -isysroot.
On darwin, --sysroot may be ignored.

(cherry picked from commit cc6d549adbb838ef87b1f251ca469dc4c3dd39aa)
2014-03-23 20:12:54 +01:00
Michael Niedermayer
9a884b7b97 Merge commit '80239a8bb11f730d95f03dfbd0deab258b413b0e' into release/2.2
* commit '80239a8bb11f730d95f03dfbd0deab258b413b0e':
  af_channelmap: fix ONE_STR mapping mode

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 19:56:37 +01:00
Michael Niedermayer
9abe0bfb7f Merge commit '26bbc1c242ebfeec3c49585207efac7293632433' into release/2.2
* commit '26bbc1c242ebfeec3c49585207efac7293632433':
  Prepare for 10 Release

Conflicts:
	RELEASE

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 19:54:52 +01:00
Carl Eugen Hoyos
13682b48e9 Autodetect VDA like all other hardware acccelerations.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 942cded690bc6dc931c60078f39cf0f339a89058)

Conflicts:
	configure
2014-03-23 19:05:59 +01:00
Vittorio Giovara
f25e6e0c25 RELEASE_NOTES: mention new filters 2014-03-23 17:28:34 +01:00
Anton Khirnov
80239a8bb1 af_channelmap: fix ONE_STR mapping mode
get_channel() returns 0 on success

CC:libav-stable@libav.org
(cherry picked from commit e843612695007cc623813073754c651ab43021f7)
2014-03-23 11:41:40 -04:00
Reinhard Tartler
26bbc1c242 Prepare for 10 Release 2014-03-23 11:38:38 -04:00
Michael Niedermayer
efe259a27e Merge commit '29d61d73b1cbf0dcd1f79bc49c7df01b0a377c85' into release/2.2
* commit '29d61d73b1cbf0dcd1f79bc49c7df01b0a377c85':
  movenc: Allow override of major brand in ftyp atom

Conflicts:
	libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 04:05:56 +01:00
Michael Niedermayer
49f11e12d5 Merge commit '9a6a7109985cbd3a20707b40cc31ed53a174195c' into release/2.2
* commit '9a6a7109985cbd3a20707b40cc31ed53a174195c':
  matroskaenc: enable Annex B to MP4 conversion for HEVC tracks.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:20:00 +01:00
Michael Niedermayer
d130fae519 Merge commit 'daaef403d122b35d87b27d6b369d287b1ed06973' into release/2.2
* commit 'daaef403d122b35d87b27d6b369d287b1ed06973':
  matroskaenc: write private data in hvcC format for HEVC.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:14:03 +01:00
Michael Niedermayer
dde996bf99 Merge commit '0f42e06651c9c4d7581b70b9ad2b160c2525094f' into release/2.2
* commit '0f42e06651c9c4d7581b70b9ad2b160c2525094f':
  doc: Point to the correct, actually maintained gas-preprocessor repo

Conflicts:
	doc/platform.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:12:28 +01:00
Michael Niedermayer
cad2958fd7 Merge commit '230c4c6ad9f74697e77351d32e679bf0c24478ea' into release/2.2
* commit '230c4c6ad9f74697e77351d32e679bf0c24478ea':
  armv6: vp8: use explicit labels in motion compensation asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:11:19 +01:00
John Stebbins
29d61d73b1 movenc: Allow override of major brand in ftyp atom
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
(cherry picked from commit 1e9db41e2a2166be5671b088ef4ad06a40af459f)
2014-03-23 00:50:02 +01:00
Tim Walker
9a6a710998 matroskaenc: enable Annex B to MP4 conversion for HEVC tracks.
(cherry picked from commit 558b20d729bc296d8e6a69f03cd509ad26a4827d)
2014-03-21 00:55:16 +01:00
Tim Walker
daaef403d1 matroskaenc: write private data in hvcC format for HEVC.
(cherry picked from commit a823d0948683bd97dd58556b5740e434166209a8)
2014-03-21 00:55:00 +01:00
Carl Eugen Hoyos
207f5a138a Add APIchanges entry and bump libswscale micro version for making gray16 full-scale. 2014-03-19 09:14:53 +01:00
Carl Eugen Hoyos
e9c8a9aaa6 swscale/utils: Fix color range of gray16
Improves rgb -> gray16 conversion

Fixes Ticket3422

The pam and png output files look visually similar, in both cases the
dynamics increase to 0x0 -> 0xfffb.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 37c07d45290cf9cdad061cd5c2af94a2783ba847)
2014-03-19 03:14:39 +01:00
Michael Niedermayer
7b7d8b8794 avcodec/mpegvideo_enc: dont use direct mode for unaligned input
Fixes Ticket3456

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 06a3185e38614ff22e4586675b85228f07819452)
2014-03-17 15:47:51 +01:00
Michael Niedermayer
90d6b563fe avcodec: Move STRIDE_ALIGN to internal.h
The next commit/bugfix will need it

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit da89572004f6c0279134d4c8c1c835496a2c4232)
2014-03-17 15:47:49 +01:00
Peter Ross
dce2f820e9 avcodec/adpcm: squelch 'mismatch in coded sample count' warning for AV_CODEC_ID_ADPCM_EA_R2/3
These ADPCM codecs include a per-frame flag that enables a raw 16-bit mode. Therefore
the the number of samples returned by get_nb_samples() is only ever approximate.

Fixes ticket #3460.

Signed-off-by: Peter Ross <pross@xvid.org>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7380201451a2edfb240cd356579c4c39a87cf5bd)
2014-03-17 15:46:12 +01:00
Peter Ross
4aab3f868f avcodec/adpcm: ADPCM_IMA_DK3 packets are padded to 16-bit packet boundary
Fixes ticket #3461.

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d1bb17940dd242e56541775318636bcbe3eab73d)
2014-03-17 15:46:00 +01:00
Michael Niedermayer
48609236da ffmpeg_opt: check that a subtitle encoder is available before auto mapping streams
Fixes Ticket3470

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 25bcf24d4d0faf0191923be8afac8f67ca98b500)
2014-03-17 15:45:49 +01:00
Michael Niedermayer
d8fe695779 avcodec/h264: be more tolerant on what pixel format changes trigger reinits
Fixes Ticket3260

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8e92ff25469f75f5c1fcbb9ba5721cea341ca34a)
2014-03-17 15:45:36 +01:00
Martin Storsjö
0f42e06651 doc: Point to the correct, actually maintained gas-preprocessor repo
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit d15c536123a44362ace6299c391a492c90b83fc7)
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-03-16 20:54:24 +02:00
Janne Grunau
230c4c6ad9 armv6: vp8: use explicit labels in motion compensation asm
The integrated arm assembler in clang-503.0.38 (Xcode-5.1) seems
to get confused by the offset of 4 and decides to use a non-wide
thumb encoding. That fails since the labels are out of range of
the limited offset a 16-bit thumb encoding offers.
2014-03-16 18:13:39 +01:00
Michael Niedermayer
f4489c9558 Merge commit 'b5210f4eae30df587815b5f005f219aa723591d3' into release/2.2
* commit 'b5210f4eae30df587815b5f005f219aa723591d3':
  http: Properly initialize icy headers string

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 04:12:43 +01:00
Michael Niedermayer
0e5d9fe2a7 Merge commit '10379d50be18325a07ef297bd2120d85a58ec78b' into release/2.2
* commit '10379d50be18325a07ef297bd2120d85a58ec78b':
  http: Declare more parameters as const where possible

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 04:12:29 +01:00
Michael Niedermayer
9ae2aaea50 Merge commit 'cd874cf8e69f1b31986fd978577994b45efa3d5c' into release/2.2
* commit 'cd874cf8e69f1b31986fd978577994b45efa3d5c':
  http: Allow setting a Content-Type for POST requests

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 04:06:49 +01:00
Michael Niedermayer
2513314912 Merge commit '82a3e469c6584e6d9e56a3fc38eb001d0650defa' into release/2.2
* commit '82a3e469c6584e6d9e56a3fc38eb001d0650defa':
  http: Improve options descriptions

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 04:02:57 +01:00
Michael Niedermayer
e727cbf0be Merge commit 'f859fed03d5d039430baea03a0ef35cfd6ac4abd' into release/2.2
* commit 'f859fed03d5d039430baea03a0ef35cfd6ac4abd':
  http: Always allow no-op seek

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:56:19 +01:00
Michael Niedermayer
bcc25353cf Merge commit '991e6fa35b4ad2df389ba7e1c2c58d064e295c76' into release/2.2
* commit '991e6fa35b4ad2df389ba7e1c2c58d064e295c76':
  http: Add support for selecting a request range

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:38:30 +01:00
Michael Niedermayer
6a10263f16 Merge commit '09dca5106698871920328ae8041d1437ce3cff43' into release/2.2
* commit '09dca5106698871920328ae8041d1437ce3cff43':
  http: Support setting custom User-Agent

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:38:07 +01:00
Michael Niedermayer
bcc6429c01 Merge commit '40de74d0eb8c1898e2184a1484fe246aed5b295d' into release/2.2
* commit '40de74d0eb8c1898e2184a1484fe246aed5b295d':
  http: Export Content-Type information

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:37:53 +01:00
Michael Niedermayer
bdb219435e Merge commit 'e2811c2ede428a20aec3630bef4378f2927fb306' into release/2.2
* commit 'e2811c2ede428a20aec3630bef4378f2927fb306':
  http: Add support reading ICY metadata

Conflicts:
	doc/protocols.texi
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:30:09 +01:00
Michael Niedermayer
a7338ae8ac Merge commit '25d14b716aef43bf9e82f1d67a364e5922332f47' into release/2.2
* commit '25d14b716aef43bf9e82f1d67a364e5922332f47':
  http: Refactor process_line

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:29:40 +01:00
Michael Niedermayer
6776c2c04f Merge commit 'f1de93dec302cc860c718e89656f184510b2d239' into release/2.2
* commit 'f1de93dec302cc860c718e89656f184510b2d239':
  http: K&R formatting cosmetics

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:29:24 +01:00
wm4
facd3dbc6e http: handle ICY in presence of chunked transfer encoding
Some http servers send an ICY stream in combination with chunked
transfer encoding. This case was handled incorrectly by the ICY code:
instead of handling chunked encoding before anything ICY related, both
were mixed.

Fix this by separating the ICY code from normal http reading. Move the
normal http reading to a new function http_read_stream(), while
http_read() handles ICY on top of http_read_stream().

The server identified itself as: cloudflare-nginx

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 636273d3d4a8c42f51832e8bf83e566e875916bf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 67f67a3748a038d880ed8a642184d2e3c76e29bb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:29:12 +01:00
Michael Niedermayer
8796c3b7d3 Merge commit '738d68d' into release/2.2
* commit '738d68d':
  http: Drop doxy comments

Conflicts:
	libavformat/http.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 03:00:17 +01:00
Michael Niedermayer
7430f3064f Merge commit '00ecce5' into release/2.2
* commit '00ecce5':
  http: Return meaningful error codes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 02:59:41 +01:00
Michael Niedermayer
eac281b06c Merge commit 'b920c1d' into release/2.2
* commit 'b920c1d':
  configure: Support older version of openjpeg1

Conflicts:
	configure

Not merged as the problematic pkg config code wasnt merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 02:58:57 +01:00
Alessandro Ghedini
b5210f4eae http: Properly initialize icy headers string
The icy_metadata_headers string never gets initialized, so,
during the first call to av_strlcatf() in parse_icy(),
strlen() will be called on a pointer to uninitialized memory.
At best this causes some garbage data to be left at the
start of the string.

By initializing icy_metadata_headers to the empty string, the
first call to strlen() will always return 0, so that data is
appended from the start of the string.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 6998a9f4c4e069f515c50614179f4cfc7d0184f5)
2014-03-15 09:54:28 -04:00
Martin Storsjö
10379d50be http: Declare more parameters as const where possible
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e77a2ea9505863e50bf013706f66bf8b7325e524)
2014-03-15 09:54:20 -04:00
Clément Bœsch
cd874cf8e6 http: Allow setting a Content-Type for POST requests
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 2572d07c1f0abd9e2bf3ed20dbe35c58f1dd6ac4)
2014-03-15 09:52:07 -04:00
Reinhard Tartler
82a3e469c6 http: Improve options descriptions
Add documentation where missing.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit fe568b3d27ca2c5cca3878b2a7a3a968e605aec4)

Conflicts:
	libavformat/http.c
2014-03-15 09:51:57 -04:00
Anssi Hannula
f859fed03d http: Always allow no-op seek
This also allows checking stream position as per ffurl_seek() doxy.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ab76d9f628ad46e1d3bbf26c5bf1f87083f239ab)
2014-03-15 09:51:17 -04:00
Anssi Hannula
991e6fa35b http: Add support for selecting a request range
Comment from Reimar Döffinger included as pro memoria.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 2ec33d27127251bbc45e1f88e60691ad59cf2319)
2014-03-15 09:51:10 -04:00
Clément Bœsch
09dca51066 http: Support setting custom User-Agent
Contextually make the default User-Agent use the common
"Name/Version" pattern.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ddfc98906373d1f17f6205cedd14c68d7a75995f)
2014-03-15 09:51:03 -04:00
Michael Niedermayer
40de74d0eb http: Export Content-Type information
Bug-Id: https://bugs.debian.org/740421

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit e58c85b0686892960042232e51c77168b264838a)
2014-03-15 09:50:54 -04:00
Luca Barbato
e2811c2ede http: Add support reading ICY metadata
Export the metadata as a icy_metadata_packet avoption.
Based on the work of wm4 and Alessandro Ghedini.

Bug-Id: https://bugs.debian.org/739936

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 8075c3d8bb1f6aade0cc7c5c40db9bc1bcd84cab)
2014-03-15 09:50:17 -04:00
Luca Barbato
25d14b716a http: Refactor process_line
(cherry picked from commit 4ff99ab3d7d5576e99e6b8a411b4a44500ed88fa)
2014-03-15 09:44:59 -04:00
Luca Barbato
f1de93dec3 http: K&R formatting cosmetics
(cherry picked from commit 7a2fddb4480121712df560cf619c1c3566cae3ff)
2014-03-15 09:44:59 -04:00
Luca Barbato
738d68de85 http: Drop doxy comments
(cherry picked from commit 78b21c1d7177e1d61ad3c9225f67699da089aa7c)
2014-03-15 09:44:59 -04:00
Luca Barbato
00ecce5c8b http: Return meaningful error codes
(cherry picked from commit 55a215ba63d9fa79cd7ee265ee2e777ee86b200c)
2014-03-15 09:44:59 -04:00
Michael Niedermayer
6ba07e9948 update for 2.2-rc2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 03:08:20 +01:00
Michael Niedermayer
125bea15d1 avcodec/libx265: fill headers in extradata
Fixes Ticket3457

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dded5ed9c5eb0c3d5a953e661ea21a9019e93ea4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Michael Niedermayer
70e3cc282b avutil/timestamp: Warn about missing __STDC_FORMAT_MACROS for C++ use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8b02dfd37cb3bc9521fc6e1f5b5f13c80d144cd2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Michael Niedermayer
242df26b44 mvformat/movenc: fix IMX
fixes Ticket3351

Tested-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 72d44f15834af68e2620a7051493359d7ee5b2c3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Michael Niedermayer
46c2dba20e doc/texi2pod: fix encoding type
docs say:
'A document having more than one "=encoding" line should be considered an error. '

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12ce58bebdff6bfae9c56dc785e3003968f93277)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Carl Eugen Hoyos
3caa6a5a57 Revert "Allow stream-copying grayscale mov files."
This reverts commit 691dec62011fe9993809fbc793126b40cac0c584.

The commit did not fix ticket #3215, it was fixed one commit earlier.
The revert may break other use-cases but they should be fixed differently,
the offending commit introduced too many problems.

Fixes ticket #3377.
Fixes ticket #3378.
(cherry picked from commit 54bbe3e2a645b4f7b36efac2bca331d3be98592a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Matt Oliver
bf08665e2e Fix modplug linkage on Windows.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 99b48fd448fa83252376d1ac96f17c953f07067c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:42:11 +01:00
Stephen Hutchinson
c4f5f4dbd3 doc/general.texi: Adjust the notes on AviSynth
FFmpeg provides local copies of these headers in compat/avisynth/,
and there is no restriction against using 2.5.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5336cd6374c7cbba9d6e65de1cec9404efcb665f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:41:27 +01:00
Michael Niedermayer
29df24252a Merge commit '2b9ee7d5b901e0d7ba617511e4ed31d3043894d3' into release/2.2
* commit '2b9ee7d5b901e0d7ba617511e4ed31d3043894d3':
  doc: Add section about AviSynth support

Conflicts:
	doc/general.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-15 02:40:44 +01:00
Luca Barbato
b920c1d5ad configure: Support older version of openjpeg1
It should work best for debian stable and people not installing the .pc
file.

(cherry picked from commit aa807425395caa17a85ed2833133278e8bd44a76)
2014-03-14 21:28:23 -04:00
Stephen Hutchinson
2b9ee7d5b9 doc: Add section about AviSynth support
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 908836e20743d7e9462011a9f30a300a5bf247ca)
2014-03-11 20:40:47 +01:00
Michael Niedermayer
f800cacada Merge remote-tracking branch 'qatar/release/10' into release/2.2
* qatar/release/10:
  lavf: always use av_free

See: 88c8e4afeaf74ee58b67145e0331e229d8050968
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:21:56 +01:00
Michael Niedermayer
5227eac5b0 Merge commit '6d56bc9a6d853a33fe53ab63db580c4facaba420' into release/2.2
* commit '6d56bc9a6d853a33fe53ab63db580c4facaba420':
  lavf: simplify ff_hevc_annexb2mp4_buf

Conflicts:
	libavformat/hevc.c
	libavformat/hevc.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:13:42 +01:00
Michael Niedermayer
bb40f8f5e2 Merge commit '2c5e1d0933facc20c6926a788cce05d3e6cad149' into release/2.2
* commit '2c5e1d0933facc20c6926a788cce05d3e6cad149':
  configure: Use the right pkgconf file for openjpeg

Conflicts:
	configure

No change as the incorrect code wasnt in ffmpegs configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:13:13 +01:00
Michael Niedermayer
ad8bf22086 Merge commit 'b37b83214ae3a462df1e8d3cc765ddbd2bfc73aa' into release/2.2
* commit 'b37b83214ae3a462df1e8d3cc765ddbd2bfc73aa':
  hevc: Use get_se_golomb_long

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:12:41 +01:00
Michael Niedermayer
7f8804296d Merge commit '6d7ab09788bdafffb3f3fc4f7feb262eb8cdf0b1' into release/2.2
* commit '6d7ab09788bdafffb3f3fc4f7feb262eb8cdf0b1':
  golomb: Add a get_se_golomb_long

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:16:27 +01:00
Michael Niedermayer
f67e75b5dc Merge commit '227cfc1f10a940c88ad3742ec805c07b6a5e7abb' into release/2.2
* commit '227cfc1f10a940c88ad3742ec805c07b6a5e7abb':
  vf_frei0r: adjust error messages

Conflicts:
	libavfilter/vf_frei0r.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:16:05 +01:00
Michael Niedermayer
35e63f35b0 Merge commit '416847d19593e87ee1704c26a9a638fd6b0d977c' into release/2.2
* commit '416847d19593e87ee1704c26a9a638fd6b0d977c':
  vf_frei0r: prevent a segfault when filter parameters are not set

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:15:51 +01:00
Michael Niedermayer
3bfb7a2537 Merge commit 'bd4ad1a1d52b8882df016826b8bdcf7b1009cb97' into release/2.2
* commit 'bd4ad1a1d52b8882df016826b8bdcf7b1009cb97':
  vf_frei0r: fix missing end of line character

Conflicts:
	libavfilter/vf_frei0r.c

No change as the token parsing change was not merged

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:15:21 +01:00
Michael Niedermayer
4a1e7a6fb7 Merge commit '6230de03aad9f26d5843afb913d196622e0b5b98' into release/2.2
* commit '6230de03aad9f26d5843afb913d196622e0b5b98':
  vf_frei0r: refactor library loading from env variable

Conflicts:
	configure
	libavfilter/vf_frei0r.c

Not merged, we use av_strtok() which leads to simpler code

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:14:41 +01:00
Michael Niedermayer
ff1e982205 Merge commit '45acc228a6d5f1e7d6c5ce6da63b293bd5eda57d' into release/2.2
* commit '45acc228a6d5f1e7d6c5ce6da63b293bd5eda57d':
  doc: fix a couple of typos in frame.h

Conflicts:
	libavutil/frame.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:09:13 +01:00
Michael Niedermayer
bb116e6ba3 Merge commit 'd37fac6dbbdddb76225aa691b83ffd9a0c7dae6b' into release/2.2
* commit 'd37fac6dbbdddb76225aa691b83ffd9a0c7dae6b':
  isom: lpcm in mov default to big endian
  movdec: handle 0x7fff langcode as macintosh per the specs

No change as these have been part of the branch previously

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:08:21 +01:00
Michael Niedermayer
ebe356bf1c avformat/hevc: fix mix of av_malloc() with free()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 88c8e4afeaf74ee58b67145e0331e229d8050968)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:06:13 +01:00
Michael Niedermayer
30099413ec Merge commit 'eabefe83f40a65d0f0c2a9a0521f6d96c3932545' into release/2.2
* commit 'eabefe83f40a65d0f0c2a9a0521f6d96c3932545':
  movenc: allow muxing HEVC in MODE_MP4.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:05:53 +01:00
Michael Niedermayer
186e0ff067 avformat/hevc: Make return codes consistent and more flexible
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5d5e2bd86242506a5af4b290b72e1c52f62f7fb6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:05:29 +01:00
Michael Niedermayer
2642ad9f55 Merge commit 'eaa79b79b25ac0ceaf44fe575a3ae724b87285b2' into release/2.2
* commit 'eaa79b79b25ac0ceaf44fe575a3ae724b87285b2':
  movenc: enable Annex B to MP4 conversion for HEVC tracks.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 12:04:54 +01:00
Michael Niedermayer
95ddd2227b avformat: fix hevcs use of golomb from avformat
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb403b2570385cbf48a11f9f48441de5cd01171e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:49:51 +01:00
Michael Niedermayer
3faebed6fa Merge commit 'c761379825ff0bf9dd191e244c4b2f7697fb2b3c' into release/2.2
* commit 'c761379825ff0bf9dd191e244c4b2f7697fb2b3c':
  movenc: write hvcC tag for HEVC.

Conflicts:
	libavformat/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:48:10 +01:00
Michael Niedermayer
3aee1fa5b6 Merge commit 'ea3309eba715e83027e8ece4a226e39a4bf2a6ce' into release/2.2
* commit 'ea3309eba715e83027e8ece4a226e39a4bf2a6ce':
  movenc: use 'hev1' tag for HEVC in MODE_MOV.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:47:51 +01:00
Michael Niedermayer
89a9c84ebb Merge commit '1c1e252cd1cbd5f59fe118c49f6d7207dbdfdbd4' into release/2.2
* commit '1c1e252cd1cbd5f59fe118c49f6d7207dbdfdbd4':
  movenc: Add a fallback fragmentation method for plain mp4 as well

Conflicts:
	libavformat/movenc.c

See: ef1aae6ea9aae9a523b6dcd8e670dbca823a88f8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:46:55 +01:00
Michael Niedermayer
0adde39e04 Merge commit 'ca2c9d6b9bfadb64e1502594fdf745a391699890' into release/2.2
* commit 'ca2c9d6b9bfadb64e1502594fdf745a391699890':
  hevc: make pps/sps ids unsigned where necessary

Conflicts:
	libavcodec/hevc.h
	libavcodec/hevc_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:39:46 +01:00
Michael Niedermayer
03ae616b19 Merge commit 'fa6b99d351ed483766a875054676a56fd8459774' into release/2.2
* commit 'fa6b99d351ed483766a875054676a56fd8459774':
  hevc: Do not turn 32bit timebases into negative numbers

Conflicts:
	libavcodec/hevc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:39:31 +01:00
Michael Niedermayer
830c3058ff Merge commit 'd79cb6947e4a9c42ac20925dd920d3a0910d9a26' into release/2.2
* commit 'd79cb6947e4a9c42ac20925dd920d3a0910d9a26':
  hevc: use av_mallocz() for allocating tab_ipm

See: 26568c04a8270ad792f3b86223914095b178b3a8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:29:06 +01:00
Michael Niedermayer
b12c5cbbb2 Merge commit '5aa4b29bbefc06fc2bbcb52af7a14393a1bcf504' into release/2.2
* commit '5aa4b29bbefc06fc2bbcb52af7a14393a1bcf504':
  hevc: Use get_bits_long() in decode_vui()

See: e15a57b67a2600e2fa6db8e6c8485add305671d1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:28:23 +01:00
Michael Niedermayer
82c96b5ad8 Merge commit 'e4cbd0d6e5a7b3b850d72f4f4ef0124b27dbdcbd' into release/2.2
* commit 'e4cbd0d6e5a7b3b850d72f4f4ef0124b27dbdcbd':
  changelog: Cleanups and prepare for v10_beta2

Conflicts:
	Changelog

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:23:30 +01:00
Michael Niedermayer
3e4b957847 Merge commit '0ede7b534483c5c90f404a8f11f776d2f2da4e7e' into release/2.2
* commit '0ede7b534483c5c90f404a8f11f776d2f2da4e7e':
  float_dsp: fix errors in documentation

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:22:10 +01:00
Michael Niedermayer
cbabbe8220 Merge commit '5b933be089ab2657eb754ebf5b804ae43badf13d' into release/2.2
* commit '5b933be089ab2657eb754ebf5b804ae43badf13d':
  arm: vp3: remove incorrect const in ff_vp3_idct_dc_add_neon declaration

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:21:54 +01:00
Michael Niedermayer
80122a3af3 Merge commit 'f2693e98b449592ec0ed4979220814bf54e60a16' into release/2.2
* commit 'f2693e98b449592ec0ed4979220814bf54e60a16':
  build: Use pkg-config for openjpeg

Conflicts:
	configure

Not merged / merge just for metadata at request of carl

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:21:18 +01:00
Michael Niedermayer
a475755b3a Merge commit 'c3861e14ceace7ee69820091871173b4abcae311' into release/2.2
* commit 'c3861e14ceace7ee69820091871173b4abcae311':
  movenc: allow override of "writing application" tag

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:04:13 +01:00
Michael Niedermayer
66030e8133 Merge commit 'daa5a988e2ec8275ad8b724ea68f78306c271ae7' into release/2.2
* commit 'daa5a988e2ec8275ad8b724ea68f78306c271ae7':
  matroskaenc: allow override of "writing application" tag

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:03:30 +01:00
Michael Niedermayer
46f8d838b3 Merge commit 'db67b7c31b6fdd3747e2b5328945ad2091533698' into release/2.2
* commit 'db67b7c31b6fdd3747e2b5328945ad2091533698':
  rv10: Forward error from rv10_decode_packet

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:03:17 +01:00
Michael Niedermayer
bc3648d4b4 Merge commit 'a643a47d41f4924b66fce339e4b82aaee20825be' into release/2.2
* commit 'a643a47d41f4924b66fce339e4b82aaee20825be':
  fic: Properly handle skip frames

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:03:01 +01:00
Michael Niedermayer
27e6b4a3ff Merge commit '23af29e8825ac112877b9ac0572ef11e5f0539f2' into release/2.2
* commit '23af29e8825ac112877b9ac0572ef11e5f0539f2':
  arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 11:02:36 +01:00
Michael Niedermayer
b82860caa7 Merge commit '72a58c0772450993d375c6cf4b187a068f5bc765' into release/2.2
* commit '72a58c0772450993d375c6cf4b187a068f5bc765':
  Update default FATE URL for release/10

Conflicts:
	tests/Makefile

Merge for metadata only as we dont duplicate the fate samples per release branch.
Theres no need for that currently

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:49:37 +01:00
Michael Niedermayer
3d05625136 Merge commit 'd5254230068e196a2496618c0d89cdfbc41f7478' into release/2.2
* commit 'd5254230068e196a2496618c0d89cdfbc41f7478':
  Revert "Add libx265 encoder"

Conflicts:
	Changelog
	LICENSE
	configure
	doc/general.texi
	libavcodec/allcodecs.c
	libavcodec/libx265.c

Not merged, release branches should only contain bugfixes
a feature removial like this has to be discussed on ffmpeg-devel first

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:46:52 +01:00
Michael Niedermayer
ddd3301bad Merge commit '4b476e6aa4b830f919cf3c67ba2caa039ff285b9' into release/2.2
* commit '4b476e6aa4b830f919cf3c67ba2caa039ff285b9':
  configure: enable PIC on s390(x)

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:32:26 +01:00
Michael Niedermayer
123981930f Merge commit 'a1ab3300c83a16c2d5f5d29c51393668b9d92667' into release/2.2
* commit 'a1ab3300c83a16c2d5f5d29c51393668b9d92667':
  arm: hpeldsp: prevent overreads in armv6 asm

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 10:31:47 +01:00
Lukasz Marek
3171e2360a Revert "lavu/buffer: add release function"
This reverts commit 3144440004941aa22ffea9933f5e5dfe826df654.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bba7b6fc41057d4aec6b1f0e12240db56fe6e9b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 09:06:51 +01:00
Michael Niedermayer
3533a850e7 lavf: always use av_free
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
(cherry picked from commit 77e9123fe5d64b0960158de6e1713d3c6c7878a7)
2014-03-10 19:53:51 -04:00
Tim Walker
6d56bc9a6d lavf: simplify ff_hevc_annexb2mp4_buf
Use ff_hevc_annexb2mp4 instead of duplicating
its functionality, and update the documentation
to match the new behavior.

(cherry picked from commit 34bbc81de8a49fbddb92b76dc733f40890480b2b)
2014-03-10 19:53:44 -04:00
Luca Barbato
2c5e1d0933 configure: Use the right pkgconf file for openjpeg
The current release of version 1 uses libopenjpeg1.

(cherry picked from commit 4a8562394b685e83ae4a38a93eef43625755a231)
2014-03-10 19:53:27 -04:00
Luca Barbato
b37b83214a hevc: Use get_se_golomb_long
Do not use inline functions that refer to tables present in other
libraries.

(cherry picked from commit ee17be3fdd37f63f4b77676820e387858908b0f4)
2014-03-10 19:53:26 -04:00
Luca Barbato
6d7ab09788 golomb: Add a get_se_golomb_long
Useful in libavformat mostly.

(cherry picked from commit 5eacbb53289570834f9a1acb15fd406ea224eef6)
2014-03-10 19:53:04 -04:00
Vittorio Giovara
227cfc1f10 vf_frei0r: adjust error messages
(cherry picked from commit 8accddeb5806cd98e3803b4ddf2a2ef576d0e4d9)
2014-03-09 17:54:01 -04:00
Vittorio Giovara
416847d195 vf_frei0r: prevent a segfault when filter parameters are not set
(cherry picked from commit 4e0be9c86f2003dd3ba2eb8fad01e8d0e538075e)
2014-03-09 17:53:47 -04:00
Vittorio Giovara
bd4ad1a1d5 vf_frei0r: fix missing end of line character
Error introduced in 61b323ce7c7cdc101eadfd7de2203922b8a39e8d.

(cherry picked from commit 4c41a7a1798dd6c60e40f79be12faa98a9347151)
2014-03-09 17:53:33 -04:00
Vittorio Giovara
6230de03aa vf_frei0r: refactor library loading from env variable
strtok_r is not needed any more, so remove it from configure.

(cherry picked from commit 61b323ce7c7cdc101eadfd7de2203922b8a39e8d)
2014-03-09 17:53:24 -04:00
Janne Grunau
45acc228a6 doc: fix a couple of typos in frame.h
(cherry picked from commit a18ef7a76c735bcf78ed4825e33ad7f9f6f77a54)
2014-03-09 17:53:09 -04:00
Mark Himsley
d37fac6dbb isom: lpcm in mov default to big endian
It is my understanding that "Unless otherwise stated, all data in a
QuickTime movie is stored in big-endian byte ordering" [1] in MOV files.

I have a couple of thousand files, which technically are invalid because
their sound sample description element 4CC is 'lpcm' but its version is
0 - and "Version 0 supports only uncompressed audio in raw ('raw ') or
twos-complement ('twos') format" [2]

Because isom.c only contains a mapping for 4CC 'lpcm' to
AV_CODEC_ID_PCM_S16LE, these files have their audio decoded as LE when
it is actually BE.

This commit adds AV_CODEC_ID_PCM_S16BE as the first match for 4CC 'lpcm'.

[1]
https://developer.apple.com/library/mac/documentation/quicktime/QTFF/qtff.pdf
page 21
[2]
https://developer.apple.com/library/mac/documentation/quicktime/QTFF/qtff.pdf
page 178

Reviewed-by: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
(cherry picked from commit 360022bd3b894cc01ea112b275fa4c8f53881808)
2014-03-09 17:50:54 -04:00
Baptiste Coudurier
7940306a47 movdec: handle 0x7fff langcode as macintosh per the specs
The correct point that seperates ISO and MAC language codes is 0x400
according to the current QT spec. Old QT specs did not list where this
seperation is but apparently only defined the meaning of the first 137.

(cherry picked from commit 9e71cc81f3655cacf0f91860fba3043f13b64059)
2014-03-09 17:50:41 -04:00
Tim Walker
eabefe83f4 movenc: allow muxing HEVC in MODE_MP4.
(cherry picked from commit 4f3db5d3418a24f3b90422e98ad75388052c4284)
2014-03-09 16:58:28 -04:00
Tim Walker
eaa79b79b2 movenc: enable Annex B to MP4 conversion for HEVC tracks.
(cherry picked from commit b6c61fb83e876d404ac3b0b3657ebfcafdcd1926)
2014-03-09 16:58:26 -04:00
Tim Walker
c761379825 movenc: write hvcC tag for HEVC.
(cherry picked from commit 20b40a597cdd4969cf1147d7c7efee2b6232524b)
2014-03-09 16:58:21 -04:00
Tim Walker
ea3309eba7 movenc: use 'hev1' tag for HEVC in MODE_MOV.
'hvc1' requires that parameter set NAL units be
present only in the samples entry, but not in the
samples themselves, requiring that additional
parameter sets, if present, be filtered out of the
samples and placed in new, additional sample entries
if they override or otherwise conflict with the
parameter sets present in the first sample entry.
We do not have any way of doing this at present, so
the files we produce can only comply with the
restrictions set for the 'hev1' sample entry name in
ISO/IEC 14496-15.

(cherry picked from commit 1d9014f0b008485eac4c19d5f5e11ede59237167)
2014-03-09 16:58:15 -04:00
Martin Storsjö
1c1e252cd1 movenc: Add a fallback fragmentation method for plain mp4 as well
Previously the default fragmentation method was only enabled
if writing an ISM file.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 1e142d5b4842dcb39fcb0e92e4aacbc9977bfa66)
2014-03-09 16:57:53 -04:00
Vittorio Giovara
ca2c9d6b9b hevc: make pps/sps ids unsigned where necessary
Fixes integer overflow and out of array accesses.
Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind

(cherry picked from commit 4d33873c2990b8d6096f60fef384f0efc4482b55)
2014-03-09 14:55:38 -04:00
Michael Niedermayer
fa6b99d351 hevc: Do not turn 32bit timebases into negative numbers
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit ed06e5d92b4c67b49068d538461fbbe0a53a8c5e)
2014-03-09 14:55:36 -04:00
Michael Niedermayer
d79cb6947e hevc: use av_mallocz() for allocating tab_ipm
Fixes use of uninitialized memory and out of stack array read.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

(cherry picked from commit 6cc94e971933cd38c452172bb048bf760e65cc3e)
2014-03-09 14:55:35 -04:00
Michael Niedermayer
5aa4b29bbe hevc: Use get_bits_long() in decode_vui()
Fix assertion failure.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

(cherry picked from commit 920c01adce6c273fc043513ff237a6266e612152)
2014-03-09 14:55:34 -04:00
Reinhard Tartler
e4cbd0d6e5 changelog: Cleanups and prepare for v10_beta2 2014-03-08 20:50:36 -05:00
Janne Grunau
0ede7b5344 float_dsp: fix errors in documentation
(cherry picked from commit 74cc901905741ca3d9e8364f42239341f4f173c4)
2014-03-08 19:36:20 -05:00
Janne Grunau
5b933be089 arm: vp3: remove incorrect const in ff_vp3_idct_dc_add_neon declaration
Was missed in aeaf268e52fc11c1f64914a319e0edddf1346d6a when integrating
clear_blocks into the idct.

(cherry picked from commit 4506a854a4d846692ba71daeeff661dc214c8fa2)
2014-03-08 19:36:02 -05:00
Pierre Lejeune
f2693e98b4 build: Use pkg-config for openjpeg
Bug-Id: 387
CC: libav-stable@libav.org
(cherry picked from commit 0e0cefb22216a4b6684a30a50cb5973400dc59f2)
2014-03-08 19:34:44 -05:00
John Stebbins
c3861e14ce movenc: allow override of "writing application" tag
Signed-off-by: Tim Walker <tdskywalker@gmail.com>

CC: libav-stable@libav.org
(cherry picked from commit 565e0c6d866ce08d4b06427456d3d1f4fd856e9c)
2014-03-08 19:34:42 -05:00
John Stebbins
daa5a988e2 matroskaenc: allow override of "writing application" tag
Signed-off-by: Tim Walker <tdskywalker@gmail.com>

CC: libav-stable@libav.org
(cherry picked from commit 0092c1dd8dac2d9e185b58503b447a0d3fb5230d)
2014-03-08 19:34:39 -05:00
Keiji Costantini
db67b7c31b rv10: Forward error from rv10_decode_packet
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit b4d372e091f6b30758db2a43a5a9fe2510ec2b13)
2014-03-08 19:34:29 -05:00
Derek Buitenhuis
a643a47d41 fic: Properly handle skip frames
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
(cherry picked from commit f87a6e500bcdaede22a123b81a2a46779cf7b71a)
2014-03-08 19:33:41 -05:00
Janne Grunau
23af29e882 arm: hpeldsp: fix put_pixels8_y2_{,no_rnd_}armv6
The overread avoidance fix in cbddee1cca0ebd01e8c5aa694d31228eb4de4b41
broke the computation for the last row since it prevented the safe
reading from the height+1-th row.
2014-03-08 21:48:21 +01:00
Nicolas George
7d995cd1b8 lavfi/af_atempo: clear references before returning error.
Once the frame has been given to ff_filter_frame(), it can
no longer be used, even on error.

Fix trac ticket #3430.
(cherry picked from commit bc6901c94944e4a81be49a6b11183cd0c55d2738)
2014-03-08 15:17:14 +01:00
Reinhard Tartler
72a58c0772 Update default FATE URL for release/10 2014-03-07 08:32:55 -05:00
Reinhard Tartler
d525423006 Revert "Add libx265 encoder"
cf. the discussion following
https://lists.libav.org/pipermail/libav-devel/2014-March/056894.html

This reverts commit 50ea93158d4c480f64069e8bd1da388486dcf4ba.

Conflicts:
	doc/general.texi
	libavcodec/version.h
2014-03-07 08:32:55 -05:00
Reinhard Tartler
4b476e6aa4 configure: enable PIC on s390(x)
The s390 architecture requires shared libraries to be built in PIC mode.
Otherwise applications will get wrong relocations at run-time, leading
to confusing segmentation faults.

CC: libav-stable@libav.org
(cherry picked from commit 5ddc9f5052316608799b932c604f9e7561f8ce24)
2014-03-07 08:32:55 -05:00
Michael Niedermayer
124c78fd44 avformat/oggparsevorbis: dont use invalid granules
Fixes Ticket3437

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12b97dd375736c332989c50ea68af9d834b2621f)
2014-03-06 09:31:49 +01:00
Janne Grunau
a1ab3300c8 arm: hpeldsp: prevent overreads in armv6 asm
Based on a patch by Russel King <rmk+libav@arm.linux.org.uk>

Bug-Id: 646
CC: libav-stable@libav.org
2014-03-05 16:21:52 +01:00
Michael Niedermayer
1af235f6b3 Merge remote-tracking branch 'qatar/release/10' into release/2.2
* qatar/release/10:
  ituh263: reject b-frame with pp_time = 0
  af_compand: replace strtok_r() with av_get_token()
  latm: Always reconfigure if no extradata was set previously
  af_compand: add a dependency on strtok_r
  lavfi: add compand audio filter

Conflicts:
	Changelog
	doc/filters.texi
	libavfilter/Makefile
	libavfilter/af_compand.c
	libavfilter/allfilters.c
	libavfilter/version.h

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 23:39:42 +01:00
Michael Niedermayer
82031e41f8 Merge commit '596d3e20ae69a278d562eea08f5e8c0ae5a5bfc4' into release/2.2
* commit '596d3e20ae69a278d562eea08f5e8c0ae5a5bfc4':
  parser: cosmetics: Drop some unnecessary parentheses
  parser: K&R formatting cosmetics
  parser: Remove commented-out cruft
  doc: name correct header
  af_volume: preserve frame properties

Conflicts:
	doc/APIchanges
	libavcodec/parser.c
	libavfilter/af_volume.c

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 23:30:47 +01:00
Michael Niedermayer
222e7549a7 Merge commit '7933039ade01b39638ec3d9e638b6ae06ee84984' into release/2.2
* commit '7933039ade01b39638ec3d9e638b6ae06ee84984':
  af_resample: preserve frame properties
  avconv: Do not divide by zero
  dca: replace some memcpy by AV_COPY128
  h264: avoid undefined behavior in chroma motion compensation
  x86: dsputil: Use correct file name as multiple inclusion guard

Conflicts:
	ffmpeg.c

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 23:16:15 +01:00
Michael Niedermayer
eb2244ece9 Merge commit '4015829accc2382393d42d62654eb96d896d1326' into release/2.2
* commit '4015829accc2382393d42d62654eb96d896d1326':
  bit_depth_template: Use file name as multiple inclusion guard
  svq3: Adjust #endif comment
  hevc: Mention the missing SPS in the error message
  doc: Name the MOV muxer as it should be called
  doc: Sort the muxer documentation

Conflicts:
	doc/muxers.texi

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 23:03:44 +01:00
Michael Niedermayer
b967c10029 Merge commit '39dc4a6bb34baf833ce1e5eabad7d0dbf933237d' into release/2.2
* commit '39dc4a6bb34baf833ce1e5eabad7d0dbf933237d':
  x86: dca: Add missing multiple inclusion guards
  gitignore: Add all examples below doc/examples
  arm: Mark the stack as non-executable
  doxygen: Replace @parblock syntax with manual linebreaks
  doxygen: Add a number of missing function parameter descriptions

Conflicts:
	.gitignore
	libavformat/avformat.h

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 22:53:25 +01:00
Michael Niedermayer
7ff4cd2acc Merge commit 'a6a2d8eb8f125a2edb512a7a47df33dbd70d6b35' into release/2.2
* commit 'a6a2d8eb8f125a2edb512a7a47df33dbd70d6b35':
  qt-faststart: Add a note about the -movflags +faststart feature
  qt-faststart: Avoid unintentionally sign extending BE_32
  qt-faststart: Check offset_count before reading from the moov_atom buffer
  qt-faststart: Check the ftello() return codes
  qt-faststart: Fix the signedness of variables keeping the ftello return values
  qt-faststart: Check fseeko() return codes
  qt-faststart: Simplify code by using a MIN() macro
  qt-faststart: Increase the copy buffer size to 64 KB

Conflicts:
	tools/qt-faststart.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 22:42:25 +01:00
Michael Niedermayer
c4149c4d54 Merge commit '1d1df82093fdacb2cbc443c70c80f8f801002d28' into release/2.2
* commit '1d1df82093fdacb2cbc443c70c80f8f801002d28':
  pthread_frame: flush all threads on flush, not just the first one

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 22:30:54 +01:00
Michael Niedermayer
8ad2f45964 Merge commit 'de187e3e9ec4803575deb1c293ccad84d2a88da8' into release/2.2
* commit 'de187e3e9ec4803575deb1c293ccad84d2a88da8':
  h264: Fix a typo from the previous commit
  h264: Lower bound check for slice offsets
  hevc: Always consider VLC NALU type mismatch fatal
  Prepare for 10_beta2 Release
  build: The MPEG-4 video parser depends on h263dsp

Conflicts:
	RELEASE
	configure

All changes are already in our 2.2 branch, this is just for metadata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-03 22:22:15 +01:00
Keiji Costantini
5df52b0131 ituh263: reject b-frame with pp_time = 0
Avoid a division by 0 in ff_mpeg4_set_one_direct_mv.

Sample-Id: 00000168-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
(cherry picked from commit 9514440337875e0c63b409abcd616b68c518283f)
2014-03-02 11:42:38 -05:00
Diego Biurrun
596d3e20ae parser: cosmetics: Drop some unnecessary parentheses
(cherry picked from commit 4ec336484d638b6b009636f465352c61a5a57061)
2014-03-02 11:42:38 -05:00
Anton Khirnov
00d5ff6431 af_compand: replace strtok_r() with av_get_token()
(cherry picked from commit bc6461c2861b7d482a037d3b3e2b44ad48805fa0)
2014-03-02 11:42:38 -05:00
Luca Barbato
437179e9c8 parser: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit a1c699659d56b76c0bf399307f642c6fd6d28281)
2014-03-02 11:42:38 -05:00
Hendrik Leppkes
031d3b66c2 latm: Always reconfigure if no extradata was set previously
AAC LOAS can have new audio config objects in the stream itself.

Make sure the decoder reconfigures itself when the first one arrives
midstream.

Bug-Id: 644
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 3aca10bf762a94d7de555cedf1ff0e4f6792bf41)
2014-03-02 11:42:38 -05:00
Diego Biurrun
b76871d870 parser: Remove commented-out cruft
(cherry picked from commit ed61f3ca8a0664a697782253b354055136c5d303)
2014-03-02 11:42:38 -05:00
Anton Khirnov
15ae305007 af_compand: add a dependency on strtok_r
(cherry picked from commit 291e49d4e7db4b982621d7a25e258f898cfc3217)
2014-03-02 11:42:38 -05:00
Vittorio Giovara
3c72204ae0 doc: name correct header
(cherry picked from commit 48d1ed9c83ee0c388e8c2898e81ffb4add509ab9)
2014-03-02 11:42:38 -05:00
Andrew Kelley
ba21499648 lavfi: add compand audio filter
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 738f83582a3aaabb81309eacd4ab9c3d2acb4071)

Conflicts:
	libavfilter/version.h
2014-03-02 11:42:38 -05:00
Anton Khirnov
7933039ade af_resample: preserve frame properties
(cherry picked from commit dcc7e4bf1d0913123bfafbc58bf47bd41dd5848d)
2014-03-02 11:42:37 -05:00
Diego Biurrun
4015829acc bit_depth_template: Use file name as multiple inclusion guard
(cherry picked from commit ba42c852477e87f6e47a5587e8f7829c46c52032)
2014-03-02 11:42:37 -05:00
Diego Biurrun
39dc4a6bb3 x86: dca: Add missing multiple inclusion guards
(cherry picked from commit b23bc95920e2f10b9621857e829c45b064f356c0)
2014-03-02 11:42:37 -05:00
Lou Logan
a6a2d8eb8f qt-faststart: Add a note about the -movflags +faststart feature
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 700687ebe07ac8b7a5cf5fd2c4892ea07a827080)
2014-03-02 11:42:37 -05:00
Anton Khirnov
58556826a8 af_volume: preserve frame properties
(cherry picked from commit 39c2880eeae6930b1036ce1f479afc1e1152c13f)
2014-03-02 11:42:37 -05:00
Luca Barbato
bc2c9a479a avconv: Do not divide by zero
(cherry picked from commit 5c79d2e12d13959fc6aed92d102c25194a06de05)
2014-03-02 11:42:37 -05:00
Diego Biurrun
9cc22be032 svq3: Adjust #endif comment
(cherry picked from commit 61e7c7f27b0a2652bf5cd282b97762ee99d025ef)
2014-03-02 11:42:37 -05:00
Diego Biurrun
33e1bca651 gitignore: Add all examples below doc/examples
(cherry picked from commit 294a51e18ab7df4d658249361a03f0d716a4e9f0)
2014-03-02 11:42:37 -05:00
Martin Storsjö
9841617b7f qt-faststart: Avoid unintentionally sign extending BE_32
Without this cast, the BE_32() expression is sign extended when
assigned to an uint64_t, since the uint8_t|uint8_t expression
is promoted to an int.

Also avoid undefined behaviour when left shifting an uint8_t
by 24 by casting it to an uint32_t explicitly before shifting.

Based on a patch by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ea7f79f93796d68559a495be824b6bbd94dfe5f6)
2014-03-02 11:42:37 -05:00
Christophe Gisquet
2897481f64 dca: replace some memcpy by AV_COPY128
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
(cherry picked from commit ef010f08ae53479c54e2f16be5a7e1a809a9e268)
2014-03-02 11:42:37 -05:00
Luca Barbato
646c564de5 hevc: Mention the missing SPS in the error message
(cherry picked from commit 175e5063320f585118a5461f15dbacf2ce17e97d)
2014-03-02 11:42:37 -05:00
Martin Storsjö
cd6281abef arm: Mark the stack as non-executable
If linking in an object file without this attribute set, the
linker will assume that an executable stack might be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 543156d7518f5e5d731123da066d86278f9fa492)
2014-03-02 11:42:37 -05:00
Janne Grunau
697be8173b h264: avoid undefined behavior in chroma motion compensation
Makes fate-h264 pass under valgrind --undef-value-errors=yes with
-cpuflags none. {avg,put}_h264_chroma_mc8_8 approximately 5% faster,
{avg,put}_h264_chroma_mc4_8 2% faster both on x86 and arm.

(cherry picked from commit 982b596ea6640bfe218a31f6c3fc542d9fe61c31)
2014-03-02 11:42:37 -05:00
Luca Barbato
1853d8bb7a doc: Name the MOV muxer as it should be called
The section name is the muxer, not the format.

(cherry picked from commit 93632a70f9ac2cb2ebf0e69d21fdfaae68ff02fd)
2014-03-02 11:42:37 -05:00
Diego Biurrun
1779cd7695 doxygen: Replace @parblock syntax with manual linebreaks
@parblock is only supported in very recent Doxygen versions.

(cherry picked from commit 2f2b2efd31f6af997812a70de22b6d717fb41d4e)
2014-03-02 11:42:37 -05:00
Diego Biurrun
bb4820727f x86: dsputil: Use correct file name as multiple inclusion guard
(cherry picked from commit 017a06a9ee86b047079166c2694c9c655ff03356)
2014-03-02 11:42:37 -05:00
Luca Barbato
affc7687d3 doc: Sort the muxer documentation
Keep the sections alphabetically sorted.

(cherry picked from commit a7b3216cbdc7796a9d14cd22a863fae3556098ba)
2014-03-02 11:42:37 -05:00
Diego Biurrun
3569470693 doxygen: Add a number of missing function parameter descriptions
(cherry picked from commit 4d7ab5cfebef91820af2933ef2f622ea598e6b53)
2014-03-02 11:42:37 -05:00
Anton Khirnov
1d1df82093 pthread_frame: flush all threads on flush, not just the first one
avcodec_flush_buffers() must release all internally held references
according to its documentation, for which all the threads need to be
flushed.

CC:libav-stable@libav.org
Bug-Id: vlc/9665
(cherry picked from commit d1f9563d502037239185c11578cc614bdf0c5870)
2014-03-02 11:42:36 -05:00
Luca Barbato
de187e3e9e h264: Fix a typo from the previous commit
f777504f640260337974848c7d5d7a3f064bbb45 changed a - in +

CC: libav-stable@libav.org
(cherry picked from commit d922c5a5fbaf0b6c73bd8c81ae059bc6e406961c)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
7754d48381 qt-faststart: Check offset_count before reading from the moov_atom buffer
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit bb95334c34d0d9abccea370ae25c4765d7764ab8)
2014-03-02 11:42:36 -05:00
Vittorio Giovara
63169474b3 h264: Lower bound check for slice offsets
And use the value from the specification.

Sample-Id: 00000451-google
Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit f777504f640260337974848c7d5d7a3f064bbb45)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
b3f106cb1f qt-faststart: Check the ftello() return codes
This silences a warning in the coverity static analyzer.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 63848854256a024a19435e87d6bc76fffa65e81e)
2014-03-02 11:42:36 -05:00
Luca Barbato
9b6ccf0f24 hevc: Always consider VLC NALU type mismatch fatal
Sample-Id: 00001667-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
(cherry picked from commit 521726ff577ca80b399d1abb687e3e1fd4840e4a)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
298d66c8de qt-faststart: Fix the signedness of variables keeping the ftello return values
These variables are assigned the return values of ftello, which
returns an off_t, which is a signed type. On errors, ftello returns
-1, thus make sure this error return value can be stored properly.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 03c2a66fcff9707f71ffef7e61ce5e3973220d4b)
2014-03-02 11:42:36 -05:00
Reinhard Tartler
4be1b68d52 Prepare for 10_beta2 Release 2014-03-02 11:42:36 -05:00
Michael Niedermayer
92edc13d69 qt-faststart: Check fseeko() return codes
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 5612244351b2eb3cb4e6225861a0f55aa5d0c475)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
c9f015f1c6 qt-faststart: Simplify code by using a MIN() macro
qt-faststart doesn't use the normal libav headers at all since
it's supposed to be a completely standalone tool, so we implement
the macro locally in this file.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit ea15a9a5d8fa6a71af3101b2af18c4dcac07987f)
2014-03-02 11:42:36 -05:00
Martin Storsjö
db6b2ca0b3 qt-faststart: Increase the copy buffer size to 64 KB
Copying data in chunks of 1 KB is a little wasteful.

64 KB should still easily fit on the stack, so there's no need
to allocate it dynamically.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3cbc7ef3d60b6af3617079f24a4f401d83353003)
2014-03-02 11:42:36 -05:00
Michael Niedermayer
3503ec8461 Changelog: remove <next>
Found-by: Timothy
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-01 18:26:04 +01:00
Michael Niedermayer
ecc5e42d92 Update for 2.2-rc1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-01 04:03:08 +01:00
Diego Biurrun
f87ce262f6 build: The MPEG-4 video parser depends on h263dsp
The dependency is indirect through the h263/mpegvideo code.
CC: libav-stable@libav.org
(cherry picked from commit 192ccc5034ad4ac1b5022fc16c1162267add6a0f)
2014-02-20 12:06:39 +01:00
269 changed files with 4374 additions and 1321 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.pnm -diff -text

View File

@ -1,11 +1,24 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version <next>
version 2.2.7
- snow: fix null pointer dereference
- iff: fix out of array access
- svq1dec: fix input data corruption
- proresenc_ks: check buffer size
version 2.2.6
- fix infinite loop in dvbsub parser
- fix some interlaced MPEG-2 videos
- fix decoding issues in dv (Ticket2340, 2341)
- fix v4l2 and v4l2enc crashes
- fix theoretical librtmp crash
- fix theoretical eamad crash
- support dimension change in g2meet
version 2.2:
- HNM version 4 demuxer and video decoder
- Live HDS muxer
- setsar/setdar filters now support variables in ratio expressions
@ -31,6 +44,7 @@ version 2.2:
- Support DNx444
- libx265 encoder
- dejudder filter
- Autodetect VDA like all other hardware accelerations
version 2.1:

View File

@ -33,6 +33,7 @@ Specifically, the GPL parts of FFmpeg are
- vf_geq.c
- vf_histeq.c
- vf_hqdn3d.c
- vf_interlace.c
- vf_kerndeint.c
- vf_mcdeint.c
- vf_mp.c

View File

@ -1 +1 @@
2.1.git
2.2.11

View File

@ -224,7 +224,7 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
av_log(NULL, AV_LOG_ERROR, "No OpenCL device detected!\n");
return AVERROR(EINVAL);
}
if (!(devices = av_malloc(sizeof(OpenCLDeviceBenchmark) * nb_devices))) {
if (!(devices = av_malloc_array(nb_devices, sizeof(OpenCLDeviceBenchmark)))) {
av_log(NULL, AV_LOG_ERROR, "Could not allocate buffer\n");
return AVERROR(ENOMEM);
}

View File

@ -13,7 +13,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the

View File

@ -13,7 +13,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301 USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the

14
configure vendored
View File

@ -149,7 +149,7 @@ Component options:
Hardware accelerators:
--disable-dxva2 disable DXVA2 code [autodetect]
--disable-vaapi disable VAAPI code [autodetect]
--enable-vda enable VDA code
--disable-vda disable VDA code [autodetect]
--disable-vdpau disable VDPAU code [autodetect]
Individual component options:
@ -2504,7 +2504,7 @@ enable static
enable swscale_alpha
# Enable hwaccels by default.
enable dxva2 vaapi vdpau xvmc
enable dxva2 vaapi vda vdpau xvmc
# build settings
SHFLAGS='-shared -Wl,-soname,$$(@F)'
@ -3324,6 +3324,9 @@ if test -n "$sysroot"; then
gcc|llvm_gcc|clang)
add_cppflags --sysroot="$sysroot"
add_ldflags --sysroot="$sysroot"
# On Darwin --sysroot may be ignored, -isysroot always affects headers and linking
add_cppflags -isysroot "$sysroot"
add_ldflags -isysroot "$sysroot"
;;
tms470)
add_cppflags -I"$sysinclude"
@ -3383,7 +3386,7 @@ case "$arch" in
tilegx|tile-gx)
arch="tilegx"
;;
i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
arch="x86"
;;
esac
@ -3661,6 +3664,10 @@ case "$arch" in
check_64bit ppc ppc64 'sizeof(void *) > 4'
spic=$shared
;;
s390)
check_64bit s390 s390x 'sizeof(void *) > 4'
spic=$shared
;;
sparc)
check_64bit sparc sparc64 'sizeof(void *) > 4'
spic=$shared
@ -4280,6 +4287,7 @@ EOF
fi
check_ldflags -Wl,--as-needed
check_ldflags -Wl,-z,noexecstack
if check_func dlopen; then
ldl=

View File

@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2014-03-18 - e9c8a9a - lsws 2.5.102
Make gray16 full-scale.
2014-xx-xx - xxxxxxx - lavu 53.05.0 - frame.h
Add av_frame_copy() for copying the frame data.

View File

@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 2.2.11
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
# in the documentation. The maximum height of the logo should not exceed 55

View File

@ -62,7 +62,7 @@ AC-3 audio decoder.
This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
the undocumented RealAudio 3 (a.k.a. dnet).
@subsubsection AC-3 Decoder Options
@subsection AC-3 Decoder Options
@table @option

View File

@ -296,7 +296,7 @@ teletext packet PTS and DTS values untouched.
Raw video demuxer.
This demuxer allows to read raw video data. Since there is no header
This demuxer allows one to read raw video data. Since there is no header
specifying the assumed video parameters, the user must specify them
in order to be able to decode the data correctly.

View File

@ -807,7 +807,7 @@ while producing the worst quality.
@item reservoir
Enable use of bit reservoir when set to 1. Default value is 1. LAME
has this enabled by default, but can be overriden by use
has this enabled by default, but can be overridden by use
@option{--nores} option.
@item joint_stereo (@emph{-m j})
@ -1271,7 +1271,7 @@ Requires the presence of the libtheora headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libtheora}.
For more informations about the libtheora project see
For more information about the libtheora project see
@url{http://www.theora.org/}.
@subsection Options
@ -1525,7 +1525,7 @@ for detail retention (adaptive quantization, psy-RD, psy-trellis).
Many libx264 encoder options are mapped to FFmpeg global codec
options, while unique encoder options are provided through private
options. Additionally the @option{x264opts} and @option{x264-params}
private options allows to pass a list of key=value tuples as accepted
private options allows one to pass a list of key=value tuples as accepted
by the libx264 @code{x264_param_parse} function.
The x264 project website is at
@ -1853,7 +1853,7 @@ Override the x264 configuration using a :-separated list of key=value
parameters.
This option is functionally the same as the @option{x264opts}, but is
duplicated for compability with the Libav fork.
duplicated for compatibility with the Libav fork.
For example to specify libx264 encoding options with @command{ffmpeg}:
@example
@ -2047,7 +2047,7 @@ Set physical density of pixels, in dots per meter, unset by default
Apple ProRes encoder.
FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
The used encoder can be choosen with the @code{-vcodec} option.
The used encoder can be chosen with the @code{-vcodec} option.
@subsection Private Options for prores-ks

View File

@ -119,8 +119,10 @@ int main(int argc, char *argv[])
end:
avformat_close_input(&fmt_ctx);
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */
av_freep(&avio_ctx->buffer);
av_freep(&avio_ctx);
if (avio_ctx) {
av_freep(&avio_ctx->buffer);
av_freep(&avio_ctx);
}
av_file_unmap(buffer, buffer_size);
if (ret < 0) {

View File

@ -14,7 +14,7 @@
The FFmpeg resampler provides a high-level interface to the
libswresample library audio resampling utilities. In particular it
allows to perform audio resampling, audio channel layout rematrixing,
allows one to perform audio resampling, audio channel layout rematrixing,
and convert audio format and packing layout.
@c man end DESCRIPTION

View File

@ -13,7 +13,7 @@
@c man begin DESCRIPTION
The FFmpeg rescaler provides a high-level interface to the libswscale
library image conversion utilities. In particular it allows to perform
library image conversion utilities. In particular it allows one to perform
image rescaling and pixel format conversion.
@c man end DESCRIPTION

View File

@ -1405,11 +1405,11 @@ ffmpeg -f image2 -pattern_type glob -i 'foo-*.jpeg' -r 12 -s WxH foo.avi
You can put many streams of the same type in the output:
@example
ffmpeg -i test1.avi -i test2.avi -map 0:3 -map 0:2 -map 0:1 -map 0:0 -c copy test12.nut
ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
@end example
The resulting output file @file{test12.avi} will contain first four streams from
the input file in reverse order.
The resulting output file @file{test12.nut} will contain the first four streams
from the input files in reverse order.
@item
To force CBR video output:

View File

@ -111,7 +111,7 @@ must be configured in the stream configuration. They are sent to
the @command{ffmpeg} encoders.
The @command{ffmpeg} @option{override_ffserver} commandline option
allows to override the encoding parameters set by the server.
allows one to override the encoding parameters set by the server.
Multiple streams can be connected to the same feed.

View File

@ -172,7 +172,7 @@ terminated when the next special character (belonging to the set
The name and arguments of the filter are optionally preceded and
followed by a list of link labels.
A link label allows to name a link and associate it to a filter output
A link label allows one to name a link and associate it to a filter output
or input pad. The preceding labels @var{in_link_1}
... @var{in_link_N}, are associated to the filter input pads,
the following labels @var{out_link_1} ... @var{out_link_M}, are
@ -491,7 +491,7 @@ aeval=val(ch)/2:c=same
@item
Invert phase of the second channel:
@example
eval=val(0)|-val(1)
aeval=val(0)|-val(1)
@end example
@end itemize
@ -3921,7 +3921,7 @@ The high threshold selects the "strong" edge pixels, which are then
connected through 8-connectivity with the "weak" edge pixels selected
by the low threshold.
@var{low} and @var{high} threshold values must be choosen in the range
@var{low} and @var{high} threshold values must be chosen in the range
[0,1], and @var{low} should be lesser or equal to @var{high}.
Default value for @var{low} is @code{20/255}, and default value for @var{high}
@ -5238,7 +5238,7 @@ Set progressive threshold.
Deinterleave or interleave fields.
This filter allows to process interlaced images fields without
This filter allows one to process interlaced images fields without
deinterlacing them. Deinterleaving splits the input frame into 2
fields (so called half pictures). Odd lines are moved to the top
half of the output image, even lines to the bottom half.
@ -6860,7 +6860,7 @@ rotate=A*sin(2*PI/T*t)
@end example
@item
Rotate the video, output size is choosen so that the whole rotating
Rotate the video, output size is chosen so that the whole rotating
input video is always completely contained in the output:
@example
rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
@ -6983,7 +6983,7 @@ Default value is @samp{0}.
@item flags
Set libswscale scaling flags. See
@ref{sws_flags,,the ffmpeg-scaler manual,ffmpeg-scaler} for the
complete list of values. If not explictly specified the filter applies
complete list of values. If not explicitly specified the filter applies
the default flags.
@item size, s
@ -7797,7 +7797,7 @@ Produce 8x8 PNG tiles of all keyframes (@option{-skip_frame nokey}) in a movie:
ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
@end example
The @option{-vsync 0} is necessary to prevent @command{ffmpeg} from
duplicating each output frame to accomodate the originally detected frame
duplicating each output frame to accommodate the originally detected frame
rate.
@item
@ -8394,7 +8394,7 @@ Set dithering to reduce the circular banding effects. Default is @code{1}
(enabled).
@item aspect
Set vignette aspect. This setting allows to adjust the shape of the vignette.
Set vignette aspect. This setting allows one to adjust the shape of the vignette.
Setting this value to the SAR of the input will make a rectangular vignetting
following the dimensions of the video.
@ -8850,7 +8850,7 @@ Default value is "all", which will cycle through the list of all tests.
For example the following:
@example
testsrc=t=dc_luma
mptestsrc=t=dc_luma
@end example
will generate a "dc_luma" test pattern.
@ -8903,7 +8903,7 @@ horizontally, vertically, or diagonally adjacent.
At each interaction the grid evolves according to the adopted rule,
which specifies the number of neighbor alive cells which will make a
cell stay alive or born. The @option{rule} option allows to specify
cell stay alive or born. The @option{rule} option allows one to specify
the rule to adopt.
This source accepts the following options:
@ -10323,7 +10323,7 @@ Note that when the movie is looped the source timestamps are not
changed, so it will generate non monotonically increasing timestamps.
@end table
This filter allows to overlay a second video on top of main input of
This filter allows one to overlay a second video on top of main input of
a filtergraph as shown in this graph:
@example
input -----------> deltapts0 --> overlay --> output

View File

@ -162,6 +162,27 @@ libzvbi is licensed under the GNU General Public License Version 2 or later
you must upgrade FFmpeg's license to GPL in order to use it.
@end float
@section AviSynth
FFmpeg can read AviSynth scripts as input. To enable support, pass
@code{--enable-avisynth} to configure. The correct headers are
included in compat/avisynth/, which allows the user to enable support
without needing to search for these headers themselves.
For Windows, supported AviSynth variants are
@url{http://avisynth.nl, AviSynth 2.5 or 2.6} for 32-bit builds and
@url{http://avs-plus.net, AviSynth+ 0.1} for 32-bit and 64-bit builds.
For Linux and OS X, the supported AviSynth variant is
@url{https://github.com/avxsynth/avxsynth, AvxSynth}.
@float NOTE
AviSynth and AvxSynth are loaded dynamically. Distributors can build FFmpeg
with @code{--enable-avisynth}, and the binaries will work regardless of the
end user having AviSynth or AvxSynth installed - they'll only need to be
installed to use AviSynth scripts (obviously).
@end float
@chapter Supported File Formats, Codecs or Features

View File

@ -299,7 +299,7 @@ the current branch history.
git commit --amend
@end example
allows to amend the last commit details quickly.
allows one to amend the last commit details quickly.
@example
git rebase -i origin/master

View File

@ -409,7 +409,7 @@ OpenAL is part of Core Audio, the official Mac OS X Audio interface.
See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
@end table
This device allows to capture from an audio input device handled
This device allows one to capture from an audio input device handled
through OpenAL.
You need to specify the name of the device to capture in the provided
@ -617,7 +617,7 @@ Select the pixel format (only valid for raw video input).
@item input_format
Set the preferred pixel format (for raw video) or a codec name.
This option allows to select the input format, when several are
This option allows one to select the input format, when several are
available.
@item framerate
@ -678,7 +678,7 @@ other filename will be interpreted as device number 0.
X11 video input device.
This device allows to capture a region of an X11 display.
This device allows one to capture a region of an X11 display.
The filename passed as input has the syntax:
@example

View File

@ -758,7 +758,7 @@ The segment muxer supports the following options:
@table @option
@item reference_stream @var{specifier}
Set the reference stream, as specified by the string @var{specifier}.
If @var{specifier} is set to @code{auto}, the reference is choosen
If @var{specifier} is set to @code{auto}, the reference is chosen
automatically. Otherwise it must be a stream specifier (see the ``Stream
specifiers'' chapter in the ffmpeg manual) which specifies the
reference stream. The default value is @code{auto}.

View File

@ -42,7 +42,7 @@ ffmpeg -i INPUT -f alsa hw:1,7
CACA output device.
This output device allows to show a video stream in CACA window.
This output device allows one to show a video stream in CACA window.
Only one CACA window is allowed per application, so you can
have only one instance of this output device in an application.
@ -216,7 +216,7 @@ OpenGL output device.
To enable this output device you need to configure FFmpeg with @code{--enable-opengl}.
Device allows to render to OpenGL context.
This output device allows one to render to OpenGL context.
Context may be provided by application or default SDL window is created.
When device renders to external context, application must implement handlers for following messages:
@ -302,7 +302,7 @@ ffmpeg -i INPUT -f pulse "stream name"
SDL (Simple DirectMedia Layer) output device.
This output device allows to show a video stream in an SDL
This output device allows one to show a video stream in an SDL
window. Only one SDL window is allowed per application, so you can
have only one instance of this output device in an application.
@ -361,7 +361,7 @@ sndio audio output device.
XV (XVideo) output device.
This output device allows to show a video stream in a X Window System
This output device allows one to show a video stream in a X Window System
window.
@subsection Options

View File

@ -51,8 +51,9 @@ The toolchain provided with Xcode is sufficient to build the basic
unacelerated code.
Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
@url{https://github.com/FFmpeg/gas-preprocessor} or
@url{http://github.com/yuvi/gas-preprocessor} to build the optimized
assembler functions. Just download the Perl script and put it somewhere
assembler functions. Put the Perl script somewhere
in your PATH, FFmpeg's configure will pick it up automatically.
Mac OS X on amd64 and x86 requires @command{yasm} to build most of the

View File

@ -213,7 +213,7 @@ m3u8 files.
HTTP (Hyper Text Transfer Protocol).
This protocol accepts the following options.
This protocol accepts the following options:
@table @option
@item seekable
@ -223,32 +223,33 @@ if set to -1 it will try to autodetect if it is seekable. Default
value is -1.
@item chunked_post
If set to 1 use chunked transfer-encoding for posts, default is 1.
If set to 1 use chunked Transfer-Encoding for posts, default is 1.
@item content_type
Set a specific content type for the POST messages.
@item headers
Set custom HTTP headers, can override built in default headers. The
value must be a string encoding the headers.
@item content_type
Force a content type.
@item user-agent
Override User-Agent header. If not specified the protocol will use a
string describing the libavformat build.
@item multiple_requests
Use persistent connections if set to 1. By default it is 0.
Use persistent connections if set to 1, default is 0.
@item post_data
Set custom HTTP post data.
@item user-agent
@item user_agent
Override the User-Agent header. If not specified the protocol will use a
string describing the libavformat build. ("Lavf/<version>")
@item timeout
Set timeout of socket I/O operations used by the underlying low level
operation. By default it is set to -1, which means that the timeout is
not specified.
@item mime_type
Set MIME type.
Export the MIME type.
@item icy
If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
@ -257,17 +258,25 @@ the @option{icy_metadata_headers} and @option{icy_metadata_packet} options.
The default is 0.
@item icy_metadata_headers
If the server supports ICY metadata, this contains the ICY specific HTTP reply
headers, separated with newline characters.
If the server supports ICY metadata, this contains the ICY-specific HTTP reply
headers, separated by newline characters.
@item icy_metadata_packet
If the server supports ICY metadata, and @option{icy} was set to 1, this
contains the last non-empty metadata packet sent by the server.
contains the last non-empty metadata packet sent by the server. It should be
polled in regular intervals by applications interested in mid-stream metadata
updates.
@item cookies
Set the cookies to be sent in future requests. The format of each cookie is the
same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
delimited by a newline character.
@item offset
Set initial byte offset.
@item end_offset
Try to limit the request to bytes preceding this offset.
@end table
@subsection HTTP Cookies
@ -951,7 +960,7 @@ used as master salt.
@section tcp
Trasmission Control Protocol.
Transmission Control Protocol.
The required syntax for a TCP url is:
@example
@ -1057,7 +1066,7 @@ udp://@var{hostname}:@var{port}[?@var{options}]
@var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
In case threading is enabled on the system, a circular buffer is used
to store the incoming data, which allows to reduce loss of data due to
to store the incoming data, which allows one to reduce loss of data due to
UDP socket buffer overruns. The @var{fifo_size} and
@var{overrun_nonfatal} options are related to this buffer.

View File

@ -35,7 +35,7 @@ Select nearest neighbor rescaling algorithm.
@item area
Select averaging area rescaling algorithm.
@item bicubiclin
@item bicublin
Select bicubic scaling algorithm for the luma component, bilinear for
chroma components.

View File

@ -327,10 +327,11 @@ die "No filename or title\n" unless defined $fn && defined $tl;
$chapters{NAME} = "$fn \- $tl\n";
$chapters{FOOTNOTES} .= "=back\n" if exists $chapters{FOOTNOTES};
# always use utf8
print "=encoding utf8\n\n";
unshift @chapters_sequence, "NAME";
for $chapter (@chapters_sequence) {
# always use utf8
print "=encoding utf8\n";
if (exists $chapters{$chapter}) {
$head = uc($chapter);
print "=head1 $head\n\n";

View File

@ -1056,7 +1056,7 @@ which can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_de
@item device_idx
Select the index of the device used to run OpenCL code.
The specifed index must be one of the indexes in the device list which
The specified index must be one of the indexes in the device list which
can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_device_list()}.
@end table

View File

@ -323,7 +323,7 @@ sigterm_handler(int sig)
received_nb_signals++;
term_exit();
if(received_nb_signals > 3)
exit_program(123);
exit(123);
}
void term_init(void)
@ -514,6 +514,8 @@ static void ffmpeg_cleanup(int ret)
if (received_sigterm) {
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
(int) received_sigterm);
} else if (ret) {
av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");
}
term_exit();
}
@ -619,7 +621,8 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
bsfc = bsfc->next;
}
if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS) &&
if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
if(
(avctx->codec_type == AVMEDIA_TYPE_AUDIO || avctx->codec_type == AVMEDIA_TYPE_VIDEO) &&
pkt->dts != AV_NOPTS_VALUE &&
ost->last_mux_dts != AV_NOPTS_VALUE) {
@ -640,6 +643,16 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
pkt->pts = FFMAX(pkt->pts, max);
pkt->dts = max;
}
}
if (pkt->dts != AV_NOPTS_VALUE &&
pkt->pts != AV_NOPTS_VALUE &&
pkt->dts > pkt->pts) {
av_log(s, AV_LOG_WARNING, "Invalid DTS: %"PRId64" PTS: %"PRId64" in output stream %d:%d\n",
pkt->dts, pkt->pts,
ost->file_index, ost->st->index);
pkt->pts = AV_NOPTS_VALUE;
pkt->dts = AV_NOPTS_VALUE;
}
}
ost->last_mux_dts = pkt->dts;
@ -1089,6 +1102,19 @@ static void do_video_stats(OutputStream *ost, int frame_size)
}
}
static void finish_output_stream(OutputStream *ost)
{
OutputFile *of = output_files[ost->file_index];
int i;
ost->finished = ENCODER_FINISHED | MUXER_FINISHED;
if (of->shortest) {
for (i = 0; i < of->ctx->nb_streams; i++)
output_streams[of->ost_index + i]->finished = ENCODER_FINISHED | MUXER_FINISHED;
}
}
/**
* Get and encode new output from any of the filtergraphs, without causing
* activity.
@ -1966,7 +1992,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
if (avpkt.duration) {
duration = av_rescale_q(avpkt.duration, ist->st->time_base, AV_TIME_BASE_Q);
} else if(ist->st->codec->time_base.num != 0 && ist->st->codec->time_base.den != 0) {
int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict+1 : ist->st->codec->ticks_per_frame;
duration = ((int64_t)AV_TIME_BASE *
ist->st->codec->time_base.num * ticks) /
ist->st->codec->time_base.den;
@ -2023,7 +2049,7 @@ static int output_packet(InputStream *ist, const AVPacket *pkt)
} else if (pkt->duration) {
ist->next_dts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
} else if(ist->st->codec->time_base.num != 0) {
int ticks= ist->st->parser ? ist->st->parser->repeat_pict + 1 : ist->st->codec->ticks_per_frame;
int ticks= av_stream_get_parser(ist->st) ? av_stream_get_parser(ist->st)->repeat_pict + 1 : ist->st->codec->ticks_per_frame;
ist->next_dts += ((int64_t)AV_TIME_BASE *
ist->st->codec->time_base.num * ticks) /
ist->st->codec->time_base.den;
@ -3145,7 +3171,7 @@ static int process_input(int file_index)
if (ost->source_index == ifile->ist_index + i &&
(ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE))
close_output_stream(ost);
finish_output_stream(ost);
}
}

View File

@ -44,12 +44,15 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
const enum AVPixelFormat mjpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
const enum AVPixelFormat ljpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
p = mjpeg_formats;
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
p =ljpeg_formats;
}
}
for (; *p != AV_PIX_FMT_NONE; p++) {
@ -825,6 +828,12 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
av_freep(&ifilter->name);
DESCRIBE_FILTER_LINK(ifilter, in, 1);
if (!ifilter->ist->dec) {
av_log(NULL, AV_LOG_ERROR,
"No decoder for stream #%d:%d, filtering impossible\n",
ifilter->ist->file_index, ifilter->ist->st->index);
return AVERROR_DECODER_NOT_FOUND;
}
switch (avfilter_pad_get_type(in->filter_ctx->input_pads, in->pad_idx)) {
case AVMEDIA_TYPE_VIDEO: return configure_input_video_filter(fg, ifilter, in);
case AVMEDIA_TYPE_AUDIO: return configure_input_audio_filter(fg, ifilter, in);

View File

@ -1783,7 +1783,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
/* pick the "best" stream of each type */
/* video: highest resolution */
if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) {
if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
int area = 0, idx = -1;
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
for (i = 0; i < nb_input_streams; i++) {
@ -1805,7 +1805,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
}
/* audio: most channels */
if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) {
if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
int channels = 0, idx = -1;
for (i = 0; i < nb_input_streams; i++) {
ist = input_streams[i];
@ -1821,7 +1821,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
/* subtitles: pick first */
MATCH_PER_TYPE_OPT(codec_names, str, subtitle_codec_name, oc, "s");
if (!o->subtitle_disable && (oc->oformat->subtitle_codec != AV_CODEC_ID_NONE || subtitle_codec_name)) {
if (!o->subtitle_disable && (avcodec_find_encoder(oc->oformat->subtitle_codec) || subtitle_codec_name)) {
for (i = 0; i < nb_input_streams; i++)
if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
new_subtitle_stream(o, oc, i);
@ -2119,7 +2119,8 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
for (j = 0; j < nb_input_files; j++) {
for (i = 0; i < input_files[j]->nb_streams; i++) {
AVCodecContext *c = input_files[j]->ctx->streams[i]->codec;
if (c->codec_type != AVMEDIA_TYPE_VIDEO)
if (c->codec_type != AVMEDIA_TYPE_VIDEO ||
!c->time_base.num)
continue;
fr = c->time_base.den * 1000 / c->time_base.num;
if (fr == 25000) {
@ -2152,19 +2153,19 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option(o, "s", norm == PAL ? "352x288" : "352x240", options);
parse_option(o, "r", frame_rates[norm], options);
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "g", norm == PAL ? "15" : "18");
av_dict_set(&o->g->codec_opts, "b:v", "1150000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "maxrate", "1150000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "minrate", "1150000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "bufsize", "327680", AV_DICT_DONT_OVERWRITE); // 40*1024*8;
opt_default(NULL, "b:v", "1150000");
opt_default(NULL, "maxrate", "1150000");
opt_default(NULL, "minrate", "1150000");
opt_default(NULL, "bufsize", "327680"); // 40*1024*8;
av_dict_set(&o->g->codec_opts, "b:a", "224000", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "b:a", "224000");
parse_option(o, "ar", "44100", options);
parse_option(o, "ac", "2", options);
av_dict_set(&o->g->format_opts, "packetsize", "2324", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->format_opts, "muxrate", "1411200", AV_DICT_DONT_OVERWRITE); // 2352 * 75 * 8;
opt_default(NULL, "packetsize", "2324");
opt_default(NULL, "muxrate", "1411200"); // 2352 * 75 * 8;
/* We have to offset the PTS, so that it is consistent with the SCR.
SCR starts at 36000, but the first two packs contain only padding
@ -2181,18 +2182,18 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option(o, "s", norm == PAL ? "480x576" : "480x480", options);
parse_option(o, "r", frame_rates[norm], options);
parse_option(o, "pix_fmt", "yuv420p", options);
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "g", norm == PAL ? "15" : "18");
av_dict_set(&o->g->codec_opts, "b:v", "2040000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "maxrate", "2516000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "minrate", "0", AV_DICT_DONT_OVERWRITE); // 1145000;
av_dict_set(&o->g->codec_opts, "bufsize", "1835008", AV_DICT_DONT_OVERWRITE); // 224*1024*8;
av_dict_set(&o->g->codec_opts, "scan_offset", "1", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "b:v", "2040000");
opt_default(NULL, "maxrate", "2516000");
opt_default(NULL, "minrate", "0"); // 1145000;
opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
opt_default(NULL, "scan_offset", "1");
av_dict_set(&o->g->codec_opts, "b:a", "224000", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "b:a", "224000");
parse_option(o, "ar", "44100", options);
av_dict_set(&o->g->format_opts, "packetsize", "2324", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "packetsize", "2324");
} else if (!strcmp(arg, "dvd")) {
@ -2203,17 +2204,17 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
parse_option(o, "s", norm == PAL ? "720x576" : "720x480", options);
parse_option(o, "r", frame_rates[norm], options);
parse_option(o, "pix_fmt", "yuv420p", options);
av_dict_set(&o->g->codec_opts, "g", norm == PAL ? "15" : "18", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "g", norm == PAL ? "15" : "18");
av_dict_set(&o->g->codec_opts, "b:v", "6000000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "maxrate", "9000000", AV_DICT_DONT_OVERWRITE);
av_dict_set(&o->g->codec_opts, "minrate", "0", AV_DICT_DONT_OVERWRITE); // 1500000;
av_dict_set(&o->g->codec_opts, "bufsize", "1835008", AV_DICT_DONT_OVERWRITE); // 224*1024*8;
opt_default(NULL, "b:v", "6000000");
opt_default(NULL, "maxrate", "9000000");
opt_default(NULL, "minrate", "0"); // 1500000;
opt_default(NULL, "bufsize", "1835008"); // 224*1024*8;
av_dict_set(&o->g->format_opts, "packetsize", "2048", AV_DICT_DONT_OVERWRITE); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
av_dict_set(&o->g->format_opts, "muxrate", "10080000", AV_DICT_DONT_OVERWRITE); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
opt_default(NULL, "packetsize", "2048"); // from www.mpucoder.com: DVD sectors contain 2048 bytes of data, this is also the size of one pack.
opt_default(NULL, "muxrate", "10080000"); // from mplex project: data_rate = 1260000. mux_rate = data_rate * 8
av_dict_set(&o->g->codec_opts, "b:a", "448000", AV_DICT_DONT_OVERWRITE);
opt_default(NULL, "b:a", "448000");
parse_option(o, "ar", "48000", options);
} else if (!strncmp(arg, "dv", 2)) {
@ -2232,6 +2233,10 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
av_log(NULL, AV_LOG_ERROR, "Unknown target: %s\n", arg);
return AVERROR(EINVAL);
}
av_dict_copy(&o->g->codec_opts, codec_opts, AV_DICT_DONT_OVERWRITE);
av_dict_copy(&o->g->format_opts, format_opts, AV_DICT_DONT_OVERWRITE);
return 0;
}

View File

@ -191,6 +191,7 @@ static const char unit_hertz_str[] = "Hz" ;
static const char unit_byte_str[] = "byte" ;
static const char unit_bit_per_second_str[] = "bit/s";
static int nb_streams;
static uint64_t *nb_streams_packets;
static uint64_t *nb_streams_frames;
static int *selected_streams;
@ -246,6 +247,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
vald /= pow(10, index * 3);
prefix_string = decimal_unit_prefixes[index];
}
vali = vald;
}
if (show_float || (use_value_prefix && vald != (long long int)vald))
@ -336,7 +338,7 @@ static const AVOption writer_options[] = {
{ "replace", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_REPLACE}, .unit = "sv" },
{ "fail", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_FAIL}, .unit = "sv" },
{ "string_validation_replacement", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str="\xEF\xBF\xBD"}},
{ NULL }
};
@ -1631,6 +1633,14 @@ static void writer_register_all(void)
#define print_section_header(s) writer_print_section_header(w, s)
#define print_section_footer(s) writer_print_section_footer(w, s)
#define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n) \
{ \
ret = av_reallocp_array(&(ptr), (new_n), sizeof(*(ptr))); \
if (ret < 0) \
goto end; \
memset( (ptr) + (cur_n), 0, ((new_n) - (cur_n)) * sizeof(*(ptr)) ); \
}
static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id)
{
AVDictionaryEntry *tag = NULL;
@ -1892,6 +1902,12 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
goto end;
}
while (!av_read_frame(fmt_ctx, &pkt)) {
if (fmt_ctx->nb_streams > nb_streams) {
REALLOCZ_ARRAY_STREAM(nb_streams_frames, nb_streams, fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(nb_streams_packets, nb_streams, fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(selected_streams, nb_streams, fmt_ctx->nb_streams);
nb_streams = fmt_ctx->nb_streams;
}
if (selected_streams[pkt.stream_index]) {
AVRational tb = fmt_ctx->streams[pkt.stream_index]->time_base;
@ -2366,9 +2382,10 @@ static int probe_file(WriterContext *wctx, const char *filename)
#define CHECK_END if (ret < 0) goto end
nb_streams_frames = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_frames));
nb_streams_packets = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_packets));
selected_streams = av_calloc(fmt_ctx->nb_streams, sizeof(*selected_streams));
nb_streams = fmt_ctx->nb_streams;
REALLOCZ_ARRAY_STREAM(nb_streams_frames,0,fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(nb_streams_packets,0,fmt_ctx->nb_streams);
REALLOCZ_ARRAY_STREAM(selected_streams,0,fmt_ctx->nb_streams);
for (i = 0; i < fmt_ctx->nb_streams; i++) {
if (stream_specifier) {

View File

@ -2989,6 +2989,8 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
AVDictionaryEntry *entry = av_dict_get(stream->metadata, "title", NULL, 0);
int i;
*pbuffer = NULL;
avc = avformat_alloc_context();
if (avc == NULL || !rtp_format) {
return -1;
@ -3025,7 +3027,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
av_free(avc);
av_free(avs);
return strlen(*pbuffer);
return *pbuffer ? strlen(*pbuffer) : AVERROR(ENOMEM);
}
static void rtsp_cmd_options(HTTPContext *c, const char *url)

View File

@ -119,7 +119,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
}
}
if ((avctx->bits_per_coded_sample & 0x1f) <= 8) {
if (avctx->bits_per_coded_sample <= 8) {
const uint8_t *pal = av_packet_get_side_data(avpkt,
AV_PKT_DATA_PALETTE,
NULL);

View File

@ -26,7 +26,6 @@ OBJS = allcodecs.o \
options.o \
parser.o \
raw.o \
rawdec.o \
resample.o \
resample2.o \
utils.o \

View File

@ -81,7 +81,7 @@ enum BandType {
INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions.
};
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
#define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10)
enum ChannelPosition {
AAC_CHANNEL_OFF = 0,

View File

@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int size;
union {
uint64_t u64;
uint8_t u8[8];
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
} tmp;
tmp.u64 = av_be2ne64(state);

View File

@ -166,7 +166,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
int err;
union {
uint64_t u64;
uint8_t u8[8];
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
} tmp = { av_be2ne64(state) };
AC3HeaderInfo hdr, *phdr = &hdr;
GetBitContext gbc;

View File

@ -256,7 +256,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
energy_cpl = energy[blk][CPL_CH][bnd];
energy_ch = energy[blk][ch][bnd];
blk1 = blk+1;
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
if (s->blocks[blk1].cpl_in_use) {
energy_cpl += energy[blk1][CPL_CH][bnd];
energy_ch += energy[blk1][ch][bnd];

View File

@ -471,9 +471,11 @@ static void adpcm_swf_decode(AVCodecContext *avctx, const uint8_t *buf, int buf_
* @param[out] coded_samples set to the number of samples as coded in the
* packet, or 0 if the codec does not encode the
* number of samples in each frame.
* @param[out] approx_nb_samples set to non-zero if the number of samples
* returned is an approximation.
*/
static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
int buf_size, int *coded_samples)
int buf_size, int *coded_samples, int *approx_nb_samples)
{
ADPCMDecodeContext *s = avctx->priv_data;
int nb_samples = 0;
@ -482,6 +484,7 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
int header_size;
*coded_samples = 0;
*approx_nb_samples = 0;
if(ch <= 0)
return 0;
@ -552,10 +555,12 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
case AV_CODEC_ID_ADPCM_EA_R2:
header_size = 4 + 5 * ch;
*coded_samples = bytestream2_get_le32(gb);
*approx_nb_samples = 1;
break;
case AV_CODEC_ID_ADPCM_EA_R3:
header_size = 4 + 5 * ch;
*coded_samples = bytestream2_get_be32(gb);
*approx_nb_samples = 1;
break;
}
*coded_samples -= *coded_samples % 28;
@ -663,11 +668,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int16_t **samples_p;
int st; /* stereo */
int count1, count2;
int nb_samples, coded_samples, ret;
int nb_samples, coded_samples, approx_nb_samples, ret;
GetByteContext gb;
bytestream2_init(&gb, buf, buf_size);
nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples);
nb_samples = get_nb_samples(avctx, &gb, buf_size, &coded_samples, &approx_nb_samples);
if (nb_samples <= 0) {
av_log(avctx, AV_LOG_ERROR, "invalid number of samples in packet\n");
return AVERROR_INVALIDDATA;
@ -683,7 +688,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
/* use coded_samples when applicable */
/* it is always <= nb_samples, so the output buffer will be large enough */
if (coded_samples) {
if (coded_samples != nb_samples)
if (!approx_nb_samples && coded_samples != nb_samples)
av_log(avctx, AV_LOG_WARNING, "mismatch in coded sample count\n");
frame->nb_samples = nb_samples = coded_samples;
}
@ -917,6 +922,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
*samples++ = c->status[0].predictor + c->status[1].predictor;
*samples++ = c->status[0].predictor - c->status[1].predictor;
}
if ((bytestream2_tell(&gb) & 1))
bytestream2_skip(&gb, 1);
break;
}
case AV_CODEC_ID_ADPCM_IMA_ISS:

View File

@ -549,10 +549,11 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
put_bits(&pb, 7, status->step_index);
if (avctx->trellis > 0) {
uint8_t buf[64];
adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status,
adpcm_compress_trellis(avctx, &samples_p[ch][0], buf, status,
64, 1);
for (i = 0; i < 64; i++)
put_bits(&pb, 4, buf[i ^ 1]);
status->prev_sample = status->predictor;
} else {
for (i = 0; i < 64; i += 2) {
int t1, t2;

View File

@ -150,6 +150,7 @@ typedef struct AICContext {
int16_t *data_ptr[NUM_BANDS];
DECLARE_ALIGNED(16, int16_t, block)[64];
DECLARE_ALIGNED(16, uint8_t, quant_matrix)[64];
} AICContext;
static int aic_decode_header(AICContext *ctx, const uint8_t *src, int size)
@ -285,7 +286,7 @@ static void recombine_block_il(int16_t *dst, const uint8_t *scan,
}
}
static void unquant_block(int16_t *block, int q)
static void unquant_block(int16_t *block, int q, uint8_t *quant_matrix)
{
int i;
@ -293,7 +294,7 @@ static void unquant_block(int16_t *block, int q)
int val = (uint16_t)block[i];
int sign = val & 1;
block[i] = (((val >> 1) ^ -sign) * q * aic_quant_matrix[i] >> 4)
block[i] = (((val >> 1) ^ -sign) * q * quant_matrix[i] >> 4)
+ sign;
}
}
@ -334,7 +335,7 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
else
recombine_block_il(ctx->block, ctx->scantable.permutated,
&base_y, &ext_y, blk);
unquant_block(ctx->block, ctx->quant);
unquant_block(ctx->block, ctx->quant, ctx->quant_matrix);
ctx->dsp.idct(ctx->block);
if (!ctx->interlaced) {
@ -352,7 +353,7 @@ static int aic_decode_slice(AICContext *ctx, int mb_x, int mb_y,
for (blk = 0; blk < 2; blk++) {
recombine_block(ctx->block, ctx->scantable.permutated,
&base_c, &ext_c);
unquant_block(ctx->block, ctx->quant);
unquant_block(ctx->block, ctx->quant, ctx->quant_matrix);
ctx->dsp.idct(ctx->block);
ctx->dsp.put_signed_pixels_clamped(ctx->block, C[blk],
ctx->frame->linesize[blk + 1]);
@ -430,6 +431,8 @@ static av_cold int aic_decode_init(AVCodecContext *avctx)
for (i = 0; i < 64; i++)
scan[i] = i;
ff_init_scantable(ctx->dsp.idct_permutation, &ctx->scantable, scan);
for (i = 0; i < 64; i++)
ctx->quant_matrix[ctx->dsp.idct_permutation[i]] = aic_quant_matrix[i];
ctx->mb_width = FFALIGN(avctx->width, 16) >> 4;
ctx->mb_height = FFALIGN(avctx->height, 16) >> 4;

View File

@ -280,7 +280,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
GetBitContext gb;
uint64_t ht_size;
int i, config_offset;
MPEG4AudioConfig m4ac;
MPEG4AudioConfig m4ac = {0};
ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx;
uint32_t als_id, header_size, trailer_size;

View File

@ -108,8 +108,12 @@ av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
{
int cpu_flags = av_get_cpu_flags();
if (have_armv6(cpu_flags))
if (have_armv6(cpu_flags) && !(have_vfpv3(cpu_flags) || have_neon(cpu_flags))) {
// This function uses the 'setend' instruction which is deprecated
// on ARMv8. This instruction is serializing on some ARMv7 cores as
// well. Therefore, only use the function on ARMv6.
c->h264_find_start_code_candidate = ff_h264_find_start_code_candidate_armv6;
}
if (have_neon(cpu_flags))
h264dsp_init_neon(c, bit_depth, chroma_format_idc);
}

View File

@ -144,10 +144,11 @@ function ff_put_pixels8_y2_armv6, export=1
eor r7, r5, r7
uadd8 r10, r10, r6
and r7, r7, r12
ldr_pre r6, r1, r2
ldrc_pre ne, r6, r1, r2
uadd8 r11, r11, r7
strd_post r8, r9, r0, r2
ldr r7, [r1, #4]
it ne
ldrne r7, [r1, #4]
strd_post r10, r11, r0, r2
bne 1b
@ -196,9 +197,10 @@ function ff_put_pixels8_y2_no_rnd_armv6, export=1
uhadd8 r9, r5, r7
ldr r5, [r1, #4]
uhadd8 r12, r4, r6
ldr_pre r6, r1, r2
ldrc_pre ne, r6, r1, r2
uhadd8 r14, r5, r7
ldr r7, [r1, #4]
it ne
ldrne r7, [r1, #4]
stm r0, {r8,r9}
add r0, r0, r2
stm r0, {r12,r14}

View File

@ -26,7 +26,7 @@
void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const int16_t *data);
void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);

View File

@ -1204,7 +1204,7 @@ function ff_put_vp8_\name\size\()_\hv\()_armv6, export=1
mov r4, #\size
stm r12, {r4, r5}
orr r12, r6, r7
b vp8_put_\name\()_\hv\()_armv6 + 4
b bl_put_\name\()_\hv\()_armv6
endfunc
.endm
@ -1300,6 +1300,7 @@ vp8_mc_hv bilin, 4, h, v, 2
function vp8_put_epel_h6_armv6
push {r1, r4-r11, lr}
bl_put_epel_h6_armv6:
sub r2, r2, #2
movrel lr, sixtap_filters_13245600 - 16
add lr, lr, r12, lsl #3
@ -1358,6 +1359,7 @@ endfunc
function vp8_put_epel_v6_armv6
push {r1, r4-r11, lr}
bl_put_epel_v6_armv6:
movrel lr, sixtap_filters_13245600 - 16
add lr, lr, r12, lsl #3
str r3, [sp, #48]
@ -1437,6 +1439,7 @@ endfunc
function vp8_put_epel_h4_armv6
push {r1, r4-r11, lr}
bl_put_epel_h4_armv6:
subs r2, r2, #1
movrel lr, fourtap_filters_1324 - 4
add lr, lr, r12, lsl #2
@ -1483,6 +1486,7 @@ endfunc
function vp8_put_epel_v4_armv6
push {r1, r4-r11, lr}
bl_put_epel_v4_armv6:
movrel lr, fourtap_filters_1324 - 4
add lr, lr, r12, lsl #2
ldm lr, {r5, r6}
@ -1544,6 +1548,7 @@ endfunc
function vp8_put_bilin_h_armv6
push {r1, r4-r11, lr}
bl_put_bilin_h_armv6:
rsb r5, r12, r12, lsl #16
ldr r12, [sp, #44]
sub r3, r3, r4
@ -1589,6 +1594,7 @@ endfunc
function vp8_put_bilin_v_armv6
push {r1, r4-r11, lr}
bl_put_bilin_v_armv6:
rsb r5, r12, r12, lsl #16
ldr r12, [sp, #44]
add r5, r5, #8

View File

@ -507,7 +507,6 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket *src)
dst->convergence_duration = src->convergence_duration;
dst->flags = src->flags;
dst->stream_index = src->stream_index;
dst->side_data_elems = src->side_data_elems;
for (i = 0; i < src->side_data_elems; i++) {
enum AVPacketSideDataType type = src->side_data[i].type;

View File

@ -214,6 +214,7 @@ typedef struct AVSContext {
int luma_scan[4];
int qp;
int qp_fixed;
int pic_qp_fixed;
int cbp;
ScanTable scantable;

View File

@ -904,7 +904,7 @@ static inline int decode_slice_header(AVSContext *h, GetBitContext *gb)
/* mark top macroblocks as unavailable */
h->flags &= ~(B_AVAIL | C_AVAIL);
if ((h->mby == 0) && (!h->qp_fixed)) {
if (!h->pic_qp_fixed) {
h->qp_fixed = get_bits1(gb);
h->qp = get_bits(gb, 6);
}
@ -1027,6 +1027,7 @@ static int decode_pic(AVSContext *h)
skip_bits1(&h->gb); //advanced_pred_mode_disable
skip_bits1(&h->gb); //top_field_first
skip_bits1(&h->gb); //repeat_first_field
h->pic_qp_fixed =
h->qp_fixed = get_bits1(&h->gb);
h->qp = get_bits(&h->gb, 6);
if (h->cur.f->pict_type == AV_PICTURE_TYPE_I) {

View File

@ -261,7 +261,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
static int cdg_decode_frame(AVCodecContext *avctx,
void *data, int *got_frame, AVPacket *avpkt)
{
const uint8_t *buf = avpkt->data;
GetByteContext gb;
int buf_size = avpkt->size;
int ret;
uint8_t command, inst;
@ -278,6 +278,8 @@ static int cdg_decode_frame(AVCodecContext *avctx,
return AVERROR(EINVAL);
}
bytestream2_init(&gb, avpkt->data, avpkt->size);
if ((ret = ff_reget_buffer(avctx, cc->frame)) < 0)
return ret;
if (!avctx->frame_number) {
@ -285,13 +287,11 @@ static int cdg_decode_frame(AVCodecContext *avctx,
memset(cc->frame->data[1], 0, AVPALETTE_SIZE);
}
command = bytestream_get_byte(&buf);
inst = bytestream_get_byte(&buf);
command = bytestream2_get_byte(&gb);
inst = bytestream2_get_byte(&gb);
inst &= CDG_MASK;
buf += 2; /// skipping 2 unneeded bytes
if (buf_size > CDG_HEADER_SIZE)
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
bytestream2_skip(&gb, 2);
bytestream2_get_buffer(&gb, cdg_data, sizeof(cdg_data));
if ((command & CDG_MASK) == CDG_COMMAND) {
switch (inst) {
@ -353,10 +353,9 @@ static int cdg_decode_frame(AVCodecContext *avctx,
*got_frame = 1;
} else {
*got_frame = 0;
buf_size = 0;
}
return buf_size;
return avpkt->size;
}
static av_cold int cdg_decode_end(AVCodecContext *avctx)

View File

@ -135,7 +135,7 @@ static int cinepak_decode_vectors (CinepakContext *s, cvid_strip *strip,
const uint8_t *eod = (data + size);
uint32_t flag, mask;
uint8_t *cb0, *cb1, *cb2, *cb3;
unsigned int x, y;
int x, y;
char *ip0, *ip1, *ip2, *ip3;
flag = 0;

View File

@ -1214,8 +1214,8 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q->num_subpackets++;
s++;
if (s > MAX_SUBPACKETS) {
avpriv_request_sample(avctx, "subpackets > %d", MAX_SUBPACKETS);
if (s > FFMIN(MAX_SUBPACKETS, avctx->block_align)) {
avpriv_request_sample(avctx, "subpackets > %d", FFMIN(MAX_SUBPACKETS, avctx->block_align));
return AVERROR_PATCHWELCOME;
}
}

View File

@ -1370,7 +1370,7 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
* Decode VQ encoded high frequencies
*/
if (s->subband_activity[k] > s->vq_start_subband[k]) {
if (!s->debug_flag & 0x01) {
if (!(s->debug_flag & 0x01)) {
av_log(s->avctx, AV_LOG_DEBUG,
"Stream with high frequencies VQ coding\n");
s->debug_flag |= 0x01;
@ -2173,7 +2173,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
if (s->core_downmix && (s->core_downmix_amode == DCA_STEREO ||
s->core_downmix_amode == DCA_STEREO_TOTAL)) {
int sign, code;
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
sign = s->core_downmix_codes[i][0] & 0x100 ? 1 : -1;
code = s->core_downmix_codes[i][0] & 0x0FF;
s->downmix_coef[i][0] = (!code ? 0.0f :
@ -2191,19 +2191,19 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
"Invalid channel mode %d\n", am);
return AVERROR_INVALIDDATA;
}
if (s->prim_channels + !!s->lfe >
if (num_core_channels + !!s->lfe >
FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
avpriv_request_sample(s->avctx, "Downmixing %d channels",
s->prim_channels + !!s->lfe);
return AVERROR_PATCHWELCOME;
}
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
s->downmix_coef[i][0] = dca_default_coeffs[am][i][0];
s->downmix_coef[i][1] = dca_default_coeffs[am][i][1];
}
}
av_dlog(s->avctx, "Stereo downmix coeffs:\n");
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
av_dlog(s->avctx, "L, input channel %d = %f\n", i,
s->downmix_coef[i][0]);
av_dlog(s->avctx, "R, input channel %d = %f\n", i,
@ -2329,6 +2329,17 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
{ /* xxx should also do MA extensions */
if (s->amode < 16) {
avctx->channel_layout = dca_core_channel_layout[s->amode];
if (s->prim_channels + !!s->lfe > 2 &&
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
/*
* Neither the core's auxiliary data nor our default tables contain
* downmix coefficients for the additional channel coded in the XCh
* extension, so when we're doing a Stereo downmix, don't decode it.
*/
s->xch_disable = 1;
}
#if FF_API_REQUEST_CHANNELS
FF_DISABLE_DEPRECATION_WARNINGS
if (s->xch_present && !s->xch_disable &&
@ -2366,7 +2377,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
return AVERROR_INVALIDDATA;
}
if (s->prim_channels + !!s->lfe > 2 &&
if (num_core_channels + !!s->lfe > 2 &&
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
channels = 2;
s->output = s->prim_channels == 2 ? s->amode : DCA_STEREO;
@ -2415,7 +2426,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
* masks in some sense -- unfortunately some channels could overlap */
if (av_popcount(channel_mask) != av_popcount(channel_layout)) {
av_log(avctx, AV_LOG_DEBUG,
"DTS-XXCH: Inconsistant avcodec/dts channel layouts\n");
"DTS-XXCH: Inconsistent avcodec/dts channel layouts\n");
return AVERROR_INVALIDDATA;
}
@ -2433,6 +2444,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
s->xxch_order_tab[j++] = posn;
}
}
}
s->lfe_index = av_popcount(channel_layout & (AV_CH_LOW_FREQUENCY-1));

View File

@ -28,6 +28,7 @@
#ifndef AVCODEC_DIRAC_ARITH_H
#define AVCODEC_DIRAC_ARITH_H
#include "libavutil/x86/asm.h"
#include "bytestream.h"
#include "get_bits.h"
@ -134,7 +135,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int ctx)
range_times_prob = (c->range * prob_zero) >> 16;
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
low -= range_times_prob << 16;
range -= range_times_prob;
bit = 0;
@ -170,6 +171,10 @@ static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_c
{
int ret = 1;
while (!dirac_get_arith_bit(c, follow_ctx)) {
if (ret >= 0x40000000) {
av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n");
return -1;
}
ret <<= 1;
ret += dirac_get_arith_bit(c, data_ctx);
follow_ctx = ff_dirac_next_ctx[follow_ctx];

View File

@ -201,6 +201,7 @@ typedef struct DiracContext {
uint16_t *mctmp; /* buffer holding the MC data multipled by OBMC weights */
uint8_t *mcscratch;
int buffer_stride;
DECLARE_ALIGNED(16, uint8_t, obmc_weight)[3][MAX_BLOCKSIZE*MAX_BLOCKSIZE];
@ -343,22 +344,44 @@ static int alloc_sequence_buffers(DiracContext *s)
return AVERROR(ENOMEM);
}
w = s->source.width;
h = s->source.height;
/* fixme: allocate using real stride here */
s->sbsplit = av_malloc(sbwidth * sbheight);
s->blmotion = av_malloc(sbwidth * sbheight * 16 * sizeof(*s->blmotion));
s->edge_emu_buffer_base = av_malloc((w+64)*MAX_BLOCKSIZE);
s->sbsplit = av_malloc_array(sbwidth, sbheight);
s->blmotion = av_malloc_array(sbwidth, sbheight * 16 * sizeof(*s->blmotion));
s->mctmp = av_malloc((w+64+MAX_BLOCKSIZE) * (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
s->mcscratch = av_malloc((w+64)*MAX_BLOCKSIZE);
if (!s->sbsplit || !s->blmotion || !s->mctmp || !s->mcscratch)
if (!s->sbsplit || !s->blmotion)
return AVERROR(ENOMEM);
return 0;
}
static int alloc_buffers(DiracContext *s, int stride)
{
int w = s->source.width;
int h = s->source.height;
av_assert0(stride >= w);
stride += 64;
if (s->buffer_stride >= stride)
return 0;
s->buffer_stride = 0;
av_freep(&s->edge_emu_buffer_base);
memset(s->edge_emu_buffer, 0, sizeof(s->edge_emu_buffer));
av_freep(&s->mctmp);
av_freep(&s->mcscratch);
s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE);
s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE);
if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch)
return AVERROR(ENOMEM);
s->buffer_stride = stride;
return 0;
}
static void free_sequence_buffers(DiracContext *s)
{
int i, j, k;
@ -382,6 +405,7 @@ static void free_sequence_buffers(DiracContext *s)
av_freep(&s->plane[i].idwt_tmp);
}
s->buffer_stride = 0;
av_freep(&s->sbsplit);
av_freep(&s->blmotion);
av_freep(&s->edge_emu_buffer_base);
@ -586,10 +610,10 @@ static av_always_inline void decode_subband_internal(DiracContext *s, SubBand *b
top = 0;
for (cb_y = 0; cb_y < cb_height; cb_y++) {
bottom = (b->height * (cb_y+1)) / cb_height;
bottom = (b->height * (cb_y+1LL)) / cb_height;
left = 0;
for (cb_x = 0; cb_x < cb_width; cb_x++) {
right = (b->width * (cb_x+1)) / cb_width;
right = (b->width * (cb_x+1LL)) / cb_width;
codeblock(s, b, &gb, &c, left, right, top, bottom, blockcnt_one, is_arith);
left = right;
}
@ -978,8 +1002,8 @@ static int dirac_unpack_idwt_params(DiracContext *s)
/* Codeblock parameters (core syntax only) */
if (get_bits1(gb)) {
for (i = 0; i <= s->wavelet_depth; i++) {
CHECKEDREAD(s->codeblock[i].width , tmp < 1, "codeblock width invalid\n")
CHECKEDREAD(s->codeblock[i].height, tmp < 1, "codeblock height invalid\n")
CHECKEDREAD(s->codeblock[i].width , tmp < 1 || tmp > (s->avctx->width >>s->wavelet_depth-i), "codeblock width invalid\n")
CHECKEDREAD(s->codeblock[i].height, tmp < 1 || tmp > (s->avctx->height>>s->wavelet_depth-i), "codeblock height invalid\n")
}
CHECKEDREAD(s->codeblock_mode, tmp > 1, "unknown codeblock mode\n")
@ -1355,8 +1379,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
motion_y >>= s->chroma_y_shift;
}
mx = motion_x & ~(-1 << s->mv_precision);
my = motion_y & ~(-1 << s->mv_precision);
mx = motion_x & ~(-1U << s->mv_precision);
my = motion_y & ~(-1U << s->mv_precision);
motion_x >>= s->mv_precision;
motion_y >>= s->mv_precision;
/* normalize subpel coordinates to epel */
@ -1854,6 +1878,9 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
s->plane[1].stride = pic->avframe->linesize[1];
s->plane[2].stride = pic->avframe->linesize[2];
if (alloc_buffers(s, FFMAX3(FFABS(s->plane[0].stride), FFABS(s->plane[1].stride), FFABS(s->plane[2].stride))) < 0)
return AVERROR(ENOMEM);
/* [DIRAC_STD] 11.1 Picture parse. picture_parse() */
if (dirac_decode_picture_header(s))
return -1;

View File

@ -36,6 +36,7 @@ typedef struct DNXHDContext {
GetBitContext gb;
int64_t cid; ///< compression id
unsigned int width, height;
enum AVPixelFormat pix_fmt;
unsigned int mb_width, mb_height;
uint32_t mb_scan_index[68]; /* max for 1080p */
int cur_field; ///< current interlaced field
@ -133,7 +134,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->is_444 = 0;
if (buf[0x4] == 0x2) {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
ctx->pix_fmt = AV_PIX_FMT_YUV444P10;
ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) {
ff_dsputil_init(&ctx->dsp, ctx->avctx);
@ -142,7 +143,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
}
ctx->is_444 = 1;
} else if (buf[0x21] & 0x40) {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) {
ff_dsputil_init(&ctx->dsp, ctx->avctx);
@ -150,7 +151,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->decode_dct_block = dnxhd_decode_dct_block_10;
}
} else {
ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
ctx->pix_fmt = AV_PIX_FMT_YUV422P;
ctx->avctx->bits_per_raw_sample = 8;
if (ctx->bit_depth != 8) {
ff_dsputil_init(&ctx->dsp, ctx->avctx);
@ -432,7 +433,13 @@ static int dnxhd_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
avctx->width, avctx->height, ctx->width, ctx->height);
first_field = 1;
}
if (avctx->pix_fmt != AV_PIX_FMT_NONE && avctx->pix_fmt != ctx->pix_fmt) {
av_log(avctx, AV_LOG_WARNING, "pix_fmt changed: %s -> %s\n",
av_get_pix_fmt_name(avctx->pix_fmt), av_get_pix_fmt_name(ctx->pix_fmt));
first_field = 1;
}
avctx->pix_fmt = ctx->pix_fmt;
ret = ff_set_dimensions(avctx, ctx->width, ctx->height);
if (ret < 0)
return ret;

View File

@ -45,8 +45,11 @@ static int dvdsub_parse(AVCodecParserContext *s,
DVDSubParseContext *pc = s->priv_data;
if (pc->packet_index == 0) {
if (buf_size < 2)
return 0;
if (buf_size < 2 || AV_RB16(buf) && buf_size < 6) {
if (buf_size)
av_log(avctx, AV_LOG_DEBUG, "Parser input %d too small\n", buf_size);
return buf_size;
}
pc->packet_len = AV_RB16(buf);
if (pc->packet_len == 0) /* HD-DVD subpicture packet */
pc->packet_len = AV_RB32(buf+2);

View File

@ -329,6 +329,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
{
DxaDecContext * const c = avctx->priv_data;
if (avctx->width%4 || avctx->height%4) {
avpriv_request_sample(avctx, "dimensions are not a multiple of 4");
return AVERROR_INVALIDDATA;
}
c->prev = av_frame_alloc();
if (!c->prev)
return AVERROR(ENOMEM);

View File

@ -29,6 +29,7 @@
*/
#include "avcodec.h"
#include "bytestream.h"
#include "get_bits.h"
#include "aandcttab.h"
#include "eaidct.h"
@ -237,30 +238,32 @@ static int decode_frame(AVCodecContext *avctx,
{
const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size;
const uint8_t *buf_end = buf+buf_size;
MadContext *s = avctx->priv_data;
AVFrame *frame = data;
GetByteContext gb;
int width, height;
int chunk_type;
int inter, ret;
if (buf_size < 26) {
av_log(avctx, AV_LOG_ERROR, "Input buffer too small\n");
*got_frame = 0;
return AVERROR_INVALIDDATA;
}
bytestream2_init(&gb, buf, buf_size);
chunk_type = AV_RL32(&buf[0]);
chunk_type = bytestream2_get_le32(&gb);
inter = (chunk_type == MADm_TAG || chunk_type == MADe_TAG);
buf += 8;
bytestream2_skip(&gb, 10);
av_reduce(&avctx->time_base.num, &avctx->time_base.den,
AV_RL16(&buf[6]), 1000, 1<<30);
bytestream2_get_le16(&gb), 1000, 1<<30);
width = AV_RL16(&buf[8]);
height = AV_RL16(&buf[10]);
calc_quant_matrix(s, buf[13]);
buf += 16;
width = bytestream2_get_le16(&gb);
height = bytestream2_get_le16(&gb);
bytestream2_skip(&gb, 1);
calc_quant_matrix(s, bytestream2_get_byte(&gb));
bytestream2_skip(&gb, 2);
if (bytestream2_get_bytes_left(&gb) < 2) {
av_log(avctx, AV_LOG_ERROR, "Input data too small\n");
return AVERROR_INVALIDDATA;
}
if (width < 16 || height < 16) {
av_log(avctx, AV_LOG_ERROR, "Dimensions too small\n");
@ -269,7 +272,7 @@ static int decode_frame(AVCodecContext *avctx,
if (avctx->width != width || avctx->height != height) {
av_frame_unref(s->last_frame);
if((width * height)/2048*7 > buf_end-buf)
if((width * height)/2048*7 > bytestream2_get_bytes_left(&gb))
return AVERROR_INVALIDDATA;
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
return ret;
@ -292,12 +295,13 @@ static int decode_frame(AVCodecContext *avctx,
}
av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size,
buf_end - buf);
bytestream2_get_bytes_left(&gb));
if (!s->bitstream_buf)
return AVERROR(ENOMEM);
s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t*)buf, (buf_end-buf)/2);
memset((uint8_t*)s->bitstream_buf + (buf_end-buf), 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&s->gb, s->bitstream_buf, 8*(buf_end-buf));
s->dsp.bswap16_buf(s->bitstream_buf, (const uint16_t *)(buf + bytestream2_tell(&gb)),
bytestream2_get_bytes_left(&gb) / 2);
memset((uint8_t*)s->bitstream_buf + bytestream2_get_bytes_left(&gb), 0, FF_INPUT_BUFFER_PADDING_SIZE);
init_get_bits(&s->gb, s->bitstream_buf, 8*(bytestream2_get_bytes_left(&gb)));
for (s->mb_y=0; s->mb_y < (avctx->height+15)/16; s->mb_y++)
for (s->mb_x=0; s->mb_x < (avctx->width +15)/16; s->mb_x++)

View File

@ -117,6 +117,7 @@ static void fft_ref(FFTComplex *tabr, FFTComplex *tab, int nbits)
}
}
#if CONFIG_MDCT
static void imdct_ref(FFTSample *out, FFTSample *in, int nbits)
{
int n = 1<<nbits;
@ -151,8 +152,10 @@ static void mdct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = REF_SCALE(s, nbits - 1);
}
}
#endif /* CONFIG_MDCT */
#if FFT_FLOAT
#if CONFIG_DCT
static void idct_ref(FFTSample *output, FFTSample *input, int nbits)
{
int n = 1<<nbits;
@ -185,6 +188,7 @@ static void dct_ref(FFTSample *output, FFTSample *input, int nbits)
output[k] = s;
}
}
#endif /* CONFIG_DCT */
#endif
@ -310,6 +314,7 @@ int main(int argc, char **argv)
tab2 = av_malloc(fft_size * sizeof(FFTSample));
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
av_log(NULL, AV_LOG_INFO,"Scale factor is set to %f\n", scale);
if (do_inverse)
@ -318,6 +323,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"MDCT");
ff_mdct_init(m, fft_nbits, do_inverse, scale);
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IFFT");
@ -327,6 +333,7 @@ int main(int argc, char **argv)
fft_ref_init(fft_nbits, do_inverse);
break;
#if FFT_FLOAT
# if CONFIG_RDFT
case TRANSFORM_RDFT:
if (do_inverse)
av_log(NULL, AV_LOG_INFO,"IDFT_C2R");
@ -335,6 +342,7 @@ int main(int argc, char **argv)
ff_rdft_init(r, fft_nbits, do_inverse ? IDFT_C2R : DFT_R2C);
fft_ref_init(fft_nbits, do_inverse);
break;
# endif /* CONFIG_RDFT */
# if CONFIG_DCT
case TRANSFORM_DCT:
if (do_inverse)
@ -343,7 +351,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"DCT_II");
ff_dct_init(d, fft_nbits, do_inverse ? DCT_III : DCT_II);
break;
# endif
# endif /* CONFIG_DCT */
#endif
default:
av_log(NULL, AV_LOG_ERROR, "Requested transform not supported\n");
@ -362,6 +370,7 @@ int main(int argc, char **argv)
av_log(NULL, AV_LOG_INFO,"Checking...\n");
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
if (do_inverse) {
imdct_ref((FFTSample *)tab_ref, (FFTSample *)tab1, fft_nbits);
@ -375,6 +384,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, tab2, fft_size / 2, scale);
}
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
s->fft_permute(s, tab);
@ -384,6 +394,7 @@ int main(int argc, char **argv)
err = check_diff((FFTSample *)tab_ref, (FFTSample *)tab, fft_size * 2, 1.0);
break;
#if FFT_FLOAT
#if CONFIG_RDFT
case TRANSFORM_RDFT:
fft_size_2 = fft_size >> 1;
if (do_inverse) {
@ -415,6 +426,8 @@ int main(int argc, char **argv)
err = check_diff((float *)tab_ref, (float *)tab2, fft_size, 1.0);
}
break;
#endif /* CONFIG_RDFT */
#if CONFIG_DCT
case TRANSFORM_DCT:
memcpy(tab, tab1, fft_size * sizeof(FFTComplex));
d->dct_calc(d, (FFTSample *)tab);
@ -425,6 +438,7 @@ int main(int argc, char **argv)
}
err = check_diff((float *)tab_ref, (float *)tab, fft_size, 1.0);
break;
#endif /* CONFIG_DCT */
#endif
}
@ -476,21 +490,25 @@ int main(int argc, char **argv)
}
switch (transform) {
#if CONFIG_MDCT
case TRANSFORM_MDCT:
ff_mdct_end(m);
break;
#endif /* CONFIG_MDCT */
case TRANSFORM_FFT:
ff_fft_end(s);
break;
#if FFT_FLOAT
# if CONFIG_RDFT
case TRANSFORM_RDFT:
ff_rdft_end(r);
break;
# endif /* CONFIG_RDFT */
# if CONFIG_DCT
case TRANSFORM_DCT:
ff_dct_end(d);
break;
# endif
# endif /* CONFIG_DCT */
#endif
}

View File

@ -622,31 +622,31 @@ static int read_header(FFV1Context *f)
f->state_transition[i] = get_symbol(c, state, 1) + c->one_state[i];
}
colorspace = get_symbol(c, state, 0); //YUV cs type
colorspace = get_symbol(c, state, 0); //YUV cs type
bits_per_raw_sample = f->version > 0 ? get_symbol(c, state, 0) : f->avctx->bits_per_raw_sample;
chroma_planes = get_rac(c, state);
chroma_h_shift = get_symbol(c, state, 0);
chroma_v_shift = get_symbol(c, state, 0);
transparency = get_rac(c, state);
chroma_planes = get_rac(c, state);
chroma_h_shift = get_symbol(c, state, 0);
chroma_v_shift = get_symbol(c, state, 0);
transparency = get_rac(c, state);
if (f->plane_count) {
if ( colorspace != f->colorspace
|| bits_per_raw_sample != f->avctx->bits_per_raw_sample
|| chroma_planes != f->chroma_planes
|| chroma_h_shift!= f->chroma_h_shift
|| chroma_v_shift!= f->chroma_v_shift
|| transparency != f->transparency) {
if (colorspace != f->colorspace ||
bits_per_raw_sample != f->avctx->bits_per_raw_sample ||
chroma_planes != f->chroma_planes ||
chroma_h_shift != f->chroma_h_shift ||
chroma_v_shift != f->chroma_v_shift ||
transparency != f->transparency) {
av_log(f->avctx, AV_LOG_ERROR, "Invalid change of global parameters\n");
return AVERROR_INVALIDDATA;
}
}
f->colorspace = colorspace;
f->colorspace = colorspace;
f->avctx->bits_per_raw_sample = bits_per_raw_sample;
f->chroma_planes = chroma_planes;
f->chroma_h_shift = chroma_h_shift;
f->chroma_v_shift = chroma_v_shift;
f->transparency = transparency;
f->chroma_planes = chroma_planes;
f->chroma_h_shift = chroma_h_shift;
f->chroma_v_shift = chroma_v_shift;
f->transparency = transparency;
f->plane_count = 2 + f->transparency;
}

View File

@ -166,6 +166,10 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
if (memcmp(src, fic_header, 7))
av_log(avctx, AV_LOG_WARNING, "Invalid FIC Header.\n");
/* Is it a skip frame? */
if (src[17])
goto skip;
nslices = src[13];
if (!nslices) {
av_log(avctx, AV_LOG_ERROR, "Zero slices found.\n");
@ -242,10 +246,11 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
ctx->slice_data[slice].y_off = y_off;
}
if (ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
NULL, nslices, sizeof(ctx->slice_data[0])) < 0)
if ((ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
NULL, nslices, sizeof(ctx->slice_data[0]))) < 0)
return ret;
skip:
*got_frame = 1;
if ((ret = av_frame_ref(data, ctx->frame)) < 0)
return ret;

View File

@ -471,10 +471,10 @@ static int decode_frame(FLACContext *s)
ret = allocate_buffers(s);
if (ret < 0)
return ret;
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
s->got_streaminfo = 1;
dump_headers(s->avctx, (FLACStreaminfo *)s);
}
ff_flacdsp_init(&s->dsp, s->avctx->sample_fmt, s->bps);
// dump_headers(s->avctx, (FLACStreaminfo *)s);

View File

@ -87,6 +87,7 @@ typedef struct G2MContext {
int compression;
int width, height, bpp;
int orig_width, orig_height;
int tile_width, tile_height;
int tiles_x, tiles_y, tile_x, tile_y;
@ -691,6 +692,7 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
switch (chunk_type) {
case DISPLAY_INFO:
got_header =
c->got_header = 0;
if (chunk_size < 21) {
av_log(avctx, AV_LOG_ERROR, "Invalid display info size %d\n",
@ -699,8 +701,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
}
c->width = bytestream2_get_be32(&bc);
c->height = bytestream2_get_be32(&bc);
if (c->width < 16 || c->width > avctx->width ||
c->height < 16 || c->height > avctx->height) {
if (c->width < 16 || c->width > c->orig_width ||
c->height < 16 || c->height > c->orig_height) {
av_log(avctx, AV_LOG_ERROR,
"Invalid frame dimensions %dx%d\n",
c->width, c->height);
@ -717,12 +719,15 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR,
"Unknown compression method %d\n",
c->compression);
return AVERROR_PATCHWELCOME;
ret = AVERROR_PATCHWELCOME;
goto header_fail;
}
c->tile_width = bytestream2_get_be32(&bc);
c->tile_height = bytestream2_get_be32(&bc);
if (!c->tile_width || !c->tile_height ||
((c->tile_width | c->tile_height) & 0xF)) {
if (c->tile_width <= 0 || c->tile_height <= 0 ||
((c->tile_width | c->tile_height) & 0xF) ||
c->tile_width * 4LL * c->tile_height >= INT_MAX
) {
av_log(avctx, AV_LOG_ERROR,
"Invalid tile dimensions %dx%d\n",
c->tile_width, c->tile_height);
@ -737,7 +742,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
(chunk_size - 21) < 16 ) {
av_log(avctx, AV_LOG_ERROR,
"Display info: missing bitmasks!\n");
return AVERROR_INVALIDDATA;
ret = AVERROR_INVALIDDATA;
goto header_fail;
}
r_mask = bytestream2_get_be32(&bc);
g_mask = bytestream2_get_be32(&bc);
@ -746,11 +752,13 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR,
"Invalid or unsupported bitmasks: R=%X, G=%X, B=%X\n",
r_mask, g_mask, b_mask);
return AVERROR_PATCHWELCOME;
ret = AVERROR_PATCHWELCOME;
goto header_fail;
}
} else {
avpriv_request_sample(avctx, "bpp=%d", c->bpp);
return AVERROR_PATCHWELCOME;
ret = AVERROR_PATCHWELCOME;
goto header_fail;
}
if (g2m_init_buffers(c)) {
ret = AVERROR(ENOMEM);
@ -862,6 +870,10 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_RGB24;
// store original sizes and check against those if resize happens
c->orig_width = avctx->width;
c->orig_height = avctx->height;
return 0;
}

View File

@ -2285,7 +2285,8 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
if (p->cur_rate == RATE_6300) {
info_bits = 0;
put_bits(&pb, 2, info_bits);
}
}else
av_assert0(0);
put_bits(&pb, 8, p->lsp_index[2]);
put_bits(&pb, 8, p->lsp_index[1]);

View File

@ -258,26 +258,21 @@ static int gif_read_image(GifState *s, AVFrame *frame)
case 1:
y1 += 8;
ptr += linesize * 8;
if (y1 >= height) {
y1 = pass ? 2 : 4;
ptr = ptr1 + linesize * y1;
pass++;
}
break;
case 2:
y1 += 4;
ptr += linesize * 4;
if (y1 >= height) {
y1 = 1;
ptr = ptr1 + linesize;
pass++;
}
break;
case 3:
y1 += 2;
ptr += linesize * 2;
break;
}
while (y1 >= height) {
y1 = 4 >> pass;
ptr = ptr1 + linesize * y1;
pass++;
}
} else {
ptr += linesize;
}

View File

@ -58,7 +58,7 @@ int main(void)
}
}
#define EXTEND(i) (i << 3 | i & 7)
#define EXTEND(i) ((i) << 3 | (i) & 7)
init_put_bits(&pb, temp, SIZE);
for (i = 0; i < COUNT; i++)
set_ue_golomb(&pb, EXTEND(i));

View File

@ -214,6 +214,18 @@ static inline int get_se_golomb(GetBitContext *gb)
}
}
static inline int get_se_golomb_long(GetBitContext *gb)
{
unsigned int buf = get_ue_golomb_long(gb);
if (buf & 1)
buf = (buf + 1) >> 1;
else
buf = -(buf >> 1);
return buf;
}
static inline int svq3_get_se_golomb(GetBitContext *gb)
{
unsigned int buf;

View File

@ -319,6 +319,14 @@ static int decode_slice(MpegEncContext *s)
}
}
if (s->codec_id == AV_CODEC_ID_H263 &&
(s->workaround_bugs & FF_BUG_AUTODETECT) &&
get_bits_left(&s->gb) >= 64 &&
AV_RB64(s->gb.buffer_end - 8) == 0xCDCDCDCDFC7F0000) {
s->padding_bug_score += 32;
}
if (s->workaround_bugs & FF_BUG_AUTODETECT) {
if (s->padding_bug_score > -2 && !s->data_partitioning)
s->workaround_bugs |= FF_BUG_NO_PADDING;

View File

@ -601,18 +601,18 @@ int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma)
if ((h->left_samples_available & 0x8080) != 0x8080) {
mode = left[mode];
if (is_chroma && (h->left_samples_available & 0x8080)) {
// mad cow disease mode, aka MBAFF + constrained_intra_pred
mode = ALZHEIMER_DC_L0T_PRED8x8 +
(!(h->left_samples_available & 0x8000)) +
2 * (mode == DC_128_PRED8x8);
}
if (mode < 0) {
av_log(h->avctx, AV_LOG_ERROR,
"left block unavailable for requested intra mode at %d %d\n",
h->mb_x, h->mb_y);
return AVERROR_INVALIDDATA;
}
if (is_chroma && (h->left_samples_available & 0x8080)) {
// mad cow disease mode, aka MBAFF + constrained_intra_pred
mode = ALZHEIMER_DC_L0T_PRED8x8 +
(!(h->left_samples_available & 0x8000)) +
2 * (mode == DC_128_PRED8x8);
}
}
return mode;
@ -634,7 +634,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src,
#define STARTCODE_TEST \
if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
if (src[i + 2] != 3) { \
if (src[i + 2] != 3 && src[i + 2] != 0) { \
/* startcode, so we must be past the end */ \
length = i; \
} \
@ -707,7 +707,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src,
if (src[si + 2] > 3) {
dst[di++] = src[si++];
dst[di++] = src[si++];
} else if (src[si] == 0 && src[si + 1] == 0) {
} else if (src[si] == 0 && src[si + 1] == 0 && src[si + 2] != 0) {
if (src[si + 2] == 3) { // escape
dst[di++] = 0;
dst[di++] = 0;
@ -1813,6 +1813,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
memset(&h->mb, 0, sizeof(h->mb));
memset(&h->mb_luma_dc, 0, sizeof(h->mb_luma_dc));
memset(&h->mb_padding, 0, sizeof(h->mb_padding));
memset(&h->cur_pic, 0, sizeof(h->cur_pic));
h->avctx = dst;
h->DPB = NULL;
@ -1820,6 +1821,17 @@ static int decode_update_thread_context(AVCodecContext *dst,
h->mb_type_pool = NULL;
h->ref_index_pool = NULL;
h->motion_val_pool = NULL;
h->intra4x4_pred_mode= NULL;
h->non_zero_count = NULL;
h->slice_table_base = NULL;
h->slice_table = NULL;
h->cbp_table = NULL;
h->chroma_pred_mode_table = NULL;
memset(h->mvd_table, 0, sizeof(h->mvd_table));
h->direct_table = NULL;
h->list_counts = NULL;
h->mb2b_xy = NULL;
h->mb2br_xy = NULL;
for (i = 0; i < 2; i++) {
h->rbsp_buffer[i] = NULL;
h->rbsp_buffer_size[i] = 0;
@ -2141,10 +2153,10 @@ static void decode_postinit(H264Context *h, int setup_finished)
stereo->type = AV_STEREO3D_CHECKERBOARD;
break;
case 1:
stereo->type = AV_STEREO3D_LINES;
stereo->type = AV_STEREO3D_COLUMNS;
break;
case 2:
stereo->type = AV_STEREO3D_COLUMNS;
stereo->type = AV_STEREO3D_LINES;
break;
case 3:
if (h->quincunx_subsampling)
@ -3168,76 +3180,79 @@ static int h264_set_parameter_from_sps(H264Context *h)
static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
{
enum AVPixelFormat pix_fmts[2];
const enum AVPixelFormat *choices = pix_fmts;
int i;
pix_fmts[1] = AV_PIX_FMT_NONE;
switch (h->sps.bit_depth_luma) {
case 9:
if (CHROMA444(h)) {
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
return AV_PIX_FMT_GBRP9;
pix_fmts[0] = AV_PIX_FMT_GBRP9;
} else
return AV_PIX_FMT_YUV444P9;
pix_fmts[0] = AV_PIX_FMT_YUV444P9;
} else if (CHROMA422(h))
return AV_PIX_FMT_YUV422P9;
pix_fmts[0] = AV_PIX_FMT_YUV422P9;
else
return AV_PIX_FMT_YUV420P9;
pix_fmts[0] = AV_PIX_FMT_YUV420P9;
break;
case 10:
if (CHROMA444(h)) {
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
return AV_PIX_FMT_GBRP10;
pix_fmts[0] = AV_PIX_FMT_GBRP10;
} else
return AV_PIX_FMT_YUV444P10;
pix_fmts[0] = AV_PIX_FMT_YUV444P10;
} else if (CHROMA422(h))
return AV_PIX_FMT_YUV422P10;
pix_fmts[0] = AV_PIX_FMT_YUV422P10;
else
return AV_PIX_FMT_YUV420P10;
pix_fmts[0] = AV_PIX_FMT_YUV420P10;
break;
case 12:
if (CHROMA444(h)) {
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
return AV_PIX_FMT_GBRP12;
pix_fmts[0] = AV_PIX_FMT_GBRP12;
} else
return AV_PIX_FMT_YUV444P12;
pix_fmts[0] = AV_PIX_FMT_YUV444P12;
} else if (CHROMA422(h))
return AV_PIX_FMT_YUV422P12;
pix_fmts[0] = AV_PIX_FMT_YUV422P12;
else
return AV_PIX_FMT_YUV420P12;
pix_fmts[0] = AV_PIX_FMT_YUV420P12;
break;
case 14:
if (CHROMA444(h)) {
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
return AV_PIX_FMT_GBRP14;
pix_fmts[0] = AV_PIX_FMT_GBRP14;
} else
return AV_PIX_FMT_YUV444P14;
pix_fmts[0] = AV_PIX_FMT_YUV444P14;
} else if (CHROMA422(h))
return AV_PIX_FMT_YUV422P14;
pix_fmts[0] = AV_PIX_FMT_YUV422P14;
else
return AV_PIX_FMT_YUV420P14;
pix_fmts[0] = AV_PIX_FMT_YUV420P14;
break;
case 8:
if (CHROMA444(h)) {
if (h->avctx->colorspace == AVCOL_SPC_RGB) {
av_log(h->avctx, AV_LOG_DEBUG, "Detected GBR colorspace.\n");
return AV_PIX_FMT_GBR24P;
} else if (h->avctx->colorspace == AVCOL_SPC_YCGCO) {
if (h->avctx->colorspace == AVCOL_SPC_YCGCO)
av_log(h->avctx, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n");
}
return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P
: AV_PIX_FMT_YUV444P;
if (h->avctx->colorspace == AVCOL_SPC_RGB)
pix_fmts[0] = AV_PIX_FMT_GBRP;
else if (h->avctx->color_range == AVCOL_RANGE_JPEG)
pix_fmts[0] = AV_PIX_FMT_YUVJ444P;
else
pix_fmts[0] = AV_PIX_FMT_YUV444P;
} else if (CHROMA422(h)) {
return h->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P
: AV_PIX_FMT_YUV422P;
if (h->avctx->color_range == AVCOL_RANGE_JPEG)
pix_fmts[0] = AV_PIX_FMT_YUVJ422P;
else
pix_fmts[0] = AV_PIX_FMT_YUV422P;
} else {
int i;
const enum AVPixelFormat * fmt = h->avctx->codec->pix_fmts ?
h->avctx->codec->pix_fmts :
h->avctx->color_range == AVCOL_RANGE_JPEG ?
h264_hwaccel_pixfmt_list_jpeg_420 :
h264_hwaccel_pixfmt_list_420;
for (i=0; fmt[i] != AV_PIX_FMT_NONE; i++)
if (fmt[i] == h->avctx->pix_fmt && !force_callback)
return fmt[i];
return ff_thread_get_format(h->avctx, fmt);
if (h->avctx->codec->pix_fmts)
choices = h->avctx->codec->pix_fmts;
else if (h->avctx->color_range == AVCOL_RANGE_JPEG)
choices = h264_hwaccel_pixfmt_list_jpeg_420;
else
choices = h264_hwaccel_pixfmt_list_420;
}
break;
default:
@ -3245,6 +3260,11 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, int force_callback)
"Unsupported bit depth %d\n", h->sps.bit_depth_luma);
return AVERROR_INVALIDDATA;
}
for (i=0; choices[i] != AV_PIX_FMT_NONE; i++)
if (choices[i] == h->avctx->pix_fmt && !force_callback)
return choices[i];
return ff_thread_get_format(h->avctx, choices);
}
/* export coded and cropped frame dimensions to AVCodecContext */
@ -3444,6 +3464,17 @@ int ff_set_ref_count(H264Context *h)
return 0;
}
static enum AVPixelFormat non_j_pixfmt(enum AVPixelFormat a)
{
switch (a) {
case AV_PIX_FMT_YUVJ420P: return AV_PIX_FMT_YUV420P;
case AV_PIX_FMT_YUVJ422P: return AV_PIX_FMT_YUV422P;
case AV_PIX_FMT_YUVJ444P: return AV_PIX_FMT_YUV444P;
default:
return a;
}
}
/**
* Decode a slice header.
* This will (re)intialize the decoder and call h264_frame_start() as needed.
@ -3573,7 +3604,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|| h->mb_width != h->sps.mb_width
|| h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
));
if (h0->avctx->pix_fmt != get_pixel_format(h0, 0))
if (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0)))
must_reinit = 1;
h->mb_width = h->sps.mb_width;
@ -4938,6 +4969,7 @@ again:
if(!idr_cleared)
idr(h); // FIXME ensure we don't lose some frames if there is reordering
idr_cleared = 1;
h->has_recovery_point = 1;
case NAL_SLICE:
init_get_bits(&hx->gb, ptr, bit_length);
hx->intra_gb_ptr =

View File

@ -37,6 +37,7 @@
#include "h264dsp.h"
#include "h264pred.h"
#include "h264qpel.h"
#include "internal.h" // for avpriv_find_start_code()
#include "rectangle.h"
#define MAX_SPS_COUNT 32
@ -61,10 +62,10 @@
#define MAX_SLICES 16
#ifdef ALLOW_INTERLACE
#define MB_MBAFF(h) h->mb_mbaff
#define MB_FIELD(h) h->mb_field_decoding_flag
#define FRAME_MBAFF(h) h->mb_aff_frame
#define FIELD_PICTURE(h) (h->picture_structure != PICT_FRAME)
#define MB_MBAFF(h) (h)->mb_mbaff
#define MB_FIELD(h) (h)->mb_field_decoding_flag
#define FRAME_MBAFF(h) (h)->mb_aff_frame
#define FIELD_PICTURE(h) ((h)->picture_structure != PICT_FRAME)
#define LEFT_MBS 2
#define LTOP 0
#define LBOT 1
@ -84,12 +85,12 @@
#define FIELD_OR_MBAFF_PICTURE(h) (FRAME_MBAFF(h) || FIELD_PICTURE(h))
#ifndef CABAC
#define CABAC(h) h->pps.cabac
#define CABAC(h) (h)->pps.cabac
#endif
#define CHROMA(h) (h->sps.chroma_format_idc)
#define CHROMA422(h) (h->sps.chroma_format_idc == 2)
#define CHROMA444(h) (h->sps.chroma_format_idc == 3)
#define CHROMA(h) ((h)->sps.chroma_format_idc)
#define CHROMA422(h) ((h)->sps.chroma_format_idc == 2)
#define CHROMA444(h) ((h)->sps.chroma_format_idc == 3)
#define EXTENDED_SAR 255
@ -677,6 +678,8 @@ typedef struct H264Context {
int frame_recovered; ///< Initial frame has been completely recovered
int has_recovery_point;
int luma_weight_flag[2]; ///< 7.4.3.2 luma_weight_lX_flag
int chroma_weight_flag[2]; ///< 7.4.3.2 chroma_weight_lX_flag
@ -689,7 +692,7 @@ typedef struct H264Context {
int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low
uint8_t parse_history[4];
uint8_t parse_history[6];
int parse_history_count;
int parse_last_mb;
uint8_t *edge_emu_buffer;
@ -1026,6 +1029,33 @@ static av_always_inline int get_dct8x8_allowed(H264Context *h)
0x0001000100010001ULL));
}
static inline int find_start_code(const uint8_t *buf, int buf_size,
int buf_index, int next_avc)
{
uint32_t state = -1;
buf_index = avpriv_find_start_code(buf + buf_index, buf + next_avc + 1, &state) - buf - 1;
return FFMIN(buf_index, buf_size);
}
static inline int get_avc_nalsize(H264Context *h, const uint8_t *buf,
int buf_size, int *buf_index)
{
int i, nalsize = 0;
if (*buf_index >= buf_size - h->nal_length_size)
return -1;
for (i = 0; i < h->nal_length_size; i++)
nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++];
if (nalsize <= 0 || nalsize > buf_size - *buf_index) {
av_log(h->avctx, AV_LOG_ERROR,
"AVC: nal size %d\n", nalsize);
return -1;
}
return nalsize;
}
void ff_h264_draw_horiz_band(H264Context *h, int y, int height);
int ff_init_poc(H264Context *h, int pic_field_poc[2], int *pic_poc);
int ff_pred_weight_table(H264Context *h);

View File

@ -28,6 +28,7 @@
typedef struct H264BSFContext {
uint8_t length_size;
uint8_t first_idr;
uint8_t idr_sps_pps_seen;
int extradata_parsed;
} H264BSFContext;
@ -155,6 +156,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
return ret;
ctx->length_size = ret;
ctx->first_idr = 1;
ctx->idr_sps_pps_seen = 0;
ctx->extradata_parsed = 1;
}
@ -174,8 +176,17 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
if (buf + nal_size > buf_end || nal_size < 0)
goto fail;
/* prepend only to the first type 5 NAL unit of an IDR picture */
if (ctx->first_idr && unit_type == 5) {
if (ctx->first_idr && (unit_type == 7 || unit_type == 8))
ctx->idr_sps_pps_seen = 1;
/* if this is a new IDR picture following an IDR picture, reset the idr flag.
* Just check first_mb_in_slice to be 0 as this is the simplest solution.
* This could be checking idr_pic_id instead, but would complexify the parsing. */
if (!ctx->first_idr && unit_type == 5 && (buf[1] & 0x80))
ctx->first_idr = 1;
/* prepend only to the first type 5 NAL unit of an IDR picture, if no sps/pps are already present */
if (ctx->first_idr && unit_type == 5 && !ctx->idr_sps_pps_seen) {
if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
avctx->extradata, avctx->extradata_size,
buf, nal_size)) < 0)
@ -185,8 +196,10 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
NULL, 0, buf, nal_size)) < 0)
goto fail;
if (!ctx->first_idr && unit_type == 1)
if (!ctx->first_idr && unit_type == 1) {
ctx->first_idr = 1;
ctx->idr_sps_pps_seen = 0;
}
}
buf += nal_size;

View File

@ -91,7 +91,7 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
state = 7;
} else {
h->parse_history[h->parse_history_count++]= buf[i];
if (h->parse_history_count>3) {
if (h->parse_history_count>5) {
unsigned int mb, last_mb= h->parse_last_mb;
GetBitContext gb;
@ -119,7 +119,7 @@ found:
pc->frame_start_found = 0;
if (h->is_avc)
return next_avc;
return i - (state & 5) - 3 * (state > 7);
return i - (state & 5) - 5 * (state > 7);
}
static int scan_mmco_reset(AVCodecParserContext *s)
@ -202,10 +202,10 @@ static int scan_mmco_reset(AVCodecParserContext *s)
*/
static inline int parse_nal_units(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
const uint8_t * const buf, int buf_size)
{
H264Context *h = s->priv_data;
const uint8_t *buf_end = buf + buf_size;
int buf_index, next_avc;
unsigned int pps_id;
unsigned int slice_type;
int state = -1, got_reset = 0;
@ -225,26 +225,26 @@ static inline int parse_nal_units(AVCodecParserContext *s,
if (!buf_size)
return 0;
buf_index = 0;
next_avc = h->is_avc ? 0 : buf_size;
for (;;) {
int src_length, dst_length, consumed, nalsize = 0;
if (h->is_avc) {
int i;
if (h->nal_length_size >= buf_end - buf) break;
nalsize = 0;
for (i = 0; i < h->nal_length_size; i++)
nalsize = (nalsize << 8) | *buf++;
if (nalsize <= 0 || nalsize > buf_end - buf) {
av_log(h->avctx, AV_LOG_ERROR, "AVC: nal size %d\n", nalsize);
if (buf_index >= next_avc) {
nalsize = get_avc_nalsize(h, buf, buf_size, &buf_index);
if (nalsize < 0)
break;
}
src_length = nalsize;
next_avc = buf_index + nalsize;
} else {
buf = avpriv_find_start_code(buf, buf_end, &state);
if (buf >= buf_end)
break;
--buf;
src_length = buf_end - buf;
buf_index = find_start_code(buf, buf_size, buf_index, next_avc);
if (buf_index >= buf_size)
break;
if (buf_index >= next_avc)
continue;
}
src_length = next_avc - buf_index;
state = buf[buf_index];
switch (state & 0x1f) {
case NAL_SLICE:
case NAL_IDR_SLICE:
@ -261,10 +261,13 @@ static inline int parse_nal_units(AVCodecParserContext *s,
}
break;
}
ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length);
ptr = ff_h264_decode_nal(h, buf + buf_index, &dst_length,
&consumed, src_length);
if (ptr == NULL || dst_length < 0)
break;
buf_index += consumed;
init_get_bits(&h->gb, ptr, 8 * dst_length);
switch (h->nal_unit_type) {
case NAL_SPS:
@ -439,7 +442,6 @@ static inline int parse_nal_units(AVCodecParserContext *s,
return 0; /* no need to evaluate the rest */
}
buf += h->is_avc ? nalsize : consumed;
}
if (q264)
return 0;

View File

@ -771,7 +771,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count)
if ( err >= 0
&& h->long_ref_count==0
&& (h->short_ref_count<=2 || h->pps.ref_count[0] <= 1 && h->pps.ref_count[1] <= 1 && pps_count == 1)
&& h->pps.ref_count[0]<=2 + (h->picture_structure != PICT_FRAME)
&& h->pps.ref_count[0]<=2 + (h->picture_structure != PICT_FRAME) + (2*!h->has_recovery_point)
&& h->cur_pic_ptr->f.pict_type == AV_PICTURE_TYPE_I){
h->cur_pic_ptr->recovered |= 1;
if(!h->avctx->has_b_frames)

View File

@ -183,6 +183,8 @@ static int decode_recovery_point(H264Context *h)
if (h->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(h->avctx, AV_LOG_DEBUG, "sei_recovery_frame_cnt: %d\n", h->sei_recovery_frame_cnt);
h->has_recovery_point = 1;
return 0;
}

View File

@ -102,26 +102,26 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
goto fail;
s->skip_flag = av_malloc(pic_size_in_ctb);
s->tab_ct_depth = av_malloc(sps->min_cb_height * sps->min_cb_width);
s->tab_ct_depth = av_malloc_array(sps->min_cb_height, sps->min_cb_width);
if (!s->skip_flag || !s->tab_ct_depth)
goto fail;
s->cbf_luma = av_malloc(sps->min_tb_width * sps->min_tb_height);
s->cbf_luma = av_malloc_array(sps->min_tb_width, sps->min_tb_height);
s->tab_ipm = av_mallocz(min_pu_size);
s->is_pcm = av_malloc(min_pu_size);
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
goto fail;
s->filter_slice_edges = av_malloc(ctb_count);
s->tab_slice_address = av_malloc(pic_size_in_ctb *
s->tab_slice_address = av_malloc_array(pic_size_in_ctb,
sizeof(*s->tab_slice_address));
s->qp_y_tab = av_malloc(pic_size_in_ctb *
s->qp_y_tab = av_malloc_array(pic_size_in_ctb,
sizeof(*s->qp_y_tab));
if (!s->qp_y_tab || !s->filter_slice_edges || !s->tab_slice_address)
goto fail;
s->horizontal_bs = av_mallocz(2 * s->bs_width * (s->bs_height + 1));
s->vertical_bs = av_mallocz(2 * s->bs_width * (s->bs_height + 1));
s->horizontal_bs = av_mallocz_array(2 * s->bs_width, (s->bs_height + 1));
s->vertical_bs = av_mallocz_array(2 * s->bs_width, (s->bs_height + 1));
if (!s->horizontal_bs || !s->vertical_bs)
goto fail;
@ -283,7 +283,7 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
static int set_sps(HEVCContext *s, const HEVCSPS *sps)
{
int ret;
unsigned num = 0, den = 0;
unsigned int num = 0, den = 0;
pic_arrays_free(s);
ret = pic_arrays_init(s, sps);
@ -652,9 +652,9 @@ static int hls_slice_header(HEVCContext *s)
av_freep(&sh->entry_point_offset);
av_freep(&sh->offset);
av_freep(&sh->size);
sh->entry_point_offset = av_malloc(sh->num_entry_point_offsets * sizeof(int));
sh->offset = av_malloc(sh->num_entry_point_offsets * sizeof(int));
sh->size = av_malloc(sh->num_entry_point_offsets * sizeof(int));
sh->entry_point_offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
sh->offset = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
sh->size = av_malloc_array(sh->num_entry_point_offsets, sizeof(int));
if (!sh->entry_point_offset || !sh->offset || !sh->size) {
sh->num_entry_point_offsets = 0;
av_log(s->avctx, AV_LOG_ERROR, "Failed to allocate memory\n");
@ -2059,8 +2059,8 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
static int hls_slice_data_wpp(HEVCContext *s, const uint8_t *nal, int length)
{
HEVCLocalContext *lc = s->HEVClc;
int *ret = av_malloc((s->sh.num_entry_point_offsets + 1) * sizeof(int));
int *arg = av_malloc((s->sh.num_entry_point_offsets + 1) * sizeof(int));
int *ret = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
int *arg = av_malloc_array(s->sh.num_entry_point_offsets + 1, sizeof(int));
int offset;
int startheader, cmpt = 0;
int i, j, res = 0;
@ -2818,6 +2818,8 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
for (i = 0; i < FF_ARRAY_ELEMS(s->pps_list); i++)
av_buffer_unref(&s->pps_list[i]);
av_buffer_unref(&s->current_sps);
av_freep(&s->sh.entry_point_offset);
av_freep(&s->sh.offset);
av_freep(&s->sh.size);
@ -2939,6 +2941,13 @@ static int hevc_update_thread_context(AVCodecContext *dst,
}
}
av_buffer_unref(&s->current_sps);
if (s0->current_sps) {
s->current_sps = av_buffer_ref(s0->current_sps);
if (!s->current_sps)
return AVERROR(ENOMEM);
}
if (s->sps != s0->sps)
ret = set_sps(s, s0->sps);

View File

@ -81,10 +81,10 @@
#define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)])
#define SAMPLE_CBF(tab, x, y) ((tab)[((y) & ((1<<log2_trafo_size)-1)) * MAX_CU_SIZE + ((x) & ((1<<log2_trafo_size)-1))])
#define IS_IDR(s) (s->nal_unit_type == NAL_IDR_W_RADL || s->nal_unit_type == NAL_IDR_N_LP)
#define IS_BLA(s) (s->nal_unit_type == NAL_BLA_W_RADL || s->nal_unit_type == NAL_BLA_W_LP || \
s->nal_unit_type == NAL_BLA_N_LP)
#define IS_IRAP(s) (s->nal_unit_type >= 16 && s->nal_unit_type <= 23)
#define IS_IDR(s) ((s)->nal_unit_type == NAL_IDR_W_RADL || (s)->nal_unit_type == NAL_IDR_N_LP)
#define IS_BLA(s) ((s)->nal_unit_type == NAL_BLA_W_RADL || (s)->nal_unit_type == NAL_BLA_W_LP || \
(s)->nal_unit_type == NAL_BLA_N_LP)
#define IS_IRAP(s) ((s)->nal_unit_type >= 16 && (s)->nal_unit_type <= 23)
/**
* Table 7-3: NAL unit type codes
@ -461,7 +461,7 @@ typedef struct HEVCSPS {
} HEVCSPS;
typedef struct HEVCPPS {
unsigned sps_id; ///< seq_parameter_set_id
unsigned int sps_id; ///< seq_parameter_set_id
uint8_t sign_data_hiding_flag;
@ -776,6 +776,8 @@ typedef struct HEVCContext {
AVBufferRef *sps_list[MAX_SPS_COUNT];
AVBufferRef *pps_list[MAX_PPS_COUNT];
AVBufferRef *current_sps;
AVBufferPool *tab_mvf_pool;
AVBufferPool *rpl_tab_pool;

View File

@ -331,6 +331,9 @@ static void hevc_close(AVCodecParserContext *s)
for (i = 0; i < FF_ARRAY_ELEMS(h->pps_list); i++)
av_buffer_unref(&h->pps_list[i]);
av_buffer_unref(&h->current_sps);
h->sps = NULL;
for (i = 0; i < h->nals_allocated; i++)
av_freep(&h->nals[i].rbsp_buffer);
av_freep(&h->nals);

View File

@ -611,8 +611,8 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
{
const AVPixFmtDescriptor *desc;
GetBitContext *gb = &s->HEVClc->gb;
int ret = 0;
int sps_id = 0;
int ret = 0;
unsigned int sps_id = 0;
int log2_diff_max_min_transform_block_size;
int bit_depth_chroma, start, vui_present, sublayer_ordering_info;
int i;
@ -843,6 +843,11 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
sps->long_term_ref_pics_present_flag = get_bits1(gb);
if (sps->long_term_ref_pics_present_flag) {
sps->num_long_term_ref_pics_sps = get_ue_golomb_long(gb);
if (sps->num_long_term_ref_pics_sps > 31U) {
av_log(0, AV_LOG_ERROR, "num_long_term_ref_pics_sps %d is out of range.\n",
sps->num_long_term_ref_pics_sps);
goto err;
}
for (i = 0; i < sps->num_long_term_ref_pics_sps; i++) {
sps->lt_ref_pic_poc_lsb_sps[i] = get_bits(gb, sps->log2_max_poc_lsb);
sps->used_by_curr_pic_lt_sps_flag[i] = get_bits1(gb);
@ -956,6 +961,12 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
if (s->pps_list[i] && ((HEVCPPS*)s->pps_list[i]->data)->sps_id == sps_id)
av_buffer_unref(&s->pps_list[i]);
}
if (s->sps_list[sps_id] && s->sps == (HEVCSPS*)s->sps_list[sps_id]->data) {
av_buffer_unref(&s->current_sps);
s->current_sps = av_buffer_ref(s->sps_list[sps_id]);
if (!s->current_sps)
s->sps = NULL;
}
av_buffer_unref(&s->sps_list[sps_id]);
s->sps_list[sps_id] = sps_buf;
}
@ -993,8 +1004,8 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
int pic_area_in_ctbs, pic_area_in_min_cbs, pic_area_in_min_tbs;
int log2_diff_ctb_min_tb_size;
int i, j, x, y, ctb_addr_rs, tile_id;
int ret = 0;
int pps_id = 0;
int ret = 0;
unsigned int pps_id = 0;
AVBufferRef *pps_buf;
HEVCPPS *pps = av_mallocz(sizeof(*pps));

View File

@ -186,7 +186,8 @@ static int generate_joint_tables(HYuvContext *s)
}
}
ff_free_vlc(&s->vlc[4]);
if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1, bits, 2, 2, 0)) < 0)
if ((ret = init_vlc(&s->vlc[4], VLC_BITS, i, len, 1, 1,
bits, 2, 2, 0)) < 0)
return ret;
}
return 0;
@ -195,21 +196,20 @@ static int generate_joint_tables(HYuvContext *s)
static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)
{
GetBitContext gb;
int i;
int ret;
int i, ret;
int count = 3;
init_get_bits(&gb, src, length * 8);
if ((ret = init_get_bits(&gb, src, length * 8)) < 0)
return ret;
if (s->version > 2)
count = 1 + s->alpha + 2*s->chroma;
for (i = 0; i < count; i++) {
if (read_len_table(s->len[i], &gb, s->vlc_n) < 0)
return -1;
if (ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n) < 0) {
return -1;
}
if ((ret = read_len_table(s->len[i], &gb, s->vlc_n)) < 0)
return ret;
if ((ret = ff_huffyuv_generate_bits_table(s->bits[i], s->len[i], s->vlc_n)) < 0)
return ret;
ff_free_vlc(&s->vlc[i]);
if ((ret = init_vlc(&s->vlc[i], VLC_BITS, s->vlc_n, s->len[i], 1, 1,
s->bits[i], 4, 4, 0)) < 0)
@ -225,18 +225,17 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length)
static int read_old_huffman_tables(HYuvContext *s)
{
GetBitContext gb;
int i;
int ret;
int i, ret;
init_get_bits(&gb, classic_shift_luma,
classic_shift_luma_table_size * 8);
if (read_len_table(s->len[0], &gb, 256) < 0)
return -1;
if ((ret = read_len_table(s->len[0], &gb, 256)) < 0)
return ret;
init_get_bits(&gb, classic_shift_chroma,
classic_shift_chroma_table_size * 8);
if (read_len_table(s->len[1], &gb, 256) < 0)
return -1;
if ((ret = read_len_table(s->len[1], &gb, 256)) < 0)
return ret;
for(i=0; i<256; i++) s->bits[0][i] = classic_add_luma [i];
for(i=0; i<256; i++) s->bits[1][i] = classic_add_chroma[i];
@ -264,6 +263,7 @@ static int read_old_huffman_tables(HYuvContext *s)
static av_cold int decode_init(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
int ret;
memset(s->vlc, 0, 4 * sizeof(VLC));
@ -313,10 +313,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->interlaced = (interlace == 1) ? 1 : (interlace == 2) ? 0 : s->interlaced;
s->context = ((uint8_t*)avctx->extradata)[2] & 0x40 ? 1 : 0;
if ( read_huffman_tables(s, ((uint8_t*)avctx->extradata) + 4,
avctx->extradata_size - 4) < 0)
return AVERROR_INVALIDDATA;
}else{
if ((ret = read_huffman_tables(s, avctx->extradata + 4,
avctx->extradata_size - 4)) < 0)
return ret;
} else {
switch (avctx->bits_per_coded_sample & 7) {
case 1:
s->predictor = LEFT;
@ -342,8 +342,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->bitstream_bpp = avctx->bits_per_coded_sample & ~7;
s->context = 0;
if (read_old_huffman_tables(s) < 0)
return AVERROR_INVALIDDATA;
if ((ret = read_old_huffman_tables(s)) < 0)
return ret;
}
if (s->version <= 2) {
@ -520,13 +520,16 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n");
return AVERROR_INVALIDDATA;
}
if (s->predictor == MEDIAN && avctx->pix_fmt == AV_PIX_FMT_YUV422P && avctx->width%4) {
av_log(avctx, AV_LOG_ERROR, "width must be a multiple of 4 this colorspace and predictor\n");
if (s->predictor == MEDIAN && avctx->pix_fmt == AV_PIX_FMT_YUV422P &&
avctx->width % 4) {
av_log(avctx, AV_LOG_ERROR, "width must be a multiple of 4 "
"for this combination of colorspace and predictor type.\n");
return AVERROR_INVALIDDATA;
}
if (ff_huffyuv_alloc_temp(s)) {
if ((ret = ff_huffyuv_alloc_temp(s)) < 0) {
ff_huffyuv_common_end(s);
return AVERROR(ENOMEM);
return ret;
}
return 0;
@ -535,23 +538,23 @@ static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
int i;
int i, ret;
if (ff_huffyuv_alloc_temp(s)) {
if ((ret = ff_huffyuv_alloc_temp(s)) < 0) {
ff_huffyuv_common_end(s);
return AVERROR(ENOMEM);
return ret;
}
for (i = 0; i < 8; i++)
s->vlc[i].table = NULL;
if (s->version >= 2) {
if (read_huffman_tables(s, ((uint8_t*)avctx->extradata) + 4,
avctx->extradata_size) < 0)
return AVERROR_INVALIDDATA;
if ((ret = read_huffman_tables(s, avctx->extradata + 4,
avctx->extradata_size)) < 0)
return ret;
} else {
if (read_old_huffman_tables(s) < 0)
return AVERROR_INVALIDDATA;
if ((ret = read_old_huffman_tables(s)) < 0)
return ret;
}
return 0;
@ -798,14 +801,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
if (s->context) {
table_size = read_huffman_tables(s, s->bitstream_buffer, buf_size);
if (table_size < 0)
return AVERROR_INVALIDDATA;
return table_size;
}
if ((unsigned)(buf_size-table_size) >= INT_MAX / 8)
return AVERROR_INVALIDDATA;
init_get_bits(&s->gb, s->bitstream_buffer+table_size,
(buf_size-table_size) * 8);
if ((ret = init_get_bits(&s->gb, s->bitstream_buffer + table_size,
(buf_size - table_size) * 8)) < 0)
return ret;
fake_ystride = s->interlaced ? p->linesize[0] * 2 : p->linesize[0];
fake_ustride = s->interlaced ? p->linesize[1] * 2 : p->linesize[1];

View File

@ -847,9 +847,9 @@ static int decode_frame(AVCodecContext *avctx,
break;
case 4:
bytestream2_init(&gb, buf, buf_size);
if (avctx->codec_tag == MKTAG('R', 'G', 'B', '8'))
if (avctx->codec_tag == MKTAG('R', 'G', 'B', '8') && avctx->pix_fmt == AV_PIX_FMT_RGB32)
decode_rgb8(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]);
else if (avctx->codec_tag == MKTAG('R', 'G', 'B', 'N'))
else if (avctx->codec_tag == MKTAG('R', 'G', 'B', 'N') && avctx->pix_fmt == AV_PIX_FMT_RGB444)
decode_rgbn(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]);
else
return unsupported(avctx);

View File

@ -879,14 +879,14 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
flag = get_bits1(&q->gb);
if (stream_format_code & 0x1)
imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf,
chctx->flcoeffs1, chctx->flcoeffs2);
else if (stream_format_code & 0x1)
imc_read_level_coeffs_raw(q, stream_format_code, chctx->levlCoeffBuf);
else
imc_read_level_coeffs(q, stream_format_code, chctx->levlCoeffBuf);
if (stream_format_code & 0x4)
if (stream_format_code & 0x1)
imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf,
chctx->flcoeffs1, chctx->flcoeffs2);
else if (stream_format_code & 0x4)
imc_decode_level_coefficients(q, chctx->levlCoeffBuf,
chctx->flcoeffs1, chctx->flcoeffs2);
else

View File

@ -35,6 +35,12 @@
#define FF_SANE_NB_CHANNELS 63U
#if HAVE_NEON || ARCH_PPC || HAVE_MMX
# define STRIDE_ALIGN 16
#else
# define STRIDE_ALIGN 8
#endif
typedef struct FramePool {
/**
* Pools for each data plane. For audio all the planes have the same size,

View File

@ -235,15 +235,15 @@ void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
/** butterfly operation for the inverse Haar transform */
#define IVI_HAAR_BFLY(s1, s2, o1, o2, t) \
t = (s1 - s2) >> 1;\
o1 = (s1 + s2) >> 1;\
o2 = t;\
t = ((s1) - (s2)) >> 1;\
o1 = ((s1) + (s2)) >> 1;\
o2 = (t);\
/** inverse 8-point Haar transform */
#define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8,\
d1, d2, d3, d4, d5, d6, d7, d8,\
t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
t1 = s1 << 1; t5 = s5 << 1;\
t1 = (s1) << 1; t5 = (s5) << 1;\
IVI_HAAR_BFLY(t1, t5, t1, t5, t0); IVI_HAAR_BFLY(t1, s3, t1, t3, t0);\
IVI_HAAR_BFLY(t5, s7, t5, t7, t0); IVI_HAAR_BFLY(t1, s2, t1, t2, t0);\
IVI_HAAR_BFLY(t3, s4, t3, t4, t0); IVI_HAAR_BFLY(t5, s6, t5, t6, t0);\
@ -485,21 +485,21 @@ void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
/** butterfly operation for the inverse slant transform */
#define IVI_SLANT_BFLY(s1, s2, o1, o2, t) \
t = s1 - s2;\
o1 = s1 + s2;\
o2 = t;\
t = (s1) - (s2);\
o1 = (s1) + (s2);\
o2 = (t);\
/** This is a reflection a,b = 1/2, 5/4 for the inverse slant transform */
#define IVI_IREFLECT(s1, s2, o1, o2, t) \
t = ((s1 + s2*2 + 2) >> 2) + s1;\
o2 = ((s1*2 - s2 + 2) >> 2) - s2;\
o1 = t;\
t = (((s1) + (s2)*2 + 2) >> 2) + (s1);\
o2 = (((s1)*2 - (s2) + 2) >> 2) - (s2);\
o1 = (t);\
/** This is a reflection a,b = 1/2, 7/8 for the inverse slant transform */
#define IVI_SLANT_PART4(s1, s2, o1, o2, t) \
t = s2 + ((s1*4 - s2 + 4) >> 3);\
o2 = s1 + ((-s1 - s2*4 + 4) >> 3);\
o1 = t;\
t = (s2) + (((s1)*4 - (s2) + 4) >> 3);\
o2 = (s1) + ((-(s1) - (s2)*4 + 4) >> 3);\
o1 = (t);\
/** inverse slant8 transform */
#define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7,\
@ -557,7 +557,7 @@ void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, c
}
#undef COMPENSATE
#define COMPENSATE(x) ((x + 1)>>1)
#define COMPENSATE(x) (((x) + 1)>>1)
src = tmp;
for (i = 0; i < 8; i++) {
if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) {
@ -597,7 +597,7 @@ void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, c
}
#undef COMPENSATE
#define COMPENSATE(x) ((x + 1)>>1)
#define COMPENSATE(x) (((x) + 1)>>1)
src = tmp;
for (i = 0; i < 4; i++) {
if (!src[0] && !src[1] && !src[2] && !src[3]) {
@ -631,7 +631,7 @@ void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const ui
int i;
int t0, t1, t2, t3, t4, t5, t6, t7, t8;
#define COMPENSATE(x) ((x + 1)>>1)
#define COMPENSATE(x) (((x) + 1)>>1)
for (i = 0; i < 8; i++) {
if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) {
memset(out, 0, 8*sizeof(out[0]));
@ -673,7 +673,7 @@ void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const ui
row4 = pitch << 2;
row8 = pitch << 3;
#define COMPENSATE(x) ((x + 1)>>1)
#define COMPENSATE(x) (((x) + 1)>>1)
for (i = 0; i < 8; i++) {
if (flags[i]) {
IVI_INV_SLANT8(in[0], in[8], in[16], in[24], in[32], in[40], in[48], in[56],
@ -710,7 +710,7 @@ void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const ui
int i;
int t0, t1, t2, t3, t4;
#define COMPENSATE(x) ((x + 1)>>1)
#define COMPENSATE(x) (((x) + 1)>>1)
for (i = 0; i < 4; i++) {
if (!in[0] && !in[1] && !in[2] && !in[3]) {
memset(out, 0, 4*sizeof(out[0]));
@ -732,7 +732,7 @@ void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const ui
row2 = pitch << 1;
#define COMPENSATE(x) ((x + 1)>>1)
#define COMPENSATE(x) (((x) + 1)>>1)
for (i = 0; i < 4; i++) {
if (flags[i]) {
IVI_INV_SLANT4(in[0], in[4], in[8], in[12],

View File

@ -224,7 +224,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
if (!comp->i_data)
return AVERROR(ENOMEM);
}
comp->reslevel = av_calloc(codsty->nreslevels, sizeof(*comp->reslevel));
comp->reslevel = av_mallocz_array(codsty->nreslevels, sizeof(*comp->reslevel));
if (!comp->reslevel)
return AVERROR(ENOMEM);
/* LOOP on resolution levels */
@ -272,7 +272,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
reslevel->log2_prec_height) -
(reslevel->coord[1][0] >> reslevel->log2_prec_height);
reslevel->band = av_calloc(reslevel->nbands, sizeof(*reslevel->band));
reslevel->band = av_mallocz_array(reslevel->nbands, sizeof(*reslevel->band));
if (!reslevel->band)
return AVERROR(ENOMEM);
@ -368,9 +368,9 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
for (j = 0; j < 2; j++)
band->coord[1][j] = ff_jpeg2000_ceildiv(band->coord[1][j], dy);
band->prec = av_calloc(reslevel->num_precincts_x *
(uint64_t)reslevel->num_precincts_y,
sizeof(*band->prec));
band->prec = av_mallocz_array(reslevel->num_precincts_x *
(uint64_t)reslevel->num_precincts_y,
sizeof(*band->prec));
if (!band->prec)
return AVERROR(ENOMEM);
@ -504,22 +504,29 @@ void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty)
for (reslevelno = 0;
comp->reslevel && reslevelno < codsty->nreslevels;
reslevelno++) {
Jpeg2000ResLevel *reslevel = comp->reslevel + reslevelno;
Jpeg2000ResLevel *reslevel;
if (!comp->reslevel)
continue;
reslevel = comp->reslevel + reslevelno;
for (bandno = 0; bandno < reslevel->nbands; bandno++) {
if (reslevel->band) {
Jpeg2000Band *band = reslevel->band + bandno;
for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) {
if (band->prec) {
Jpeg2000Prec *prec = band->prec + precno;
av_freep(&prec->zerobits);
av_freep(&prec->cblkincl);
av_freep(&prec->cblk);
}
}
Jpeg2000Band *band;
av_freep(&band->prec);
if (!reslevel->band)
continue;
band = reslevel->band + bandno;
for (precno = 0; precno < reslevel->num_precincts_x * reslevel->num_precincts_y; precno++) {
if (band->prec) {
Jpeg2000Prec *prec = band->prec + precno;
av_freep(&prec->zerobits);
av_freep(&prec->cblkincl);
av_freep(&prec->cblk);
}
}
av_freep(&band->prec);
}
av_freep(&reslevel->band);
}

View File

@ -217,6 +217,11 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s,
x += stride;
}
if (x >= w) {
av_log(NULL, AV_LOG_ERROR, "run overflow\n");
return;
}
/* decode run termination value */
Rb = R(last, x);
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;

View File

@ -96,8 +96,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0],
(const WebRtc_UWord16*) buf, &s->decoder, 1);
WebRtcIlbcfix_DecodeImpl((int16_t *) frame->data[0], (const uint16_t *) buf, &s->decoder, 1);
*got_frame_ptr = 1;
@ -170,7 +169,7 @@ static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
return ret;
WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->data, (const WebRtc_Word16*) frame->data[0], &s->encoder);
WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->data, (const int16_t *) frame->data[0], &s->encoder);
avpkt->size = s->encoder.no_of_bytes;
*got_packet_ptr = 1;

View File

@ -183,6 +183,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
MPADecodeHeader hdr;
int len, ret, ch;
int lame_result;
uint32_t h;
if (frame) {
switch (avctx->sample_fmt) {
@ -238,7 +239,12 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
determine the frame size. */
if (s->buffer_index < 4)
return 0;
if (avpriv_mpegaudio_decode_header(&hdr, AV_RB32(s->buffer))) {
h = AV_RB32(s->buffer);
if (ff_mpa_check_header(h) < 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid mp3 header at start of buffer\n");
return AVERROR_BUG;
}
if (avpriv_mpegaudio_decode_header(&hdr, h)) {
av_log(avctx, AV_LOG_ERROR, "free format output not supported\n");
return -1;
}

View File

@ -349,7 +349,8 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
avctx->delay = duration;
av_assert0(!s->afq.remaining_delay);
s->afq.frames->duration += duration;
s->afq.frames->pts -= duration;
if (s->afq.frames->pts != AV_NOPTS_VALUE)
s->afq.frames->pts -= duration;
s->afq.remaining_samples += duration;
}
ff_af_queue_remove(&s->afq, duration, &avpkt->pts, &avpkt->duration);

View File

@ -202,10 +202,10 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
case AV_STEREO3D_CHECKERBOARD:
fpa_type = 0;
break;
case AV_STEREO3D_LINES:
case AV_STEREO3D_COLUMNS:
fpa_type = 1;
break;
case AV_STEREO3D_COLUMNS:
case AV_STEREO3D_LINES:
fpa_type = 2;
break;
case AV_STEREO3D_SIDEBYSIDE:
@ -391,19 +391,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
OPT_STR("level", x4->level);
if(x4->x264opts){
const char *p= x4->x264opts;
while(p){
char param[256]={0}, val[256]={0};
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
OPT_STR(param, "1");
}else
OPT_STR(param, val);
p= strchr(p, ':');
p+=!!p;
}
}
if (avctx->i_quant_factor > 0)
x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor);
@ -589,6 +576,19 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
x4->params.b_repeat_headers = 0;
if(x4->x264opts){
const char *p= x4->x264opts;
while(p){
char param[256]={0}, val[256]={0};
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
OPT_STR(param, "1");
}else
OPT_STR(param, val);
p= strchr(p, ':');
p+=!!p;
}
}
if (x4->x264_params) {
AVDictionary *dict = NULL;
AVDictionaryEntry *en = NULL;

View File

@ -81,6 +81,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
libx265Context *ctx = avctx->priv_data;
x265_nal *nal;
uint8_t *buf;
char sar[10];
int sar_num, sar_den;
int nnal;
int ret;
@ -121,11 +122,11 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
av_reduce(&sar_num, &sar_den,
avctx->sample_aspect_ratio.num,
avctx->sample_aspect_ratio.den, 4096);
ctx->params->bEnableVuiParametersPresentFlag = 1;
ctx->params->bEnableAspectRatioIdc = 1;
ctx->params->aspectRatioIdc = 255;
ctx->params->sarWidth = sar_num;
ctx->params->sarHeight = sar_den;
snprintf(sar, sizeof(sar), "%d:%d", sar_num, sar_den);
if (x265_param_parse(ctx->params, "sar", sar) == X265_PARAM_BAD_VALUE) {
av_log(avctx, AV_LOG_ERROR, "Invalid SAR: %d:%d.\n", sar_num, sar_den);
return AVERROR_INVALIDDATA;
}
if (x265_max_bit_depth == 8)
ctx->params->internalBitDepth = 8;
@ -190,7 +191,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
for (i = 0; i < nnal; i++)
ctx->header_size += nal[i].sizeBytes;
ctx->header = av_malloc(ctx->header_size);
ctx->header = av_malloc(ctx->header_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!ctx->header) {
av_log(avctx, AV_LOG_ERROR,
"Cannot allocate HEVC header of size %d.\n", ctx->header_size);
@ -204,6 +205,13 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
buf += nal[i].sizeBytes;
}
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) {
avctx->extradata_size = ctx->header_size;
avctx->extradata = ctx->header;
ctx->header_size = 0;
ctx->header = NULL;
}
return 0;
}

View File

@ -83,6 +83,17 @@ static void build_basic_mjpeg_vlc(MJpegDecodeContext *s)
avpriv_mjpeg_val_ac_chrominance, 251, 0, 0);
}
static void parse_avid(MJpegDecodeContext *s, uint8_t *buf, int len)
{
s->buggy_avid = 1;
if (len > 14 && buf[12] == 1) /* 1 - NTSC */
s->interlace_polarity = 1;
if (len > 14 && buf[12] == 2) /* 2 - PAL */
s->interlace_polarity = 0;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO, "AVID: len:%d %d\n", len, len > 14 ? buf[12] : -1);
}
av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
{
MJpegDecodeContext *s = avctx->priv_data;
@ -120,7 +131,17 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
if (avctx->field_order == AV_FIELD_BB) { /* quicktime icefloe 019 */
s->interlace_polarity = 1; /* bottom field first */
av_log(avctx, AV_LOG_DEBUG, "bottom field first\n");
} else if (avctx->field_order == AV_FIELD_UNKNOWN) {
if (avctx->codec_tag == AV_RL32("MJPG"))
s->interlace_polarity = 1;
}
if ( avctx->extradata_size > 8
&& AV_RL32(avctx->extradata) == 0x2C
&& AV_RL32(avctx->extradata+4) == 0x18) {
parse_avid(s, avctx->extradata, avctx->extradata_size);
}
if (avctx->codec->id == AV_CODEC_ID_AMV)
s->flipped = 1;
@ -218,7 +239,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
{
int len, nb_components, i, width, height, pix_fmt_id, ret;
int len, nb_components, i, width, height, bits, pix_fmt_id, ret;
int h_count[MAX_COMPONENTS];
int v_count[MAX_COMPONENTS];
@ -228,11 +249,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
/* XXX: verify len field validity */
len = get_bits(&s->gb, 16);
s->avctx->bits_per_raw_sample =
s->bits = get_bits(&s->gb, 8);
bits = get_bits(&s->gb, 8);
if (s->pegasus_rct)
s->bits = 9;
if (s->bits == 9 && !s->pegasus_rct)
bits = 9;
if (bits == 9 && !s->pegasus_rct)
s->rct = 1; // FIXME ugly
if(s->lossless && s->avctx->lowres){
@ -262,7 +283,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
return AVERROR_INVALIDDATA;
}
}
if (s->ls && !(s->bits <= 8 || nb_components == 1)) {
if (s->ls && !(bits <= 8 || nb_components == 1)) {
avpriv_report_missing_feature(s->avctx,
"JPEG-LS that is not <= 8 "
"bits/component or 16-bit gray");
@ -308,11 +329,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
/* if different size, realloc/alloc picture */
if ( width != s->width || height != s->height
|| bits != s->bits
|| memcmp(s->h_count, h_count, sizeof(h_count))
|| memcmp(s->v_count, v_count, sizeof(v_count))) {
s->width = width;
s->height = height;
s->bits = bits;
memcpy(s->h_count, h_count, sizeof(h_count));
memcpy(s->v_count, v_count, sizeof(v_count));
s->interlaced = 0;
@ -1230,7 +1253,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
}
if (!Al) {
s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss);
s->coefs_finished[c] |= (2LL << se) - (1LL << ss);
last_scan = !~s->coefs_finished[c];
}
@ -1530,6 +1553,8 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
}
if (id == AV_RB32("LJIF")) {
int rgb = s->rgb;
int pegasus_rct = s->pegasus_rct;
if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_INFO,
"Pegasus lossless jpeg header found\n");
@ -1539,17 +1564,27 @@ static int mjpeg_decode_app(MJpegDecodeContext *s)
skip_bits(&s->gb, 16); /* unknown always 0? */
switch (i=get_bits(&s->gb, 8)) {
case 1:
s->rgb = 1;
s->pegasus_rct = 0;
rgb = 1;
pegasus_rct = 0;
break;
case 2:
s->rgb = 1;
s->pegasus_rct = 1;
rgb = 1;
pegasus_rct = 1;
break;
default:
av_log(s->avctx, AV_LOG_ERROR, "unknown colorspace %d\n", i);
}
len -= 9;
if (s->got_picture)
if (rgb != s->rgb || pegasus_rct != s->pegasus_rct) {
av_log(s->avctx, AV_LOG_WARNING, "Mismatching LJIF tag\n");
goto out;
}
s->rgb = rgb;
s->pegasus_rct = pegasus_rct;
goto out;
}
if (id == AV_RL32("colr") && len > 0) {
@ -1694,12 +1729,10 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
/* buggy avid, it puts EOI only at every 10th frame */
if (!strncmp(cbuf, "AVID", 4)) {
s->buggy_avid = 1;
if (len > 14 && cbuf[12] == 1) /* 1 - NTSC, 2 - PAL */
s->interlace_polarity = 1;
parse_avid(s, cbuf, len);
} else if (!strcmp(cbuf, "CS=ITU601"))
s->cs_itu601 = 1;
else if ((!strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32)) ||
else if ((!strncmp(cbuf, "Intel(R) JPEG Library, version 1", 32) && s->avctx->codec_tag) ||
(!strncmp(cbuf, "Metasoft MJPEG Codec", 20)))
s->flipped = 1;

View File

@ -487,7 +487,7 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n)
put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
}
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64])
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64])
{
int i;
if (s->chroma_format == CHROMA_444) {

View File

@ -61,6 +61,6 @@ void ff_mjpeg_encode_stuffing(MpegEncContext *s);
void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[3], int vsample[3]);
void ff_mjpeg_encode_dc(PutBitContext *pb, int val,
uint8_t *huff_size, uint16_t *huff_code);
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]);
#endif /* AVCODEC_MJPEGENC_H */

View File

@ -872,7 +872,7 @@ static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,
return 0;
}
#define MSB_MASK(bits) (-1u << bits)
#define MSB_MASK(bits) (-1u << (bits))
/** Generate PCM samples using the prediction filters and residual values
* read from the data stream, and update the filter state. */

View File

@ -111,7 +111,7 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
if (color) {
memset(s->frame->data[0] + y*s->frame->linesize[0] + x, color, run_length);
if (half_vert)
if (half_vert && y + half_vert < s->avctx->height)
memset(s->frame->data[0] + (y+1)*s->frame->linesize[0] + x, color, run_length);
}
x+= run_length;

View File

@ -189,7 +189,13 @@ static av_always_inline int cmp_inline(MpegEncContext *s, const int x, const int
int uvdxy; /* no, it might not be used uninitialized */
if(dxy){
if(qpel){
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
if (h << size == 16) {
c->qpel_put[size][dxy](c->temp, ref[0] + x + y*stride, stride); //FIXME prototype (add h)
} else if (size == 0 && h == 8) {
c->qpel_put[1][dxy](c->temp , ref[0] + x + y*stride , stride);
c->qpel_put[1][dxy](c->temp + 8, ref[0] + x + y*stride + 8, stride);
} else
av_assert2(0);
if(chroma){
int cx= hx/2;
int cy= hy/2;

View File

@ -1206,6 +1206,16 @@ static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = {
AV_PIX_FMT_NONE
};
static const enum AVPixelFormat mpeg12_pixfmt_list_422[] = {
AV_PIX_FMT_YUV422P,
AV_PIX_FMT_NONE
};
static const enum AVPixelFormat mpeg12_pixfmt_list_444[] = {
AV_PIX_FMT_YUV444P,
AV_PIX_FMT_NONE
};
static inline int uses_vdpau(AVCodecContext *avctx) {
return avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG2;
}
@ -1214,16 +1224,18 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
{
Mpeg1Context *s1 = avctx->priv_data;
MpegEncContext *s = &s1->mpeg_enc_ctx;
const enum AVPixelFormat *pix_fmts;
if (s->chroma_format < 2)
return ff_thread_get_format(avctx,
avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
pix_fmts = avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ?
mpeg1_hwaccel_pixfmt_list_420 :
mpeg2_hwaccel_pixfmt_list_420);
mpeg2_hwaccel_pixfmt_list_420;
else if (s->chroma_format == 2)
return AV_PIX_FMT_YUV422P;
pix_fmts = mpeg12_pixfmt_list_422;
else
return AV_PIX_FMT_YUV444P;
pix_fmts = mpeg12_pixfmt_list_444;
return ff_thread_get_format(avctx, pix_fmts);
}
static void setup_hwaccel_for_pixfmt(AVCodecContext *avctx)
@ -1878,6 +1890,14 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
} else
goto eos;
}
if (s->mb_y >= ((s->height + 15) >> 4) &&
s->progressive_frame &&
!s->progressive_sequence &&
get_bits_left(&s->gb) <= 8 &&
get_bits_left(&s->gb) >= 0 &&
s->mb_skip_run == -1 &&
show_bits(&s->gb, 8) == 0)
goto eos;
ff_init_block_index(s);
}

Some files were not shown because too many files have changed in this diff Show More