1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

38880 Commits

Author SHA1 Message Date
Reimar Döffinger
a149fa97d9 avcodec/frame_thread_encoder: Fix AV_OPT_TYPE_STRING handling in avctx
This is the equivalent to what 7d317d4706
did for the codec-specific options.
av_opt_copy has specific handling so it's fine that we already copied
the whole context before.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2017-09-16 16:46:00 +02:00
Kaustubh Raste
1a85fb7e1e avcodec/mips: Improve hevc sao band filter msa functions
Preload data in band filter 0-8 for better pipeline parallelization.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-15 22:36:42 +02:00
Kaustubh Raste
0105ed551c avcodec/mips: Improve avc mc copy msa functions
Remove loops and unroll as block sizes are known.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-15 22:19:07 +02:00
Kaustubh Raste
e5a650e141 avcodec/mips: Improve avc lpf msa functions
Optimize luma intra case by reducing conditional cases.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-15 22:19:07 +02:00
Matthieu Bouron
dd8ffb191f lavc/mediacodec_wrapper: fix jni vaargs types
Fixes decoding on 32-bit devices with Android NDK >= 15.
2017-09-15 14:19:16 +02:00
Kaustubh Raste
c6314cd750 avcodec/mips: Improve hevc idct msa functions
Align the buffers. Remove reduandant constant array.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-15 01:47:14 +02:00
Kaustubh Raste
f692e55aab avcodec/mips: Improve hevc lpf msa functions
Seperate the filter processing in all strong, all weak and strong + weak cases.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-15 01:47:14 +02:00
James Almer
6561cdd70c avcodec.h: fix doxygen comment 2017-09-14 01:43:52 -03:00
Mark Thompson
c8dea81921 lavc: Add wrapped_avframe decoder
Intended for use with hardware frames for which rawvideo is not
sufficient.  Requires the trusted packet flag to be set - decoding
fails if not to avoid security issues (the wrapped AVFrame can
contain pointers to arbitrary data).
2017-09-13 22:25:29 +01:00
Mark Thompson
82342cead1 lavc: Add flag to mark packets containing trusted input 2017-09-13 22:25:29 +01:00
James Almer
7bae17e37a avcodec/extract_extradata: return an error when buffer allocation fails
ret is 0 by default.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-13 17:22:00 -03:00
James Almer
9669c05baf avcodec/h264_sei: add namespace prefix to frame packingarrangement enum values
Missed in 6eb102a616.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-12 19:59:23 -03:00
Mark Thompson
6eb102a616 h264_sei: Add namespace prefix to all SEI values
This avoids confusion with equivalent H.265 SEI values when both are
being used at the same time.

(cherry picked from commit 6ea220cbee)
2017-09-12 22:29:31 +01:00
Ronald S. Bultje
1db03e952b vp9: fix explicit memory order for report_progress. 2017-09-12 15:26:05 -04:00
Ronald S. Bultje
183216b218 frame_thread_encoder: make 'exit' member atomic.
Should fix the following tsan warning:

WARNING: ThreadSanitizer: data race (pid=19806)
  Read of size 4 at 0x7b84000012f0 by thread T9:
    #0 worker src/libavcodec/frame_thread_encoder.c:66 (ffmpeg+0x0000007f349e)
[..]
  Previous write of size 4 at 0x7b84000012f0 by main thread (mutexes: write M1395):
    #0 ff_frame_thread_encoder_free src/libavcodec/frame_thread_encoder.c:239 (ffmpeg+0x0000007f379e)
[..]
2017-09-12 08:21:10 -04:00
Michael Niedermayer
e952d4b7ac avcodec/hevc_ps: Fix limit of chroma_qp_offset_list_len_minus1
A value of 5 is allowed

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 01:52:14 +02:00
Michael Niedermayer
abf3f9fa23 avcodec/hevc_ps: Fix c?_qp_offset_list size
Fixes: runtime error: index 5 out of bounds for type 'int8_t const[5]'
Fixes:3175/clusterfuzz-testcase-minimized-4736774054084608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 01:52:14 +02:00
Michael Niedermayer
380659604f avcodec/shorten: Move buffer allocation and offset init to end of read_header()
They are time consuming operations, performing them after the other checks
improves the speed with damaged input dramatically.

