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

2022-02-08 Thread Chen, Wenbin
t; 1080p transcoding (no B frames) 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 | 16 > libavcodec/vaap

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

2022-02-10 Thread Wenbin Chen
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 f81737ab6d..6236391357 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -423,13 +423,13

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

2022-02-10 Thread Chen, Wenbin
> On Tue, 2022-02-08 at 11:05 +0800, Wenbin Chen wrote: > > Add vaSyncBuffer to VAAPI encoder. Old version API vaSyncSurface wait > > surface to complete. When surface is used for multiple operation, it > > waits all operations to finish. vaSyncBuffer only wait one

[FFmpeg-devel] [PATCH] libavcodec/qsvenc_hevc: encode RGB format rawvideo

2022-02-13 Thread Wenbin Chen
MediaSDK. Sigend-off-by: Wenbin Chen --- libavcodec/qsv.c | 16 libavcodec/qsvenc.c | 15 +++ libavcodec/qsvenc_hevc.c | 6 ++ 3 files changed, 37 insertions(+) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 1a432dbd82..b75877e698 100644 --- a

[FFmpeg-devel] Optimize HEVC decoding for loongarch

2022-02-14 Thread Hao Chen
ffmpeg -i 5_h265_1080p_60fps_3Mbps.mkv -f rawvideo -y /dev/null -an before: 94fps after : 191fps [PATCH v1 1/5] avutil: [loongarch] Update loongson_intrinsics.h to [PATCH v1 2/5] avcodec: [loongarch] Optimize Hevcdsp with LSX. [PATCH v1 3/5] avcodec: [loongarch] Optimize Hevc_idct/lpf with LSX. [P

[FFmpeg-devel] [PATCH v1 1/5] avutil: [loongarch] Update loongson_intrinsics.h to v1.1.0

2022-02-14 Thread Hao Chen
The loongson_intrinsics.h file is updated from v1.0.3 version to v1.1.0. Some spelling mistakes are fixed and new functions are added. Signed-off-by: Hao Chen --- libavutil/loongarch/loongson_intrinsics.h | 1697 +++-- 1 file changed, 884 insertions(+), 813 deletions(-) diff

[FFmpeg-devel] [PATCH v1 4/5] avcodec: [loongarch] Optimize Hevc_mc_bi with LSX.

2022-02-14 Thread Hao Chen
/libavcodec/loongarch/hevc_mc_bi_lsx.c new file mode 100644 index 00..9092fdccb2 --- /dev/null +++ b/libavcodec/loongarch/hevc_mc_bi_lsx.c @@ -0,0 +1,2289 @@ +/* + * Copyright (c) 2022 Loongson Technology Corporation Limited + * Contributed by Lu Wang + *Hao Chen + * + * This

[FFmpeg-devel] [PATCH v1 5/5] avcodec: [loongarch] Optimize Hevc_mc_uni/w with LSX.

2022-02-14 Thread Hao Chen
--- /dev/null +++ b/libavcodec/loongarch/hevc_mc_uni_lsx.c @@ -0,0 +1,1423 @@ +/* + * Copyright (c) 2022 Loongson Technology Corporation Limited + * Contributed by Lu Wang + *Hao Chen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc_hevc: encode RGB format rawvideo

2022-02-14 Thread Chen, Wenbin
> Wenbin Chen: > > Add support for hevc_qsv to input RGB format frame. It will > > transform frame to yuv inside MediaSDK instead of using auto > > scale. Now hevc_qsv supports directly encoding BGRA and X2RGB10 > > format. X2RGB10 is only supported in VDENC (-lo

[FFmpeg-devel] [PATCH v2] libavcodec/qsvenc_hevc: encode RGB format rawvideo

2022-02-14 Thread Wenbin Chen
MediaSDK. Signed-off-by: Wenbin Chen --- libavcodec/qsv.c | 16 libavcodec/qsvenc.c | 13 + libavcodec/qsvenc_hevc.c | 6 ++ 3 files changed, 35 insertions(+) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 1a432dbd82..b75877e698 100644 --- a

[FFmpeg-devel] Optimize HEVC decoding for loongarch

2022-02-17 Thread Hao Chen
ffmpeg -i 5_h265_1080p_60fps_3Mbps.mkv -f rawvideo -y /dev/null -an before: 94fps after : 191fps V2: Retrigger the patchwork.ffmpeg test. [PATCH v2 1/5] avutil: [loongarch] Update loongson_intrinsics.h to [PATCH v2 2/5] avcodec: [loongarch] Optimize Hevcdsp with LSX. [PATCH v2 3/5] avcodec: [loon

[FFmpeg-devel] [PATCH v2 1/5] avutil: [loongarch] Update loongson_intrinsics.h to v1.1.0

2022-02-17 Thread Hao Chen
The loongson_intrinsics.h file is updated from v1.0.3 version to v1.1.0. Some spelling mistakes are fixed and new functions are added. Signed-off-by: Hao Chen --- libavutil/loongarch/loongson_intrinsics.h | 1697 +++-- 1 file changed, 884 insertions(+), 813 deletions(-) diff

[FFmpeg-devel] [PATCH v2 4/5] avcodec: [loongarch] Optimize Hevc_mc_bi with LSX.

2022-02-17 Thread Hao Chen
ffmpeg -i 5_h265_1080p_60fps_3Mbps.mkv -f rawvideo -y /dev/null -an before: 124fps after : 182fps Signed-off-by: Hao Chen --- libavcodec/loongarch/Makefile |3 +- libavcodec/loongarch/hevc_mc_bi_lsx.c | 2289 + libavcodec/loongarch

[FFmpeg-devel] [PATCH v2 5/5] avcodec: [loongarch] Optimize Hevc_mc_uni/w with LSX.

2022-02-17 Thread Hao Chen
From: Lu Wang ffmpeg -i 5_h265_1080p_60fps_3Mbps.mkv -f rawvideo -y /dev/null -an before: 182fps after : 191fps Signed-off-by: Hao Chen --- libavcodec/loongarch/Makefile |4 +- libavcodec/loongarch/hevc_mc_uni_lsx.c| 1423 + libavcodec/loongarch

Re: [FFmpeg-devel] [PATCH v2] libavcodec/qsvenc_hevc: encode RGB format rawvideo

2022-02-17 Thread Chen, Wenbin
> On Tue, 2022-02-15 at 15:00 +0800, Wenbin Chen wrote: > > Add support for hevc_qsv to input RGB format frame. It will > > transform frame to yuv inside MediaSDK instead of using auto > > scale. Now hevc_qsv supports directly encoding BGRA and X2RGB10 > > format. X

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

2022-02-17 Thread Wenbin Chen
From: Wenbin Chen Add vaSyncBuffer to VAAPI encoder. Old version API vaSyncSurface wait surface to complete. When surface is used for multiple operation, it waits all operations to finish. vaSyncBuffer only wait one channel to finish. Signed-off-by: Wenbin Chen Signed-off-by: Haihao Xiang

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

2022-02-17 Thread Wenbin Chen
From: Wenbin Chen Fix: #7706. After commit 5fdcf85bbffe7451c2, vaapi encoder's performance decrease. The reason is that vaRenderPicture() and vaSyncBuffer() are called at the same time (vaRenderPicture() always followed by a vaSyncBuffer()). Now I changed them to be called in a asynchronou

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

2022-02-17 Thread Hao Chen
VCodecContext *avctx) ^ cc1: some warnings being treated as errors 在 2022/2/18 上午10:07, Wenbin Chen 写道: From: Wenbin Chen Add vaSyncBuffer to VAAPI encoder. Old version API vaSyncSurface wait surface to complete. When surface is used for multiple operation, it waits all

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

2022-02-17 Thread Wenbin Chen
Add vaSyncBuffer to VAAPI encoder. Old version API vaSyncSurface wait surface to complete. When surface is used for multiple operation, it waits all operations to finish. vaSyncBuffer only wait one channel to finish. Signed-off-by: Wenbin Chen Signed-off-by: Haihao Xiang --- libavcodec

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

2022-02-17 Thread Wenbin Chen
make better use of hardware. Async_depth is added to increase encoder's performance. The frames that are sent to hardware are stored in a fifo. Encoder will sync output after async fifo is full. Signed-off-by: Wenbin Chen Signed-off-by: Haihao Xiang --- doc/encoders.texi | 6

[FFmpeg-devel] [PATCH v3] libavcodec/qsvenc_hevc: encode RGB format rawvideo

2022-02-17 Thread Wenbin Chen
-by: Wenbin Chen --- libavcodec/qsv.c | 16 libavcodec/qsvenc.c | 8 libavcodec/qsvenc_hevc.c | 6 ++ 3 files changed, 30 insertions(+) diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index 1a432dbd82..b75877e698 100644 --- a/libavcodec/qsv.c +++ b

[FFmpeg-devel] [PATCH v2] libavcodec/qsvenc: add more ChromaFormat support to mjpeg_qsv

2022-02-20 Thread Wenbin Chen
ChromaForamt for mjpeg-qsv is always set to yuv420, and this will be wrong when encode other pixel format (for example yuyv422). ChromaFormat is changed to be adaptive to pix_fmt. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

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

2022-02-21 Thread Wenbin Chen
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 --- doc/encoders.texi | 5 + libavcodec/qsvenc.c | 5 +++-- 2 files changed, 8

Re: [FFmpeg-devel] [PATCH v2 1/5] avutil: [loongarch] Update loongson_intrinsics.h to v1.1.0

2022-02-24 Thread Hao Chen
coding style. 在 2022/2/21 下午11:00, Michael Niedermayer 写道: On Thu, Feb 17, 2022 at 07:11:47PM +0800, Hao Chen wrote: The loongson_intrinsics.h file is updated from v1.0.3 version to v1.1.0. Some spelling mistakes are fixed and new functions are added. Signed-off-by: Hao Chen --- libavutil

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

2022-03-17 Thread Wenbin Chen
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 Signed-off-by: Guangxin Xu

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

2022-03-17 Thread Wenbin Chen
_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 | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index

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

2022-03-17 Thread Wenbin Chen
is 8 (default) and decoder may followed by VPP, use NumFrameSuggest + 16 to set init_pool_size. Signed-off-by: Wenbin Chen Signed-off-by: Guangxin Xu --- libavcodec/qsvdec.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libavcodec/qsvdec.c b/libavcodec

[FFmpeg-devel] [PATCH] libavcodec/cbs_av1: Add size check before parse obu

2022-03-23 Thread Wenbin Chen
will not match the same obu frame. Now size check is added before parsing obu frame to avoid this error. Signed-off-by: Wenbin Chen --- libavcodec/cbs_av1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 1229480567

[FFmpeg-devel] [PATCH v2] libavcodec/cbs_av1: Add size check before parse obu

2022-03-29 Thread Wenbin Chen
will not match the same obu frame. Now size check is added before parsing obu frame to avoid this error. Signed-off-by: Wenbin Chen --- libavcodec/cbs_av1.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 1229480567

[FFmpeg-devel] [PATCH 1/2] libavutil/hwcontext_vulkan: Fix VK_FORMAT_R8G8_UNORM and VK_FORMAT_R16G16_UNORM map problem on Vulkan

2022-03-29 Thread Wenbin Chen
DRM_FORMAT_GR1616, while p010 need DRM_FORMAT_RG1616. Add sw_format check to vulkan_fmt_to_drm() to fix this problem. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vulkan.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil

[FFmpeg-devel] [PATCH 2/2] libavutil/hwcontext_vaapi: fix nv12 map error

2022-03-29 Thread Wenbin Chen
The UV plane of NV12 should not be mapped to DRM_FORMAT_GR88. Remove this map after the problem is fixed on ffmpeg-vulkan side. Signed-off-by: Wenbin Chen --- libavutil/hwcontext_vaapi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c

[FFmpeg-devel] [PATCH 1/2] libavcodec/qsvdec: Add more pixel format support to qsvdec

2022-03-29 Thread Wenbin Chen
Qsv decoder only supports directly output nv12 and p010 to system memory. For other format, we need to download frame from qsv format to system memory. Now add other supported format to qsvdec. Signed-off-by: Wenbin Chen --- libavcodec/qsv.c | 36

[FFmpeg-devel] [PATCH 2/2] libavcodec/qsvenc: Add more pixel format support to qsvenc

2022-03-29 Thread Wenbin Chen
Qsv encoder only support input P010 and nv12 format directly from system memory. For other format, we need to upload frame to device memory and input qsv format to encoder. Now add other system memory format support to qsv encoder. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 30

Re: [FFmpeg-devel] [PATCH v3 7/7] avutil/la: Add function performance testing

2023-05-24 Thread Hao Chen
在 2023/5/20 下午5:38, Rémi Denis-Courmont 写道: Le lauantaina 20. toukokuuta 2023, 10.27.19 EEST Hao Chen a écrit : From: yuanhecai This patch supports the use of the "checkasm --bench" testing feature on loongarch platform. Change-Id: I42790388d057c9ade0dfa38a19d9c1fd44ca0bc3 ---

[FFmpeg-devel] Add LSX optimization in avcodec and swscale.

2023-05-24 Thread Hao Chen
v1: Add LSX optimization in avcodec and swscale, due to the 2K series CPUs only support lsx. v2: Modified the implementation of some functions and added support for the checkasm --bench feature. v3: Fix whitespace errors in patch. v4: Remove clobbering memory in libavutil/loongarch/timer.h [PATC

[FFmpeg-devel] [PATCH v4 1/7] avcodec/la: add LSX optimization for h264 idct.

2023-05-24 Thread Hao Chen
From: Shiyou Yin loongson_asm.S is LoongArch asm optimization helper. Add functions: ff_h264_idct_add_8_lsx ff_h264_idct8_add_8_lsx ff_h264_idct_dc_add_8_lsx ff_h264_idct8_dc_add_8_lsx ff_h264_idct_add16_8_lsx ff_h264_idct8_add4_8_lsx ff_h264_idct_add8_8_lsx ff_h264_idct_add8_422_

[FFmpeg-devel] [PATCH v4 3/7] avcodec/la: Add LSX optimization for h264 chroma and intrapred.

2023-05-24 Thread Hao Chen
0 --- a/libavcodec/loongarch/h264_intrapred_lasx.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2021 Loongson Technology Corporation Limited - * Contributed by Hao Chen - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the

[FFmpeg-devel] [PATCH v4 4/7] avcodec/la: Add LSX optimization for h264 qpel.

2023-05-24 Thread Hao Chen
From: yuanhecai ./configure --disable-lasx ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -y /dev/null -an before: 214fps after: 274fps --- libavcodec/loongarch/Makefile |2 + libavcodec/loongarch/h264qpel.S | 1686 + .../loongarch/h264qpel_

[FFmpeg-devel] [PATCH v4 7/7] avutil/la: Add function performance testing

2023-05-24 Thread Hao Chen
From: yuanhecai This patch supports the use of the "checkasm --bench" testing feature on loongarch platform. Change-Id: I42790388d057c9ade0dfa38a19d9c1fd44ca0bc3 --- libavutil/loongarch/timer.h | 48 + libavutil/timer.h | 2 ++ 2 files changed, 50

[FFmpeg-devel] [PATCH v4 6/7] swscale/la: Add following builtin optimized functions

2023-05-24 Thread Hao Chen
From: Jin Bo yuv420_rgb24_lsx yuv420_bgr24_lsx yuv420_rgba32_lsx yuv420_argb32_lsx yuv420_bgra32_lsx yuv420_abgr32_lsx ./configure --disable-lasx ffmpeg -i ~/media/1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -pix_fmt rgb24 -y /dev/null -an before: 184fps after: 207fps --- libswscale/loongarch/Make

Re: [FFmpeg-devel] [PATCH v3 7/7] avutil/la: Add function performance testing

2023-05-24 Thread Hao Chen
在 2023/5/24 下午7:03, Rémi Denis-Courmont 写道: Le 24 mai 2023 10:39:59 GMT+03:00, Hao Chen a écrit : 在 2023/5/20 下午5:38, Rémi Denis-Courmont 写道: Le lauantaina 20. toukokuuta 2023, 10.27.19 EEST Hao Chen a écrit : From: yuanhecai This patch supports the use of the "checkasm --bench&quo

Re: [FFmpeg-devel] [PATCH v4 1/7] avcodec/la: add LSX optimization for h264 idct.

2023-05-24 Thread Hao Chen
在 2023/5/25 上午5:28, Michael Niedermayer 写道: On Wed, May 24, 2023 at 03:48:27PM +0800, Hao Chen wrote: From: Shiyou Yin loongson_asm.S is LoongArch asm optimization helper. Add functions: ff_h264_idct_add_8_lsx ff_h264_idct8_add_8_lsx ff_h264_idct_dc_add_8_lsx

[FFmpeg-devel] Add LSX optimization in avcodec and swscale.

2023-05-25 Thread Hao Chen
v1: Add LSX optimization in avcodec and swscale, due to the 2K series CPUs only support lsx. v2: Modified the implementation of some functions and added support for the checkasm --bench feature. v3: Fix whitespace errors in patch. v4: Remove clobbering memory in libavutil/loongarch/timer.h v5: Fi

[FFmpeg-devel] [PATCH v5 1/7] avcodec/la: add LSX optimization for h264 idct.

2023-05-25 Thread Hao Chen
From: Shiyou Yin loongson_asm.S is LoongArch asm optimization helper. Add functions: ff_h264_idct_add_8_lsx ff_h264_idct8_add_8_lsx ff_h264_idct_dc_add_8_lsx ff_h264_idct8_dc_add_8_lsx ff_h264_idct_add16_8_lsx ff_h264_idct8_add4_8_lsx ff_h264_idct_add8_8_lsx ff_h264_idct_add8_422_

[FFmpeg-devel] [PATCH v5 3/7] avcodec/la: Add LSX optimization for h264 chroma and intrapred.

2023-05-25 Thread Hao Chen
0 --- a/libavcodec/loongarch/h264_intrapred_lasx.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2021 Loongson Technology Corporation Limited - * Contributed by Hao Chen - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the

[FFmpeg-devel] [PATCH v5 4/7] avcodec/la: Add LSX optimization for h264 qpel.

2023-05-25 Thread Hao Chen
From: yuanhecai ./configure --disable-lasx ffmpeg -i 1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -y /dev/null -an before: 214fps after: 274fps --- libavcodec/loongarch/Makefile |2 + libavcodec/loongarch/h264qpel.S | 1686 + .../loongarch/h264qpel_

[FFmpeg-devel] [PATCH v5 6/7] swscale/la: Add following builtin optimized functions

2023-05-25 Thread Hao Chen
From: Jin Bo yuv420_rgb24_lsx yuv420_bgr24_lsx yuv420_rgba32_lsx yuv420_argb32_lsx yuv420_bgra32_lsx yuv420_abgr32_lsx ./configure --disable-lasx ffmpeg -i ~/media/1_h264_1080p_30fps_3Mbps.mp4 -f rawvideo -pix_fmt rgb24 -y /dev/null -an before: 184fps after: 207fps --- libswscale/loongarch/Make

[FFmpeg-devel] [PATCH v5 7/7] avutil/la: Add function performance testing

2023-05-25 Thread Hao Chen
From: yuanhecai This patch supports the use of the "checkasm --bench" testing feature on loongarch platform. Change-Id: I42790388d057c9ade0dfa38a19d9c1fd44ca0bc3 --- libavutil/loongarch/timer.h | 48 + libavutil/timer.h | 2 ++ 2 files changed, 50

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

2022-06-15 Thread Wenbin Chen
From: Yue Heng Enable dynamic QP configuration in runtime on qsv encoder. Through AVFrame->metadata, we can set key "qsv_config_qp" to change QP configuration when we encode video in CQP mode. Signed-off-by: Yue Heng Signed-off-by: Wenbin Chen --- doc/encoders.texi | 9 ++

[FFmpeg-devel] [PATCH] libavcodec/qsvenc_hevc: Use default value from MSDK to set bf.

2022-06-20 Thread Wenbin Chen
Change the default value of "bf" for hevc_qsv to -1. 8 isn't the best choice so let MSDK to decide the number of b frames. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc_hevc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/qsvenc_hevc

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

2022-06-20 Thread Chen, Wenbin
> On Wed, 2022-06-15 at 15:25 +0800, Wenbin Chen wrote: > > From: Yue Heng > > > > Enable dynamic QP configuration in runtime on qsv encoder. Through > > AVFrame->metadata, we can set key "qsv_config_qp" to change QP > > configuration when we encode

[FFmpeg-devel] [PATCH v2] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

2022-06-21 Thread Wenbin Chen
From: Yue Heng Enable dynamic QP configuration in runtime on qsv encoder. Through AVFrame->metadata, we can set key "qsv_config_qp" to change QP configuration when we encode video in CQP mode. Signed-off-by: Yue Heng Signed-off-by: Wenbin Chen --- doc/encoders.texi | 10

[FFmpeg-devel] [PATCH v3] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

2022-06-22 Thread Wenbin Chen
From: Yue Heng Enable dynamic QP configuration in runtime on qsv encoder. Through AVFrame->metadata, we can set key "qsv_config_qp" to change QP configuration when we encode video in CQP mode. Signed-off-by: Yue Heng Signed-off-by: Wenbin Chen --- doc/encoders.texi | 10

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: Add support to qsv to encode external surface.

2022-06-27 Thread Wenbin Chen
evice=qsv:reverse=1:extra_hw_frames=16, \ format=qsv" -c:v h264_qsv output.264 Signed-off-by: Wenbin Chen Signed-off-by: Tong Wu --- libavcodec/qsv_internal.h | 1 + libavcodec/qsvenc.c | 19 -- libavutil/hwcontext_qsv.c | 79 ++- 3 files c

[FFmpeg-devel] [PATCH] libavcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb()

2022-06-30 Thread Wenbin Chen
on platform supporting AVX512 which lead to creating a frame in mpeg2enc, and this lead to the different outputs. Signed-off-by: Wenbin Chen --- libavcodec/mpegvideo_enc.c | 29 +-- tests/ref/seek/vsynth_lena-mpeg2-422 | 40 +- tests/ref

Re: [FFmpeg-devel] [PATCH] libavcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb()

2022-07-01 Thread Chen, Wenbin
> On Fri, Jul 1, 2022 at 10:00 AM Xiang, Haihao < > haihao.xiang-at-intel@ffmpeg.org> wrote: > > > On Fri, 2022-07-01 at 13:34 +0800, Wenbin Chen wrote: > > > For 422 frames we should not use hard coded 8 to calculate mb size for > > > uv plane. Chroma s

Re: [FFmpeg-devel] [PATCH] libavcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb()

2022-07-03 Thread Chen, Wenbin
> On Fri, Jul 01, 2022 at 01:34:34PM +0800, Wenbin Chen wrote: > > For 422 frames we should not use hard coded 8 to calculate mb size for > > uv plane. Chroma shift should be taken into consideration to be > > compatiple with different sampling format. > > > > T

[FFmpeg-devel] [PATCH v2 1/2] libavcodec/mpegvideo_enc: Fix a chroma mb size error in sse_mb()

2022-07-03 Thread Wenbin Chen
on platform supporting AVX512 which lead to creating a frame in mpeg2enc, and this lead to the different outputs. Signed-off-by: Wenbin Chen --- libavcodec/mpegvideo_enc.c | 20 + tests/ref/seek/vsynth_lena-mpeg2-422 | 40 +- tests/ref/vsynth

[FFmpeg-devel] [PATCH v2 2/2] libavcodec/mpegvideo_enc: Unify the code style

2022-07-03 Thread Wenbin Chen
Change whitespace and add newline to unify the code style. Signed-off-by: Wenbin Chen --- libavcodec/mpegvideo_enc.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 970f71fe37..c9d9e2a764 100644

Re: [FFmpeg-devel] [PATCH v3] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

2022-07-03 Thread Chen, Wenbin
> Quoting Wenbin Chen (2022-06-23 07:32:42) > > From: Yue Heng > > > > Enable dynamic QP configuration in runtime on qsv encoder. Through > > AVFrame->metadata, we can set key "qsv_config_qp" to change QP > > configuration when we encode vide

Re: [FFmpeg-devel] [PATCH v3] libavcodec/qsvenc: Enable fixed QP configure in qsv CQP runtime

2022-07-04 Thread Chen, Wenbin
> Quoting Chen, Wenbin (2022-07-04 08:33:49) > > > Why is this using frame metadata rather than the AVVideoEncParams > side > > > data? > > > > The usage of AVVideoEncParams relates to the "qp" variable in > mfxEncodeCtrl which is passed > >

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: Use parameter from AVCodecContext to reset qsv codec

2022-07-06 Thread Wenbin Chen
ff-by: Wenbin Chen --- doc/encoders.texi | 5 ++--- libavcodec/qsvenc.c | 26 -- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 02a91ffe96..bf5fafd3fe 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -33

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

2022-07-06 Thread Wenbin Chen
l.com/content/www/us/en/develop/documentation/media-capabilities-of-intel-hardware/top.html 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..d94

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: Fix a log format issue

2022-07-06 Thread Wenbin Chen
Add a line feed to fix a log format issue. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 2382c2f5f7..81d93235d7 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -308,6 +308,7

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc: Fix a log format issue

2022-07-07 Thread Chen, Wenbin
> > On Jul 7, 2022, at 1:57 PM, Wenbin Chen intel@ffmpeg.org> wrote: > > > > Add a line feed to fix a log format issue. > > > > Signed-off-by: Wenbin Chen > > --- > > libavcodec/qsvenc.c | 1 + > > 1 file changed, 1 insertion(+) > > &

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: Change the parameter log to be thread safe

2022-07-08 Thread Wenbin Chen
Dividing one line log into several av_log() call is not thread safe. Now merge these strings into one av_log() call. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 87 ++--- 1 file changed, 42 insertions(+), 45 deletions(-) diff --git a/libavcodec

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc: Use parameter from AVCodecContext to reset qsv codec

2022-07-13 Thread Chen, Wenbin
from AVCodecContext. > > Signed-off-by: Wenbin Chen > --- > doc/encoders.texi | 5 ++--- > libavcodec/qsvenc.c | 26 -- > 2 files changed, 10 insertions(+), 21 deletions(-) > > diff --git a/doc/encoders.texi b/doc/encoders.texi > index 02a91ffe96..bf5f

[FFmpeg-devel] [PATCH v2] libavcodec/qsvenc: Use parameter from AVCodecContext to reset qsv codec

2022-07-14 Thread Wenbin Chen
param is passed to both "in" and "out" parameters when call MFXVideoENCODE_Query(), the value in q->param may be changed. New variables are added to store old configuration, so that we can detect real parameter change. Signed-off-by: Wenbin Chen --- doc/encoders.texi |

[FFmpeg-devel] [PATCH v3] libavcodec/cbs_av1: Add size check before parse obu

2022-08-16 Thread Wenbin Chen
will not match the same obu frame. Now size check is added before parsing obu frame to avoid this error. Signed-off-by: Wenbin Chen --- libavcodec/cbs_av1.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c index 154d9156cf..9c51a8c7c8 100644 --- a

[FFmpeg-devel] [PATCH] libavcodec/qsvenc_hevc: add main10sp support to hevc_qsv

2022-08-16 Thread Wenbin Chen
ned-off-by: Wenbin Chen --- doc/encoders.texi| 4 libavcodec/qsvenc.c | 33 +++-- libavcodec/qsvenc.h | 6 +- libavcodec/qsvenc_hevc.c | 3 +++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: Add adaptive_i/b to hevc_qsv

2022-08-17 Thread Wenbin Chen
Add adaptive_i/b feature to hevc_qsv. Adaptive_i allows changing of frame type from P and B to I. Adaptive_b allows changing of frame type frome B to P. Signed-off-by: Wenbin Chen --- doc/encoders.texi| 7 +++ libavcodec/qsvenc.c | 9 - libavcodec/qsvenc_hevc.c | 2

[FFmpeg-devel] [PATCH 1/6] libavcodec/qsvenc: Add max_frame_size reset support to qsv

2022-08-18 Thread Wenbin Chen
Signed-off-by: Wenbin Chen --- doc/encoders.texi | 4 libavcodec/qsvenc.c | 20 libavcodec/qsvenc.h | 2 ++ 3 files changed, 26 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index 6d73f74196..69fa46f3ea 100644 --- a/doc/encoders.texi +++ b/doc

[FFmpeg-devel] [PATCH 2/6] libavcodec/qsvenc: Add gop_size reset support to qsvenc

2022-08-18 Thread Wenbin Chen
Signed-off-by: Wenbin Chen --- doc/encoders.texi | 3 +++ libavcodec/qsvenc.c | 18 +- libavcodec/qsvenc.h | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 69fa46f3ea..9fb63856b1 100644 --- a/doc/encoders.texi

[FFmpeg-devel] [PATCH 3/6] libavcodec/qsvenc: Add "slice" intra refresh type to qsvenc

2022-08-18 Thread Wenbin Chen
Add "slice" intra refresh type to h264_qsv and hevc_qsv. This type means horizontal refresh by slices without overlapping. Also update the doc. Signed-off-by: Wenbin Chen --- doc/encoders.texi| 12 libavcodec/qsvenc_h264.c | 1 + libavcodec/qsvenc_hevc.c | 1

[FFmpeg-devel] [PATCH 5/6] libavcodec/qsvenc: Add max/min qp reset support in qsvenc

2022-08-18 Thread Wenbin Chen
Signed-off-by: Wenbin Chen --- doc/encoders.texi | 11 +++ libavcodec/qsvenc.c | 78 + libavcodec/qsvenc.h | 9 ++ 3 files changed, 98 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index b28b1f7f0b..fad3cad30b 100644

[FFmpeg-devel] [PATCH 6/6] libavcodec/qsvenc: Add low_delay_brc reset support to qsvenc

2022-08-18 Thread Wenbin Chen
Signed-off-by: Wenbin Chen --- doc/encoders.texi | 4 libavcodec/qsvenc.c | 23 ++- libavcodec/qsvenc.h | 2 ++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index fad3cad30b..d8e52006ce 100644 --- a/doc

[FFmpeg-devel] [PATCH 4/6] libavcodec/qsvenc: Add intra refresh reset support to qsvenc

2022-08-18 Thread Wenbin Chen
Signed-off-by: Wenbin Chen --- doc/encoders.texi | 7 +++ libavcodec/qsvenc.c | 33 + libavcodec/qsvenc.h | 5 + 3 files changed, 45 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index 48fe73fd33..b28b1f7f0b 100644 --- a/doc

Re: [FFmpeg-devel] [PATCH] avcodec/mips: Fix MMI macro replaces in HEVC Decoder

2022-08-18 Thread Hao Chen
There are still some bugs unresolved in HEVC decoding. The checkasm-hevc-pel test failed. It's suggested to repair together. 在 2022/8/18 下午3:15, 戚铁铮 写道: The latest commit of Loongson MMI macro replaces were incorrect. It makes a mass of green tints on HEVC videos when playing. I've compared it

Re: [FFmpeg-devel] [PATCH v3] libavcodec/cbs_av1: Add size check before parse obu

2022-08-23 Thread Chen, Wenbin
f_order_hint is updated and will not match the same obu frame. Now size > check is added before parsing obu frame to avoid this error. > > Signed-off-by: Wenbin Chen > --- > libavcodec/cbs_av1.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libavcodec/c

[FFmpeg-devel] [PATCH] libavutil/hwcontext_qsv: Align width and heigh when download qsv frame

2022-03-31 Thread Wenbin Chen
t; -f null - Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 95f8071abe..1e7c065902 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcon

Re: [FFmpeg-devel] [PATCH 1/2] libavcodec/qsvdec: Add more pixel format support to qsvdec

2022-04-02 Thread Chen, Wenbin
> On Wed, 2022-03-30 at 14:43 +0800, Wenbin Chen wrote: > > Qsv decoder only supports directly output nv12 and p010 to system > > memory. For other format, we need to download frame from qsv format > > to system memory. Now add other supported format to qsvdec. > > >

[FFmpeg-devel] [PATCH v2 1/2] libavcodec/qsvdec: Add more pixel format support to qsvdec

2022-04-02 Thread Wenbin Chen
Qsv decoder only supports directly output nv12 and p010 to system memory. For other format, we need to download frame from qsv format to system memory. Now add other supported format to qsvdec. Signed-off-by: Wenbin Chen --- libavcodec/qsv.c | 36

[FFmpeg-devel] [PATCH v2 2/2] libavcodec/qsvenc: Add more pixel format support to qsvenc

2022-04-02 Thread Wenbin Chen
Qsv encoder only support input P010 and nv12 format directly from system memory. For other format, we need to upload frame to device memory and input qsv format to encoder. Now add other system memory format support to qsv encoder. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 30

[FFmpeg-devel] [PATCH v2] libavutil/hwcontext_qsv: Align width and heigh when download qsv frame

2022-04-02 Thread Wenbin Chen
t; -f null - Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 32 1 file changed, 32 insertions(+) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 95f8071abe..fe11e215a8 100644 --- a/libavutil/hwcontext_qsv.c +++ b/libavutil/hwcon

Re: [FFmpeg-devel] [PATCH v2 1/2] libavcodec/qsvdec: Add more pixel format support to qsvdec

2022-04-06 Thread Chen, Wenbin
> On Sat, 2022-04-02 at 17:35 +0800, Wenbin Chen wrote: > > Qsv decoder only supports directly output nv12 and p010 to system > > memory. For other format, we need to download frame from qsv format > > to system memory. Now add other supported format to qsvdec. > > >

[FFmpeg-devel] [PATCH v3 1/2] libavcodec/qsvdec: Add more pixel format support to qsvdec

2022-04-06 Thread Wenbin Chen
Qsv decoder only supports directly output nv12 and p010 to system memory. For other format, we need to download frame from qsv format to system memory. Now add other supported format to qsvdec. Signed-off-by: Wenbin Chen --- libavcodec/qsv.c | 36

[FFmpeg-devel] [PATCH v3 2/2] libavcodec/qsvenc: Add more pixel format support to qsvenc

2022-04-06 Thread Wenbin Chen
Qsv encoder only support input P010 and nv12 format directly from system memory. For other format, we need to upload frame to device memory and input qsv format to encoder. Now add other system memory format support to qsv encoder. Signed-off-by: Wenbin Chen --- libavcodec/qsvenc.c | 30

[FFmpeg-devel] [PATCH v3] libavutil/hwcontext_qsv: Align width and heigh when download qsv frame

2022-04-06 Thread Wenbin Chen
t; -f null - Signed-off-by: Wenbin Chen --- libavutil/hwcontext_qsv.c | 47 ++- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c index 95f8071abe..66c0e38955 100644 --- a/libavutil/hwcontext_q

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

2022-04-26 Thread Wenbin Chen
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. Signed-off-by: Wenbin Chen Signed-off-by: Tong Wu --- libavcodec/qsv_internal.h | 2 + libavcodec/qsvdec.c | 160

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

2022-04-27 Thread Chen, Wenbin
> On Tue, 2022-04-26 at 18:00 +0800, Wenbin Chen wrote: > > 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. > > > > Signed-off-by: Wenbin

Re: [FFmpeg-devel] [PATCH v2] libavcodec/cbs_av1: Add size check before parse obu

2022-05-04 Thread Chen, Wenbin
> On 29/03/2022 09:29, Wenbin Chen wrote: > > cbs_av1_write_unit() check pbc size after parsing obu frame, and return > > AVERROR(ENOSPC) if pbc is small. pbc will be reallocated and this obu > > frame will be parsed again, but this may cause error because > > CodedBits

[FFmpeg-devel] [PATCH] libavcodec/qsvenc: Add min/max QP control options for I/P/B frame

2022-05-05 Thread Wenbin Chen
From: Yue Heng To do more accurate QP control, add min/max QP control on I/P/B frame separately to qsv encoder. qmax and qmin still work but newly-added options have higher priority. Signed-off-by: Yue Heng Signed-off-by: Wenbin Chen --- doc/encoders.texi | 18

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

2022-05-05 Thread Wenbin Chen
Use the mfxEncoderCtrl parameter to enable ROI. Get side data "AVRegionOfInterest" from filter "addroi" and use it to configure "mfxExtEncoderROI" which is the MediaSDK's ROI configuration. Signed-off-by: Wenbin Chen --- libavcodec/qsv_internal.h | 4

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc: Add min/max QP control options for I/P/B frame

2022-05-25 Thread Chen, Wenbin
> On Fri, 2022-05-06 at 10:19 +0800, Wenbin Chen wrote: > > From: Yue Heng > > > > To do more accurate QP control, add min/max QP control on I/P/B frame > > separately to qsv encoder. qmax and qmin still work but newly-added > > options have higher priority

[FFmpeg-devel] [PATCH v2] libavcodec/qsvenc: Add min/max QP control options for I/P/B frame

2022-05-25 Thread Wenbin Chen
From: Yue Heng To do more accurate QP control, add min/max QP control on I/P/B frame separately to qsv encoder. qmax and qmin still work but newly-added options have higher priority. Signed-off-by: Yue Heng Signed-off-by: Wenbin Chen --- doc/encoders.texi| 36

Re: [FFmpeg-devel] [PATCH] libavcodec/qsvenc: add ROI support to qsv encoder

2022-06-01 Thread Chen, Wenbin
> On Fri, 2022-05-06 at 13:49 +0800, Wenbin Chen wrote: > > Use the mfxEncoderCtrl parameter to enable ROI. Get side data > > "AVRegionOfInterest" > > from filter "addroi" and use it to configure "mfxExtEncoderROI" which is > > the MediaSD

[FFmpeg-devel] [PATCH v2] libavcodec/qsvenc: add ROI support to qsv encoder

2022-06-01 Thread Wenbin Chen
From: Wenbin Chen Use the mfxEncoderCtrl parameter to enable ROI. Get side data "AVRegionOfInterest" and use it to configure "mfxExtEncoderROI" which is the MediaSDK's ROI configuration. Signed-off-by: Wenbin Chen --- libavcodec/qsv_internal.h | 4 ++ libav

[FFmpeg-devel] [PATCH v3] libavcodec/qsvenc: add ROI support to qsv encoder

2022-06-05 Thread Wenbin Chen
Use The mfxEncoderCtrl parameter to enable ROI. Get side data "AVRegionOfInterest" and use it to configure "mfxExtEncoderROI" which is the MediaSDK's ROI configuration. Signed-off-by: Wenbin Chen --- libavcodec/qsv_internal.h | 4 ++ libav

Re: [FFmpeg-devel] [PATCH v3] libavcodec/qsvenc: add ROI support to qsv encoder

2022-06-07 Thread Chen, Wenbin
> Use The mfxEncoderCtrl parameter to enable ROI. Get side data > "AVRegionOfInterest" and use it to configure "mfxExtEncoderROI" which is > the MediaSDK's ROI configuration. > > Signed-off-by: Wenbin Chen > --- > libavcodec/qsv_intern

[FFmpeg-devel] [PATCH v4] libavcodec/qsvenc: add ROI support to qsv encoder

2022-06-07 Thread Wenbin Chen
Use The mfxEncoderCtrl parameter to enable ROI. Get side data "AVRegionOfInterest" and use it to configure "mfxExtEncoderROI" which is the MediaSDK's ROI configuration. Signed-off-by: Wenbin Chen --- libavcodec/qsv_internal.h | 4 ++ libav

<    1   2   3   4   5   6   >