summaryrefslogtreecommitdiff
path: root/libavcodec/vp9.c
Commit message (Collapse)AuthorAge
* lavc/videotoolbox: add VP9 hardware accelerationrcombs2021-11-28
| | | | On M1 Max, this supports profiles 0 and 2, but not 1 and 3.
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-20
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Remove vp9_free_entries()Andreas Rheinhardt2021-09-04
| | | | | | | | | | | Now that the mutexes and conditions are only initialized and destroyed once, said function only had one purpose: free the entries array. Given that vp9_alloc_entries() already does this if the array is already allocated it is unnecessary to call vp9_free_entries() anywhere except when closing. And then one can just inline the one free into vp9_decode_free(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Use av_freep() instead of av_free()Andreas Rheinhardt2021-09-04
| | | | | | | | Otherwise the context would be in an inconsistent state if vp9_alloc_entries() failed (and if this would be checked). Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Don't free buffer known to be NULLAndreas Rheinhardt2021-09-04
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Check initializing conditions/mutexesAndreas Rheinhardt2021-09-04
| | | | | | Also don't destroy uninitialized conditions/mutexes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Do not destroy uninitialized mutexes/conditionsAndreas Rheinhardt2021-09-04
| | | | | | | | | | | | | | | | Also do not destroy and reinitialize mutexes and conditions when certain input parameters change. Given that the decoder did not create these variables at all during init, uninitialized mutexes and conditions are destroyed before the very first initialization. This is undefined behaviour and certain threading implementations like pthreadGC2 crash when it is attempted. Fix this by initializing these objects once during init and freeing them in close. Reported-by: Steve Lhomme <robux4@ycbcr.xyz> Reviewed-by: Steve Lhomme <robux4@ycbcr.xyz> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Mark decoder as init-threadsafeAndreas Rheinhardt2021-05-10
| | | | | | It only allocates some AVFrames. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Inline function with only one caller into itAndreas Rheinhardt2021-05-10
| | | | | | | | | The split into vp9_decode_init() and init_frames() is a remnant of using init_thread_copy() for frame-threading; the latter has been removed, so there is no reason for init_frames() not be part of vp9_decode_init(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Remove excessive log messagesAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/vp9: Cleanup generically on init failureAndreas Rheinhardt2021-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec: Constify AVCodecsAndreas Rheinhardt2021-04-27
| | | | | | | | | | Given that the AVCodec.next pointer has now been removed, most of the AVCodecs are not modified at all any more and can therefore be made const (as this patch does); the only exceptions are the very few codecs for external libraries that have a init_static_data callback. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avutil/frame: Remove deprecated AVFrame.pkt_pts fieldAndreas Rheinhardt2021-04-27
| | | | | | | Deprecated in 32c8359093d1ff4f45ed19518b449b3ac3769d27. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* Mark some pointers as constAndreas Rheinhardt2021-01-01
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/vp9: Fix stack-buffer overflow with VP9 VDPAU availableAndreas Rheinhardt2020-10-11
| | | | | | | | | | | | | ccca62ef991f0a47dfa30c3e822d91294b8afe4c added new VP9 VDPAU profiles and as a consequence AV_PIX_FMT_VDPAU can now be twice in the list of pixel formats used for format negotiation by ff_thread_get_format(); yet there is only one entry in said list reserved for VDPAU, leading to a stack-buffer overflow. This commit fixes this by making sure that AV_PIX_FMT_VDPAU will not occur twice in said list. Fixes Coverity ticket 1468046. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* VP9 Profile 2 VDPAU supportManojGuptaBonda2020-10-08
| | | | | | | Added VDPAU to list of supported formats for VP9 420 10 and 12 bit formats. Add VP9 10/12 Bit support for VDPAU Signed-off-by: Philip Langdale <philipl@overt.org>
* vp9dec: support exporting QP tables through the AVVideoEncParams APIAnton Khirnov2020-05-12
|
* vp9dec: factorise freeing per-tile allocated dataAnton Khirnov2020-05-12
|
* lavc/vp9: fix reference frame dimensions check for SINGLE_REFERENCE modeLinjie Fu2020-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | With the description in frame size with refs semantics (SPEC 7.2.5), it is a requirement of bitstream conformance that for at least one reference frame has the valid dimensions. Modify the check to make sure the decoder works well in SINGLE_REFERENCE mode that not all reference frames have valid dimensions. Check and error out if invalid reference frame is used in inter_recon. One of the failure case is a 480x272 inter frame (SINGLE_REFERENCE mode) with following reference pool: 0. 960x544 LAST valid 1. 1920x1088 GOLDEN invalid, but not used in single reference mode 2. 1920x1088 ALTREF invalid, but not used in single reference mode 3~7 ... Unused Identical logic in libvpx: <https://github.com/webmproject/libvpx/blob/master/vp9/decoder/vp9_decodeframe.c#L736> Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* lavc: Rename hwaccel.h to hwconfig.hMark Thompson2020-04-26
| | | | | This already applied to decoders as well as hwaccels, and adding encoder support was going to make the name even more inaccurate.
* avcodec/vp9: prevent null pointer use on init_frames() failurePeter Ross2020-04-25
| | | | | Signed-off-by: Peter Ross <pross@xvid.org> Reviewed-by: James Almer <jamrial@gmail.com>
* pthread_frame: merge the functionality for normal decoder init and ↵Anton Khirnov2020-04-10
| | | | | | | | | | | | | | | | init_thread_copy The current design, where - proper init is called for the first per-thread context - first thread's private data is copied into private data for all the other threads - a "fixup" function is called for all the other threads to e.g. allocate dynamically allocated data is very fragile and hard to follow, so it is abandoned. Instead, the same init function is used to init each per-thread context. Where necessary, AVCodecInternal.is_copy can be used to differentiate between the first thread and the other ones (e.g. for decoding the extradata just once).
* lavc: replace AVCodecInternal.allocate_progress with an internal capAnton Khirnov2020-04-10
| | | | This is a constant codec property, so a capability flag is more appropriate.
* avcodec/vp9: use a buffer pool to allocate VP9Frame extradataJames Almer2020-03-26
| | | | | Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: Replace get_bits_long() by get_bits() where possibleMichael Niedermayer2019-12-31
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Add support for VP9 VDPAU hwaccel decodeManojGuptaBonda2019-10-26
| | | | | | | | | | | | | | | Support for VDPAU accelerated VP9 decoding was added with libvdpau-1.3. Support for the same in ffmpeg is added with this patch. Profiles related to VDPAU VP9 can be found in latest vdpau.h present in libvdpau-1.3. DRC clips are not supported yet due to http://trac.ffmpeg.org/ticket/8068 Add VP9 VDPAU to list of hwaccels and supported formats Added file vdpau_vp9.c and Modified configure to add VDPAU VP9 support. Mapped VP9 profiles to VDPAU VP9 profiles. Populated the codec specific params that need to be passed to VDPAU. Signed-off-by: Philip Langdale <philipl@overt.org>
* libavcodec: Reduce the size of some arraysAndreas Rheinhardt2019-06-20
| | | | | | | | | | This commit uses smaller types for some static const arrays to reduce their size in case the entries can be represented in the smaller type. The biggest savings came from inv_map_table in vp9.c. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/vp9: Check in decode_tiles() if there is data remainingMichael Niedermayer2018-10-30
| | | | | | | | | Fixes: Timeout Fixes: 9330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5707345857347584 Fixes: 9775/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5643845344690176 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/vp9: add profile 2 10-bit DXVA2/D3D11 decoding supportHendrik Leppkes2018-04-13
| | | | Fixes trac ticket #7099.
* avcodec/vp9: mark frame as finished on decode_tiles() failureMichael Niedermayer2017-12-15
| | | | | | | | | | | Fixes deadlock with framethreads Fixes: Netflix_Aerial_1080p_60fps_8bit_420.y4m.vp9.noaltref.webm.ivf.s69372_r01-05_b6-.ivf Fixes: Netflix_Aerial_1080p_60fps_10bit_420.y4m.vp9.noaltref.webm.ivf.s149104_r01-05_b6-.ivf Fixes: ducks_take_off_444_720p50.y4m.vp9.webm.ivf.s107375_r01-05_b6-.ivf Reported-by: James Zern <jzern@google.com> Reviewed-by: James Zern <jzern@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* vp9: use superframe split BSFwm42017-11-29
| | | | | | | | | | | | | | | webm usually has invisible superframes merged with normal frames. (vpxenc muxes them in this form, which is evidence enough that this is the standard webm packet format. It's rather unclear whether ffmpeg is even allowed to remux them with split packets.) The vp9 decoder needs them to be in separate packets for multithreading to work. Add the BSF to the decoder, so the conversion happens automatically. This contains the important part of fa1749dd34c55fb9, which was apparently skipped in commit d417e95af76. This restores Libav API compatibility.
* lavc: Add hardware config metadata for decoders supporting hardware outputMark Thompson2017-11-26
| | | | | | | | | This includes a pointer to the associated hwaccel for decoders using hwaccels - these will be used later to implement the hwaccel setup without needing a global list. Also added is a new file listing all hwaccels as external declarations - this will be used later to generate the hwaccel list at configure time.
* avcodec: implement vp9 nvdec hwaccelTimo Rothenpieler2017-11-13
|
* vp9: fix explicit memory order for report_progress.Ronald S. Bultje2017-09-12
|
* vp9: assert -> av_assert and fix associated compile error.Ronald S. Bultje2017-09-11
|
* vp9: fix compilation with threading disabled.Ronald S. Bultje2017-09-11
|
* avcodec/vp9: Add tile threading supportIlia Valiakhmetov2017-09-08
| | | | | Signed-off-by: Ilia Valiakhmetov <zakne0ne@gmail.com> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* vp9: set color range to MPEG for intraonly profile 0James Zern2017-08-21
| | | | | | | | this is undocumented in the vp9 bitstream and decoding specification doc, but matches libvpx Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* dxva: add support for new dxva2 and d3d11 hwaccel APIswm42017-06-27
| | | | | | | | | | | | | | | This also adds support to avconv (which is trivial due to the new hwaccel API being generic enough). The new decoder setup code in dxva2.c is significantly based on work by Steve Lhomme <robux4@gmail.com>, but with heavy changes/rewrites. Merges Libav commit f9e7a2f95a7194a8736cc1416a03a1a0155a3e9f. Also adds untested VP9 support. The check for DXVA2 COBJs is removed. Just update your MinGW to something newer than a 5 year old release. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* vp9: split out loopfilter functions in their own source file.Ronald S. Bultje2017-03-28
|
* vp9: re-split the decoder/format/dsp interface header files.Ronald S. Bultje2017-03-28
| | | | | The advantage here is that the internal software decoder interface is not exposed to the DSP functions or the hardware accelerations.
* lavc/vp9: clarify inv_recenter_nonnegClément Bœsch2017-03-27
| | | | Ends up identical to Libav.
* lavc/vp9: consistent use of typedef instead of structClément Bœsch2017-03-27
|
* lavc/vp9: misc cosmeticsClément Bœsch2017-03-27
| | | | Imported from Libav
* lavc/vp9: rename res to retClément Bœsch2017-03-27
|
* lavc/vp9: split a few assignment out of ifsClément Bœsch2017-03-27
|
* lavc/vp9: rename {ref,unref,alloc}_frame to frame_{ref,unref,alloc}Clément Bœsch2017-03-27
| | | | For consistency with Libav.
* lavc/vp9: rename ctx to avctxClément Bœsch2017-03-27
| | | | | This reduces diff with Libav. It also prevents a potential confusion between the private context and the AVCodecContext.
* lavc/vp9: split into vp9{block,data,mvs}Clément Bœsch2017-03-27
| | | | This is following Libav layout to ease merges.
* avcodec/vp568: Check that there is enough data for ff_vp56_init_range_decoder()Michael Niedermayer2017-03-07
| | | | | | | | Fixes: timeout in 730/clusterfuzz-testcase-5265113739165696 (part 1 of 2) Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Reviewed-by: BBB Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>