aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vaapi_encode_av1.c
Commit message (Collapse)AuthorAgeFilesLines
* lavc/vaapi_encode_av1: Fix ref_order_hint value for second slotDavid Rosca5 days1-0/+3
| | | | | | | | We always use two slots, even when only one L0 reference is supported by the driver. However we still need to set the correct value for the ref_order_hint of the second slot. Fixes regression from bf9f921ef7 ("avcodec/hw_base_encode: restrict size of next_prev")
* avcodec/codec_internal, all: Use macros to set deprecated AVCodec fieldsAndreas Rheinhardt2025-03-101-4/+1
| | | | | | | | | | | | | | The aim of this is twofold: a) Clang warns when setting a deprecated field in a definition and because several of the widely set AVCodec fields are deprecated, one gets several hundred warnings from Clang for an ordinary build. Yet fortunately Clang (unlike GCC) allows to disable deprecation warnings inside a definition, so that one can create simple macros to set these fields that also suppress deprecation warnings for Clang. This has already been done in fdff1b9cbfd8cf5a9810c29efa4baf13a4786742 for AVCodec.channel_layouts. b) Using macros will allow to easily migrate these fields to internal ones. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavc/vaapi_encode_av1: Fix encode fail since 9db68ed0Fei Wang2024-09-191-1/+1
| | | | | Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Fei Wang <fei.w.wang@intel.com>
* hw_base_encode: refactor picture allocation/freeingLynne2024-09-091-13/+13
| | | | | | | | | | | | This commit cleans up and refactors the mess of private state upon private state that used to be. Now, FFHWBaseEncodePicture is fully initialized upon call-time, and, most importantly, this lets APIs which require initialization data for frames (VkImageViews) to initialize this for both the input image, and the reconstruction (DPB) image. Signed-off-by: Tong Wu <wutong1208@outlook.com>
* avcodec/internal: add FFCodec.color_rangesNiklas Haas2024-09-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I went through all codecs and put them into five basic categories: 1. JPEG range only 2. MPEG range only 3. Explicitly tagged 4. Broken (codec supports both but encoder ignores tags) 5. N/A (headerless or pseudo-formats) Filters in category 5 remain untouched. The rest gain an explicit assignment of their supported color ranges, with codecs in category 4 being set to MPEG-only for safety. It might be considered redundant to distinguish between 0 (category 5) and MPEG+JPEG (category 3), but in doing so we effectively communicate that we can guarantee that these tags will be encoded, which is distinct from the situation where there are some codecs that simply don't have tagging or implied semantics (e.g. rawvideo). A full list of codecs follows: JPEG range only: - amv - roqvideo MPEG range only: - asv1, asv2 - avui - cfhd - cljr - dnxhd - dvvideo - ffv1 - flv - h261, h263, h263p - {h263,vp8}_v4l2m2m - huffyuv, ffvhuff - jpeg2000 - libopenjpeg - libtheora - libwebp, libwebp_anim - libx262 - libxavs, libxavs2 - libxvid - mpeg1video, mpeg2video - mpeg2_qsv - mpeg2_vaapi - mpeg4, msmpeg4, msmpeg4v2, wmv1, wmv2 - mpeg4_omx - prores, prores_aw, prores_ks - rv10, rv20 - snow - speedhq - svq1 - tiff - utvideo Explicitly tagged (MPEG/JPEG): - {av1,h264,hevc}_nvenc - {av1,h264,hevc}_vaapi - {av1,h264,hevc,vp8,vp9,mpeg4}_mediacodec - {av1,h264,hevc,vp9}_qsv - h264_amf - {h264,hevc,prores}_videotoolbox - libaom-av1 - libkvazaar - libopenh264 - librav1e - libsvtav1 - libvpx, libvpx-vp9 - libx264 - libx265 - ljpeg - mjpeg - vc2 Broken (encoder ignores tags): - {av1,hevc}_amf - {h264,hevc,mpeg4}_v4l2m2m - h264_omx - libxeve - magicyuv - {vp8,vp9,mjpeg}_vaapi N/A: - ayuv, yuv4, y41p, v308, v210, v410, v408 (headerless) - pgmyuv (headerless) - rawvideo, bitpacked (headerless) - vnull, wrapped_avframe (pseudocodecs)
* avcodec/hw_base_encode: avoid getting FFHWBaseEncodeContext from avctxTong Wu2024-07-021-1/+1
| | | | | | | | | | This patch is to make FFHWBaseEncodeContext a standalone component and avoid getting FFHWBaseEncodeContext from avctx->priv_data. This patch also removes some unnecessary AVCodecContext arguments. For receive_packet call, a small wrapper is introduced. Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/vaapi_encode: extract a get_recon_format function to base layerTong Wu2024-07-021-5/+5
| | | | | | Surface size and block size parameters are also moved to base layer. Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/vaapi_encode: extract the init and close function to base layerTong Wu2024-07-021-1/+1
| | | | | | | Related parameters such as device context, frame context are also moved to base layer. Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/vaapi_encode: move the dpb logic from VAAPI to base layerTong Wu2024-07-021-16/+19
| | | | | | | | | | Move receive_packet function to base. This requires adding *alloc, *issue, *output, *free as hardware callbacks. HWBaseEncodePicture is introduced as the base layer structure. The related parameters in VAAPIEncodeContext are also extracted to HWBaseEncodeContext. Then DPB management logic can be fully extracted to base layer as-is. Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/vaapi_encode: add async_depth to common optionsTong Wu2024-07-021-0/+1
| | | | Signed-off-by: Tong Wu <tong1.wu@intel.com>
* avcodec/hw_base_encode: add FF_HW_ prefix for two enumsTong Wu2024-07-021-6/+6
| | | | | | | PICTURE_TYPE_* and FLAG_* are added FF_HW_ prefix after being moved to base layer. Signed-off-by: Tong Wu <tong1.wu@intel.com>
* lavc/vaapi_encode_av1: insert HDR_CLL metadata if haveHaihao Xiang2024-05-111-0/+15
| | | | | | Only look for HDR_CLL on key frame on the output. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavc/vaapi_encode_av1: Insert HDR_MDCV metadata if haveHaihao Xiang2024-05-111-0/+46
| | | | | | Only look for HDR_MDVC on key frame on the output. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavc/vaapi_encode_av1: implement write_extra_header callbackHaihao Xiang2024-05-111-1/+41
| | | | | | This can be used to insert a metadata OBU to the stream later. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
* lavc/vaapi_encode_av1: Set roi_quant_rangeDavid Rosca2024-04-011-0/+2
|
* all: use designated initializers for AVOption.unitAnton Khirnov2024-02-141-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Makes it robust against adding fields before it, which will be useful in following commits. Majority of the patch generated by the following Coccinelle script: @@ typedef AVOption; identifier arr_name; initializer list il; initializer list[8] il1; expression tail; @@ AVOption arr_name[] = { il, { il1, - tail + .unit = tail }, ... }; with some manual changes, as the script: * has trouble with options defined inside macros * sometimes does not handle options under an #else branch * sometimes swallows whitespace
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+1
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-1/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* cbs_av1: Make fake OBU size length field a write optionMark Thompson2023-10-021-1/+3
| | | | | This is an option to modify the behaviour of the writer, not a syntax field.
* lavc/vaapi_encode: Add VAAPI AV1 encoderFei Wang2023-09-221-0/+949
Signed-off-by: Fei Wang <fei.w.wang@intel.com> Acked-by: Neal Gompa <ngompa13@gmail.com>