summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/videotoolbox: use decode_params to propagate H264 PPS changes and ↵Aman Gupta2017-11-13
| | | | | | | | | | | | | | | | | | | | | restart on SPS changes This fixes decoding of H264 video samples with SPS and PPS changes. See for example https://s3.amazonaws.com/tmm1/videotoolbox/spschange.ts, which previously stalled the decoder and failed to produce any new frames after the SPS change. Also see https://s3.amazonaws.com/tmm1/videotoolbox/ppschange.ts, which uses multiple PPS and would previously cause VT decode failures. If the VideoToolbox session needs to be restarted, and videotoolbox_start() fails for some reason (for instance, if the video is interlaced and the decoder is running on iOS), avcodec will return AVERROR_EXTERNAL. This can be used by the API user to switch to another decoder. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/h264: implement new decode_params callback for PPS/SPSAman Gupta2017-11-13
| | | | | | | | | This callback will be used by the VideoToolbox H264 hwaccel so that it can receive SPS and PPS NALUs. VideoToolbox requires PPS changes to be fed into the decoder session, and for the session to be recreated when the SPS changes. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec: add decode_params callback to AVHWAccel structAman Gupta2017-11-13
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/h264, videotoolbox: return AVERROR_INVALIDDATA when no frames are ↵Aman Gupta2017-11-13
| | | | | | | | | | | | | | produced The only reason videotoolbox wouldn't produce frames is if the data fed to it was invalid, so returning AVERROR_INVALIDDATA makes sense here. Further, it means AVERROR_EXTERNAL can be used in further commits to signal fatal VideoToolbox errors, letting the user know that they need to fallback to another decoder. Signed-off-by: Aman Gupta <aman@tmm1.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/videotoolbox: print descriptive errors on decode failuresAman Gupta2017-11-13
| | | | Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolbox: reset bitstream_size in end_frameAman Gupta2017-11-13
| | | | | | | | | | | This allows decode_slice to be invoked multiple times before end_frame, causing slices to accumulate before being fed into the VT decoder. An upcoming commit will re-use decode_slice for parameter NALUs, so they can be propagated into the VT decoder session along with slice data. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolbox: extract videotoolbox_{start,stop} helpersAman Gupta2017-11-13
| | | | | | | These helpers will be used in later commits to automatically restart the decoder session when SPS changes are encountered. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolbox: use early return in videotoolbox_default_freeAman Gupta2017-11-13
| | | | | | Cosmetic change only. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolboxenc: re-indent codeAman Gupta2017-11-13
| | | | | | Cosmetic change only. Signed-off-by: Aman Gupta <aman@tmm1.net>
* avcodec/videotoolboxenc: add hevc_videotoolbox encoderAman Gupta2017-11-13
| | | | | Signed-off-by: Aman Gupta <aman@tmm1.net> Reviewed-by: Rodger Combs <rodger.combs@gmail.com>
* avcodec/nvdec: fix return value on errorTimo Rothenpieler2017-11-13
|
* avcodec/nvdec: warn about thread count if applicableTimo Rothenpieler2017-11-13
|
* avcodec: implement vp9 nvdec hwaccelTimo Rothenpieler2017-11-13
|
* avcodec/aacpsdsp_template: Fix integer overflows in ps_decorrelate_c()Michael Niedermayer2017-11-13
| | | | | | | | Fixes: runtime error: signed integer overflow: 1939661764 - -454942263 cannot be represented in type 'int' Fixes: 3191/clusterfuzz-testcase-minimized-5688798451073024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_fixed: Fix undefined shiftMichael Niedermayer2017-11-13
| | | | | | | | Fixes: runtime error: left shift of negative value -801112064 Fixes: 3492/clusterfuzz-testcase-minimized-5784775283441664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mdct_*: Fix integer overflow in addition in RESCALE()Michael Niedermayer2017-11-13
| | | | | | | | Fixes: runtime error: signed integer overflow: 1219998458 - -1469874012 cannot be represented in type 'int' Fixes: 3443/clusterfuzz-testcase-minimized-5369987105554432 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/snowdec: Fix integer overflow in header parsingMichael Niedermayer2017-11-13
| | | | | | | | Fixes: 3984/clusterfuzz-testcase-minimized-5265759929368576 Fixes: runtime error: signed integer overflow: -1085585801 + -1094995529 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Fix missing used attribute for inline assembly variablesThomas Köppe2017-11-13
| | | | | | | | | | | | | Variables used in inline assembly need to be marked with attribute((used)). Static constants already were, via the define of DECLARE_ASM_CONST. But DECLARE_ALIGNED does not add this attribute, and some of the variables defined with it are const only used in inline assembly, and therefore appeared dead. This change adds a macro DECLARE_ASM_ALIGNED that marks variables as used. This change makes FFMPEG work with Clang's ThinLTO. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* videotoolbox: add frame_params supportwm42017-11-12
| | | | | | Allows decoding with API users which require this API. Reviewed-by: Aman Gupta <ffmpeg@tmm1.net>
* avcodec/mpeg2_metadata_bsf: fix the AVClass version numberJames Almer2017-11-12
| | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h265_metadata_bsf: fix the AVClass version numberJames Almer2017-11-12
| | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/h264_metadata_bsf: fix the AVClass version numberJames Almer2017-11-12
| | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/nvdec: add support for 12 bit formatsTimo Rothenpieler2017-11-12
|
* avcodec/nvdec: check hardware capabilitiesTimo Rothenpieler2017-11-12
|
* avcodec/nvdec: don't add thread buffer twiceTimo Rothenpieler2017-11-12
| | | | | This is already added to the initial pool size in ff_decode_get_hw_frames_ctx, so adding it here again increases the amount of surfaces needlessly.
* Merge commit '5c22c90c1d5050f1206e46494b193320ac2397cb'James Almer2017-11-12
|\ | | | | | | | | | | | | | | | | | | * commit '5c22c90c1d5050f1206e46494b193320ac2397cb': vp9_superframe_bsf: cache packets by creating new references instead of moving pointers See 37f4a093f7f95241e4fcd582758504491e85e488 7a02b364b68c0bf7f065f5c217fae458f0efdb8d Merged-by: James Almer <jamrial@gmail.com>
| * vp9_superframe_bsf: cache packets by creating new references instead of ↵James Almer2017-11-11
| | | | | | | | | | | | | | | | moving pointers Fixes invalid reads after free. Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '0ccddbad200c1d9439c5a836501917d515cddf76'James Almer2017-11-12
|\| | | | | | | | | | | | | | | | | * commit '0ccddbad200c1d9439c5a836501917d515cddf76': smacker: limit recursion depth of smacker_decode_bigtree See 946ecd19ea752399bccc751c9339ff74b815587e Merged-by: James Almer <jamrial@gmail.com>
| * smacker: limit recursion depth of smacker_decode_bigtreeAndreas Cadhalpun2017-11-10
| | | | | | | | | | | | | | | | | | This fixes segmentation faults due to stack-overflow caused by too deep recursion. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
* | Merge commit 'cd4663dc80323ba64989d0c103d51ad3ee0e9c2f'James Almer2017-11-12
|\| | | | | | | | | | | | | | | | | * commit 'cd4663dc80323ba64989d0c103d51ad3ee0e9c2f': smacker: add sanity check for length in smacker_decode_tree() See b829da363985cb2f80130bba304cc29a632f6446 Merged-by: James Almer <jamrial@gmail.com>
| * smacker: add sanity check for length in smacker_decode_tree()Michael Niedermayer2017-11-10
| | | | | | | | | | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Bug-Id: 1098 Cc: libav-stable@libav.org Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
* | Merge commit '1746c7c8f2f9a6c5eacb486426dd0a579b4b7498'James Almer2017-11-12
|\| | | | | | | | | | | | | * commit '1746c7c8f2f9a6c5eacb486426dd0a579b4b7498': libspeexenc: Use speex_lib_get_mode instead of the speex_foo_mode data symbols Merged-by: James Almer <jamrial@gmail.com>
| * libspeexenc: Use speex_lib_get_mode instead of the speex_foo_mode data symbolsMartin Storsjö2017-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | This avoids issues linking to a DLL version of libspeex, since the libspeex headers lack proper dllimport declarations for the data symbols. This isn't an issue when building with mingw with GNU binutils, since GNU ld can fix up that kind of data import automatically. libspeexdec.c already uses speex_lib_get_mode as well. Signed-off-by: Martin Storsjö <martin@martin.st>
| * vaapi: Always free parameter buffers after vaEndPicture() with libva2Mark Thompson2017-10-25
| | | | | | | | | | | | This is an ABI change in libva2: previously the Intel driver had this behaviour and it was implemented as a driver quirk, but now it is part of the specification so all drivers must do it.
| * vaapi: Remove H.264 baseline profileMark Thompson2017-10-24
| | | | | | | | | | | | This has been deprecated in libva2 because hardware does not and will not support it. Therefore never consider it for decode, and for encode assume the user meant constrained baseline profile instead.
| * vaapi: Disable deprecation warnings around use of struct vaapi_contextMark Thompson2017-10-24
| |
* | lavc/jpeg2000dec: Fix used variables reading palette.Carl Eugen Hoyos2017-11-12
| | | | | | | | Affected files with palette and colour-depth < 8.
* | Merge commit 'b487add7ecf78efda36d49815f8f8757bd24d4cb'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit 'b487add7ecf78efda36d49815f8f8757bd24d4cb': arm: Remove a redundant check in fmtconvert_init_arm.c Merged-by: James Almer <jamrial@gmail.com>
| * arm: Remove a redundant check in fmtconvert_init_arm.cMartin Storsjö2017-10-24
| | | | | | | | | | | | | | This was missed in e2710e790c0, where have_vfp && !have_vfpv3 were converted into have_vfp_vm. Signed-off-by: Martin Storsjö <martin@martin.st>
| * lavc: fix hw_device_ctx operationwm42017-10-23
| | | | | | | | | | | | | | Commit b46a77f19d accidentally broke this (requested change that was added to the patch later and which was not fully tested). Signed-off-by: Mark Thompson <sw@jkqxz.net>
* | avcodec/Makefile: build libxvid_rc.o only if libxvid_encoder is enabledJames Almer2017-11-11
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | nvdec: add frames_params supportwm42017-11-11
| |
* | Merge commit 'b46a77f19ddc4b2b5fa3187835ceb602a5244e24'James Almer2017-11-11
|\| | | | | | | | | | | | | | | | | * commit 'b46a77f19ddc4b2b5fa3187835ceb602a5244e24': lavc: external hardware frame pool initialization Includes the fix from e724bdfffbd3c27aac53d1f32f20f105f37caef0 Merged-by: James Almer <jamrial@gmail.com>
| * lavc: external hardware frame pool initializationwm42017-10-19
| | | | | | | | | | | | | | | | | | | | | | | | This adds a new API, which allows the API user to query the required AVHWFramesContext parameters. This also reduces code duplication across the hwaccels by introducing ff_decode_get_hw_frames_ctx(), which uses the new API function. It takes care of initializing the hw_frames_ctx if needed, and does additional error handling and API usage checking. Support for VDA and Cuvid missing. Signed-off-by: Anton Khirnov <anton@khirnov.net>
| * qsv: Make the hevc idr_interval consistent with the h264 oneLuca Barbato2017-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the MediaSDK documentation the idr_interval value has a different meaning depending on the codec: 0 in H264 means make every I-frame IDR, in HEVC it means to have it only at the beginning. 1 in H264 means every other I-frame is not-IDR, in HEVC it means that every I-frame is IDR. Keep the behaviour consistent between the two encoders by increasing by 1 internally the idr_interval value for HEVC.
* | Revert "Merge commit '8e97a8c69162afce47abea96c8c0914f3550e212'"James Almer2017-11-11
| | | | | | | | | | | | | | This reverts commit 1a4315f24d2c5857ebeb379fe39f0124746ee30a, reversing changes made to 869401cefc22e221edbf135bacaa1f21014fd001. At least one distro (Arch) ships gsm.h inside the gsm/ folder
* | Merge commit '732510636e597585a79be7d111c88b3f7e174fe7'James Almer2017-11-11
|\| | | | | | | | | | | | | * commit '732510636e597585a79be7d111c88b3f7e174fe7': aarch64: Remove a dot from a label Merged-by: James Almer <jamrial@gmail.com>
| * aarch64: Remove a dot from a labelMartin Storsjö2017-10-18
| | | | | | | | | | | | This fixes building with armasm64 (when run through gas-preprocessor). Signed-off-by: Martin Storsjö <martin@martin.st>
| * mss1: Add missing macro parameters to ARITH_GET_* macrosDiego Biurrun2017-10-16
| | | | | | | | | | It is wrong to pass no arguments to a macro that expects one argument and some compilers complain.
* | Merge commit '077011b5af2b3150efc52a9b58f5ef9bb0235087'James Almer2017-11-11
|\| | | | | | | | | | | | | | | | | * commit '077011b5af2b3150efc52a9b58f5ef9bb0235087': qsv: Expose idr_interval for hevc as well Also includes 98afe3fb71afd4a18009924aaba56bc577bbd400. Merged-by: James Almer <jamrial@gmail.com>