[FFmpeg-devel] [PATCH] libavcodec/qsvenc.c: add max_frame_size support for hevc_qsv

2020-11-29 Thread wenbin . chen
From: Wenbinc-Bin The max_frame_size parameter is set only when codec is h264. Now I add hevc in that conditional statement. Signed-off-by: Wenbin CHEN --- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: add max_frame_size support for hevc_qsv

2020-12-01 Thread wenbin . chen
From: Wenbinc-Bin The max_frame_size parameter is set only when codec is h264. Now I add hevc in that conditional statement. Signed-off-by: Wenbin CHEN --- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: add DisableDeblockingIdc support for qsv

2020-12-03 Thread wenbin . chen
From: Wenbinc-Bin MediaSDK already has a flag to control deblocking (DisableDeblockingIdc). Add dblk_idc parameter in ffmpeg to expose this flag to user. Sigend-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 4 libavcodec/qsvenc.h | 3 +++ 2 files changed, 7 insertions(+) diff --git

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2020-12-09 Thread wenbin . chen
From: Wenbinc-Bin Add low latency P-pyramid support for qsv, and it relates to a new command line parameter "-p_strategy". To enable this flag, user also need to set "-bf" to -1 or 0. Signed-off-by Wenbin Chen --- libavcodec/qsvenc.c | 22 ++ libavcodec

[FFmpeg-devel] [PATCH V2] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2020-12-24 Thread wenbin . chen
From: Wenbinc-Bin Add low latency P-pyramid support for qsv, and it relates to a new command line parameter "-p_strategy". To enable this flag, user also need to set "-bf" to -1 or 0. Signed-off-by Wenbin Chen --- libavcodec/qsvenc.c | 23 +++ liba

[FFmpeg-devel] [PATCH V6] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2020-12-29 Thread wenbin . chen
From: Wenbinc-Bin Add low latency P-pyramid support for qsv, and it relates to a new command line parameter "-p_strategy". To enable this flag, user also need to set "-bf" to 0. P-strategy has two modes "1-simple" and "2-pyramid". Signed-off-by Wenbin

[FFmpeg-devel] [PATCH V4] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2020-12-28 Thread wenbin . chen
efers to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#PRefType patch V4: modify the coding style problem. Signed-off-by Wenbin Chen --- libavcodec/qsvenc.c | 32 libavcodec/qsvenc.h | 2 ++ 2 files changed, 34 insertions(+) diff

[FFmpeg-devel] [PATCH V5] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2020-12-28 Thread wenbin . chen
efers to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#PRefType patch V2~V4: modify the coding style problem. patch V5: forget to change "if" statement's coding style and fix it in V5. Signed-off-by Wenbin Chen --- libavcodec/qsvenc.c | 32 ++

[FFmpeg-devel] [PATCH V3] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2020-12-28 Thread wenbin . chen
efers to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#PRefType Signed-off-by Wenbin Chen --- libavcodec/qsvenc.c | 32 libavcodec/qsvenc.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsve

[FFmpeg-devel] [PATCH 04/10] libavcodec/qsvdec.c: extract frame packing arrangement data

2021-01-25 Thread wenbin . chen
From: Wenbinc-Bin Use h264_sei to parse SEI data got from MediaSDK. Extract frame packing arrangement information from SEI data and config AVStereo3D side data for decoded frame. Sigend-off-by: Wenbin Chen --- libavcodec/qsv_internal.h | 2 + libavcodec/qsvdec.c | 149

[FFmpeg-devel] [PATCH 07/10] libavocdec/qsvenc_hevc: encode RGB format rawvideo

2021-01-25 Thread wenbin . chen
to the A2RGB20 format in MediaSDK, and for A2RGB10 the two MSBs is A channels while this two bits in X2RGB10Le is undefined. MediaSDK team is discussing about this, so I leave an interface here. Sigend-of-by: Wenbin Chen --- libavcodec/qsv.c | 16 libavcodec/qsvenc.c | 19

[FFmpeg-devel] [PATCH 02/10] libavcodec/qsvenc: add DisableDeblockingIdc support for qsv

2021-01-25 Thread wenbin . chen
From: Wenbinc-Bin MediaSDK already has a flag to control deblocking (DisableDeblockingIdc). Add dblk_idc parameter in ffmpeg to expose this flag to user. Sigend-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 6 ++ libavcodec/qsvenc.h | 3 +++ 2 files changed, 9 insertions(+) diff --git

[FFmpeg-devel] [PATCH 03/10] libavcodec/qsvenc: add low latency P-pyramid support for qsv

