summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_decode.c
Commit message (Collapse)AuthorAgeFilesLines
* vaapi: support VAProfileH264High10 decodingjianfeng.zheng2023-04-171-0/+5
| | | | | | see https://github.com/intel/libva/pull/664 Signed-off-by: jianfeng.zheng <jianfeng.zheng@mthreads.com>
* lavc/vaapi_hevc: Add vaapi profile parse support for SCCLinjie Fu2023-02-271-1/+3
| | | | | | | | | Note that Screen-Extended Main 4:4:4 and 4:4:4 10 supports chroma_format_idc from 0, 1 or 3, hence both 420 and 444 are supported. Signed-off-by: Linjie Fu <linjie.justin.fu@gmail.com> Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* lavc/vaapi: Add support for remaining 10/12bit profilesPhilip Langdale2022-09-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the necessary pixel formats defined, we can now expose support for the remaining 10/12bit combinations that VAAPI can handle. Specifically, we are adding support for: * HEVC ** 12bit 420 ** 10bit 422 ** 12bit 422 ** 10bit 444 ** 12bit 444 * VP9 ** 10bit 444 ** 12bit 444 These obviously require actual hardware support to be usable, but where that exists, it is now enabled. Note that unlike YUVA/YUVX, the Intel driver does not formally expose support for the alphaless formats XV30 and XV360, and so we are implicitly discarding the alpha from the decoder and passing undefined values for the alpha to the encoder. If a future encoder iteration was to actually do something with the alpha bits, we would need to use a formal alpha capable format or the encoder would need to explicitly accept the alphaless format.
* lavc/vaapi: Switch preferred 8bit 444 format to VUYXPhilip Langdale2022-08-251-1/+3
| | | | | | | | | As vaapi doesn't actually do anything useful with the alpha channel, and we have an alphaless format available, let's use that instead. The changes here are mostly 1:1 switching, but do note the explicit change in the number of declared channels from 4 to 3 to reflect that the alpha is being ignored.
* lavc/vaapi_decode: add missing flag when picking best pixel formatPhilip Langdale2022-08-091-0/+2
| | | | | | | | | | | | | | | | | | | | | vaapi_decode_find_best_format currently does not set the VA_SURFACE_ATTRIB_SETTABLE flag on the pixel format attribute that it returns. Without this flag, the attribute will be ignored by vaCreateSurfaces, meaning that the driver's default logic for picking a pixel format will kick in. So far, this hasn't produced visible problems, but when trying to decode 4:4:4 content, at least on Intel, the driver will pick the 444P planar format, even though the decoder can only return the AYUV packed format. The hwcontext_vaapi code that sets surface attributes when picking formats does not have this bug. Applications may use their own logic for finding the best format, and so may not hit this bug. eg: mpv is unaffected.
* lavc/vaapi: Declare support for decoding 8bit 4:4:4 contentPhilip Langdale2022-08-031-0/+2
| | | | | | | | | | | Now that we have a combination of capable hardware (new enough Intel) and a mutually understood format ("AYUV"), we can declare support for decoding 8bit 4:4:4 content via VAAPI. This requires listing AYUV as a supported format, and then adding VAAPI as a supported hwaccel for the relevant codecs (HEVC and VP9). I also had to add VP9Profile1 to the set of supported profiles for VAAPI as it was never relevant before.
* configure: Use a separate config_components.h header for $ALL_COMPONENTSMartin Storsjö2022-03-161-0/+2
| | | | | | | | This avoids unnecessary rebuilds of most source files if only the list of enabled components has changed, but not the other properties of the build, set in config.h. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavcodec/vaapi_decode: fix the problem that init_pool_size < nb_surfaceWenbin Chen2022-01-291-1/+1
| | | | | | | | | | | | | | | | | | | | For vaapi if the init_pool_size is not zero, the pool size is fixed. This means max surfaces is init_pool_size, but when mapping vaapi frame to qsv frame, the init_pool_size < nb_surface. The cause is that vaapi_decode_make_config() config the init_pool_size and it is called twice. The first time is to init frame_context and the second time is to init codec. On the second time the init_pool_size is changed to original value so the init_pool_size is lower than the reall size because pool_size used to initialize frame_context need to plus thread_count and 3 (guarantee 4 base work surfaces). Now add code to make sure init_pool_size is only set once. Now the following commandline works: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \ -hwaccel_output_format vaapi -i input.264 \ -vf "hwmap=derive_device=qsv,format=qsv" \ -c:v h264_qsv output.264 Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
* avcodec/vaapi: increase av1 decode pool sizeFei Wang2021-10-161-1/+1
| | | | | | | | For film grain clip, vaapi_av1 decoder will cache additional 8 surfaces that will be used to store frames which apply film grain. So increase the pool size by plus 8 to avoid leak of surface. Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* avcodec/vaapi: Remove old and deprecated VAAPI context and headerAndreas Rheinhardt2021-04-271-53/+0
| | | | | | | Deprecated in 851960f6f8cf1f946fe42fa36cf6598fac68072c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: add av1 VAAPI decoderFei Wang2020-11-021-0/+6
| | | | | | | | | Example cmdline: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -v verbose \ -c:v av1 -i input.ivf -pix_fmt yuv420p -vsync passthrough -f md5 \ -y out.md5 Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* lavc/vaapi_decode: fix the build failure when hevc_vaapi is disabledLinjie Fu2020-04-131-1/+1
| | | | | | | | | Verified with ./configure --enable-vaapi --disable-hwaccel=hevc_vaapi Failure reported in: http://fate.ffmpeg.org/report.cgi?time=20200401135031&slot=x86_64-archlinux-gcc-random Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc/vaapi_decode: add decode support for HEVC_MAIN_STILL_PICTURELinjie Fu2020-02-241-0/+2
| | | | Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* lavc/vaapi_decode: add profile_parser and format map support for HEVC REXTLinjie Fu2020-02-241-6/+22
| | | | | | | | | Add function pointer field in vaapi_profile_map[], set profile_parser for HEVC_REXT to find the exact va_profile. Also add format map support. Signed-off-by: Linjie Fu <linjie.fu@intel.com>
* avcodec/vaapi: free slice_buffers when decoding failedLinjie Fu2018-09-231-6/+8
| | | | | | | | | | If vaEndPicture() failed in ff_vaapi_decode_issue(), free the pic->slice_buffers. Fixes the memory leak issue in ticket #7385 Signed-off-by: Linjie Fu <linjie.fu@intel.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* configure: Use pkgconfig for VAAPIMark Thompson2018-09-231-2/+0
| | | | | | | Set the minimum version to 0.35.0 (libva 1.3.0) and remove redundant configure tests. This also allows the proprietary libmfx fork of libva, which always shows the version number 0.99.0 (independent of the actual version).
* vaapi: Add MJPEG decode hwaccelMark Thompson2018-02-211-0/+2
|
* vaapi_decode: Make the frames context format selection more generalMark Thompson2018-02-211-22/+130
| | | | | Examine the supported fourcc list manually and make the best choice, then use the external attribute on the frames context to force that fourcc.
* vaapi_decode: Ignore the profile when not usefulMark Thompson2017-11-261-1/+2
| | | | | Enables VP8 decoding - the decoder places the the bitstream version in the profile field, which we want to ignore.
* vaapi: Make the decode profile matching more explicitMark Thompson2017-11-261-11/+9
| | | | | Also fixes a bug where it could attempt to decode with an unsupported codec if allow-profile-mismatch was set.
* Merge commit 'b46a77f19ddc4b2b5fa3187835ceb602a5244e24'James Almer2017-11-111-115/+101
|\ | | | | | | | | | | | | | | | | * 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-191-115/+101
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * vaapi: Add external control of allow-profile-mismatchMark Thompson2017-04-261-9/+2
| | | | | | | | Uses the just-added ALLOW_PROFILE_MISMATCH flag.
| * vaapi: Implement device-only setupMark Thompson2017-02-131-18/+111
| | | | | | | | | | In this case, the user only supplies a device and the frame context is allocated internally by lavc.
| * vaapi_decode: use the correct logging contextAnton Khirnov2016-12-191-3/+3
| |
| * hevcdec: add a VAAPI hwaccelAnton Khirnov2016-12-191-0/+1
| | | | | | | | | | Partially based on a patch by Timo Rothenpieler <timo@rothenpieler.org>. Additional scaling list handling fix by Jun Zhao <mypopydev@gmail.com>.
| * vaapi_decode: Remove vestigial unmap codeMark Thompson2016-10-241-4/+1
| | | | | | | | | | | | | | The buffer map/unmap code was in an early version of this before it was committed, but the unmap was never removed. While wrong, this was harmless (and therefore unnoticed) because the buffers can't be mapped at this point - all drivers just did nothing with the call.
| * vaapi_decode: Clear parameter buffers to fix picture reuseMark Thompson2016-10-241-0/+1
| | | | | | | | | | | | When decoding interlaced pictures, the structure is reused to render to the same surface twice. The parameter buffers were not being cleared, which caused the i965 driver to error out.
| * vaapi_decode: Ignore the profile when not usefulMark Thompson2016-09-081-1/+2
| | | | | | | | | | Enables VP8 decoding - the decoder places the the bitstream version in the profile field, which we want to ignore.
| * lavc: Remove old vaapi decode infrastructureMark Thompson2016-08-301-32/+46
| | | | | | | | | | Deprecates struct vaapi_context and the installed header vaapi.h, to be removed at the next version bump.
| * lavc: Rewrite VAAPI decode infrastructureMark Thompson2016-08-301-0/+534
| | | | | Moves much of the setup logic for VAAPI decoding into lavc; the user now need only provide the hw_frames_ctx.
* lavc/vaapi_decode: fix profile search when profile mismatch is allowedJun Zhao2017-10-091-1/+3
| | | | | | | | When profile mismatch is allowed, use the highest supported profile for VAAPI decoding. Signed-off-by: Jun Zhao <jun.zhao@intel.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* vaapi: Always free parameter buffers after vaEndPicture() with libva2Mark Thompson2017-10-091-2/+2
| | | | | | 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-091-1/+0
| | | | | | 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: Add external control of allow-profile-mismatchMark Thompson2017-06-141-9/+2
| | | | | | Uses the just-added ALLOW_PROFILE_MISMATCH flag. (cherry picked from commit 7acb90333a187b0e847b66f9d3511245423dc0ce)
* vaapi: Implement device-only setupMark Thompson2017-03-221-18/+111
| | | | | | | In this case, the user only supplies a device and the frame context is allocated internally by lavc. (cherry picked from commit 5dd9a4b88b287bf8c93520afda7becb1ad0d1894)
* lavc: Remove old vaapi decode infrastructureMark Thompson2017-01-171-32/+46
| | | | | | | Deprecates struct vaapi_context and the installed header vaapi.h, to be removed at the next version bump. (cherry picked from commit 851960f6f8cf1f946fe42fa36cf6598fac68072c)
* lavc: Rewrite VAAPI decode infrastructureMark Thompson2017-01-171-0/+536
Moves much of the setup logic for VAAPI decoding into lavc; the user now need only provide the hw_frames_ctx. (cherry picked from commit 123ccd07c55ccf075cc5daf5581237fbccb86bdb) (cherry picked from commit 5e879b54a3a46817ea6c8a95a9aecab1176418b9) (cherry picked from commit 0aec37e625821040c103641eec9c1e7a1efa2952) (cherry picked from commit cfa4eb4fba782f3f37a33be997b27a91a07053c9)