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

2021-11-03 Thread Wenbin Chen
From: nyanmisaka 

mfxHDLPair was added to qsv, so modify qsv->opencl map function as well.
Now the following commandline works:

ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 \
-init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device ocl \
-hwaccel 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 
---
 libavutil/hwcontext_opencl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
index 26a3a24593..4b6e74ff6f 100644
--- a/libavutil/hwcontext_opencl.c
+++ b/libavutil/hwcontext_opencl.c
@@ -2249,7 +2249,8 @@ static int opencl_map_from_qsv(AVHWFramesContext *dst_fc, 
AVFrame *dst,
 #if CONFIG_LIBMFX
 if (src->format == AV_PIX_FMT_QSV) {
 mfxFrameSurface1 *mfx_surface = (mfxFrameSurface1*)src->data[3];
-va_surface = *(VASurfaceID*)mfx_surface->Data.MemId;
+mfxHDLPair *pair = (mfxHDLPair*)mfx_surface->Data.MemId;
+va_surface = *(VASurfaceID*)pair->first;
 } else
 #endif
 if (src->format == AV_PIX_FMT_VAAPI) {
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


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

2021-11-03 Thread Wenbin Chen
From: nyanmisaka 

The data stored in data[3] in VAAPI AVFrame is VASurfaceID while
the data stored in pair->first is the pointer of VASurfaceID, so
we need to do cast to make 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: 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/hwcontext_qsv.c
index 5a285fd25b..8075c27862 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -1219,7 +1219,7 @@ static int qsv_map_to(AVHWFramesContext *dst_ctx,
 case AV_PIX_FMT_VAAPI:
 {
 mfxHDLPair *pair = (mfxHDLPair*)hwctx->surfaces[i].Data.MemId;
-if (pair->first == src->data[3]) {
+if (*(VASurfaceID*)pair->first == (VASurfaceID)src->data[3]) {
 index = i;
 break;
 }
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


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

2021-11-03 Thread Wenbin Chen
This commandline cause core dumped:
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

reason: We use nb_surfaces to assign surface to handle_pairs_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: Wenbin Chen 
---
 libavutil/hwcontext_qsv.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index c18747f7eb..5a285fd25b 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -1123,8 +1123,7 @@ static int qsv_frames_derive_to(AVHWFramesContext 
*dst_ctx,
 case AV_HWDEVICE_TYPE_VAAPI:
 {
 AVVAAPIFramesContext *src_hwctx = src_ctx->hwctx;
-s->handle_pairs_internal = av_calloc(src_ctx->initial_pool_size,
- 
sizeof(*s->handle_pairs_internal));
+s->handle_pairs_internal = av_calloc(src_hwctx->nb_surfaces, 
sizeof(*s->handle_pairs_internal));
 if (!s->handle_pairs_internal)
 return AVERROR(ENOMEM);
 s->surfaces_internal = av_calloc(src_hwctx->nb_surfaces,
@@ -1146,15 +1145,15 @@ static int qsv_frames_derive_to(AVHWFramesContext 
*dst_ctx,
 case AV_HWDEVICE_TYPE_D3D11VA:
 {
 AVD3D11VAFramesContext *src_hwctx = src_ctx->hwctx;
-s->handle_pairs_internal = av_calloc(src_ctx->initial_pool_size,
+s->handle_pairs_internal = av_calloc(src_ctx->nb_surfaces,
  
sizeof(*s->handle_pairs_internal));
 if (!s->handle_pairs_internal)
 return AVERROR(ENOMEM);
-s->surfaces_internal = av_calloc(src_ctx->initial_pool_size,
+s->surfaces_internal = av_calloc(src_ctx->nb_surfaces,
  sizeof(*s->surfaces_internal));
 if (!s->surfaces_internal)
 return AVERROR(ENOMEM);
-for (i = 0; i < src_ctx->initial_pool_size; i++) {
+for (i = 0; i < src_ctx->nb_surfaces; i++) {
 qsv_init_surface(dst_ctx, &s->surfaces_internal[i]);
 s->handle_pairs_internal[i].first = 
(mfxMemId)src_hwctx->texture_infos[i].texture;
 if (src_hwctx->BindFlags & D3D11_BIND_RENDER_TARGET) {
@@ -1164,7 +1163,7 @@ static int qsv_frames_derive_to(AVHWFramesContext 
*dst_ctx,
 }
 s->surfaces_internal[i].Data.MemId = 
(mfxMemId)&s->handle_pairs_internal[i];
 }
-dst_hwctx->nb_surfaces = src_ctx->initial_pool_size;
+dst_hwctx->nb_surfaces = src_ctx->nb_surfaces;
 if (src_hwctx->BindFlags & D3D11_BIND_RENDER_TARGET) {
 dst_hwctx->frame_type |= 
MFX_MEMTYPE_VIDEO_MEMORY_PROCESSOR_TARGET;
 } else {
@@ -1177,7 +1176,7 @@ static int qsv_frames_derive_to(AVHWFramesContext 
*dst_ctx,
 case AV_HWDEVICE_TYPE_DXVA2:
 {
 AVDXVA2FramesContext *src_hwctx = src_ctx->hwctx;
-s->handle_pairs_internal = av_calloc(src_ctx->initial_pool_size,
+s->handle_pairs_internal = av_calloc(src_ctx->nb_surfaces,
  
sizeof(*s->handle_pairs_internal));
 if (!s->handle_pairs_internal)
 return AVERROR(ENOMEM);
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[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, 3 insertions(+), 2 deletions(-)

diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index 8ab96bad25..086e7b9daa 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -72,7 +72,6 @@ static av_cold void load_functions(void)
 }
 
 typedef struct D3D11VAFramesContext {
-int nb_surfaces;
 int nb_surfaces_used;
 
 DXGI_FORMAT format;
@@ -287,7 +286,7 @@ static int d3d11va_frames_init(AVHWFramesContext *ctx)
 hwctx->texture_infos = av_calloc(ctx->initial_pool_size, 
sizeof(*hwctx->texture_infos));
 if (!hwctx->texture_infos)
 return AVERROR(ENOMEM);
-s->nb_surfaces = ctx->initial_pool_size;
+hwctx->nb_surfaces = ctx->initial_pool_size;
 
 ctx->internal->pool_internal = 
av_buffer_pool_init2(sizeof(AVD3D11FrameDescriptor),
 ctx, 
d3d11va_pool_alloc, NULL);
diff --git a/libavutil/hwcontext_d3d11va.h b/libavutil/hwcontext_d3d11va.h
index 77d2d72f1b..b0df470190 100644
--- a/libavutil/hwcontext_d3d11va.h
+++ b/libavutil/hwcontext_d3d11va.h
@@ -173,6 +173,8 @@ typedef struct AVD3D11VAFramesContext {
  * This field is ignored/invalid if a user-allocated texture is provided.
 */
 AVD3D11FrameDescriptor *texture_infos;
+
+int nb_surfaces;
 } AVD3D11VAFramesContext;
 
 #endif /* AVUTIL_HWCONTEXT_D3D11VA_H */
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] libvpxdec: Correct linking against variables.

2021-11-03 Thread Matt Oliver
Instead link against the function that returns the correct variable. This
fixes linking errors with dlls with msvc.
---
 libavcodec/libvpxdec.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index 42d1b8ab1c..b2aa205036 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -242,11 +242,11 @@ static int vpx_decode(AVCodecContext *avctx,
&ctx->decoder_alpha,
 #if CONFIG_LIBVPX_VP8_DECODER && CONFIG_LIBVPX_VP9_DECODER
(avctx->codec_id == AV_CODEC_ID_VP8) ?
-   &vpx_codec_vp8_dx_algo :
&vpx_codec_vp9_dx_algo
+   vpx_codec_vp8_dx() : vpx_codec_vp9_dx()
 #elif CONFIG_LIBVPX_VP8_DECODER
-   &vpx_codec_vp8_dx_algo
+   vpx_codec_vp8_dx()
 #else
-   &vpx_codec_vp9_dx_algo
+   vpx_codec_vp9_dx()
 #endif
);
 if (ret)
@@ -350,7 +350,7 @@ static av_cold int vpx_free(AVCodecContext *avctx)
 static av_cold int vp8_init(AVCodecContext *avctx)
 {
 VPxContext *ctx = avctx->priv_data;
-return vpx_init(avctx, &ctx->decoder, &vpx_codec_vp8_dx_algo);
+return vpx_init(avctx, &ctx->decoder, vpx_codec_vp8_dx());
 }

 const AVCodec ff_libvpx_vp8_decoder = {
@@ -372,7 +372,7 @@ const AVCodec ff_libvpx_vp8_decoder = {
 static av_cold int vp9_init(AVCodecContext *avctx)
 {
 VPxContext *ctx = avctx->priv_data;
-return vpx_init(avctx, &ctx->decoder, &vpx_codec_vp9_dx_algo);
+return vpx_init(avctx, &ctx->decoder, vpx_codec_vp9_dx());
 }

 AVCodec ff_libvpx_vp9_decoder = {
--


0001-libvpxdec-Correct-linking-against-variables.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] Fix missing PCM sample size option when it is used as the lone option for DirectShow audio capture

2021-11-03 Thread Roger Pack
I have looked at these two patches and they look good to me, if
anybody could commit them for me, that would be great.

On Wed, Nov 3, 2021 at 8:10 PM Brad Isbell  wrote:
>
> From 25e34ef9f995afffe67e519bb6f03a750aa09ae2 Mon Sep 17 00:00:00 2001
> From: Brad Isbell 
> Date: Wed, 3 Nov 2021 20:38:59 -0500
> Subject: [PATCH 2/2] Fix missing PCM sample size option when it is used as
> the
>  lone option for DirectShow audio capture
>
> Signed-off-by: Brad Isbell 
> ---
>  libavdevice/dshow.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
> index 5c1e494..e313c9a 100644
> --- a/libavdevice/dshow.c
> +++ b/libavdevice/dshow.c
> @@ -569,7 +569,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum
> dshowDeviceType devtype,
>  (ctx->requested_width &&
> ctx->requested_height) ||
>   ctx->pixel_format !=
> AV_PIX_FMT_NONE ||
>   ctx->video_codec_id !=
> AV_CODEC_ID_RAWVIDEO))
> -  || (devtype == AudioDevice && (ctx->channels ||
> ctx->sample_rate));
> +  || (devtype == AudioDevice && (ctx->channels ||
> ctx->sample_rate || ctx->sample_size));
>  int format_set = 0;
>  int should_show_properties = (devtype == VideoDevice) ?
> ctx->show_video_device_dialog : ctx->show_audio_device_dialog;
>
> --
> 2.32.0.windows.1
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v2] swscale/x86/output.asm: add x86-optimized planer gbr yuv2anyX functions

2021-11-03 Thread mindmark
From: Mark Reid 

changes since v1:
* remove vex intruction on sse4 path
* some load/pack marcos use less intructions
* fixed some typos

yuv2gbrp_full_X_4_512_c: 12757.6
yuv2gbrp_full_X_4_512_sse2: 8946.6
yuv2gbrp_full_X_4_512_sse4: 5138.6
yuv2gbrp_full_X_4_512_avx2: 3889.6
yuv2gbrap_full_X_4_512_c: 15368.6
yuv2gbrap_full_X_4_512_sse2: 11916.1
yuv2gbrap_full_X_4_512_sse4: 6294.6
yuv2gbrap_full_X_4_512_avx2: 3477.1
yuv2gbrp9be_full_X_4_512_c: 14381.6
yuv2gbrp9be_full_X_4_512_sse2: 9139.1
yuv2gbrp9be_full_X_4_512_sse4: 5150.1
yuv2gbrp9be_full_X_4_512_avx2: 2834.6
yuv2gbrp9le_full_X_4_512_c: 12990.1
yuv2gbrp9le_full_X_4_512_sse2: 9118.1
yuv2gbrp9le_full_X_4_512_sse4: 5132.1
yuv2gbrp9le_full_X_4_512_avx2: 2833.1
yuv2gbrp10be_full_X_4_512_c: 14401.6
yuv2gbrp10be_full_X_4_512_sse2: 9133.1
yuv2gbrp10be_full_X_4_512_sse4: 5126.1
yuv2gbrp10be_full_X_4_512_avx2: 2837.6
yuv2gbrp10le_full_X_4_512_c: 12718.1
yuv2gbrp10le_full_X_4_512_sse2: 9106.1
yuv2gbrp10le_full_X_4_512_sse4: 5120.1
yuv2gbrp10le_full_X_4_512_avx2: 2826.1
yuv2gbrap10be_full_X_4_512_c: 18535.6
yuv2gbrap10be_full_X_4_512_sse2: 33617.6
yuv2gbrap10be_full_X_4_512_sse4: 6264.1
yuv2gbrap10be_full_X_4_512_avx2: 3422.1
yuv2gbrap10le_full_X_4_512_c: 16724.1
yuv2gbrap10le_full_X_4_512_sse2: 11787.1
yuv2gbrap10le_full_X_4_512_sse4: 6282.1
yuv2gbrap10le_full_X_4_512_avx2: 3441.6
yuv2gbrp12be_full_X_4_512_c: 13723.6
yuv2gbrp12be_full_X_4_512_sse2: 9128.1
yuv2gbrp12be_full_X_4_512_sse4: 7997.6
yuv2gbrp12be_full_X_4_512_avx2: 2844.1
yuv2gbrp12le_full_X_4_512_c: 12257.1
yuv2gbrp12le_full_X_4_512_sse2: 9107.6
yuv2gbrp12le_full_X_4_512_sse4: 5142.6
yuv2gbrp12le_full_X_4_512_avx2: 2837.6
yuv2gbrap12be_full_X_4_512_c: 18511.1
yuv2gbrap12be_full_X_4_512_sse2: 12156.6
yuv2gbrap12be_full_X_4_512_sse4: 6251.1
yuv2gbrap12be_full_X_4_512_avx2: 3444.6
yuv2gbrap12le_full_X_4_512_c: 16687.1
yuv2gbrap12le_full_X_4_512_sse2: 11785.1
yuv2gbrap12le_full_X_4_512_sse4: 6243.6
yuv2gbrap12le_full_X_4_512_avx2: 3446.1
yuv2gbrp14be_full_X_4_512_c: 13690.6
yuv2gbrp14be_full_X_4_512_sse2: 9120.6
yuv2gbrp14be_full_X_4_512_sse4: 5138.1
yuv2gbrp14be_full_X_4_512_avx2: 2843.1
yuv2gbrp14le_full_X_4_512_c: 14995.6
yuv2gbrp14le_full_X_4_512_sse2: 9119.1
yuv2gbrp14le_full_X_4_512_sse4: 5126.1
yuv2gbrp14le_full_X_4_512_avx2: 2843.1
yuv2gbrp16be_full_X_4_512_c: 12367.1
yuv2gbrp16be_full_X_4_512_sse2: 8233.6
yuv2gbrp16be_full_X_4_512_sse4: 4820.1
yuv2gbrp16be_full_X_4_512_avx2: 2666.6
yuv2gbrp16le_full_X_4_512_c: 10904.1
yuv2gbrp16le_full_X_4_512_sse2: 8214.1
yuv2gbrp16le_full_X_4_512_sse4: 4824.1
yuv2gbrp16le_full_X_4_512_avx2: 2629.1
yuv2gbrap16be_full_X_4_512_c: 26569.6
yuv2gbrap16be_full_X_4_512_sse2: 10884.1
yuv2gbrap16be_full_X_4_512_sse4: 5488.1
yuv2gbrap16be_full_X_4_512_avx2: 3272.1
yuv2gbrap16le_full_X_4_512_c: 14010.1
yuv2gbrap16le_full_X_4_512_sse2: 10562.1
yuv2gbrap16le_full_X_4_512_sse4: 5463.6
yuv2gbrap16le_full_X_4_512_avx2: 3255.1
yuv2gbrpf32be_full_X_4_512_c: 14524.1
yuv2gbrpf32be_full_X_4_512_sse2: 8552.6
yuv2gbrpf32be_full_X_4_512_sse4: 4636.1
yuv2gbrpf32be_full_X_4_512_avx2: 2474.6
yuv2gbrpf32le_full_X_4_512_c: 13060.6
yuv2gbrpf32le_full_X_4_512_sse2: 9682.6
yuv2gbrpf32le_full_X_4_512_sse4: 4298.1
yuv2gbrpf32le_full_X_4_512_avx2: 2453.1
yuv2gbrapf32be_full_X_4_512_c: 18629.6
yuv2gbrapf32be_full_X_4_512_sse2: 11363.1
yuv2gbrapf32be_full_X_4_512_sse4: 15201.6
yuv2gbrapf32be_full_X_4_512_avx2: 3727.1
yuv2gbrapf32le_full_X_4_512_c: 16677.6
yuv2gbrapf32le_full_X_4_512_sse2: 10221.6
yuv2gbrapf32le_full_X_4_512_sse4: 5693.6
yuv2gbrapf32le_full_X_4_512_avx2: 3656.6

---
 libswscale/x86/output.asm | 435 +-
 libswscale/x86/swscale.c  |  98 +
 tests/checkasm/Makefile   |   2 +-
 tests/checkasm/checkasm.c |   1 +
 tests/checkasm/checkasm.h |   1 +
 tests/checkasm/sw_gbrp.c  | 198 +
 tests/fate/checkasm.mak   |   1 +
 7 files changed, 734 insertions(+), 2 deletions(-)
 create mode 100644 tests/checkasm/sw_gbrp.c

diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
index 52cf9f2c2e..ce0a2650b4 100644
--- a/libswscale/x86/output.asm
+++ b/libswscale/x86/output.asm
@@ -38,7 +38,49 @@ pw_32: times 8 dw 32
 pd_255:times 8 dd 255
 pw_512:times 8 dw 512
 pw_1024:   times 8 dw 1024
-
+pd_65535_invf: times 8 dd 0x37800080 ;1.0/65535.0
+pd_yuv2gbrp16_start:   times 8 dd -0x4000
+pd_yuv2gbrp_y_start:   times 8 dd  (1 << 9)
+pd_yuv2gbrp_uv_start:  times 8 dd  ((1 << 9) - (128 << 19))
+pd_yuv2gbrp_a_start:   times 8 dd  (1 << 18)
+pd_yuv2gbrp16_offset:  times 8 dd  0x1  ;(1 << 16)
+pd_yuv2gbrp16_round13: times 8 dd  0x02000  ;(1 << 13)
+pd_yuv2gbrp16_a_offset:times 8 dd  0x20002000
+pd_yuv2gbrp16_upper30: times 8 dd  0x3FFF ;(1<<30) - 1
+pd_yuv2gbrp16_upper27: times 8 dd  0x07FF ;(1<<27) - 1
+pd_yuv2gbrp16_upperC:  times 8 dd  0xC000
+pb_pack_shuffle8:   db  0,  4,  8, 12, \
+   -1, -1, -1, -1, \
+ 

[FFmpeg-devel] [PATCH v2 3/3] tests/checkasm: add check for vf_exposure

2021-11-03 Thread Wu Jianhua
Signed-off-by: Wu Jianhua 
---
 tests/checkasm/Makefile  |  1 +
 tests/checkasm/checkasm.c|  3 ++
 tests/checkasm/checkasm.h|  1 +
 tests/checkasm/vf_exposure.c | 62 
 tests/fate/checkasm.mak  |  1 +
 5 files changed, 68 insertions(+)
 create mode 100644 tests/checkasm/vf_exposure.c

diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index 4ef5fa87da..7b86ffca6b 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -37,6 +37,7 @@ AVFILTEROBJS-$(CONFIG_AFIR_FILTER) += af_afir.o
 AVFILTEROBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o
 AVFILTEROBJS-$(CONFIG_COLORSPACE_FILTER) += vf_colorspace.o
 AVFILTEROBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
+AVFILTEROBJS-$(CONFIG_EXPOSURE_FILTER)   += vf_exposure.o
 AVFILTEROBJS-$(CONFIG_GBLUR_FILTER)  += vf_gblur.o
 AVFILTEROBJS-$(CONFIG_HFLIP_FILTER)  += vf_hflip.o
 AVFILTEROBJS-$(CONFIG_THRESHOLD_FILTER)  += vf_threshold.o
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index b1353f7cbe..50961d9961 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -169,6 +169,9 @@ static const struct {
 #if CONFIG_EQ_FILTER
 { "vf_eq", checkasm_check_vf_eq },
 #endif
+#if CONFIG_EXPOSURE_FILTER
+{ "vf_exposure", checkasm_check_vf_exposure },
+#endif
 #if CONFIG_GBLUR_FILTER
 { "vf_gblur", checkasm_check_vf_gblur },
 #endif
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 68b0697d3e..b402894ad3 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -78,6 +78,7 @@ void checkasm_check_utvideodsp(void);
 void checkasm_check_v210dec(void);
 void checkasm_check_v210enc(void);
 void checkasm_check_vf_eq(void);
+void checkasm_check_vf_exposure(void);
 void checkasm_check_vf_gblur(void);
 void checkasm_check_vf_hflip(void);
 void checkasm_check_vf_threshold(void);
diff --git a/tests/checkasm/vf_exposure.c b/tests/checkasm/vf_exposure.c
new file mode 100644
index 00..14f0efed5f
--- /dev/null
+++ b/tests/checkasm/vf_exposure.c
@@ -0,0 +1,62 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include 
+#include 
+#include "checkasm.h"
+#include "libavfilter/exposure.h"
+
+#define PIXELS 256
+#define BUF_SIZE (PIXELS * 4)
+
+#define randomize_buffers(buf, size) \
+do { \
+int j;   \
+float *tmp_buf = (float *)buf;   \
+for (j = 0; j < size; j++)   \
+tmp_buf[j] = (float)(rnd() & 0xFF); \
+} while (0)
+
+void checkasm_check_vf_exposure(void)
+{
+float *dst_ref = av_malloc(BUF_SIZE);
+float *dst_new = av_malloc(BUF_SIZE);
+ExposureContext s;
+
+s.exposure = 0.5f;
+s.black = 0.1f;
+s.scale = 1.f / (exp2f(-s.exposure) - s.black);
+
+randomize_buffers(dst_ref, PIXELS);
+memcpy(dst_new, dst_ref, BUF_SIZE);
+
+ff_exposure_init(&s);
+
+if (check_func(s.exposure_func, "exposure")) {
+declare_func(void, float *dst, int length, float black, float scale);
+call_ref(dst_ref, PIXELS, s.black, s.scale);
+call_new(dst_new, PIXELS, s.black, s.scale);
+if (!float_near_abs_eps_array(dst_ref, dst_new, 0.01f, PIXELS))
+fail();
+bench_new(dst_new, PIXELS, s.black, s.scale);
+}
+report("exposure");
+
+av_freep(&dst_ref);
+av_freep(&dst_new);
+}
diff --git a/tests/fate/checkasm.mak b/tests/fate/checkasm.mak
index 6e7edbe655..4d4cd6cc88 100644
--- a/tests/fate/checkasm.mak
+++ b/tests/fate/checkasm.mak
@@ -34,6 +34,7 @@ FATE_CHECKASM = fate-checkasm-aacpsdsp
  \
 fate-checkasm-vf_blend  \
 fate-checkasm-vf_colorspace \
 fate-checkasm-vf_eq \
+fate-checkasm-vf_exposure   \
 fate-checkasm-vf_gblur  \
 fate-checkasm-vf_hflip  \
 fate-checkasm-vf_nlmeans\
-- 
2.17.1

__

[FFmpeg-devel] [PATCH v2 2/3] avfilter/x86/vf_exposure: add ff_exposure_avx2

2021-11-03 Thread Wu Jianhua
Performance data(Less is better):
exposure_sse:   500491
exposure_avx2:  449122

Signed-off-by: Wu Jianhua 
---
 libavfilter/x86/vf_exposure.asm| 15 +++
 libavfilter/x86/vf_exposure_init.c |  6 ++
 2 files changed, 21 insertions(+)

diff --git a/libavfilter/x86/vf_exposure.asm b/libavfilter/x86/vf_exposure.asm
index 3351c6fb3b..f271167805 100644
--- a/libavfilter/x86/vf_exposure.asm
+++ b/libavfilter/x86/vf_exposure.asm
@@ -36,11 +36,21 @@ cglobal exposure, 2, 2, 4, ptr, length, black, scale
 VBROADCASTSS m1, xmm1
 %endif
 
+%if cpuflag(fma3) || cpuflag(fma4)
+mulps   m0, m0, m1 ; black * scale
+%endif
+
 .loop:
+%if cpuflag(fma3) || cpuflag(fma4)
+movam2, m0
+vfmsub231ps m2, m1, [ptrq]
+movu[ptrq], m2
+%else
 movum2, [ptrq]
 subps   m2, m2, m0
 mulps   m2, m2, m1
 movu[ptrq], m2
+%endif
 add   ptrq, mmsize
 sublengthq, mmsize/4
 
@@ -52,4 +62,9 @@ cglobal exposure, 2, 2, 4, ptr, length, black, scale
 %if ARCH_X86_64
 INIT_XMM sse
 EXPOSURE
+
+%if HAVE_AVX2_EXTERNAL
+INIT_YMM avx2
+EXPOSURE
+%endif
 %endif
diff --git a/libavfilter/x86/vf_exposure_init.c 
b/libavfilter/x86/vf_exposure_init.c
index de1b360f6c..80dae6164e 100644
--- a/libavfilter/x86/vf_exposure_init.c
+++ b/libavfilter/x86/vf_exposure_init.c
@@ -24,6 +24,7 @@
 #include "libavfilter/exposure.h"
 
 void ff_exposure_sse(float *ptr, int length, float black, float scale);
+void ff_exposure_avx2(float *ptr, int length, float black, float scale);
 
 av_cold void ff_exposure_init_x86(ExposureContext *s)
 {
@@ -32,5 +33,10 @@ av_cold void ff_exposure_init_x86(ExposureContext *s)
 #if ARCH_X86_64
 if (EXTERNAL_SSE(cpu_flags))
 s->exposure_func = ff_exposure_sse;
+
+#if HAVE_AVX2_EXTERNAL
+if (EXTERNAL_AVX2_FAST(cpu_flags))
+s->exposure_func = ff_exposure_avx2;
+#endif
 #endif
 }
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v2 1/3] avfilter/x86/vf_exposure: add x86 SIMD optimization

2021-11-03 Thread Wu Jianhua
Performance data(Less is better):
exposure_c:857394
exposure_sse:  327589

Signed-off-by: Wu Jianhua 
---
 libavfilter/exposure.h | 36 +++
 libavfilter/vf_exposure.c  | 36 +--
 libavfilter/x86/Makefile   |  2 ++
 libavfilter/x86/vf_exposure.asm| 55 ++
 libavfilter/x86/vf_exposure_init.c | 36 +++
 5 files changed, 147 insertions(+), 18 deletions(-)
 create mode 100644 libavfilter/exposure.h
 create mode 100644 libavfilter/x86/vf_exposure.asm
 create mode 100644 libavfilter/x86/vf_exposure_init.c

diff --git a/libavfilter/exposure.h b/libavfilter/exposure.h
new file mode 100644
index 00..e76a517826
--- /dev/null
+++ b/libavfilter/exposure.h
@@ -0,0 +1,36 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFILTER_EXPOSURE_H
+#define AVFILTER_EXPOSURE_H
+#include "avfilter.h"
+
+typedef struct ExposureContext {
+const AVClass *class;
+
+float exposure;
+float black;
+float scale;
+
+void (*exposure_func)(float *ptr, int length, float black, float scale);
+} ExposureContext;
+
+void ff_exposure_init(ExposureContext *s);
+void ff_exposure_init_x86(ExposureContext *s);
+
+#endif
diff --git a/libavfilter/vf_exposure.c b/libavfilter/vf_exposure.c
index 108fba7930..045ae710d3 100644
--- a/libavfilter/vf_exposure.c
+++ b/libavfilter/vf_exposure.c
@@ -26,23 +26,20 @@
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
+#include "exposure.h"
 
-typedef struct ExposureContext {
-const AVClass *class;
-
-float exposure;
-float black;
+static void exposure_c(float *ptr, int length, float black, float scale)
+{
+int i;
 
-float scale;
-int (*do_slice)(AVFilterContext *s, void *arg,
-int jobnr, int nb_jobs);
-} ExposureContext;
+for (i = 0; i < length; i++)
+ptr[i] = (ptr[i] - black) * scale;
+}
 
 static int exposure_slice(AVFilterContext *ctx, void *arg, int jobnr, int 
nb_jobs)
 {
 ExposureContext *s = ctx->priv;
 AVFrame *frame = arg;
-const int width = frame->width;
 const int height = frame->height;
 const int slice_start = (height * jobnr) / nb_jobs;
 const int slice_end = (height * (jobnr + 1)) / nb_jobs;
@@ -52,24 +49,27 @@ static int exposure_slice(AVFilterContext *ctx, void *arg, 
int jobnr, int nb_job
 for (int p = 0; p < 3; p++) {
 const int linesize = frame->linesize[p] / 4;
 float *ptr = (float *)frame->data[p] + slice_start * linesize;
-for (int y = slice_start; y < slice_end; y++) {
-for (int x = 0; x < width; x++)
-ptr[x] = (ptr[x] - black) * scale;
-
-ptr += linesize;
-}
+s->exposure_func(ptr, linesize * (slice_end - slice_start), black, 
scale);
 }
 
 return 0;
 }
 
+void ff_exposure_init(ExposureContext *s)
+{
+s->exposure_func = exposure_c;
+
+if (ARCH_X86)
+ff_exposure_init_x86(s);
+}
+
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
 AVFilterContext *ctx = inlink->dst;
 ExposureContext *s = ctx->priv;
 
 s->scale = 1.f / (exp2f(-s->exposure) - s->black);
-ff_filter_execute(ctx, s->do_slice, frame, NULL,
+ff_filter_execute(ctx, exposure_slice, frame, NULL,
   FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
 
 return ff_filter_frame(ctx->outputs[0], frame);
@@ -80,7 +80,7 @@ static av_cold int config_input(AVFilterLink *inlink)
 AVFilterContext *ctx = inlink->dst;
 ExposureContext *s = ctx->priv;
 
-s->do_slice = exposure_slice;
+ff_exposure_init(s);
 
 return 0;
 }
diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile
index a29941eaeb..e84a388aa5 100644
--- a/libavfilter/x86/Makefile
+++ b/libavfilter/x86/Makefile
@@ -8,6 +8,7 @@ OBJS-$(CONFIG_BWDIF_FILTER)  += 
x86/vf_bwdif_init.o
 OBJS-$(CONFIG_COLORSPACE_FILTER) += x86/colorspacedsp_init.o
 OBJS-$(CONFIG_CONVOLUTION_FILTER)+= x86/vf_convolution_init.o
 OBJS-$(CONFIG_EQ_FILTER) += x86/vf_eq_init.o
+OBJS-$(CONFIG_EXPOSURE_FILTER)   += x86/vf_exposure_init.o
 OBJS-$(CONFIG_FSPP_FILTER)   += x86/vf_fs

[FFmpeg-devel] [PATCH 2/2] Fix missing PCM sample size option when it is used as the lone option for DirectShow audio capture

2021-11-03 Thread Brad Isbell
>From 25e34ef9f995afffe67e519bb6f03a750aa09ae2 Mon Sep 17 00:00:00 2001
From: Brad Isbell 
Date: Wed, 3 Nov 2021 20:38:59 -0500
Subject: [PATCH 2/2] Fix missing PCM sample size option when it is used as
the
 lone option for DirectShow audio capture

Signed-off-by: Brad Isbell 
---
 libavdevice/dshow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 5c1e494..e313c9a 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -569,7 +569,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum
dshowDeviceType devtype,
 (ctx->requested_width &&
ctx->requested_height) ||
  ctx->pixel_format !=
AV_PIX_FMT_NONE ||
  ctx->video_codec_id !=
AV_CODEC_ID_RAWVIDEO))
-  || (devtype == AudioDevice && (ctx->channels ||
ctx->sample_rate));
+  || (devtype == AudioDevice && (ctx->channels ||
ctx->sample_rate || ctx->sample_size));
 int format_set = 0;
 int should_show_properties = (devtype == VideoDevice) ?
ctx->show_video_device_dialog : ctx->show_audio_device_dialog;

-- 
2.32.0.windows.1
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/2] Use WAVEFORMATEX from AM_MEDIA_TYPE for describing device capabilities. (Fixes #9420)

2021-11-03 Thread Brad Isbell
>From fd6bfd237d4d25de04d8179ccb1ff2d2f0aa904f Mon Sep 17 00:00:00 2001
From: Brad Isbell 
Date: Sun, 3 Oct 2021 00:16:05 -0500
Subject: [PATCH 1/2] Use WAVEFORMATEX from AM_MEDIA_TYPE for describing
device
 capabilities.  (Fixes #9420)

Signed-off-by: Brad Isbell 
---
 libavdevice/dshow.c | 32 
 1 file changed, 12 insertions(+), 20 deletions(-)

diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c
index 8d0a6fc..5c1e494 100644
--- a/libavdevice/dshow.c
+++ b/libavdevice/dshow.c
@@ -422,28 +422,20 @@ dshow_cycle_formats(AVFormatContext *avctx, enum
dshowDeviceType devtype,
 goto next;
 }
 if (!pformat_set) {
-av_log(avctx, AV_LOG_INFO, "  min ch=%lu bits=%lu
rate=%6lu max ch=%lu bits=%lu rate=%6lu\n",
-   acaps->MinimumChannels,
acaps->MinimumBitsPerSample, acaps->MinimumSampleFrequency,
-   acaps->MaximumChannels,
acaps->MaximumBitsPerSample, acaps->MaximumSampleFrequency);
+av_log(
+avctx,
+AV_LOG_INFO,
+"  ch=%2lu, bits=%2lu, rate=%6lu\n",
+fx->nChannels, fx->wBitsPerSample, fx->nSamplesPerSec
+);
 continue;
 }
-if (ctx->sample_rate) {
-if (ctx->sample_rate > acaps->MaximumSampleFrequency ||
-ctx->sample_rate < acaps->MinimumSampleFrequency)
-goto next;
-fx->nSamplesPerSec = ctx->sample_rate;
-}
-if (ctx->sample_size) {
-if (ctx->sample_size > acaps->MaximumBitsPerSample ||
-ctx->sample_size < acaps->MinimumBitsPerSample)
-goto next;
-fx->wBitsPerSample = ctx->sample_size;
-}
-if (ctx->channels) {
-if (ctx->channels > acaps->MaximumChannels ||
-ctx->channels < acaps->MinimumChannels)
-goto next;
-fx->nChannels = ctx->channels;
+if (
+(ctx->sample_rate && ctx->sample_rate !=
fx->nSamplesPerSec) ||
+(ctx->sample_size && ctx->sample_size !=
fx->wBitsPerSample) ||
+(ctx->channels&& ctx->channels!= fx->nChannels
)
+) {
+goto next;
 }
 }
 if (IAMStreamConfig_SetFormat(config, type) != S_OK)
-- 
2.32.0.windows.1
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] swscale/x86/output.asm: add x86-optimized planer gbr yuv2anyX functions

2021-11-03 Thread Mark Reid
On Sun, Oct 24, 2021 at 9:10 PM  wrote:

> From: Mark Reid 
>
> yuv2gbrp_full_X_4_512_c: 12096.6
> yuv2gbrp_full_X_4_512_sse2: 10782.6
> yuv2gbrp_full_X_4_512_sse4: 5143.6
> yuv2gbrp_full_X_4_512_avx2: 3000.1
> yuv2gbrap_full_X_4_512_c: 15463.1
> yuv2gbrap_full_X_4_512_sse2: 14296.6
> yuv2gbrap_full_X_4_512_sse4: 6319.1
> yuv2gbrap_full_X_4_512_avx2: 3554.1
> yuv2gbrp9be_full_X_4_512_c: 14281.6
> yuv2gbrp9be_full_X_4_512_sse2: 11206.1
> yuv2gbrp9be_full_X_4_512_sse4: 5033.6
> yuv2gbrp9be_full_X_4_512_avx2: 3012.6
> yuv2gbrp9le_full_X_4_512_c: 12688.6
> yuv2gbrp9le_full_X_4_512_sse2: 10914.1
> yuv2gbrp9le_full_X_4_512_sse4: 5144.6
> yuv2gbrp9le_full_X_4_512_avx2: 3014.6
> yuv2gbrp10be_full_X_4_512_c: 14257.6
> yuv2gbrp10be_full_X_4_512_sse2: 11089.6
> yuv2gbrp10be_full_X_4_512_sse4: 5039.1
> yuv2gbrp10be_full_X_4_512_avx2: 3001.1
> yuv2gbrp10le_full_X_4_512_c: 12098.6
> yuv2gbrp10le_full_X_4_512_sse2: 10884.1
> yuv2gbrp10le_full_X_4_512_sse4: 5138.1
> yuv2gbrp10le_full_X_4_512_avx2: 2999.6
> yuv2gbrap10be_full_X_4_512_c: 18549.6
> yuv2gbrap10be_full_X_4_512_sse2: 14538.6
> yuv2gbrap10be_full_X_4_512_sse4: 6292.6
> yuv2gbrap10be_full_X_4_512_avx2: 3583.6
> yuv2gbrap10le_full_X_4_512_c: 16631.1
> yuv2gbrap10le_full_X_4_512_sse2: 14190.6
> yuv2gbrap10le_full_X_4_512_sse4: 6348.1
> yuv2gbrap10le_full_X_4_512_avx2: 3554.6
> yuv2gbrp12be_full_X_4_512_c: 13555.1
> yuv2gbrp12be_full_X_4_512_sse2: 10952.1
> yuv2gbrp12be_full_X_4_512_sse4: 5137.6
> yuv2gbrp12be_full_X_4_512_avx2: 3009.6
> yuv2gbrp12le_full_X_4_512_c: 12082.6
> yuv2gbrp12le_full_X_4_512_sse2: 10891.1
> yuv2gbrp12le_full_X_4_512_sse4: 5184.1
> yuv2gbrp12le_full_X_4_512_avx2: 3011.1
> yuv2gbrap12be_full_X_4_512_c: 18689.6
> yuv2gbrap12be_full_X_4_512_sse2: 14522.6
> yuv2gbrap12be_full_X_4_512_sse4: 6237.6
> yuv2gbrap12be_full_X_4_512_avx2: 3585.6
> yuv2gbrap12le_full_X_4_512_c: 16760.6
> yuv2gbrap12le_full_X_4_512_sse2: 14202.1
> yuv2gbrap12le_full_X_4_512_sse4: 6252.1
> yuv2gbrap12le_full_X_4_512_avx2: 3591.1
> yuv2gbrp14be_full_X_4_512_c: 13555.6
> yuv2gbrp14be_full_X_4_512_sse2: 10949.1
> yuv2gbrp14be_full_X_4_512_sse4: 5185.1
> yuv2gbrp14be_full_X_4_512_avx2: 3012.1
> yuv2gbrp14le_full_X_4_512_c: 12068.1
> yuv2gbrp14le_full_X_4_512_sse2: 10883.6
> yuv2gbrp14le_full_X_4_512_sse4: 5145.1
> yuv2gbrp14le_full_X_4_512_avx2: 3007.1
> yuv2gbrp16be_full_X_4_512_c: 12383.6
> yuv2gbrp16be_full_X_4_512_sse2: 8230.6
> yuv2gbrp16be_full_X_4_512_sse4: 4765.6
> yuv2gbrp16be_full_X_4_512_avx2: 2742.6
> yuv2gbrp16le_full_X_4_512_c: 10906.1
> yuv2gbrp16le_full_X_4_512_sse2: 28732.1
> yuv2gbrp16le_full_X_4_512_sse4: 4709.6
> yuv2gbrp16le_full_X_4_512_avx2: 2753.1
> yuv2gbrap16be_full_X_4_512_c: 15472.6
> yuv2gbrap16be_full_X_4_512_sse2: 11021.6
> yuv2gbrap16be_full_X_4_512_sse4: 5487.6
> yuv2gbrap16be_full_X_4_512_avx2: 3143.6
> yuv2gbrap16le_full_X_4_512_c: 13668.6
> yuv2gbrap16le_full_X_4_512_sse2: 10562.1
> yuv2gbrap16le_full_X_4_512_sse4: 5506.6
> yuv2gbrap16le_full_X_4_512_avx2: 3149.6
> yuv2gbrpf32be_full_X_4_512_c: 15471.1
> yuv2gbrpf32be_full_X_4_512_sse2: 8524.6
> yuv2gbrpf32be_full_X_4_512_sse4: 4559.1
> yuv2gbrpf32be_full_X_4_512_avx2: 2388.1
> yuv2gbrpf32le_full_X_4_512_c: 14247.6
> yuv2gbrpf32le_full_X_4_512_sse2: 7600.6
> yuv2gbrpf32le_full_X_4_512_sse4: 4385.6
> yuv2gbrpf32le_full_X_4_512_avx2: 2258.6
> yuv2gbrapf32be_full_X_4_512_c: 18412.1
> yuv2gbrapf32be_full_X_4_512_sse2: 11353.6
> yuv2gbrapf32be_full_X_4_512_sse4: 5807.1
> yuv2gbrapf32be_full_X_4_512_avx2: 2928.1
> yuv2gbrapf32le_full_X_4_512_c: 16485.1
> yuv2gbrapf32le_full_X_4_512_sse2: 10202.1
> yuv2gbrapf32le_full_X_4_512_sse4: 5571.6
> yuv2gbrapf32le_full_X_4_512_avx2: 2847.6
>
>
> ---
>  libswscale/x86/output.asm | 440 +-
>  libswscale/x86/swscale.c  |  99 +
>  tests/checkasm/Makefile   |   2 +-
>  tests/checkasm/checkasm.c |   1 +
>  tests/checkasm/checkasm.h |   1 +
>  tests/checkasm/sw_gbrp.c  | 198 +
>  tests/fate/checkasm.mak   |   1 +
>  7 files changed, 740 insertions(+), 2 deletions(-)
>  create mode 100644 tests/checkasm/sw_gbrp.c
>
> diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
> index 52cf9f2c2e..e80b6256b4 100644
> --- a/libswscale/x86/output.asm
> +++ b/libswscale/x86/output.asm
> @@ -38,7 +38,49 @@ pw_32: times 8 dw 32
>  pd_255:times 8 dd 255
>  pw_512:times 8 dw 512
>  pw_1024:   times 8 dw 1024
> -
> +pd_65535_invf: times 8 dd 0x37800080 ;1.0/65535.0
> +pd_yuv2gbrp16_start:   times 8 dd -0x4000
> +pd_yuv2gbrp_y_start:   times 8 dd  (1 << 9)
> +pd_yuv2gbrp_uv_start:  times 8 dd  ((1 << 9) - (128 << 19))
> +pd_yuv2gbrp_a_start:   times 8 dd  (1 << 18)
> +pd_yuv2gbrp16_offset:  times 8 dd  0x1  ;(1 << 16)
> +pd_yuv2gbrp16_round13: times 8 dd  0x02000  ;(1 << 13)
> +pd_yuv2gbrp16_a_offset:times 8 dd  0x20002000
> +pd_yuv2gbrp16_upper30: times 8 dd  0x3FFF ;(1<<30) - 1
> +pd_yuv2gbrp16_upper27: times 8 dd  0x07FF ;(1<<27

Re: [FFmpeg-devel] [PATCH] avfilter/scale_npp: add scale2ref_npp filter

2021-11-03 Thread Timo Rothenpieler

On 31.10.2021 14:54, Timo Rothenpieler wrote:

On 31.10.2021 14:35, Timo Rothenpieler wrote:

From: Roman Arzumanyan 

Signed-off-by: Timo Rothenpieler 
---
Here's my revised version of the patch.
It brings its order of operation much more in line with normal 
scale/scale2ref.
Also gets rid of differences in option parsing between the 2ref and 
non-2ref version of the filters.
I also added some more options, like the eval option or size, size it 
was used anyway, just not exposed.


If no further issues or comments arise, I will apply this patch in a 
few days.

I also plan to come up with a similar patch for scale_cuda.


  doc/filters.texi   | 111 
  libavfilter/allfilters.c   |   1 +
  libavfilter/version.h  |   2 +-
  libavfilter/vf_scale_npp.c | 544 ++---
  4 files changed, 618 insertions(+), 40 deletions(-)


The configure/Makefile line for this got somehow lost in rebase.
Added locally.


applied


smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/1] swscale/input: fix planar_rgb16_to_a for gbrap10be and gbrap12be formats

2021-11-03 Thread mindmark
From: Mark Reid 

---
 libswscale/input.c  | 2 +-
 tests/ref/fate/filter-pixfmts-scale | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libswscale/input.c b/libswscale/input.c
index 477dc3d6b2..336f957c8c 100644
--- a/libswscale/input.c
+++ b/libswscale/input.c
@@ -911,7 +911,7 @@ static void planar_rgb_to_uv(uint8_t *_dstU, uint8_t 
*_dstV, const uint8_t *src[
 }
 
 #define rdpx(src) \
-is_be ? AV_RB16(src) : AV_RL16(src)
+(is_be ? AV_RB16(src) : AV_RL16(src))
 static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t 
*_src[4],
int width, int bpc, int is_be, 
int32_t *rgb2yuv)
 {
diff --git a/tests/ref/fate/filter-pixfmts-scale 
b/tests/ref/fate/filter-pixfmts-scale
index 07c4ff536d..1623e5c939 100644
--- a/tests/ref/fate/filter-pixfmts-scale
+++ b/tests/ref/fate/filter-pixfmts-scale
@@ -19,9 +19,9 @@ bgrad8316272bc3a360ef9dff3ecc84520a3
 bgra64be4e6a1b9f9c18b881c27d76611d45f737
 bgra64leefeee0abcc658ebcff049d5e74d74943
 gbrap   4a100f750ac846b34bfeef0d6893c3de
-gbrap10be   dc6aea3559ea4fcdda1ccc4f23d2f2fb
+gbrap10be   50735fbc471a5ac5a6645c85881f3670
 gbrap10le   6e1cba57029fdf0f9d46b5e5cd55112b
-gbrap12be   dbe3a662c016563529032cd4dfb80262
+gbrap12be   58170165829484b3db4a3b9165198987
 gbrap12le   24f5ecb32435b73353517e017c165e31
 gbrap16be   31968e6872a46e8174fb57f8920ed10d
 gbrap16le   8c6758f33671b673b6d30969fc05a23d
-- 
2.29.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] Support for loongson loongarch.

2021-11-03 Thread Michael Niedermayer
On Wed, Nov 03, 2021 at 03:42:19PM +0800, 殷时友 wrote:
> Dose anyone know who is responsible for the fate website?
> I can offer a server to do the fate test on loongarch,
> But I don’t know how to make it work for FFmpeg fate website.

should be described here:
https://ffmpeg.org/fate.html#Submitting-the-results-to-the-FFmpeg-result-aggregation-server
if something is unclear, please ask

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] lavf/mov: Always prefer tfdt over sidx

2021-11-03 Thread Gyan Doshi




On 2021-11-03 03:16 pm, Thilo Borgmann wrote:

Hi,

this effectively reverts 071930de724166bfb90fc6d368c748771188fd94 and fixes the 
underlying issue by always preferring TFDT.

Furthermore, the current solution fails if the -use_tfdt flag is given but no 
TFDT box is found in the stream.


Thanks for the heads-up.

The original impetus for my patch was a client's sample file which had 
rubbish sidx values but sane tfdt ones, likely due to a buggy muxer.

The motivation for an option was to give the user control.

I think hardcoding a reversed preference can lead to the same impasse. 
How about change the default value of use_tfdt and check for tfdt 
presence when enabled?


Regards,
Gyan
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] Fix first_pcr initial update

2021-11-03 Thread lance . lmwang
On Wed, Nov 03, 2021 at 01:01:29PM +0200, Maksym Veremeyenko wrote:
> On 02.11.2021 12:47, Maksym Veremeyenko wrote:
> > One of latest commit 
> > https://source.ffmpeg.org/?p=ffmpeg.git;a=commitdiff;h=6f36eb0da71d22aadf8f056f0966bd86656ea57e
> > claim it fixes endless loop on package generation if muxrate specified
> > and copyts used. But actually it does not work properly if
> > *-mpegts_copyts 1* specified:
> > 
> > ffmpeg -y -copyts -i loewe.ts -c:v libx264 -x264opts
> > nal-hrd=cbr:force-cfr=1 -b:v 3500k -minrate 3500k -maxrate 3500k
> > -bufsize 1000k  -c:a mp2 -f mpegts -mpegts_copyts 1 -muxrate 4500k
> > -vframes 1000 test.ts
> > 
> > ffmpeg generate huge file until it reach zero-based pcr value equal to
> > first dts.
> > 
> 
> updated patch attached
> 
> -- 
> Maksym Veremeyenko

> From 5d6265e84417d7169d9c225be7305c116c33042f Mon Sep 17 00:00:00 2001
> From: Maksym Veremeyenko 
> Date: Wed, 3 Nov 2021 12:57:45 +0200
> Subject: [PATCH] Fix first_pcr initial update
> 
> ---
>  libavformat/mpegtsenc.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
> index 35c835c..dd01628 100644
> --- a/libavformat/mpegtsenc.c
> +++ b/libavformat/mpegtsenc.c
> @@ -1692,12 +1692,12 @@ static int 
> mpegts_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
>  if (side_data)
>  stream_id = side_data[0];
>  
> -if (ts->copyts < 1) {
> -if (!ts->first_dts_checked && dts != AV_NOPTS_VALUE) {
> -ts->first_pcr += dts * 300;
> -ts->first_dts_checked = 1;
> -}
> +if (!ts->first_dts_checked && dts != AV_NOPTS_VALUE) {
> +ts->first_pcr += dts * 300;
> +ts->first_dts_checked = 1;
> +}
>  
> +if (ts->copyts < 1) {
>  if (pts != AV_NOPTS_VALUE)
>  pts += delay;
>  if (dts != AV_NOPTS_VALUE)
> -- 
> 1.8.3.1
> 

LGTM


> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


-- 
Thanks,
Limin Wang
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/libx264: fix sei payload leaks on error

2021-11-03 Thread James Almer

On 11/1/2021 7:03 PM, James Almer wrote:

Signed-off-by: James Almer 
---
  libavcodec/libx264.c | 23 +++
  1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 21f434d06d..0766b4a950 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -293,6 +293,18 @@ static void reconfig_encoder(AVCodecContext *ctx, const 
AVFrame *frame)
  }
  }
  
+static void free_picture(AVCodecContext *ctx)

+{
+X264Context *x4 = ctx->priv_data;
+x264_picture_t *pic = &x4->pic;
+
+for (int i = 0; i < pic->extra_sei.num_payloads; i++)
+av_free(pic->extra_sei.payloads[i].payload);
+av_freep(&pic->extra_sei.payloads);
+av_freep(&pic->prop.quant_offsets);
+pic->extra_sei.num_payloads = 0;
+}
+
  static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame 
*frame,
int *got_packet)
  {
@@ -396,15 +408,17 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, 
const AVFrame *frame,
  roi = (const AVRegionOfInterest*)sd->data;
  roi_size = roi->self_size;
  if (!roi_size || sd->size % roi_size != 0) {
+free_picture(ctx);
  av_log(ctx, AV_LOG_ERROR, "Invalid 
AVRegionOfInterest.self_size.\n");
  return AVERROR(EINVAL);
  }
  nb_rois = sd->size / roi_size;
  
  qoffsets = av_calloc(mbx * mby, sizeof(*qoffsets));

-if (!qoffsets)
+if (!qoffsets) {
+free_picture(ctx);
  return AVERROR(ENOMEM);
-
+}
  // This list must be iterated in reverse because the first
  // region in the list applies when regions overlap.
  for (int i = nb_rois - 1; i >= 0; i--) {
@@ -420,6 +434,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, 
const AVFrame *frame,
  
  if (roi->qoffset.den == 0) {

  av_free(qoffsets);
+free_picture(ctx);
  av_log(ctx, AV_LOG_ERROR, 
"AVRegionOfInterest.qoffset.den must not be zero.\n");
  return AVERROR(EINVAL);
  }
@@ -452,7 +467,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, 
const AVFrame *frame,
  continue;
  tmp = av_fast_realloc(sei->payloads, &sei_data_size, 
(sei->num_payloads + 1) * sizeof(*sei_payload));
  if (!tmp) {
-av_freep(&x4->pic.prop.quant_offsets);
+free_picture(ctx);
  return AVERROR(ENOMEM);
  }
  sei->payloads = tmp;
@@ -460,7 +475,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, 
const AVFrame *frame,
  sei_payload = &sei->payloads[sei->num_payloads];
  sei_payload->payload = av_memdup(side_data->data, 
side_data->size);
  if (!sei_payload->payload) {
-av_freep(&x4->pic.prop.quant_offsets);
+free_picture(ctx);
  return AVERROR(ENOMEM);
  }
  sei_payload->payload_size = side_data->size;


Will apply.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] Fix first_pcr initial update

2021-11-03 Thread Maksym Veremeyenko

On 02.11.2021 12:47, Maksym Veremeyenko wrote:
One of latest commit 
https://source.ffmpeg.org/?p=ffmpeg.git;a=commitdiff;h=6f36eb0da71d22aadf8f056f0966bd86656ea57e 
claim it fixes endless loop on package generation if muxrate specified 
and copyts used. But actually it does not work properly if 
*-mpegts_copyts 1* specified:


ffmpeg -y -copyts -i loewe.ts -c:v libx264 -x264opts 
nal-hrd=cbr:force-cfr=1 -b:v 3500k -minrate 3500k -maxrate 3500k 
-bufsize 1000k  -c:a mp2 -f mpegts -mpegts_copyts 1 -muxrate 4500k 
-vframes 1000 test.ts


ffmpeg generate huge file until it reach zero-based pcr value equal to 
first dts.




updated patch attached

--
Maksym Veremeyenko
From 5d6265e84417d7169d9c225be7305c116c33042f Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko 
Date: Wed, 3 Nov 2021 12:57:45 +0200
Subject: [PATCH] Fix first_pcr initial update

---
 libavformat/mpegtsenc.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 35c835c..dd01628 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1692,12 +1692,12 @@ static int mpegts_write_packet_internal(AVFormatContext 
*s, AVPacket *pkt)
 if (side_data)
 stream_id = side_data[0];
 
-if (ts->copyts < 1) {
-if (!ts->first_dts_checked && dts != AV_NOPTS_VALUE) {
-ts->first_pcr += dts * 300;
-ts->first_dts_checked = 1;
-}
+if (!ts->first_dts_checked && dts != AV_NOPTS_VALUE) {
+ts->first_pcr += dts * 300;
+ts->first_dts_checked = 1;
+}
 
+if (ts->copyts < 1) {
 if (pts != AV_NOPTS_VALUE)
 pts += delay;
 if (dts != AV_NOPTS_VALUE)
-- 
1.8.3.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] Fix first_pcr initial update

2021-11-03 Thread Maksym Veremeyenko

On 03.11.2021 11:19, lance.lmw...@gmail.com wrote:

On Tue, Nov 02, 2021 at 05:36:37PM +0200, Maksym Veremeyenko wrote:

On 02.11.2021 16:59, lance.lmw...@gmail.com wrote:
[...]

+if (!ts->first_dts_checked && dts != AV_NOPTS_VALUE) {
+ts->first_pcr += dts * 300;
+ts->first_dts_checked = 1;
+}
+


I think it's not same as the old code, the first_pcr will add extra delay if 
copyts is
0.

[...]


try with below command:
  ./ffmpeg -y -copyts -i http://samples.ffmpeg.org/MPEG2/foxksaz.ts -c:v 
libx264 -x264opts nal-hrd=cbr:force-cfr=1 \
-b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 1000k  -c:a mp2 -f mpegts \
-mpegts_copyts 0 -muxrate 4500k -vframes 1000 test.ts

You'll get some "dts < pcr, TS is invalid" message.




yes, you are correct, in my tests s->max_delay was always 0 so i did not 
payed attention on order.


--
Maksym Veremeyenko

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] lavf/mov: Always prefer tfdt over sidx

2021-11-03 Thread Thilo Borgmann
Hi,

this effectively reverts 071930de724166bfb90fc6d368c748771188fd94 and fixes the 
underlying issue by always preferring TFDT.

Furthermore, the current solution fails if the -use_tfdt flag is given but no 
TFDT box is found in the stream.

-Thilo
From 1ae6d7f213d0ba2360b9b1cf7fde2e3d0adde70d Mon Sep 17 00:00:00 2001
From: Thilo Borgmann 
Date: Tue, 2 Nov 2021 22:49:37 +0100
Subject: [PATCH] lavf/mov: Always prefer tfdt over sidx

---
 doc/demuxers.texi  |  6 --
 libavformat/isom.h |  1 -
 libavformat/mov.c  | 12 +---
 3 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index 1c9575b2e8..fa669f88fe 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -689,12 +689,6 @@ Set mfra timestamps as PTS
 Don't use mfra box to set timestamps
 @end table
 
-@item use_tfdt
-For fragmented input, set fragment's starting timestamp to 
@code{baseMediaDecodeTime} from the @code{tfdt} box.
-Default is disabled, which will preferentially use the 
@code{earliest_presentation_time} from the @code{sidx} box.
-In either case, the timestamp from the @code{mfra} box will be used if it's 
available and @code{use_mfra_for} is
-set to pts or dts.
-
 @item export_all
 Export unrecognized boxes within the @var{udta} box as metadata entries. The 
first four
 characters of the box type are set as the key. Default is false.
diff --git a/libavformat/isom.h b/libavformat/isom.h
index f3c18c95be..55e5fa7b23 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -279,7 +279,6 @@ typedef struct MOVContext {
 int moov_retry;
 int use_mfra_for;
 int has_looked_for_mfra;
-int use_tfdt;
 MOVFragmentIndex frag_index;
 int atom_depth;
 unsigned int aax_mode;  ///< 'aax' file has been detected
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 3fcb1dc908..00205bb1be 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4828,16 +4828,16 @@ static int mov_read_trun(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 dts = frag_stream_info->first_tfra_pts;
 av_log(c->fc, AV_LOG_DEBUG, "found mfra time %"PRId64
 ", using it for dts\n", pts);
-} else if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE && 
!c->use_tfdt) {
+} else if (frag_stream_info->tfdt_dts != AV_NOPTS_VALUE) {
+dts = frag_stream_info->tfdt_dts - sc->time_offset;
+av_log(c->fc, AV_LOG_DEBUG, "found tfdt time %"PRId64
+", using it for dts\n", dts);
+} else if (frag_stream_info->sidx_pts != AV_NOPTS_VALUE) {
 // FIXME: sidx earliest_presentation_time is *PTS*, s.b.
 // pts = frag_stream_info->sidx_pts;
 dts = frag_stream_info->sidx_pts - sc->time_offset;
 av_log(c->fc, AV_LOG_DEBUG, "found sidx time %"PRId64
 ", using it for pts\n", pts);
-} else if (frag_stream_info->tfdt_dts != AV_NOPTS_VALUE) {
-dts = frag_stream_info->tfdt_dts - sc->time_offset;
-av_log(c->fc, AV_LOG_DEBUG, "found tfdt time %"PRId64
-", using it for dts\n", dts);
 } else {
 dts = sc->track_end - sc->time_offset;
 av_log(c->fc, AV_LOG_DEBUG, "found track end time %"PRId64
@@ -8533,8 +8533,6 @@ static const AVOption mov_options[] = {
 FLAGS, "use_mfra_for" },
 {"pts", "pts", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_MFRA_PTS}, 0, 0,
 FLAGS, "use_mfra_for" },
-{"use_tfdt", "use tfdt for fragment timestamps", OFFSET(use_tfdt), 
AV_OPT_TYPE_BOOL, {.i64 = 0},
-0, 1, FLAGS},
 { "export_all", "Export unrecognized metadata entries", OFFSET(export_all),
 AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags = FLAGS },
 { "export_xmp", "Export full XMP metadata", OFFSET(export_xmp),
-- 
2.20.1 (Apple Git-117)

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] Fix first_pcr initial update

2021-11-03 Thread lance . lmwang
On Tue, Nov 02, 2021 at 05:36:37PM +0200, Maksym Veremeyenko wrote:
> On 02.11.2021 16:59, lance.lmw...@gmail.com wrote:
> [...]
> > > +if (!ts->first_dts_checked && dts != AV_NOPTS_VALUE) {
> > > +ts->first_pcr += dts * 300;
> > > +ts->first_dts_checked = 1;
> > > +}
> > > +
> > 
> > I think it's not same as the old code, the first_pcr will add extra delay 
> > if copyts is
> > 0.
> > 
> 
> proposed patch extend updating ts->first_pcr not only when copyts is 0 but
> when copyts is 1 (*-mpegts_copyts 1* specified)
> 
> very similar issue i found at
> http://ffmpeg.org/pipermail/ffmpeg-devel/2019-April/242766.html
> 
I mean you need move the code before if (ts->copyts < 1) { instead of after.

try with below command:
 ./ffmpeg -y -copyts -i http://samples.ffmpeg.org/MPEG2/foxksaz.ts -c:v libx264 
-x264opts nal-hrd=cbr:force-cfr=1 \
-b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 1000k  -c:a mp2 -f mpegts \
-mpegts_copyts 0 -muxrate 4500k -vframes 1000 test.ts

You'll get some "dts < pcr, TS is invalid" message.


> -- 
> Maksym Veremeyenko
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

-- 
Thanks,
Limin Wang
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] Support for loongson loongarch.

2021-11-03 Thread 殷时友
Dose anyone know who is responsible for the fate website?
I can offer a server to do the fate test on loongarch,
But I don’t know how to make it work for FFmpeg fate website.

> 2021年11月2日 下午8:51,殷时友  写道:
> 
> Hello
> 
> I am trying to add support for loongarch(a new architecture launched by 
> Loongson) in ffmpeg, 
> Should I donate a test machine or just offer a qemu before uploading patches?
> Alos, who should I contact if I want to add loongarch state into 
> fate.ffmpeg.org .
> Any other suggestions or precautions will be appreciated.
> 
> About loongarch:
> Manual can be found here: https://github.com/loongson/LoongArch-Documentation 
> 
> Applying cloud host  is available in here: http://www.loongcloud.com.cn/ 
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".