2021-01-25 Thread wenbin . chen
models refer to https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#PRefType Signed-off-by Wenbin Chen --- libavcodec/qsvenc.c | 30 ++ libavcodec/qsvenc.h | 2 ++ 2 files changed, 32 insertions(+) diff --git a/libavcodec/qsvenc.c b/libavcod

[FFmpeg-devel] [PATCH 05/10] libavcodec/qsvenc: Add transform skip for hevc_qsv

2021-01-25 Thread wenbin . chen
From: Wenbinc-Bin Add transform skip option for hevc_qsv. Command line option is "transform_skip". By enabling this option, the transform_skip_enabled_flag in PPS will be set to 1. This option is only supported in the platform newer than ICL. Signed-off-by Wenbin Chen --- libavcode

[FFmpeg-devel] [PATCH 01/10] libavcodec/qsvenc.c: add max_frame_size support for hevc_qsv

2021-01-25 Thread wenbin . chen
From: Wenbinc-Bin The max_frame_size parameter is set only when codec is h264. Now I add hevc in that conditional statement. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index

[FFmpeg-devel] [PATCH 09/10] libavcodec/qsvdec: using suggested num to set init_pool_size

2021-01-25 Thread wenbin . chen
) and decoder may followed by VPP, use NumFrameSuggest + 16 to set init_pool_size. Sigend-off-by Wenbin Chen --- fftools/ffmpeg_qsv.c | 9 - libavcodec/qsvdec.c | 28 +++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg_qsv.c b/fftools

[FFmpeg-devel] [PATCH 06/10] libavcodec/qsvenc.c: add ROI support to qsv encoder

2021-01-25 Thread wenbin . chen
-qsv, so add allocate and free process as well. Sigend-off-by: Wenbin Chen --- libavcodec/qsv_internal.h | 3 ++ libavcodec/qsvenc.c | 74 +++ 2 files changed, 77 insertions(+) diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h index

[FFmpeg-devel] [PATCH 10/10] libavcodec/qsvdec: move unref before get_format

2021-01-25 Thread wenbin . chen
is released, the new one is already created, and somehow the device memory is stil be taken, even if the destory memory function is called. Moving unref before creating new context can solve this problem. Signed-off-by Wenbin Chen --- libavcodec/qsvdec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[FFmpeg-devel] [PATCH 08/10] libavcodec/qsvenc: add horizontal intra refresh and refresh cycle dist

2021-01-25 Thread wenbin . chen
From: Wenbinc-Bin Add an new intra refresh type: "horizontal", and an new param ref_cycle_dist. This param specify the distance between the beginnings of the intra-refresh cycles in frames. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 13 +++-- libavcode

[FFmpeg-devel] [PATCH 1/3] libavcodec/qsvdec: reinit decoder according to decode() return value

2021-04-25 Thread wenbin . chen
From: "Chen,Wenbin" FFmpeg-qsv decoder reinit codec when width and height change, but there are not only resolution change need to reinit codec. I change it to use return value from DecodeFrameAsync() to decide whether decoder need to be reinitialized. Signed-off-by Wenbin Chen

[FFmpeg-devel] [PATCH 2/3] libavcodec/qsvdec: remove redundant decodeHeader()

2021-04-25 Thread wenbin . chen
on. Remove the buffer_count and use the got_frame to decide whether the decoder is drain. Signed-off-by: Wenbin Chen Signed-off-by Guangxin Xu --- libavcodec/qsvdec.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcode

[FFmpeg-devel] [PATCH 3/3] libavcodec/qsvdec: using suggested num to set init_pool_size

2021-04-25 Thread wenbin . chen
) and max_b_frames is 8 (default) and decoder may followed by VPP, use NumFrameSuggest + 16 to set init_pool_size. Sigend-off-by Wenbin Chen Signed-off-by Guangxin Xu --- fftools/ffmpeg_qsv.c | 9 - libavcodec/qsvdec.c | 14 ++ 2 files changed, 22 insertions(+), 1 deletion

[FFmpeg-devel] [PATCH V2] libavfilter/qsvvpp: change the output frame's width and height

2021-03-23 Thread wenbin . chen
w I assign the out_link's w/h to output frame to overwrite the w/h got from hw_frame_ctx. Signed-off-by: Wenbin Chen --- libavfilter/qsvvpp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c index f216b3f248..70d6cb4

[FFmpeg-devel] [PATCH V2] libavcodec/qsvdec: reinit decoder according to decode() return value