Fixes: Timeout
Fixes: 2928/clusterfuzz-testcase-4992812120539136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-12 01:52:14 +02:00
James Almer
c9a1cd08ea avcodec/hevc_ps: improve check for missing default display window bitstream
Fixes ticket #6644

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-11 20:01:41 -03:00
Ronald S. Bultje
4ce99e96d6 vp9: assert -> av_assert and fix associated compile error. 2017-09-11 16:02:25 -04:00
Ronald S. Bultje
9bab39dee5 vp9: fix compilation with threading disabled. 2017-09-11 08:01:59 -04:00
Michael Niedermayer
2d025e7428 avcodec/jpeg2000dsp: Fix multiple integer overflows in ict_int()
Fixes: runtime error: signed integer overflow: 22553 * -188962 cannot be represented in type 'int'
Fixes: 3042/clusterfuzz-testcase-minimized-5174210131394560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-11 12:28:23 +02:00
Michael Niedermayer
f0efd795f4 avcodec/clearvideo: Only output a frame if one is coded in the packet
Fixes: Timeout (183 ms instead of about 20 sec)
Fixes: 3147/clusterfuzz-testcase-4870592182353920

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-11 12:23:59 +02:00
Michael Niedermayer
c225da68cf avcodec/hevcdsp_template: Fix undefined shift in put_hevc_pel_bi_w_pixels
Fixes: runtime error: left shift of negative value -95
Fixes: 3077/clusterfuzz-testcase-minimized-4684917524922368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-11 12:23:58 +02:00
Michael Niedermayer
b5995856a4 avcodec/diracdec: Fix overflow in DC computation
Fixes: runtime error: signed integer overflow: 11896 + 2147483646 cannot be represented in type 'int'
Fixes: 3053/clusterfuzz-testcase-minimized-6355082062856192

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-11 12:23:53 +02:00
Jesse Liu
8e17cd20b9 add missing ignore files
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-10 19:08:33 +02:00
Michael Niedermayer
981f04b2ae avcodec/scpr: optimize shift loop.
Speeds code up from 50sec to 15sec

Fixes Timeout
Fixes: 3242/clusterfuzz-testcase-5811951672229888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-10 19:08:23 +02:00
Michael Niedermayer
d98d29a775 avcodec/dirac_vlc: limit res_bits in APPEND_RESIDUE()
Fixes: runtime error: left shift of 1073741838 by 1 places cannot be represented in type 'int32_t' (aka 'int')
Fixes: 3279/clusterfuzz-testcase-minimized-4564805744590848

Suggested-by: <atomnuker>
Reviewed-by: <atomnuker>
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-09 18:55:47 +02:00
Jun Zhao
a918f16f7c lavc/vaapi_encode_mpeg2: fix frame rate calc error when use time_base.
fix frame rate calc error when use time_base.

Signed-off-by: Yun Zhou <yunx.z.zhou@intel.com>
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
2017-09-09 11:31:46 +01:00
Ilia Valiakhmetov
e59da0f7ff avcodec/vp9: Add tile threading support
Signed-off-by: Ilia Valiakhmetov <zakne0ne@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2017-09-08 10:25:40 -04:00
Ilia Valiakhmetov
83c12fefd2 avcodec/pthread_slice: add ff_slice_thread_execute_with_mainfunc()
Signed-off-by: Ilia Valiakhmetov <zakne0ne@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2017-09-08 10:25:32 -04:00
Mark Wachsler
fde5c7dc79 libavcodec/h264_parse: don't use uninitialized value when chroma_format_idc==0
When parsing a monochrome file, chroma_log2_weight_denom was used without
being initialized, which could lead to a bogus error message being printed, e.g.
  [h264 @ 0x61a000026480] chroma_log2_weight_denom 24576 is out of range
