summaryrefslogtreecommitdiff
path: root/libavcodec/vp9.c
Commit message (Collapse)AuthorAge
* 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>
* avcodec/vaapi-vp9: add support for profile 2 (bpp > 8)Mathieu Velten2016-12-05
| | | | Signed-off-by: Mark Thompson <sw@jkqxz.net>
* avcodec/vp9: move bpp to the shared context for use in hwaccelMathieu Velten2016-12-05
| | | | Signed-off-by: Mark Thompson <sw@jkqxz.net>
* aarch64: vp9: Add NEON optimizations of VP9 MC functionsMartin Storsjö2016-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This work is sponsored by, and copyright, Google. These are ported from the ARM version; it is essentially a 1:1 port with no extra added features, but with some hand tuning (especially for the plain copy/avg functions). The ARM version isn't very register starved to begin with, so there's not much to be gained from having more spare registers here - we only avoid having to clobber callee-saved registers. Examples of runtimes vs the 32 bit version, on a Cortex A53: ARM AArch64 vp9_avg4_neon: 27.2 23.7 vp9_avg8_neon: 56.5 54.7 vp9_avg16_neon: 169.9 167.4 vp9_avg32_neon: 585.8 585.2 vp9_avg64_neon: 2460.3 2294.7 vp9_avg_8tap_smooth_4h_neon: 132.7 125.2 vp9_avg_8tap_smooth_4hv_neon: 478.8 442.0 vp9_avg_8tap_smooth_4v_neon: 126.0 93.7 vp9_avg_8tap_smooth_8h_neon: 241.7 234.2 vp9_avg_8tap_smooth_8hv_neon: 690.9 646.5 vp9_avg_8tap_smooth_8v_neon: 245.0 205.5 vp9_avg_8tap_smooth_64h_neon: 11273.2 11280.1 vp9_avg_8tap_smooth_64hv_neon: 22980.6 22184.1 vp9_avg_8tap_smooth_64v_neon: 11549.7 10781.1 vp9_put4_neon: 18.0 17.2 vp9_put8_neon: 40.2 37.7 vp9_put16_neon: 97.4 99.5 vp9_put32_neon/armv8: 346.0 307.4 vp9_put64_neon/armv8: 1319.0 1107.5 vp9_put_8tap_smooth_4h_neon: 126.7 118.2 vp9_put_8tap_smooth_4hv_neon: 465.7 434.0 vp9_put_8tap_smooth_4v_neon: 113.0 86.5 vp9_put_8tap_smooth_8h_neon: 229.7 221.6 vp9_put_8tap_smooth_8hv_neon: 658.9 621.3 vp9_put_8tap_smooth_8v_neon: 215.0 187.5 vp9_put_8tap_smooth_64h_neon: 10636.7 10627.8 vp9_put_8tap_smooth_64hv_neon: 21076.8 21026.9 vp9_put_8tap_smooth_64v_neon: 9635.0 9632.4 These are generally about as fast as the corresponding ARM routines on the same CPU (at least on the A53), in most cases marginally faster. The speedup vs C code is pretty much the same as for the 32 bit case; on the A53 it's around 6-13x for ther larger 8tap filters. The exact speedup varies a little, since the C versions generally don't end up exactly as slow/fast as on 32 bit. This is an adapted cherry-pick from libav commit 383d96aa2229f644d9bd77b821ed3a309da5e9fc. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* arm: vp9: Add NEON optimizations of VP9 MC functionsMartin Storsjö2016-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This work is sponsored by, and copyright, Google. The filter coefficients are signed values, where the product of the multiplication with one individual filter coefficient doesn't overflow a 16 bit signed value (the largest filter coefficient is 127). But when the products are accumulated, the resulting sum can overflow the 16 bit signed range. Instead of accumulating in 32 bit, we accumulate the largest product (either index 3 or 4) last with a saturated addition. (The VP8 MC asm does something similar, but slightly simpler, by accumulating each half of the filter separately. In the VP9 MC filters, each half of the filter can also overflow though, so the largest component has to be handled individually.) Examples of relative speedup compared to the C version, from checkasm: Cortex A7 A8 A9 A53 vp9_avg4_neon: 1.71 1.15 1.42 1.49 vp9_avg8_neon: 2.51 3.63 3.14 2.58 vp9_avg16_neon: 2.95 6.76 3.01 2.84 vp9_avg32_neon: 3.29 6.64 2.85 3.00 vp9_avg64_neon: 3.47 6.67 3.14 2.80 vp9_avg_8tap_smooth_4h_neon: 3.22 4.73 2.76 4.67 vp9_avg_8tap_smooth_4hv_neon: 3.67 4.76 3.28 4.71 vp9_avg_8tap_smooth_4v_neon: 5.52 7.60 4.60 6.31 vp9_avg_8tap_smooth_8h_neon: 6.22 9.04 5.12 9.32 vp9_avg_8tap_smooth_8hv_neon: 6.38 8.21 5.72 8.17 vp9_avg_8tap_smooth_8v_neon: 9.22 12.66 8.15 11.10 vp9_avg_8tap_smooth_64h_neon: 7.02 10.23 5.54 11.58 vp9_avg_8tap_smooth_64hv_neon: 6.76 9.46 5.93 9.40 vp9_avg_8tap_smooth_64v_neon: 10.76 14.13 9.46 13.37 vp9_put4_neon: 1.11 1.47 1.00 1.21 vp9_put8_neon: 1.23 2.17 1.94 1.48 vp9_put16_neon: 1.63 4.02 1.73 1.97 vp9_put32_neon: 1.56 4.92 2.00 1.96 vp9_put64_neon: 2.10 5.28 2.03 2.35 vp9_put_8tap_smooth_4h_neon: 3.11 4.35 2.63 4.35 vp9_put_8tap_smooth_4hv_neon: 3.67 4.69 3.25 4.71 vp9_put_8tap_smooth_4v_neon: 5.45 7.27 4.49 6.52 vp9_put_8tap_smooth_8h_neon: 5.97 8.18 4.81 8.56 vp9_put_8tap_smooth_8hv_neon: 6.39 7.90 5.64 8.15 vp9_put_8tap_smooth_8v_neon: 9.03 11.84 8.07 11.51 vp9_put_8tap_smooth_64h_neon: 6.78 9.48 4.88 10.89 vp9_put_8tap_smooth_64hv_neon: 6.99 8.87 5.94 9.56 vp9_put_8tap_smooth_64v_neon: 10.69 13.30 9.43 14.34 For the larger 8tap filters, the speedup vs C code is around 5-14x. This is significantly faster than libvpx's implementation of the same functions, at least when comparing the put_8tap_smooth_64 functions (compared to vpx_convolve8_horiz_neon and vpx_convolve8_vert_neon from libvpx). Absolute runtimes from checkasm: Cortex A7 A8 A9 A53 vp9_put_8tap_smooth_64h_neon: 20150.3 14489.4 19733.6 10863.7 libvpx vpx_convolve8_horiz_neon: 52623.3 19736.4 21907.7 25027.7 vp9_put_8tap_smooth_64v_neon: 14455.0 12303.9 13746.4 9628.9 libvpx vpx_convolve8_vert_neon: 42090.0 17706.2 17659.9 16941.2 Thus, on the A9, the horizontal filter is only marginally faster than libvpx, while our version is significantly faster on the other cores, and the vertical filter is significantly faster on all cores. The difference is especially large on the A7. The libvpx implementation does the accumulation in 32 bit, which probably explains most of the differences. This is an adapted cherry-pick from libav commits ffbd1d2b0002576ef0d976a41ff959c635373fdc, 392caa65df3efa8b2d48a80f08a6af4892c61c08, 557c1675cf0e803b2fee43b4c8b58433842c84d0 and 11623217e3c9b859daee544e31acdd0821b61039. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* vp9: change order of operations in adapt_prob().Ronald S. Bultje2016-10-24
| | | | | | | | | | | This is intended to workaround bug "665 Integer Divide Instruction May Cause Unpredictable Behavior" on some early AMD CPUs, which causes a div-by-zero in this codepath, such as reported in Mozilla bug #1293996. Note that this isn't guaranteed to fix the bug, since a compiler is free to reorder instructions that don't depend on each other. However, it appears to fix the bug in Firefox, and a similar patch was applied to libvpx also (see Chrome bug #599899).
* Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'Hendrik Leppkes2016-10-07
|\ | | | | | | | | | | | | * commit '32c8359093d1ff4f45ed19518b449b3ac3769d27': lavc: export the timestamps when decoding in AVFrame.pts Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * vp9: Return the correct size when decoding a superframeDenis Charmet2016-06-05
| | | | | | | | | | | | | | | | | | | | | | | | According to avcodec.h, avcodec_decode_video2 should return the number of bytes used if a frame was decoded. The current implementation returns size - used size of all the subframes. This fixes the VLC's bug https://trac.videolan.org/vlc/ticket/16836. The superframe is always fully consumed. Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | vp9: ignore frame_context_index field in key-/intraonly-frames.Ronald S. Bultje2016-04-17
| | | | | | | | Reproduces a bug to remain consistent with libvpx' behaviour.
* | vp9: fix a few signed integer left-shifts.Ronald S. Bultje2016-03-11
| | | | | | | | Fixes trac tickets 5127, 5129, 5130.
* | vp9: only call ff_get_format on stream format changes.Ronald S. Bultje2016-02-13
| | | | | | | | | | | | In practice, this means we don't call it N times for N-threaded decoding. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavc: add vp9 profiles to AVCodecDescriptorHendrik Leppkes2016-01-01
| |
* | vaapi: Add VP9 hwaccell supportTimo Rothenpieler2015-12-22
| | | | | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec: implement vp9 dxva2 hwaccelHendrik Leppkes2015-12-07
| |
* | vp9: add hwaccel hooksHendrik Leppkes2015-12-07
| |
* | vp9: fix pixel format changes with threadingHendrik Leppkes2015-12-07
| |
* | vp9: always keep s->bytesperpixel and ctx->pix_fmt in sync.Ronald S. Bultje2015-12-02
| | | | | | | | Fixes mozilla bug 1229128.