2021-03-23 Thread wenbin . chen
From: "Chen,Wenbin" FFmpeg-qsv decoder reinit codec when width and height change, but there are not only resolution change need to reinit codec. I change it to use return value from DecodeFrameAsync() to decide whether decoder need to be reinitialized. Signed-off-by Wenbin Chen ---

[FFmpeg-devel] [PATCH V3] libavfilter/qsvvpp: change the output frame's width and height

2021-03-28 Thread wenbin . chen
->height to 1088, which is different from the height of encoder (1080) and this will be treated as resolution change. The aligend value can be kept in hw_frame_ctx as it is hardware dependent. Now I assign the out_link's w/h to output frame to overwrite the w/h got from hw_frame_ctx. Signed-

[FFmpeg-devel] [PATCH] libavcodec/qsvdec.c: using queue count to unref frame

2021-03-10 Thread wenbin . chen
From: "Chen,Wenbin" MSDK vc1 and av1 sometimes output frame into the same suface, but ffmpeg-qsv assume the surface will be used only once, so it will unref the frame when it receives the outpur surface. Now change it to unref frame according to queue count. Signed-off-by W

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: add more ChromaFormat support for mjpeg-qsv

2021-03-22 Thread wenbin . chen
From: "Chen,Wenbin" ChromaForamt for mjpeg-qsv is always set to yuv420, and this will be wrong when encode other pixel format (for example yuyv422). I change this assignment to be adaptive to pix_fmt. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 3 ++- 1 file changed, 2

[FFmpeg-devel] [PATCH] libavfilter/qsvvpp: change the output frame's width and height

2021-03-22 Thread wenbin . chen
I assign the out_link's w/h to output frame to overwrite the w/h got from hw_frame_ctx. Signed-off-by: Wenbin Chen --- libavfilter/qsvvpp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c index f216b3f248..8658a70083 100644 --- a/libavfilter/qsvv

[FFmpeg-devel] [PATCH] libavcodec/qsvdec: use the param from decodeHeader to configure surface

2021-03-22 Thread wenbin . chen
param from decoderHeader to configure surface. Signed-off-by Wenbin Chen --- libavcodec/qsvdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index 569ccd4fba..3ab48ea7a2 100644 --- a/libavcodec/qsvdec.c +++ b/libavcode

[FFmpeg-devel] [PATCH] libavcodec/qsvdec: reinit decoder according to decode() return value

2021-03-22 Thread wenbin . chen
From: "Chen,Wenbin" FFmpeg-qsv decoder reinit codec when width and height change, but there are not only resolution change need to reinit codec. I change it to use return value from DecodeFrameAsync() to decide whether decoder need to be reinitialized. Signed-off-by Wenbin Chen ---

[FFmpeg-devel] [PATCH V2] libavcodec/qsvdec.c: using queue count to unref frame

2021-03-11 Thread wenbin . chen
From: "Chen,Wenbin" MSDK vc1 and av1 sometimes output frame into the same suface, but ffmpeg-qsv assume the surface will be used only once, so it will unref the frame when it receives the output surface. Now change it to unref frame according to queue count. Signed-off-by W

[FFmpeg-devel] [PATCH] libavcodec/vaapi_encode: Change libva call to async way

2021-03-07 Thread wenbin . chen
er specify the bitrate (-b:v XXX). Signed-off-by: Wenbin CHEN --- libavcodec/vaapi_encode.c | 42 +-- libavcodec/vaapi_encode.h | 3 +++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: add mbbrc to hevc_qsv

2021-04-12 Thread wenbin . chen
From: "Chen,Wenbin" Add mbbrc to hevc_qsv For detailed description, please see "mbbrc" part in: https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxextcodingoption2 Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 5 +++-- 1 file changed

[FFmpeg-devel] [PATCH] libavcodec/qsvdec: skip non-key frame after "seek" function

2021-02-18 Thread wenbin . chen
il reading a key frame. Signed-off-by: Wenbin Chen --- libavcodec/qsvdec.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index d10f90a0db..8133406085 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -616,6 +616,13 @@ int ff_qsv_pr

[FFmpeg-devel] [PATCH 04/10] hwcontext_vaapi: Use PRIME_2 memory type for modifiers.

2021-08-30 Thread wenbin . chen
From: Bas Nieuwenhuizen This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier

[FFmpeg-devel] [PATCH 09/10] libavutil/hwcontext_vulkan: specify the modifier to create VKImage

2021-08-30 Thread wenbin . chen
From: Wenbin Chen On the lastset intel-vulkan-driver the VK_EXT_image_drm_format_modifier flags is enabled. As what driver log recommand, we need to use VK_IMAGE_TILING_LINEAR or VK_IMAGE_DRM_FORMAT_MODIFIER_EXT to create VKImage. Add code to get supported modifier for sw_format and use