It also could led to warnings using AddressSanitizer.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-08 13:48:40 +02:00
Kaustubh Raste
9b2c3c406f avcodec/mips: Improve vp9 mc msa functions
Load the specific destination bytes instead of MSA load and pack.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-08 13:48:40 +02:00
Kaustubh Raste
c75b23cbea avcodec/mips: Improve vp9 idct msa functions
Removed memset calls.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-08 13:48:40 +02:00
Kaustubh Raste
2e79813a8e avcodec/mips: Improve vp9 lpf msa functions
Updated VP9_LPF_FILTER4_4W macro to process on 8 bit data.
Replaced VP9_LPF_FILTER4_8W with VP9_LPF_FILTER4_4W.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-08 13:48:40 +02:00
Timo Rothenpieler
d0961d3069 avcodec/nvenc: sanitize variable names 2017-09-07 12:08:32 +02:00
Timo Rothenpieler
a56d0497cb avcodec/nvenc: migrate to new encode API
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2017-09-07 12:08:32 +02:00
Paras Chadha
b07faf39ed avcodec/fitsdec: write output to frame directly
Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-06 22:48:42 -03:00
James Almer
f4e593f7b5 avcodec/audiotoolboxdec: use av_freep()
This prevents leaving dangling pointers.
2017-09-06 13:04:21 -03:00
James Almer
3242babf64 avcodec/audiotoolboxdec: switch to the new generic filtering mechanism
Tested-by: ubitux
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-06 12:54:27 -03:00
James Almer
e49338a9c0 avcodec/audiotoolboxdec: add FF_CODEC_CAP_INIT_CLEANUP to the decoder capabilities
Extradata may be allocated and the AudioConverterRef may be created during init(),
which in case of a failure would not be freed as close() isn't called afterwards.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-06 11:35:14 -03:00
James Almer
7273e234de avcodec/audiotoolboxdec: always use a copy of the AVCodecContext extradata
Fixes memleaks introduced by 954e2b3d34

Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-06 11:35:07 -03:00
Kaustubh Raste
fa805df060 libavcodec/mips: Improve avc idct8 msa function
Replace memset call with msa stores.

Signed-off-by: Kaustubh Raste <kaustubh.raste@imgtec.com>
Reviewed-by: Manojkumar Bhosale <Manojkumar.Bhosale@imgtec.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-05 22:16:03 +02:00
James Almer
6cadbb16e9 avcodec: add AV_HWACCEL_CODEC_CAP_EXPERIMENTAL flag
This flag replaces the deprecated, non-prefixed HWACCEL_CODEC_CAP_EXPERIMENTAL
one.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-09-04 17:48:41 -03:00
Michael Niedermayer
c595139f1f avcodec/dirac_vlc: Fix invalid shift in ff_dirac_golomb_read_32bit()
Fixes: runtime error: shift exponent 64 is too large for 64-bit type 'residual' (aka 'unsigned long')
Fixes: 2838/clusterfuzz-testcase-minimized-6260066086813696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-02 23:50:28 +02:00
Michael Niedermayer
f71cd44147 avcodec/dirac_dwt: Fix multiple overflows in 9/7 lifting
Fixes: runtime error: signed integer overflow: 1073901567 + 1073901567 cannot be represented in type 'int'
Fixes: 3124/clusterfuzz-testcase-minimized-454643435752652

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-02 23:50:28 +02:00
Michael Niedermayer
2a0823ae96 avcodec/diracdec: Fix integer overflow in INTRA_DC_PRED()
Fixes: runtime error: signed integer overflow: 1168175789 + 1168178473 cannot be represented in type 'int'
Fixes: 3081/clusterfuzz-testcase-minimized-4807564879462400
Fixes: 2844/clusterfuzz-testcase-minimized-5561715838156800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-09-02 23:50:28 +02:00
Timo Rothenpieler
4e6638abb4 avcodec/nvenc: always output picture timing SEI
Interlaced encoding profits from it, or might even need it in some
players.
No harm in enabling it unconditionally.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2017-09-02 16:01:57 +02:00
James Almer
9aa2469930 avcodec/internal: move FF_QSCALE_TYPE defines from avcodec.h
Their use in the public header is deprecated and will be removed, but
they are still needed by some codecs at least as long as qscale related
deprecated fields in the AVFrame struct remain in the tree.
2017-09-01 14:44:44 -03:00
Timo Rothenpieler
0e995eac20 avcodec/nvenc: only push cuda context on encoder close if encoder exists
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2017-09-01 10:52:15 +02:00