[FFmpeg-devel] [PATCH 06/10] libavutil/hwcontext_vulkan: Add one_memory flag to make vulkan compatible with vaapi device.

2021-08-30 Thread wenbin . chen
rived from vaapi device, so that this change will not affect current vulkan behaviour. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index

[FFmpeg-devel] [PATCH 07/10] libavutil/hwcontext_vulkan: Allocate vkFrame in one memory

2021-08-30 Thread wenbin . chen
e is added to AVVKFrame to store the offset of each plane. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 46 +++- libavutil/hwcontext_vulkan.h | 1 + 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b

[FFmpeg-devel] [PATCH 08/10] libavutil/hwcontext_vulkan: fix wrong offset of plane

2021-08-30 Thread wenbin . chen
set should be 0. Also, when I import vaapi frame to vulkan I got broken frame, and setting plane_data->offset to 0 makes command works. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.

[FFmpeg-devel] [PATCH 05/10] libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frame

2021-08-30 Thread wenbin . chen
From: "Chen,Wenbin" Vulkan will map nv12 to R8 and GR88, so add this map to vaapi to support vulkan frame. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vaapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index

[FFmpeg-devel] [PATCH 10/10] libavutil/hwcontext_vulkan: Add hwupload and hwdownload support when using one_memory flag.

2021-08-30 Thread wenbin . chen
From: "Chen,Wenbin" Add hwupload and hwdownload support to vulkan when frames are allocated in one memory Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b

[FFmpeg-devel] [PATCH 03/10] libavfilter/vulkan: Fix the way to use sem

2021-08-30 Thread wenbin . chen
0p.264 -vf "hwupload=extra_hw_frames=16,scale_vulkan=1920:1080, hwdownload,format=yuv420p" -f rawvideo output.yuv Signed-off-by: Wenbin Chen --- libavfilter/vf_avgblur_vulkan.c | 4 +-- libavfilter/vf_chromaber_vulkan.c | 4 +-- libavfilter/vf_overlay_vulkan.c | 6 ++-- libavfilt

[FFmpeg-devel] [PATCH 01/10] libavfilter/vulkan: Fix problem when device have queue_count greater than 1

2021-08-30 Thread wenbin . chen
_hw_device vul -i input1080p.264 -vf "hwupload=extra_hw_frames=16,scale_vulkan=1920:1080, hwdownload,format=yuv420p" -f rawvideo output.yuv Signed-off-by: Wenbin Chen --- libavfilter/vulkan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vulkan.c b/

[FFmpeg-devel] [PATCH 02/10] libavutil/hwcontext_vulkan: fix a tile mismatch problem

2021-08-30 Thread wenbin . chen
we should configure VkImageSubresource according to tiling rather than extension. Now fix it. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 94fdad7f06..

[FFmpeg-devel] [V2 03/10] libavfilter/vulkan: Fix the way to use sem

2021-08-31 Thread Wenbin Chen
pload=extra_hw_frames=16,scale_vulkan=1920:1080, hwdownload,format=yuv420p" -f rawvideo output.yuv Signed-off-by: Wenbin Chen --- libavfilter/vf_avgblur_vulkan.c | 4 +-- libavfilter/vf_chromaber_vulkan.c | 4 +-- libavfilter/vf_overlay_vulkan.c | 6 ++-- libavfilter/vf_scale_vulkan.

[FFmpeg-devel] [V2 04/10] hwcontext_vaapi: Use PRIME_2 memory type for modifiers.

2021-08-31 Thread Wenbin Chen
From: Bas Nieuwenhuizen This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier

[FFmpeg-devel] [V2 02/10] libavutil/hwcontext_vulkan: fix a tile mismatch problem

2021-08-31 Thread Wenbin Chen
according to tiling rather than extension. Now fix it. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 94fdad7f06..88db5b8b70 100644 --- a/libavutil

[FFmpeg-devel] [V2 01/10] libavfilter/vulkan: Fix problem when device have queue_count greater than 1

2021-08-31 Thread Wenbin Chen
-vf "hwupload=extra_hw_frames=16,scale_vulkan=1920:1080, hwdownload,format=yuv420p" -f rawvideo output.yuv Signed-off-by: Wenbin Chen --- libavfilter/vulkan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vulkan.c b/libavfilter/vulkan.c index

[FFmpeg-devel] [V2 06/10] libavutil/hwcontext_vulkan: Add one_memory flag to make vulkan compatible with vaapi device.

2021-08-31 Thread Wenbin Chen
that this change will not affect current vulkan behaviour. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 9a29267aed..6417f59d4a 100644

[FFmpeg-devel] [V2 05/10] libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frame

2021-08-31 Thread Wenbin Chen
Vulkan will map nv12 to R8 and GR88, so add this map to vaapi to support vulkan frame. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vaapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 75acc851d6..994b744e4d 100644

[FFmpeg-devel] [V2 10/10] libavutil/hwcontext_vulkan: Add hwupload and hwdownload support when using one_memory flag.

2021-08-31 Thread Wenbin Chen
Add hwupload and hwdownload support to vulkan when frames are allocated in one memory Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index

[FFmpeg-devel] [V2 09/10] libavutil/hwcontext_vulkan: specify the modifier to create VKImage

2021-08-31 Thread Wenbin Chen
64 Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 77 +--- libavutil/hwcontext_vulkan.h | 5 +++ 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 3a639c997b..99b2190

[FFmpeg-devel] [V2 07/10] libavutil/hwcontext_vulkan: Allocate vkFrame in one memory

2021-08-31 Thread Wenbin Chen
the offset of each plane. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 46 +++- libavutil/hwcontext_vulkan.h | 1 + 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index

[FFmpeg-devel] [V2 08/10] libavutil/hwcontext_vulkan: fix wrong offset of plane

2021-08-31 Thread Wenbin Chen
vaapi frame to vulkan I got broken frame, and setting plane_data->offset to 0 makes command works. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulka

[FFmpeg-devel] [PATCH] libavutil/hwcontext_qsv: fix a bug for mapping qsv frame to vaapi

2021-09-09 Thread Wenbin Chen
a[3] in vaapi frame. pair->first is *VASurfaceID while data[3] in vaapi frame is VASurfaceID. I fix this line of code. Now the command above works. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_q

[FFmpeg-devel] [PATCH V2] libavutil/hwcontext_qsv: fix a bug for mapping qsv frame to vaapi

2021-09-13 Thread Wenbin Chen
a[3] in vaapi frame. pair->first is *VASurfaceID while data[3] in vaapi frame is VASurfaceID. I fix this line of code. Now the command above works. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavutil/h

[FFmpeg-devel] [PATCH] libavfilter/vf_vpp_qsv: fix uninitialized variable problem

2021-09-14 Thread Wenbin Chen
This two variables may be used below with uninitialized value. Now fix them. Signed-off-by: Wenbin Chen --- libavfilter/vf_vpp_qsv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index c268b5dba8..22ffe0d7f3 100644

[FFmpeg-devel] [PATCH V2 1/3] libavcodec/vaapi_encode: Add new API adaption to vaapi_encode

2022-01-04 Thread Wenbin Chen
. "wait=1" means wait until operation ready. "wait=0" means query operation's status. If it is ready return 0, if it is still in progress return EAGAIN. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 47 +-- 1 file changed, 40 insert

[FFmpeg-devel] [PATCH V2 2/3] libavcodec/vaapi_encode: Change the way to call async to increase performance

2022-01-04 Thread Wenbin Chen
, it will keep previous operation. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 64 --- libavcodec/vaapi_encode.h | 5 +++ 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index

[FFmpeg-devel] [PATCH V2 3/3] libavcodec/vaapi_encode: Add async_depth to vaapi_encoder to increase performance

2022-01-04 Thread Wenbin Chen
mes) with -async_depth=4 can increase 20% performance on my environment. The async increases performance but also introduces frame delay. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 19 ++- libavcodec/vaapi_encode.h | 12 ++-- 2 files changed, 24 insertions(+)

[FFmpeg-devel] [PATCH V2] libavutil/hwcontext_qsv: clean padding when upload qsv frames

2021-12-22 Thread Wenbin Chen
ing area with border pixel to fix this run2run problem, and also move the new AVFrame to global structure to reduce redundant allocation operation to increase preformance. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 96 +-- 1 file changed,

[FFmpeg-devel] [PATCH] doc/encoders.texi Add doc for qsv

2022-01-04 Thread Wenbin Chen
Add doc for qsv decoder. Add more option's introduction to qsv encoder. Signed-off-by: Wenbin Chen --- doc/decoders.texi | 42 doc/encoders.texi | 253 +- 2 files changed, 292 insertions(+), 3 deletions(-) diff --git a/doc/decoders.texi b

[FFmpeg-devel] [PATCH V2 5/5] libavutil/hwcontext_vulkan: specify the modifier to create VKImage

2021-11-23 Thread Wenbin Chen
.264 -vf "hwmap=derive_device=vulkan,format=vulkan, \ scale_vulkan=1920:1080,hwmap=derive_device=vaapi,format=vaapi" -c:v h264_vaapi output.264 Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 130 +-- 1 file changed, 124 insertions(+), 6

[FFmpeg-devel] [PATCH V2 3/5] libavutil/hwcontext_vulkan: Allocate vkFrame in one memory

2021-11-23 Thread Wenbin Chen
A new flag frame_flag is also added to AVVulkanFramesContext. User can use this flag to force enable or disable this behaviour. A new variable "offset "is added to AVVKFrame. It describe describe the offset from the memory currently bound to the VkImage. Signed-off-by: Wenbin Chen --- libavuti

[FFmpeg-devel] [PATCH V2 1/5] hwcontext_vaapi: Use PRIME_2 memory type for modifiers.

2021-11-23 Thread Wenbin Chen
From: Bas Nieuwenhuizen This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier

[FFmpeg-devel] [PATCH V2 4/5] libavutil/hwcontext_vulkan: Add hwupload and hwdownload support when using contiguous_planes flag.

2021-11-23 Thread Wenbin Chen
Add hwupload and hwdownload support to vulkan when frames are allocated in one memory Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index

[FFmpeg-devel] [PATCH V2 2/5] libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frame

2021-11-23 Thread Wenbin Chen
Vulkan will map nv12 to R8 and GR88, so add this map to vaapi to support vulkan frame. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vaapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 75acc851d6..994b744e4d 100644

[FFmpeg-devel] [PATCH 1/3] libavcodec/vaapi_decode: fix the problem that init_pool_size < nb_surface

2021-11-16 Thread Wenbin Chen
ces). 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

[FFmpeg-devel] [PATCH 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

2021-11-16 Thread Wenbin Chen
qsv -hwaccel_output_format qsv -hwaccel_device qs -c:v h264_qsv \ -i input.264 -vf "hwmap=derive_device=opencl,format=opencl,avgblur_opencl, \ hwmap=derive_device=qsv:reverse=1:extra_hw_frames=32,format=qsv" \ -c:v h264_qsv output.264 Signed-off-by: nyanmisaka Signed-off-by: Wenbin Chen -

[FFmpeg-devel] [PATCH 2/3] libavutil/hwcontext_qsv: fix a bug for mapping vaapi frame to qsv

2021-11-16 Thread Wenbin Chen
-i input.264 \ -vf "hwmap=derive_device=qsv,format=qsv" -c:v h264_qsv output.264 Signed-off-by: nyanmisaka Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontex

[FFmpeg-devel] [PATCH V3 1/5] hwcontext_vaapi: Use PRIME_2 memory type for modifiers.

2021-11-25 Thread Wenbin Chen
From: Bas Nieuwenhuizen This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier

[FFmpeg-devel] [PATCH V3 3/5] libavutil/hwcontext_vulkan: Allocate vkFrame in one memory

2021-11-25 Thread Wenbin Chen
A new flag frame_flag is also added to AVVulkanFramesContext. User can use this flag to force enable or disable this behaviour. A new variable "offset "is added to AVVKFrame. It describe describe the offset from the memory currently bound to the VkImage. Signed-off-by: Wenbin Chen --- libavuti

[FFmpeg-devel] [PATCH V3 2/5] libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frame

2021-11-25 Thread Wenbin Chen
Vulkan will map nv12 to R8 and GR88, so add this map to vaapi to support vulkan frame. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vaapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 75acc851d6..994b744e4d 100644

[FFmpeg-devel] [PATCH V3 5/5] libavutil/hwcontext_vulkan: specify the modifier to create VKImage

2021-11-25 Thread Wenbin Chen
.264 -vf "hwmap=derive_device=vulkan,format=vulkan, \ scale_vulkan=1920:1080,hwmap=derive_device=vaapi,format=vaapi" -c:v h264_vaapi output.264 Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 127 +-- 1 file changed, 121 insertions(+), 6

[FFmpeg-devel] [PATCH V3 4/5] libavutil/hwcontext_vulkan: Add support to hwmap to software frame when using contiguous_planes flag.

2021-11-25 Thread Wenbin Chen
Add support to map vulkan frames to software frames when using contiguous_planes flag. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index

[FFmpeg-devel] [PATCH 3/3] libavcodec/vaapi_encode: Add async_depth to vaapi_encoder to increase performance

2021-10-27 Thread Wenbin Chen
mes) with -async_depth=4 can increase 20% performance on my environment. The async increases performance but also introduces frame delay. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 20 +++- libavcodec/vaapi_encode.h | 12 ++-- 2 files changed, 25 insertions(+)

[FFmpeg-devel] [PATCH 1/3] libavcodec/vaapi_encode: Change the way to call async to increase performance

2021-10-27 Thread Wenbin Chen
, so we can send serveral frames to HW at once to increase performance. Now I changed them to be called in a asynchronous way, which will make better use of hardware. 1080p transcoding increases about 17% fps on my environment. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 41

[FFmpeg-devel] [PATCH 2/3] libavcodec/vaapi_encode: Add new API adaption to vaapi_encode

2021-10-27 Thread Wenbin Chen
;wait=1" means wait until operation ready. "wait=0" means query operation's status. If ready return 0, if still in progress return EAGAIN. Signed-off-by: Wenbin Chen --- libavcodec/vaapi_encode.c | 47 +-- 1 file changed, 40 insertions(+), 7 dele

[FFmpeg-devel] [PATCH 3/7] libavutil/hwcontext_vulkan: Add one_memory flag to make vulkan compatible with vaapi device.

2021-11-09 Thread Wenbin Chen
that this change will not affect current vulkan behaviour. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 6041580117..ccf3e58f49 100644

[FFmpeg-devel] [PATCH 7/7] libavutil/hwcontext_vulkan: specify the modifier to create VKImage

2021-11-09 Thread Wenbin Chen
.264 -vf "hwmap=derive_device=vulkan,format=vulkan, \ scale_vulkan=1920:1080,hwmap=derive_device=vaapi,format=vaapi" -c:v h264_vaapi output.264 Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 76 +--- libavutil/hwcontext_vulkan.h | 5 ++

[FFmpeg-devel] [PATCH 1/7] hwcontext_vaapi: Use PRIME_2 memory type for modifiers.

2021-11-09 Thread Wenbin Chen
From: Bas Nieuwenhuizen This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier

[FFmpeg-devel] [PATCH 4/7] libavutil/hwcontext_vulkan: Allocate vkFrame in one memory

2021-11-09 Thread Wenbin Chen
the offset of each plane. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 46 +++- libavutil/hwcontext_vulkan.h | 1 + 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index

[FFmpeg-devel] [PATCH 6/7] libavutil/hwcontext_vulkan: fix a sem_wait bug when export drm

2021-11-09 Thread Wenbin Chen
sem_sig_val is wrongly assigned to pWaitSemaphoreValues when export drm. Now fix it. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index b857d1a9ed

[FFmpeg-devel] [PATCH 5/7] libavutil/hwcontext_vulkan: Add hwupload and hwdownload support when using one_memory flag.

2021-11-09 Thread Wenbin Chen
Add hwupload and hwdownload support to vulkan when frames are allocated in one memory Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index

[FFmpeg-devel] [PATCH 2/7] libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frame

2021-11-09 Thread Wenbin Chen
Vulkan will map nv12 to R8 and GR88, so add this map to vaapi to support vulkan frame. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vaapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 75acc851d6..994b744e4d 100644

[FFmpeg-devel] [PATCH 2/4] libavutil/hwcontext_qsv: fix a bug when malloc handle_pairs_internal

2021-11-03 Thread Wenbin Chen
s_internal but handle_pairs_internal is alloced with the size of init_pool_size. This lead to access to illegal address. Now change it to use nb_surfaces to allocate handle_pairs_internal and the core dumped error is unseen. Also change D3D11VA to use nb_surfaces to align to VAAPI and DXVA2. Signed-off-by: W

[FFmpeg-devel] [PATCH 3/4] libavutil/hwcontext_qsv: fix a bug for mapping vaapi frame to qsv

2021-11-03 Thread Wenbin Chen
-i input.264 \ -vf "hwmap=derive_device=qsv,format=qsv" -c:v h264_qsv output.264 Signed-off-by: nyanmisaka Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontex

[FFmpeg-devel] [PATCH 1/4] libavutil/hwcontext_d3d11va: Add nb_surfaces to AVD3D11VAFramesContext

2021-11-03 Thread Wenbin Chen
Adding nb_surfaces in AVD3D11VAFramesContext in the end of the structure to support flexible size of this arrays and align to AVDXVA2FramesContext and AVVAAPIFramesContext. Signed-off-by Wenbin Chen --- libavutil/hwcontext_d3d11va.c | 3 +-- libavutil/hwcontext_d3d11va.h | 2 ++ 2 files changed

[FFmpeg-devel] [PATCH 4/4] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

2021-11-03 Thread Wenbin Chen
qsv -hwaccel_output_format qsv -hwaccel_device qs -c:v h264_qsv \ -i input.264 -vf "hwmap=derive_device=opencl,format=opencl,avgblur_opencl, \ hwmap=derive_device=qsv:reverse=1:extra_hw_frames=32,format=qsv" \ -c:v h264_qsv output.264 Signed-off-by: nyanmisaka Signed-off-by: Wenbin Chen -

[FFmpeg-devel] [PATCH V4 3/5] libavutil/hwcontext_vulkan: Allocate vkFrame in one memory

2021-11-29 Thread Wenbin Chen
A new flag frame_flag is also added to AVVulkanFramesContext. User can use this flag to force enable or disable this behaviour. A new variable "offset "is added to AVVKFrame. It describe describe the offset from the memory currently bound to the VkImage. Signed-off-by: Wenbin Chen --- libavuti

[FFmpeg-devel] [PATCH V4 1/5] hwcontext_vaapi: Use PRIME_2 memory type for modifiers.

2021-11-29 Thread Wenbin Chen
From: Bas Nieuwenhuizen This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier

[FFmpeg-devel] [PATCH V4 5/5] libavutil/hwcontext_vulkan: specify the modifier to create VKImage

2021-11-29 Thread Wenbin Chen
.264 -vf "hwmap=derive_device=vulkan,format=vulkan, \ scale_vulkan=1920:1080,hwmap=derive_device=vaapi,format=vaapi" -c:v h264_vaapi output.264 Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 127 +-- 1 file changed, 121 insertions(+), 6

[FFmpeg-devel] [PATCH V4 4/5] libavutil/hwcontext_vulkan: Add support to hwmap to software frame when using contiguous_planes flag.

2021-11-29 Thread Wenbin Chen
Add support to map vulkan frames to software frames when using contiguous_planes flag. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index

[FFmpeg-devel] [PATCH V4 2/5] libavutil/hwcontext_vaapi: Add a new nv12 format map to support vulkan frame

2021-11-29 Thread Wenbin Chen
Vulkan will map nv12 to R8 and GR88, so add this map to vaapi to support vulkan frame. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vaapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c index 75acc851d6..994b744e4d 100644

[FFmpeg-devel] [PATCH V2 2/3] libavutil/hwcontext_qsv: fix a bug for mapping vaapi frame to qsv

2021-11-30 Thread Wenbin Chen
-i input.264 \ -vf "hwmap=derive_device=qsv,format=qsv" -c:v h264_qsv output.264 Signed-off-by: nyanmisaka Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontex

[FFmpeg-devel] [PATCH V2 1/3] libavcodec/vaapi_decode: fix the problem that init_pool_size < nb_surface

2021-11-30 Thread Wenbin Chen
ces). 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

[FFmpeg-devel] [PATCH V2 3/3] libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl

2021-11-30 Thread Wenbin Chen
qsv -hwaccel_output_format qsv -hwaccel_device qs -c:v h264_qsv \ -i input.264 -vf "hwmap=derive_device=opencl,format=opencl,avgblur_opencl, \ hwmap=derive_device=qsv:reverse=1:extra_hw_frames=32,format=qsv" \ -c:v h264_qsv output.264 Signed-off-by: nyanmisaka Signed-off-by: Wenbin Chen -

[FFmpeg-devel] [PATCH] libavfilter/vf_overlay_qsv: Use format of first input to set output format for overlay_qsv

2021-12-09 Thread Wenbin Chen
0:y=0:alpha=255, \ hwdownload,format=p010le" -f rawvideo -y output_p010.yuv Signed-off-by: Wenbin Chen --- libavfilter/vf_overlay_qsv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c index 7e76b39aa9..d947a1faa1 100644 --- a/l

[FFmpeg-devel] [PATCH V5 3/5] libavutil/hwcontext_vulkan: Allocate vkFrame in one memory

2021-12-01 Thread Wenbin Chen
A new flag frame_flag is also added to AVVulkanFramesContext. User can use this flag to force enable or disable this behaviour. A new variable "offset "is added to AVVKFrame. It describe describe the offset from the memory currently bound to the VkImage. Signed-off-by: Wenbin Chen --- libavuti

[FFmpeg-devel] [PATCH V5 1/5] hwcontext_vaapi: Use PRIME_2 memory type for modifiers.

2021-12-01 Thread Wenbin Chen
From: Bas Nieuwenhuizen This way we can pass explicit modifiers in. Sometimes the modifier matters for the number of memory planes that libva accepts, in particular when dealing with driver-compressed textures. Furthermore the driver might not actually be able to determine the implicit modifier

  1   2   3   >