[FFmpeg-devel] [PATCH 2/2] aacdec: fix single-sample delay for SBR streams

2023-12-03 Thread Lynne
Our SBR implementation introduces a single sample of latency into the
output, which is currently never skipped.
This delay is separate from any container skip value and always present,
as it is from an additional part of the decoding process.

Fixes Trac issue #9667

>From 5b9d971b108677d54bc3aac317669007462dbcc9 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Mon, 30 Oct 2023 05:40:22 +0100
Subject: [PATCH 2/2] aacdec: fix single-sample delay for SBR streams

Our SBR implementation introduces a single sample of latency into the
output, which is currently never skipped.
This delay is separate from any container skip value and always present,
as it is from an additional part of the decoding process.

Fixes Trac issue #9667
---
 libavcodec/aac.h |  1 +
 libavcodec/aacdec_template.c | 23 ++-
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/libavcodec/aac.h b/libavcodec/aac.h
index 285d3b7482..06aecf 100644
--- a/libavcodec/aac.h
+++ b/libavcodec/aac.h
@@ -298,6 +298,7 @@ struct AACContext {
 AVCodecContext *avctx;
 AVFrame *frame;
 
+int skip_samples;
 int is_saved; ///< Set if elements have stored overlap from previous frame.
 DynamicRangeControl che_drc;
 
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 2b3509c85f..a82cd69a60 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -529,6 +529,8 @@ static void flush(AVCodecContext *avctx)
 }
 }
 }
+
+ac->skip_samples = 1;
 }
 
 /**
@@ -1222,6 +1224,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx)
 return AVERROR(ENOMEM);
 }
 
+ac->skip_samples = 1;
 ac->random_state = 0x1f2e3d4c;
 
 #define MDCT_INIT(s, fn, len, sval)\
@@ -2390,7 +2393,7 @@ static int decode_dynamic_range(DynamicRangeControl *che_drc,
 
 static int decode_fill(AACContext *ac, GetBitContext *gb, int len) {
 uint8_t buf[256];
-int i, major, minor;
+int i;
 
 if (len < 13+7*8)
 goto unknown;
@@ -2404,10 +2407,6 @@ static int decode_fill(AACContext *ac, GetBitContext *gb, int len) {
 if (ac->avctx->debug & FF_DEBUG_PICT_INFO)
 av_log(ac->avctx, AV_LOG_DEBUG, "FILL:%s\n", buf);
 
-if (sscanf(buf, "libfaac %d.%d", , ) == 2){
-ac->avctx->internal->skip_samples = 1024;
-}
-
 unknown:
 skip_bits_long(gb, len);
 
@@ -3374,6 +3373,20 @@ static int aac_decode_frame(AVCodecContext *avctx, AVFrame *frame,
 if (buf[buf_offset])
 break;
 
+if (ac->skip_samples) {
+int skip = 0;
+
+/* Our SBR implementation introduces a sample of delay into the output. */
+if (ac->oc[1].m4ac.sbr)
+skip = 1;
+
+err = ff_decode_skip_samples(avctx, frame, skip);
+if (err < 0)
+return err;
+
+ac->skip_samples = 0;
+}
+
 return buf_size > buf_offset ? buf_consumed : buf_size;
 }
 
-- 
2.43.0

___
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] decode: add ff_decode_skip_samples function

2023-12-03 Thread Lynne
This is a convenience function, which is required to be called by decoders
needing to skip samples every time.
It automatically creates and increments side data.

This function is a simplified version of an earlier patch. It is only
able to add additional delay, rather than insert or override any.

>From 3045ac286538641076ce4547cda677c3b159877f Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Mon, 30 Oct 2023 05:38:17 +0100
Subject: [PATCH 1/2] decode: add ff_decode_skip_samples function

This is a convenience function, which is required to be called by decoders
needing to skip samples every time.
It automatically creates and increments side data.

This function is a simplified version of an earlier patch. It is only
able to add additional delay, rather than insert or override any.
---
 libavcodec/decode.c | 17 +
 libavcodec/decode.h |  8 
 2 files changed, 25 insertions(+)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 2cfb3fcf97..450d63d947 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -299,6 +299,23 @@ static int64_t guess_correct_pts(AVCodecContext *ctx,
 return pts;
 }
 
+int ff_decode_skip_samples(AVCodecContext *avctx, AVFrame *frame, uint32_t skip)
+{
+uint32_t val = 0;
+AVFrameSideData *side = av_frame_get_side_data(frame, AV_FRAME_DATA_SKIP_SAMPLES);
+if (!side) {
+side = av_frame_new_side_data(frame, AV_FRAME_DATA_SKIP_SAMPLES, 10);
+if (!side)
+return AVERROR(ENOMEM);
+}
+
+val += AV_RL32(side->data);
+val += skip;
+AV_WL32(side->data, val);
+
+return 0;
+}
+
 static int discard_samples(AVCodecContext *avctx, AVFrame *frame, int64_t *discarded_samples)
 {
 AVCodecInternal *avci = avctx->internal;
diff --git a/libavcodec/decode.h b/libavcodec/decode.h
index daf1a67444..c83476208c 100644
--- a/libavcodec/decode.h
+++ b/libavcodec/decode.h
@@ -155,4 +155,12 @@ int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_pr
 const AVPacketSideData *ff_get_coded_side_data(const AVCodecContext *avctx,
enum AVPacketSideDataType type);
 
+/**
+ * Skip samples in an AVFrame.
+ *
+ * @param skip amount of samples to skip unconditionally
+ */
+int ff_decode_skip_samples(AVCodecContext *avctx, AVFrame *frame,
+   uint32_t skip);
+
 #endif /* AVCODEC_DECODE_H */
-- 
2.43.0

___
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] lavc/Makefile: build vulkan decode code if vulkan_av1 has been enabled

2023-12-03 Thread Lynne
Dec 3, 2023, 21:23 by ngomp...@gmail.com:

> On Sun, Dec 3, 2023 at 3:06 PM Lynne  wrote:
>
>>
>> Fixes builds with only vulkan_av1 enabled.
>>
>
> Thanks for this fix!
>
> Reviewed-by: Neal Gompa 
> Tested-by: Neal Gompa 
>

Pushed, thanks.
___
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 4/4] libavfilter/vf_dnn_detect: Add yolov4 support

2023-12-03 Thread wenbin . chen-at-intel . com
From: Wenbin Chen 

The difference of yolov4 is that sigmoid function needed to be applied
on x, y coordinates. Also make it compatiple with NHWC output as the
yolov4 model from openvino model zoo has NHWC output layout.

Model refer to: 
https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/yolo-v4-tf

Signed-off-by: Wenbin Chen 
---
 libavfilter/vf_dnn_detect.c | 71 ++---
 1 file changed, 59 insertions(+), 12 deletions(-)

diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c
index 7a32b191c3..1b04a2cb98 100644
--- a/libavfilter/vf_dnn_detect.c
+++ b/libavfilter/vf_dnn_detect.c
@@ -35,7 +35,8 @@
 typedef enum {
 DDMT_SSD,
 DDMT_YOLOV1V2,
-DDMT_YOLOV3
+DDMT_YOLOV3,
+DDMT_YOLOV4
 } DNNDetectionModelType;
 
 typedef struct DnnDetectContext {
@@ -75,6 +76,7 @@ static const AVOption dnn_detect_options[] = {
 { "ssd", "output shape [1, 1, N, 7]",  0,
AV_OPT_TYPE_CONST,   { .i64 = DDMT_SSD },0, 0, FLAGS, "model_type" },
 { "yolo","output shape [1, N*Cx*Cy*DetectionBox]",  0,   
AV_OPT_TYPE_CONST,   { .i64 = DDMT_YOLOV1V2 },0, 0, FLAGS, "model_type" 
},
 { "yolov3",  "outputs shape [1, N*D, Cx, Cy]",  0,   
AV_OPT_TYPE_CONST,   { .i64 = DDMT_YOLOV3 },  0, 0, FLAGS, "model_type" 
},
+{ "yolov4",  "outputs shape [1, N*D, Cx, Cy]",  0,   
AV_OPT_TYPE_CONST,   { .i64 = DDMT_YOLOV4 },0, 0, FLAGS, "model_type" },
 { "cell_w",  "cell width", OFFSET2(cell_w),  
AV_OPT_TYPE_INT,   { .i64 = 0 },0, INTMAX_MAX, FLAGS },
 { "cell_h",  "cell height",OFFSET2(cell_h),  
AV_OPT_TYPE_INT,   { .i64 = 0 },0, INTMAX_MAX, FLAGS },
 { "nb_classes",  "The number of class",OFFSET2(nb_classes),  
AV_OPT_TYPE_INT,   { .i64 = 0 },0, INTMAX_MAX, FLAGS },
@@ -84,6 +86,14 @@ static const AVOption dnn_detect_options[] = {
 
 AVFILTER_DEFINE_CLASS(dnn_detect);
 
+static inline float sigmoid(float x) {
+return 1.f / (1.f + exp(-x));
+}
+
+static inline float linear(float x) {
+return x;
+}
+
 static int dnn_detect_get_label_id(int nb_classes, int cell_size, float 
*label_data)
 {
 float max_prob = 0;
@@ -142,6 +152,8 @@ static int dnn_detect_parse_yolo_output(AVFrame *frame, 
DNNData *output, int out
 float *output_data = output[output_index].data;
 float *anchors = ctx->anchors;
 AVDetectionBBox *bbox;
+float (*post_process_raw_data)(float x);
+int is_NHWC = 0;
 
 if (ctx->model_type == DDMT_YOLOV1V2) {
 cell_w = ctx->cell_w;
@@ -149,13 +161,30 @@ static int dnn_detect_parse_yolo_output(AVFrame *frame, 
DNNData *output, int out
 scale_w = cell_w;
 scale_h = cell_h;
 } else {
-cell_w = output[output_index].width;
-cell_h = output[output_index].height;
+if (output[output_index].height != output[output_index].width &&
+output[output_index].height == output[output_index].channels) {
+is_NHWC = 1;
+cell_w = output[output_index].height;
+cell_h = output[output_index].channels;
+} else {
+cell_w = output[output_index].width;
+cell_h = output[output_index].height;
+}
 scale_w = ctx->scale_width;
 scale_h = ctx->scale_height;
 }
 box_size = nb_classes + 5;
 
+switch (ctx->model_type) {
+case DDMT_YOLOV1V2:
+case DDMT_YOLOV3:
+post_process_raw_data = linear;
+break;
+case DDMT_YOLOV4:
+post_process_raw_data = sigmoid;
+ break;
+}
+
 if (!cell_h || !cell_w) {
 av_log(filter_ctx, AV_LOG_ERROR, "cell_w and cell_h are detected\n");
 return AVERROR(EINVAL);
@@ -193,19 +222,36 @@ static int dnn_detect_parse_yolo_output(AVFrame *frame, 
DNNData *output, int out
 float *detection_boxes_data;
 int label_id;
 
-detection_boxes_data = output_data + box_id * box_size * 
cell_w * cell_h;
-conf = detection_boxes_data[cy * cell_w + cx + 4 * cell_w * 
cell_h];
+if (is_NHWC) {
+detection_boxes_data = output_data +
+((cy * cell_w + cx) * detection_boxes + box_id) * 
box_size;
+conf = post_process_raw_data(detection_boxes_data[4]);
+} else {
+detection_boxes_data = output_data + box_id * box_size * 
cell_w * cell_h;
+conf = post_process_raw_data(
+detection_boxes_data[cy * cell_w + cx + 4 * 
cell_w * cell_h]);
+}
 if (conf < conf_threshold) {
 continue;
 }
 
-x= detection_boxes_data[cy * cell_w + cx];
-y= detection_boxes_data[cy * cell_w + cx + 

[FFmpeg-devel] [PATCH 3/4] libavfilter/vf_dnn_detect: Add yolov3 support

2023-12-03 Thread wenbin . chen-at-intel . com
From: Wenbin Chen 

Add yolov3 support. The difference of yolov3 is that it has multiple
outputs in different scale to perform better on both large and small
object.

The model detail refer to: 
https://github.com/openvinotoolkit/open_model_zoo/tree/master/models/public/yolo-v3-tf

Signed-off-by: Wenbin Chen 
---
 libavfilter/vf_dnn_detect.c | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c
index 86f61c9907..7a32b191c3 100644
--- a/libavfilter/vf_dnn_detect.c
+++ b/libavfilter/vf_dnn_detect.c
@@ -35,6 +35,7 @@
 typedef enum {
 DDMT_SSD,
 DDMT_YOLOV1V2,
+DDMT_YOLOV3
 } DNNDetectionModelType;
 
 typedef struct DnnDetectContext {
@@ -73,6 +74,7 @@ static const AVOption dnn_detect_options[] = {
 { "model_type",  "DNN detection model type",   OFFSET2(model_type),  
AV_OPT_TYPE_INT,   { .i64 = DDMT_SSD },INT_MIN, INT_MAX, FLAGS, 
"model_type" },
 { "ssd", "output shape [1, 1, N, 7]",  0,
AV_OPT_TYPE_CONST,   { .i64 = DDMT_SSD },0, 0, FLAGS, "model_type" },
 { "yolo","output shape [1, N*Cx*Cy*DetectionBox]",  0,   
AV_OPT_TYPE_CONST,   { .i64 = DDMT_YOLOV1V2 },0, 0, FLAGS, "model_type" 
},
+{ "yolov3",  "outputs shape [1, N*D, Cx, Cy]",  0,   
AV_OPT_TYPE_CONST,   { .i64 = DDMT_YOLOV3 },  0, 0, FLAGS, "model_type" 
},
 { "cell_w",  "cell width", OFFSET2(cell_w),  
AV_OPT_TYPE_INT,   { .i64 = 0 },0, INTMAX_MAX, FLAGS },
 { "cell_h",  "cell height",OFFSET2(cell_h),  
AV_OPT_TYPE_INT,   { .i64 = 0 },0, INTMAX_MAX, FLAGS },
 { "nb_classes",  "The number of class",OFFSET2(nb_classes),  
AV_OPT_TYPE_INT,   { .i64 = 0 },0, INTMAX_MAX, FLAGS },
@@ -146,6 +148,11 @@ static int dnn_detect_parse_yolo_output(AVFrame *frame, 
DNNData *output, int out
 cell_h = ctx->cell_h;
 scale_w = cell_w;
 scale_h = cell_h;
+} else {
+cell_w = output[output_index].width;
+cell_h = output[output_index].height;
+scale_w = ctx->scale_width;
+scale_h = ctx->scale_height;
 }
 box_size = nb_classes + 5;
 
@@ -173,6 +180,7 @@ static int dnn_detect_parse_yolo_output(AVFrame *frame, 
DNNData *output, int out
   output[output_index].height *
   output[output_index].width / box_size / cell_w / cell_h;
 
+anchors = anchors + (detection_boxes * output_index * 2);
 /**
  * find all candidate bbox
  * yolo output can be reshaped to [B, N*D, Cx, Cy]
@@ -284,6 +292,21 @@ static int dnn_detect_post_proc_yolo(AVFrame *frame, 
DNNData *output, AVFilterCo
 return 0;
 }
 
+static int dnn_detect_post_proc_yolov3(AVFrame *frame, DNNData *output,
+   AVFilterContext *filter_ctx, int 
nb_outputs)
+{
+int ret = 0;
+for (int i = 0; i < nb_outputs; i++) {
+ret = dnn_detect_parse_yolo_output(frame, output, i, filter_ctx);
+if (ret < 0)
+return ret;
+}
+ret = dnn_detect_fill_side_data(frame, filter_ctx);
+if (ret < 0)
+return ret;
+return 0;
+}
+
 static int dnn_detect_post_proc_ssd(AVFrame *frame, DNNData *output, 
AVFilterContext *filter_ctx)
 {
 DnnDetectContext *ctx = filter_ctx->priv;
@@ -380,8 +403,11 @@ static int dnn_detect_post_proc_ov(AVFrame *frame, DNNData 
*output, int nb_outpu
 ret = dnn_detect_post_proc_yolo(frame, output, filter_ctx);
 if (ret < 0)
 return ret;
+case DDMT_YOLOV3:
+ret = dnn_detect_post_proc_yolov3(frame, output, filter_ctx, 
nb_outputs);
+if (ret < 0)
+return ret;
 }
-
 return 0;
 }
 
-- 
2.34.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] libavfilter/vf_dnn_detect: Add input pad

2023-12-03 Thread wenbin . chen-at-intel . com
From: Wenbin Chen 

Add input pad to get model input resolution. Detection models always
have fixed input size. And the output coordinators are based on the
input resolution, so we need to get input size to map coordinators to
our real output frames.

Signed-off-by: Wenbin Chen 
---
 libavfilter/dnn/dnn_backend_openvino.c | 24 --
 libavfilter/vf_dnn_detect.c| 28 +-
 2 files changed, 45 insertions(+), 7 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_openvino.c 
b/libavfilter/dnn/dnn_backend_openvino.c
index 089e028818..671a995c70 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -1073,9 +1073,15 @@ static int get_input_ov(void *model, DNNData *input, 
const char *input_name)
 return AVERROR(ENOSYS);
 }
 
-input->channels = dims[1];
-input->height   = input_resizable ? -1 : dims[2];
-input->width= input_resizable ? -1 : dims[3];
+if (dims[1] <= 3) { // NCHW
+input->channels = dims[1];
+input->height   = input_resizable ? -1 : dims[2];
+input->width= input_resizable ? -1 : dims[3];
+} else { // NHWC
+input->height   = input_resizable ? -1 : dims[1];
+input->width= input_resizable ? -1 : dims[2];
+input->channels = dims[3];
+}
 input->dt   = precision_to_datatype(precision);
 
 return 0;
@@ -1105,9 +,15 @@ static int get_input_ov(void *model, DNNData *input, 
const char *input_name)
 return DNN_GENERIC_ERROR;
 }
 
-input->channels = dims.dims[1];
-input->height   = input_resizable ? -1 : dims.dims[2];
-input->width= input_resizable ? -1 : dims.dims[3];
+if (dims[1] <= 3) { // NCHW
+input->channels = dims[1];
+input->height   = input_resizable ? -1 : dims[2];
+input->width= input_resizable ? -1 : dims[3];
+} else { // NHWC
+input->height   = input_resizable ? -1 : dims[1];
+input->width= input_resizable ? -1 : dims[2];
+input->channels = dims[3];
+}
 input->dt   = precision_to_datatype(precision);
 return 0;
 }
diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c
index 373dda58bf..86f61c9907 100644
--- a/libavfilter/vf_dnn_detect.c
+++ b/libavfilter/vf_dnn_detect.c
@@ -699,13 +699,39 @@ static av_cold void dnn_detect_uninit(AVFilterContext 
*context)
 free_detect_labels(ctx);
 }
 
+static int config_input(AVFilterLink *inlink)
+{
+AVFilterContext *context = inlink->dst;
+DnnDetectContext *ctx = context->priv;
+DNNData model_input;
+int ret;
+
+ret = ff_dnn_get_input(>dnnctx, _input);
+if (ret != 0) {
+av_log(ctx, AV_LOG_ERROR, "could not get input from the model\n");
+return ret;
+}
+ctx->scale_width = model_input.width == -1 ? inlink->w : model_input.width;
+ctx->scale_height = model_input.height ==  -1 ? inlink->h : 
model_input.height;
+
+return 0;
+}
+
+static const AVFilterPad dnn_detect_inputs[] = {
+{
+.name = "default",
+.type = AVMEDIA_TYPE_VIDEO,
+.config_props = config_input,
+},
+};
+
 const AVFilter ff_vf_dnn_detect = {
 .name  = "dnn_detect",
 .description   = NULL_IF_CONFIG_SMALL("Apply DNN detect filter to the 
input."),
 .priv_size = sizeof(DnnDetectContext),
 .init  = dnn_detect_init,
 .uninit= dnn_detect_uninit,
-FILTER_INPUTS(ff_video_default_filterpad),
+FILTER_INPUTS(dnn_detect_inputs),
 FILTER_OUTPUTS(ff_video_default_filterpad),
 FILTER_PIXFMTS_ARRAY(pix_fmts),
 .priv_class= _detect_class,
-- 
2.34.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] libavfiter/dnn/dnn_backend_openvino: add multiple output support

2023-12-03 Thread wenbin . chen-at-intel . com
From: Wenbin Chen 

Add multiple output support to openvino backend. You can use '&' to
split different output when you set output name using command line.

Signed-off-by: Wenbin Chen 
---
 libavfilter/dnn/dnn_backend_common.c   |   7 -
 libavfilter/dnn/dnn_backend_openvino.c | 216 +
 libavfilter/vf_dnn_detect.c|  11 +-
 3 files changed, 150 insertions(+), 84 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_common.c 
b/libavfilter/dnn/dnn_backend_common.c
index 91a4a3c4bf..632832ec36 100644
--- a/libavfilter/dnn/dnn_backend_common.c
+++ b/libavfilter/dnn/dnn_backend_common.c
@@ -43,13 +43,6 @@ int ff_check_exec_params(void *ctx, DNNBackendType backend, 
DNNFunctionType func
 return AVERROR(EINVAL);
 }
 
-if (exec_params->nb_output != 1 && backend != DNN_TF) {
-// currently, the filter does not need multiple outputs,
-// so we just pending the support until we really need it.
-avpriv_report_missing_feature(ctx, "multiple outputs");
-return AVERROR(ENOSYS);
-}
-
 return 0;
 }
 
diff --git a/libavfilter/dnn/dnn_backend_openvino.c 
b/libavfilter/dnn/dnn_backend_openvino.c
index 6fe8b9c243..089e028818 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -64,7 +64,7 @@ typedef struct OVModel{
 ov_compiled_model_t *compiled_model;
 ov_output_const_port_t* input_port;
 ov_preprocess_input_info_t* input_info;
-ov_output_const_port_t* output_port;
+ov_output_const_port_t** output_ports;
 ov_preprocess_output_info_t* output_info;
 ov_preprocess_prepostprocessor_t* preprocess;
 #else
@@ -77,6 +77,7 @@ typedef struct OVModel{
 SafeQueue *request_queue;   // holds OVRequestItem
 Queue *task_queue;  // holds TaskItem
 Queue *lltask_queue; // holds LastLevelTaskItem
+int nb_outputs;
 } OVModel;
 
 // one request for one call to openvino
@@ -349,7 +350,7 @@ static void infer_completion_callback(void *args)
 TaskItem *task = lltask->task;
 OVModel *ov_model = task->model;
 SafeQueue *requestq = ov_model->request_queue;
-DNNData output;
+DNNData *outputs;
 OVContext *ctx = _model->ctx;
 #if HAVE_OPENVINO2
 size_t* dims;
@@ -358,45 +359,61 @@ static void infer_completion_callback(void *args)
 ov_shape_t output_shape = {0};
 ov_element_type_e precision;
 
-memset(, 0, sizeof(output));
-status = 
ov_infer_request_get_output_tensor_by_index(request->infer_request, 0, 
_tensor);
-if (status != OK) {
-av_log(ctx, AV_LOG_ERROR,
-   "Failed to get output tensor.");
+outputs = av_calloc(ov_model->nb_outputs, sizeof(*outputs));
+if (!outputs) {
+av_log(ctx, AV_LOG_ERROR, "Failed to alloc outputs.");
 return;
 }
 
-status = ov_tensor_data(output_tensor, );
-if (status != OK) {
-av_log(ctx, AV_LOG_ERROR,
-   "Failed to get output data.");
-return;
-}
+for (int i = 0; i < ov_model->nb_outputs; i++) {
+status = 
ov_infer_request_get_tensor_by_const_port(request->infer_request,
+   
ov_model->output_ports[i],
+   _tensor);
+if (status != OK) {
+av_log(ctx, AV_LOG_ERROR,
+"Failed to get output tensor.");
+goto end;
+}
 
-status = ov_tensor_get_shape(output_tensor, _shape);
-if (status != OK) {
-av_log(ctx, AV_LOG_ERROR, "Failed to get output port shape.\n");
-return;
-}
-dims = output_shape.dims;
+status = ov_tensor_data(output_tensor, [i].data);
+if (status != OK) {
+av_log(ctx, AV_LOG_ERROR,
+"Failed to get output data.");
+goto end;
+}
 
-status = ov_port_get_element_type(ov_model->output_port, );
-if (status != OK) {
-av_log(ctx, AV_LOG_ERROR, "Failed to get output port data type.\n");
+status = ov_tensor_get_shape(output_tensor, _shape);
+if (status != OK) {
+av_log(ctx, AV_LOG_ERROR, "Failed to get output port shape.\n");
+goto end;
+}
+dims = output_shape.dims;
+
+status = ov_port_get_element_type(ov_model->output_ports[i], 
);
+if (status != OK) {
+av_log(ctx, AV_LOG_ERROR, "Failed to get output port data 
type.\n");
+goto end;
+}
+outputs[i].dt   = precision_to_datatype(precision);
+
+outputs[i].channels = output_shape.rank > 2 ? dims[output_shape.rank - 
3] : 1;
+outputs[i].height   = output_shape.rank > 1 ? dims[output_shape.rank - 
2] : 1;
+outputs[i].width= output_shape.rank > 0 ? dims[output_shape.rank - 
1] : 1;
+av_assert0(request->lltask_count <= dims[0]);
+outputs[i].layout   = ctx->options.layout;
+outputs[i].scale= ctx->options.scale;

Re: [FFmpeg-devel] [PATCH] libavformat/vvc: Make probe more conservative

2023-12-03 Thread Nuo Mi
>
>  return 0;
>
> -if ((nal2 & 0x7) == 0) // nuh_temporal_id_plus1
> +if (nuh_temporal_id_plus1 == 0) // nuh_temporal_id_plus1
> +return 0;
> +if (nuh_temporal_id_plus1 != 1 && (type >= VVC_IDR_W_RADL &&
> type <= VVC_RSV_IRAP_11
> +|| type == VVC_DCI_NUT ||
> type == VVC_OPI_NUT
> +|| type == VVC_VPS_NUT ||
> type == VVC_SPS_NUT
> +|| type == VVC_EOS_NUT ||
> type == VVC_EOB_NUT))
>
Hi Frank,
Thank you for the patch.
You can use a function for these two checks.

 if (!check_temporal_id(nal2 & 0x7, type))
return 0


 return 0;
>
>  switch (type) {
> --
> 2.43.0
>
> ___
> 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".


Re: [FFmpeg-devel] [PATCH] configure: don't warn deprecated symbols from libvpl

2023-12-03 Thread Xiang, Haihao
On Ma, 2023-11-27 at 16:11 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> libvpl deprecated some symbols (e.g. MFX_EXTBUFF_VPP_DENOISE2 is used to
> replace MFX_EXTBUFF_VPP_DENOISE), however the new symbols aren't support
> by MediaSDK runtime. In order to support the combination of libvpl and
> MediaSDK runtime on legacy devices, we continue to use the deprecated
> symbols in FFmpeg. This patch added -DMFX_DEPRECATED_OFF to CFLAGS to
> silence the corresponding compilation warnings.
> 
> Signed-off-by: Haihao Xiang 
> ---
>  configure | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configure b/configure
> index 838e627084..d77c053226 100755
> --- a/configure
> +++ b/configure
> @@ -6776,6 +6776,7 @@ elif enabled libvpl; then
>  # is extracted from "vpl >= 2.6"
>  check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad
> || \
>  die "ERROR: libvpl >= 2.6 not found"
> +    add_cflags -DMFX_DEPRECATED_OFF
>  fi
>  
>  if enabled libmfx; then

Will apply,

Thanks
Haihao
___
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 v2] lavu/hwcontext_qsv: use mfxImplDescription instead of mfxExtendedDeviceId on Linux

2023-12-03 Thread Xiang, Haihao
On Ma, 2023-11-27 at 13:37 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> mfxExtendedDeviceId mightn't be supported in certain configurations of
> oneVPL on Linux, so we can't ensure a property filter for
> mfxExtendedDeviceId.DeviceID or mfxExtendedDeviceId.VendorID works as
> expected. This fixed the issue mentioned in [1]
> 
> [1] http://ffmpeg.org/pipermail/ffmpeg-user/2023-October/056983.html
> 
> Signed-off-by: Haihao Xiang 
> ---
>  libavutil/hwcontext_qsv.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
> index 1bfda9e69b..7f4a0fda0f 100644
> --- a/libavutil/hwcontext_qsv.c
> +++ b/libavutil/hwcontext_qsv.c
> @@ -821,7 +821,7 @@ static int qsv_va_update_config(void *ctx, mfxHDL handle,
> mfxConfig cfg)
>  impl_value.Type = MFX_VARIANT_TYPE_U16;
>  impl_value.Data.U16 = (attr.value & 0x);
>  sts = MFXSetConfigFilterProperty(cfg,
> - (const mfxU8
> *)"mfxExtendedDeviceId.DeviceID", impl_value);
> + (const mfxU8
> *)"mfxImplDescription.mfxDeviceDescription.DeviceID", impl_value);
>  if (sts != MFX_ERR_NONE) {
>  av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration"
>     "DeviceID property: %d.\n", sts);
> @@ -893,10 +893,10 @@ static int qsv_new_mfx_loader(void *ctx,
>  goto fail;
>  }
>  
> -    impl_value.Type = MFX_VARIANT_TYPE_U16;
> -    impl_value.Data.U16 = 0x8086; // Intel device only
> +    impl_value.Type = MFX_VARIANT_TYPE_U32;
> +    impl_value.Data.U32 = 0x8086; // Intel device only
>  sts = MFXSetConfigFilterProperty(cfg,
> - (const mfxU8
> *)"mfxExtendedDeviceId.VendorID", impl_value);
> + (const mfxU8
> *)"mfxImplDescription.VendorID", impl_value);
>  if (sts != MFX_ERR_NONE) {
>  av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration"
>     "VendorID property: %d.\n", sts);

Will apply,

Thanks
Haihao


___
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 1/2] lavc/qsvdec: return 0 if more data is required

2023-12-03 Thread Xiang, Haihao
On Ma, 2023-11-27 at 14:01 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> The type of qsv decoders is FF_CODEC_CB_TYPE_DECODE which must not
> return AVERROR(EAGAIN). commit 42b20c9 added an assertion to check the
> returned value.
> 
> Signed-off-by: Haihao Xiang 
> ---
>  libavcodec/qsvdec.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
> index da700f25e9..b501964089 100644
> --- a/libavcodec/qsvdec.c
> +++ b/libavcodec/qsvdec.c
> @@ -1076,6 +1076,9 @@ static int qsv_decode_frame(AVCodecContext *avctx,
> AVFrame *frame,
>  
>  ret = qsv_process_data(avctx, >qsv, frame, got_frame, 
> >buffer_pkt);
>  if (ret < 0){
> +    if (ret == AVERROR(EAGAIN))
> +    ret = 0;
> +
>  /* Drop buffer_pkt when failed to decode the packet. Otherwise,
>     the decoder will keep decoding the failure packet. */
>  av_packet_unref(>buffer_pkt);

Will apply the patchset, 

Thanks
Haihao
___
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] lavfi/vf_vpp_qsv: set the default value of async_depth to 4

2023-12-03 Thread Xiang, Haihao
On Vr, 2023-11-24 at 15:00 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> Both qsv encoders and decoders use 4 as the default value of
> async_depth, let's use 4 as the default value for vpp_qsv filter too.
> 
> Signed-off-by: Haihao Xiang 
> ---
>  libavfilter/vf_vpp_qsv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
> index c07b45fedb..5356103e00 100644
> --- a/libavfilter/vf_vpp_qsv.c
> +++ b/libavfilter/vf_vpp_qsv.c
> @@ -879,7 +879,7 @@ static const AVOption vpp_options[] = {
>  { "h",  "Output video height(0=input video height, -1=keep input
> video aspect)", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255,
> .flags = FLAGS },
>  { "height", "Output video height(0=input video height, -1=keep input
> video aspect)", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255,
> .flags = FLAGS },
>  { "format", "Output pixel format", OFFSET(output_format_str),
> AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS },
> -    { "async_depth", "Internal parallelization depth, the higher the value
> the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = 0
> }, 0, INT_MAX, .flags = FLAGS },
> +    { "async_depth", "Internal parallelization depth, the higher the value
> the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = 4
> }, 0, INT_MAX, .flags = FLAGS },
>  #if QSV_ONEVPL
>  { "scale_mode", "scaling & format conversion mode (mode compute(3), vd(4)
> and ve(5) are only available on some platforms)", OFFSET(scale_mode),
> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 5, .flags = FLAGS, "scale mode" },
>  #else

Will apply,

Haihao

___
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 v2] lavu/hwcontext_vaapi: ignore nonexistent device in default DRM device selection

2023-12-03 Thread Xiang, Haihao
On Di, 2023-11-28 at 13:38 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> It is possible that renderD128 doesn't exist but renderD129 is
> available in a system (see [1]). This change can make sure the default
> DRM device selection works even if renderD128 doesn't exist.
> 
> [1]
> https://github.com/intel/intel-device-plugins-for-kubernetes/blob/main/cmd/gpu_plugin/README.md#issues-with-media-workloads-on-multi-gpu-setups
> 
> Signed-off-by: Haihao Xiang 
> ---
>  libavutil/hwcontext_vaapi.c | 15 +--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
> index 12bc95119a..29fc8bd648 100644
> --- a/libavutil/hwcontext_vaapi.c
> +++ b/libavutil/hwcontext_vaapi.c
> @@ -1733,8 +1733,19 @@ static int vaapi_device_create(AVHWDeviceContext *ctx,
> const char *device,
>   "/dev/dri/renderD%d", 128 + n);
>  priv->drm_fd = open(path, O_RDWR);
>  if (priv->drm_fd < 0) {
> -    av_log(ctx, AV_LOG_VERBOSE, "Cannot open "
> -   "DRM render node for device %d.\n", n);
> +    if (errno == ENOENT) {
> +    if (n != max_devices - 1) {
> +    av_log(ctx, AV_LOG_VERBOSE,
> +   "No render device %s, try next device for
> "
> +   "DRM render node.\n", path);
> +    continue;
> +    }
> +
> +    av_log(ctx, AV_LOG_VERBOSE, "No available render
> device "
> +   "for DRM render node.\n");
> +    } else
> +    av_log(ctx, AV_LOG_VERBOSE, "Cannot open "
> +   "DRM render node for device %d.\n", n);
>  break;
>  }
>  #if CONFIG_LIBDRM

Will apply,

Haihao


___
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] lavc/ac3: add R-V Zbb extract_exponents

2023-12-03 Thread Zhao Zhili

> On Dec 4, 2023, at 04:11, Rémi Denis-Courmont  wrote:
> 
> 
> 
> Le 3 décembre 2023 19:50:18 GMT+02:00, Zhao Zhili  > a écrit :
>> 
>> 
>>> On Oct 3, 2023, at 00:47, Rémi Denis-Courmont  wrote:
>>> 
>>> 
>>> diff --git a/libavcodec/riscv/ac3dsp_rvb.S b/libavcodec/riscv/ac3dsp_rvb.S
>>> new file mode 100644
>>> index 00..48f8bb101e
>>> --- /dev/null
>>> +++ b/libavcodec/riscv/ac3dsp_rvb.S
>>> 
>>> +func ff_extract_exponents_rvb, zbb
>>> +1:
>>> +lw   t0, (a1)
>>> +addi a0, a0, 1
>>> +neg  t1, t0
>>> +addi a1, a1, 4
>>> +max  t0, t0, t1
>>> +addi a2, a2, -1
>>> +clz  t0, t0
>>> +addi t0, t0, 24 - __riscv_xlen
>>> +sb   t0, -1(a0)
>>> +bgtza2, 1b
>>> +
>>> +ret
>>> +endfunc
>>> —
>> 
>> Got build failure with clang 14:
>> 
>> :6:21: warning: unknown option, expected 'push', 'pop', 
>> 'rvc', 'norvc', 'relax' or 'norelax'
>>   .option arch, +zbb
>>   ^
>> src/libavcodec/riscv/ac3dsp_rvb.S:24:1: note: while in macro instantiation
>> func ff_extract_exponents_rvb, zbb
>> ^
>> src/libavcodec/riscv/ac3dsp_rvb.S:30:9: error: instruction requires the 
>> following: 'Zbb' (Basic Bit-Manipulation)
>>   max t0, t0, t1
>>   ^
>> src/libavcodec/riscv/ac3dsp_rvb.S:32:9: error: instruction requires the 
>> following: 'Zbb' (Basic Bit-Manipulation)
>>   clz t0, t0
>>   ^
>> make: *** [/home/quink/work/ffmpeg/ffbuild/common.mak:93: 
>> libavcodec/riscv/ac3dsp_rvb.o] Error 1
>> make: *** Waiting for unfinished jobs
>> :6:21: warning: unknown option, expected 'push', 'pop', 
>> 'rvc', 'norvc', 'relax' or 'norelax'
>>   .option arch, +f
>>   ^
>> src/libavcodec/riscv/audiodsp_rvf.S:23:1: note: while in macro instantiation
>> func ff_vector_clipf_rvf, f
>> ^
>> 
>> Someone says clang 14 has Zbb extensions support. I don’t know what’s going 
>> on.
> 
> It's not practical to support such a broken assembler as LLVM built-in's 
> until they get their act together. You can add tests in FFmpeg configure but 
> that's just going to turn all optimisations off. You could also disable the 
> integrated assembler and use binutils, but then you'll hit the limitation of 
> FFmpeg's configure whereby it tests the inline assembler rather than the 
> outline one.
> 
> So really you're better off with GCC. RISC-V support on LLVM is pretty sad, 
> TBH.

OK, just check if this is an unknown issue. I’m totally fine to stay with GCC.

> ___
> 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".


Re: [FFmpeg-devel] [PATCH 6/7] avutil/imgutils: add new function av_image_fill_color()

2023-12-03 Thread Stefano Sabatini
On date Sunday 2023-12-03 01:27:25 +0100, Marton Balint wrote:
> Signed-off-by: Marton Balint 
> ---
>  doc/APIchanges   |  3 +++
>  libavutil/imgutils.c |  4 ++--
>  libavutil/imgutils.h | 30 ++
>  libavutil/version.h  |  2 +-
>  4 files changed, 36 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 4a2dc1c44f..b6ac8e08e2 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09
>  
>  API changes, most recent first:
>  
> +2023-12-xx - xxx - lavu 58.33.100 - imguils.h

imguils typo

> +  Add av_image_fill_color()
> +
>  2023-11-08 - b82957a66a7 - lavu 58.32.100 - channel_layout.h
>Add AV_CH_LAYOUT_7POINT2POINT3 and AV_CHANNEL_LAYOUT_7POINT2POINT3.
>Add AV_CH_LAYOUT_9POINT1POINT4_BACK and 
> AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK.
> diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
> index 959e6850ac..c09848a317 100644
> --- a/libavutil/imgutils.c
> +++ b/libavutil/imgutils.c
> @@ -579,7 +579,7 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, 
> uint8_t *clear,
>  // if it's a subsampled packed format).
>  #define MAX_BLOCK_SIZE 32
>  
> -static int image_fill_color(uint8_t * const dst_data[4], const ptrdiff_t 
> dst_linesize[4],
> +int av_image_fill_color(uint8_t * const dst_data[4], const ptrdiff_t 
> dst_linesize[4],
>  enum AVPixelFormat pix_fmt, const uint32_t color[4],
>  int width, int height)
>  {
> @@ -712,5 +712,5 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  color[c] = src;
>  }
>  
> -return image_fill_color(dst_data, dst_linesize, pix_fmt, color, width, 
> height);
> +return av_image_fill_color(dst_data, dst_linesize, pix_fmt, color, 
> width, height);
>  }
> diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
> index fa3bb101b1..e047b3a693 100644
> --- a/libavutil/imgutils.h
> +++ b/libavutil/imgutils.h
> @@ -339,6 +339,36 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  enum AVPixelFormat pix_fmt, enum AVColorRange range,
>  int width, int height);
>  
> +/**
> + * Overwrite the image data with a color. This is suitable for filling a
> + * sub-rectangle of an image, meaning the padding between the right most 
> pixel
> + * and the left most pixel on the next line will not be overwritten. For some
> + * formats, the image size might be rounded up due to inherent alignment.
> + *
> + * If the pixel format has alpha, it is also replaced. Color component values
> + * are interpreted as native integers (or intfloats) regardless of actual 
> pixel
> + * format endianness.
> + *
> + * This can return an error if the pixel format is not supported. Normally, 
> all
> + * non-hwaccel pixel formats should be supported.
> + *
> + * Passing NULL for dst_data is allowed. Then the function returns whether 
> the
> + * operation would have succeeded. (It can return an error if the pix_fmt is
> + * not supported.)
> + *
> + * @param dst_data  data pointers to destination image
> + * @param dst_linesize  linesizes for the destination image
> + * @param pix_fmt   the pixel format of the image
> + * @param color the color components to be used for the fill
> + * @param width the width of the image in pixels
> + * @param heightthe height of the image in pixels

> + * @return 0 if the image data was cleared, a negative AVERROR code otherwise

was filled

> + */
> +int av_image_fill_color(uint8_t * const dst_data[4], const ptrdiff_t 
> dst_linesize[4],
> +enum AVPixelFormat pix_fmt, const uint32_t color[4],
> +int width, int height);

LGTM otherwise.
___
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 5/7] avutil/imgutils: factorize a fill color function

2023-12-03 Thread Stefano Sabatini
On date Sunday 2023-12-03 01:27:24 +0100, Marton Balint wrote:
> In preparation for making it public.
> 
> Signed-off-by: Marton Balint 
> ---
>  libavutil/imgutils.c | 101 +++
>  1 file changed, 63 insertions(+), 38 deletions(-)
> 
> diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
> index 26bb2f2c6f..959e6850ac 100644
> --- a/libavutil/imgutils.c
> +++ b/libavutil/imgutils.c
> @@ -579,30 +579,24 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, 
> uint8_t *clear,
>  // if it's a subsampled packed format).
>  #define MAX_BLOCK_SIZE 32
>  
> -int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t 
> dst_linesize[4],
> -enum AVPixelFormat pix_fmt, enum AVColorRange range,
> +static int image_fill_color(uint8_t * const dst_data[4], const ptrdiff_t 
> dst_linesize[4],
> +enum AVPixelFormat pix_fmt, const uint32_t color[4],
>  int width, int height)
>  {
>  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
>  int nb_planes = av_pix_fmt_count_planes(pix_fmt);
> -// A pixel or a group of pixels on each plane, with a value that 
> represents black.
> +// A pixel or a group of pixels on each plane, with a value that 
> represents the color.
>  // Consider e.g. AV_PIX_FMT_UYVY422 for non-trivial cases.
>  uint8_t clear_block[4][MAX_BLOCK_SIZE] = {{0}}; // clear padding with 0
>  int clear_block_size[4] = {0};
>  ptrdiff_t plane_line_bytes[4] = {0};
> -int rgb, xyz, pal, limited, alpha, bitstream, fltp;
> +int bitstream;
>  int plane, c;
>  
>  if (!desc || nb_planes < 1 || nb_planes > 4 || desc->flags & 
> AV_PIX_FMT_FLAG_HWACCEL)
>  return AVERROR(EINVAL);
>  
> -rgb = !!(desc->flags & AV_PIX_FMT_FLAG_RGB);
> -xyz = !!(desc->flags & AV_PIX_FMT_FLAG_XYZ);
> -pal = !!(desc->flags & AV_PIX_FMT_FLAG_PAL);
> -limited = !rgb && !xyz && !pal && range != AVCOL_RANGE_JPEG;
> -alpha = !pal && !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
>  bitstream = !!(desc->flags & AV_PIX_FMT_FLAG_BITSTREAM);
> -fltp = !!(desc->flags & AV_PIX_FMT_FLAG_FLOAT);
>  
>  for (c = 0; c < desc->nb_components; c++) {
>  const AVComponentDescriptor comp = desc->comp[c];
> @@ -623,7 +617,6 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  uint8_t *c_data[4];
>  const int c_linesize[4] = {0};
>  uint32_t src_array[MAX_BLOCK_SIZE];
> -uint32_t src = 0;
>  int x;
>  
>  if (comp.depth > 32)
> @@ -631,34 +624,8 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  if (w < 1)
>  return AVERROR(EINVAL);
>  
> -if (pix_fmt == AV_PIX_FMT_MONOWHITE) {
> -src = 1;
> -} else if (c + 1 == desc->nb_components && alpha) {
> -// (Assume even limited YUV uses full range alpha.)
> -if (fltp && comp.depth != 16 && comp.depth != 32)
> -return AVERROR(EINVAL);
> -if (fltp)
> -src = (comp.depth == 16 ? 0x3C00 : 0x3F80); // 1.0
> -else
> -src = (comp.depth == 32 ? 0 : (1 << comp.depth)) - 1;
> -} else if (c == 0 && limited && comp.depth > 1) {
> -if (comp.depth < 8 || fltp && comp.depth != 16 && comp.depth != 
> 32)
> -return AVERROR(EINVAL);
> -if (fltp)
> -src = (comp.depth == 16 ? 0x3000 : 0x3D80); // 0.0625
> -else
> -src = 16 << (comp.depth - 8);
> -} else if ((c == 1 || c == 2) && !rgb && !xyz) {
> -if (comp.depth < 8 || fltp && comp.depth != 16 && comp.depth != 
> 32)
> -return AVERROR(EINVAL);
> -if (fltp)
> -src = (comp.depth == 16 ? 0x3800 : 0x3F00); // 0.5
> -else
> -src = 128 << (comp.depth - 8);
> -}
> -
>  for (x = 0; x < w; x++)
> -src_array[x] = src;
> +src_array[x] = color[c];
>  
>  for (x = 0; x < 4; x++)
>  c_data[x] = _block[x][0];
> @@ -689,3 +656,61 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  
>  return 0;
>  }
> +
> +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t 
> dst_linesize[4],
> +enum AVPixelFormat pix_fmt, enum AVColorRange range,
> +int width, int height)
> +{
> +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
> +int nb_planes = av_pix_fmt_count_planes(pix_fmt);
> +int rgb, xyz, pal, limited, alpha, fltp;
> +uint32_t color[4] = {0};
> +
> +if (!desc || nb_planes < 1 || nb_planes > 4 || desc->flags & 
> AV_PIX_FMT_FLAG_HWACCEL)
> +return AVERROR(EINVAL);
> +
> +rgb = !!(desc->flags & AV_PIX_FMT_FLAG_RGB);
> +xyz 

Re: [FFmpeg-devel] [PATCH 4/7] avutil/imgutils: add support for 32bit pixel format for av_image_fill_black()

2023-12-03 Thread Stefano Sabatini
On date Sunday 2023-12-03 01:27:23 +0100, Marton Balint wrote:
> Signed-off-by: Marton Balint 
> ---
>  libavutil/imgutils.c| 32 ++--
>  tests/ref/fate/imgutils | 24 
>  2 files changed, 34 insertions(+), 22 deletions(-)
> 
> diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
> index 5e401139c8..26bb2f2c6f 100644
> --- a/libavutil/imgutils.c
> +++ b/libavutil/imgutils.c
> @@ -590,7 +590,7 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  uint8_t clear_block[4][MAX_BLOCK_SIZE] = {{0}}; // clear padding with 0
>  int clear_block_size[4] = {0};
>  ptrdiff_t plane_line_bytes[4] = {0};
> -int rgb, xyz, pal, limited, alpha, bitstream;
> +int rgb, xyz, pal, limited, alpha, bitstream, fltp;
>  int plane, c;
>  
>  if (!desc || nb_planes < 1 || nb_planes > 4 || desc->flags & 
> AV_PIX_FMT_FLAG_HWACCEL)
> @@ -602,6 +602,7 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  limited = !rgb && !xyz && !pal && range != AVCOL_RANGE_JPEG;
>  alpha = !pal && !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA);
>  bitstream = !!(desc->flags & AV_PIX_FMT_FLAG_BITSTREAM);
> +fltp = !!(desc->flags & AV_PIX_FMT_FLAG_FLOAT);
>  
>  for (c = 0; c < desc->nb_components; c++) {
>  const AVComponentDescriptor comp = desc->comp[c];
> @@ -621,11 +622,11 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  int w = (bitstream ? 8 : 1) * clear_block_size[comp.plane] / 
> comp.step;
>  uint8_t *c_data[4];
>  const int c_linesize[4] = {0};
> -uint16_t src_array[MAX_BLOCK_SIZE];
> -uint16_t src = 0;
> +uint32_t src_array[MAX_BLOCK_SIZE];
> +uint32_t src = 0;
>  int x;
>  
> -if (comp.depth > 16)
> +if (comp.depth > 32)
>  return AVERROR(EINVAL);
>  if (w < 1)
>  return AVERROR(EINVAL);
> @@ -634,15 +635,26 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  src = 1;
>  } else if (c + 1 == desc->nb_components && alpha) {
>  // (Assume even limited YUV uses full range alpha.)
> -src = (1 << comp.depth) - 1;

> +if (fltp && comp.depth != 16 && comp.depth != 32)
> +return AVERROR(EINVAL);

nit+: this might be merged in the if (fltp) branch below for clarity
and to avoid a branch

> +if (fltp)
> +src = (comp.depth == 16 ? 0x3C00 : 0x3F80); // 1.0

> +else
> +src = (comp.depth == 32 ? 0 : (1 << comp.depth)) - 1;
>  } else if (c == 0 && limited && comp.depth > 1) {
> -if (comp.depth < 8)

> +if (comp.depth < 8 || fltp && comp.depth != 16 && comp.depth != 
> 32)

nit: use () to group the right hand part of the or, or this might
confuse the human reader

>  return AVERROR(EINVAL);
> -src = 16 << (comp.depth - 8);
> +if (fltp)
> +src = (comp.depth == 16 ? 0x3000 : 0x3D80); // 0.0625
> +else
> +src = 16 << (comp.depth - 8);
>  } else if ((c == 1 || c == 2) && !rgb && !xyz) {
> -if (comp.depth < 8)
> +if (comp.depth < 8 || fltp && comp.depth != 16 && comp.depth != 
> 32)
>  return AVERROR(EINVAL);
> -src = 128 << (comp.depth - 8);
> +if (fltp)
> +src = (comp.depth == 16 ? 0x3800 : 0x3F00); // 0.5
> +else
> +src = 128 << (comp.depth - 8);
>  }
>  
>  for (x = 0; x < w; x++)
> @@ -651,7 +663,7 @@ int av_image_fill_black(uint8_t * const dst_data[4], 
> const ptrdiff_t dst_linesiz
>  for (x = 0; x < 4; x++)
>  c_data[x] = _block[x][0];
>  
> -av_write_image_line(src_array, c_data, c_linesize, desc, 0, 0, c, w);
> +av_write_image_line2(src_array, c_data, c_linesize, desc, 0, 0, c, 
> w, 4);
>  }
>  

LGTM otherwise.
___
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 3/7] avutil/imgutils: fix av_image_fill_black() for some pixel formats

2023-12-03 Thread Stefano Sabatini
On date Sunday 2023-12-03 01:27:22 +0100, Marton Balint wrote:
> - Fixes YA formats, because previous code always assumed alpha as the 4th
>   component.
> - Fixes PAL format (as long as 0 is black, as in a systematic palette), 
> because
>   previous code assumed it as limited Y.
> - Fixes XYZ format because it does not need nonzero chroma components
> - Fixes xv30be as the bitstream mode got merged to the non-bitstream mode.
> 
> Signed-off-by: Marton Balint 
> ---
>  libavutil/imgutils.c| 49 +++--
>  tests/ref/fate/imgutils | 14 ++--
>  2 files changed, 25 insertions(+), 38 deletions(-)

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".


Re: [FFmpeg-devel] [PATCH 2/7] avutil/tests/imgutils: add tests for av_image_fill_black()

2023-12-03 Thread Stefano Sabatini
On date Sunday 2023-12-03 01:27:21 +0100, Marton Balint wrote:
> Signed-off-by: Marton Balint 
> ---
>  libavutil/tests/imgutils.c |  60 --
>  tests/ref/fate/imgutils| 217 +
>  2 files changed, 268 insertions(+), 9 deletions(-)
> 
> diff --git a/libavutil/tests/imgutils.c b/libavutil/tests/imgutils.c
> index f3a433ac4a..500d24fdb8 100644
> --- a/libavutil/tests/imgutils.c
> +++ b/libavutil/tests/imgutils.c
> @@ -17,6 +17,7 @@
>   */
>  
>  #include "libavutil/imgutils.c"
> +#include "libavutil/crc.h"
>  
>  #undef printf
>  static int basic_tests(enum AVPixelFormat pix_fmt, int w, int h) {
> @@ -55,9 +56,43 @@ static int basic_tests(enum AVPixelFormat pix_fmt, int w, 
> int h) {
>  return 0;
>  }
>  

> +static int black_tests(const AVPixFmtDescriptor *desc, enum AVPixelFormat 
> pix_fmt, int w, int h)

nit: check_image_fill_black ?

> +{
> +uint8_t *data[4];
> +ptrdiff_t linesizes1[4];
> +int ret, total_size, linesizes[4];
> +

> +if (av_image_fill_linesizes(linesizes, pix_fmt, w) < 0)
> +return -1;

nit: maybe we could store and return ret to give more information

> +total_size = av_image_alloc(data, linesizes, w, h, pix_fmt, 4);
> +if (total_size < 0) {
> +printf("alloc failure");
> +return -1;

ditto

> +}
> +printf("total_size: %6d", total_size);
> +if (desc->flags & AV_PIX_FMT_FLAG_PAL)
> +total_size -= 256 * 4;
> +// Make it non-black by default...
> +memset(data[0], 0xA3, total_size);
> +for (int i = 0; i < 4; i++)
> +linesizes1[i] = linesizes[i];
> +for (enum AVColorRange range = 0; range < AVCOL_RANGE_NB; range++) {
> +ret = av_image_fill_black(data, linesizes1, pix_fmt, range, w, h);
> +printf(",  black_%s_crc: ", av_color_range_name(range));
> +if (ret < 0) {
> +printf("--");

> +} else {
> +const AVCRC *ctx = av_crc_get_table(AV_CRC_32_IEEE_LE);

nit: crc?

> +printf("0x%08"PRIx32, av_crc(ctx, 0, data[0], total_size));
> +}
> +}
> +av_freep([0]);
> +
> +return 0;
> +}
> +
>  int main(void)
>  {
> -const AVPixFmtDescriptor *desc = NULL;
>  int64_t x, y;
>  
>  for (y = -1; y @@ -69,15 +104,22 @@ int main(void)
>  }
>  printf("\n");
>  
> -while (desc = av_pix_fmt_desc_next(desc)) {
> -int w = 64, h = 48;
> -enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(desc);
> +for (int i = 0; i < 2; i++) {
> +printf(i ? "\nblack tests\n" : "basic tests\n");
> +for (const AVPixFmtDescriptor *desc = NULL; desc = 
> av_pix_fmt_desc_next(desc);) {
> +int w = 64, h = 48;
> +enum AVPixelFormat pix_fmt = av_pix_fmt_desc_get_id(desc);
>  
> -if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
> -continue;
> -printf("%-16s", desc->name);
> -basic_tests(pix_fmt, w, h);
> -printf("\n");
> +if (desc->flags & AV_PIX_FMT_FLAG_HWACCEL)
> +continue;
> +
> +printf("%-16s", desc->name);
> +if (i == 0)
> +basic_tests(pix_fmt, w, h);
> +else
> +black_tests(desc, pix_fmt, w, h);
> +printf("\n");
> +}
>  }

LGTM otherwise.
___
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] trac spam

2023-12-03 Thread Michael Niedermayer
On Sun, Dec 03, 2023 at 09:39:50AM +0100, Michael Koch wrote:
> please delete:
> 
> comment 14 in ticket 2104
> comment 6 in ticket 2776
> user "bunnybellid"

deleted

thx

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

No great genius has ever existed without some touch of madness. -- Aristotle


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".


[FFmpeg-devel] [PATCH] libavfilter/asrc_flite: fixes and improvements

2023-12-03 Thread Paul B Mahol
Attached.
From fe1ece70c0ecbe6fb24e0823fe46db57242396e4 Mon Sep 17 00:00:00 2001
From: Paul B Mahol 
Date: Sun, 3 Dec 2023 21:38:08 +0100
Subject: [PATCH 1/2] avfilter/asrc_flite: switch to activate

Allows to set EOF timestamp.

Signed-off-by: Paul B Mahol 
---
 libavfilter/asrc_flite.c | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/libavfilter/asrc_flite.c b/libavfilter/asrc_flite.c
index 1c3053aa39..74c8414b5c 100644
--- a/libavfilter/asrc_flite.c
+++ b/libavfilter/asrc_flite.c
@@ -29,6 +29,7 @@
 #include "libavutil/opt.h"
 #include "libavutil/thread.h"
 #include "avfilter.h"
+#include "filters.h"
 #include "audio.h"
 #include "formats.h"
 #include "internal.h"
@@ -256,14 +257,20 @@ static int config_props(AVFilterLink *outlink)
 return 0;
 }
 
-static int request_frame(AVFilterLink *outlink)
+static int activate(AVFilterContext *ctx)
 {
-AVFrame *samplesref;
-FliteContext *flite = outlink->src->priv;
+AVFilterLink *outlink = ctx->outputs[0];
+FliteContext *flite = ctx->priv;
 int nb_samples = FFMIN(flite->wave_nb_samples, flite->frame_nb_samples);
+AVFrame *samplesref;
 
-if (!nb_samples)
-return AVERROR_EOF;
+if (!ff_outlink_frame_wanted(outlink))
+return FFERROR_NOT_READY;
+
+if (!nb_samples) {
+ff_outlink_set_status(outlink, AVERROR_EOF, flite->pts);
+return 0;
+}
 
 samplesref = ff_get_audio_buffer(outlink, nb_samples);
 if (!samplesref)
@@ -272,11 +279,6 @@ static int request_frame(AVFilterLink *outlink)
 memcpy(samplesref->data[0], flite->wave_samples,
nb_samples * flite->wave->num_channels * 2);
 samplesref->pts = flite->pts;
-#if FF_API_FRAME_PKT
-FF_DISABLE_DEPRECATION_WARNINGS
-samplesref->pkt_pos = -1;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 samplesref->sample_rate = flite->wave->sample_rate;
 flite->pts += nb_samples;
 flite->wave_samples += nb_samples * flite->wave->num_channels;
@@ -290,7 +292,6 @@ static const AVFilterPad flite_outputs[] = {
 .name  = "default",
 .type  = AVMEDIA_TYPE_AUDIO,
 .config_props  = config_props,
-.request_frame = request_frame,
 },
 };
 
@@ -300,6 +301,7 @@ const AVFilter ff_asrc_flite = {
 .init  = init,
 .uninit= uninit,
 .priv_size = sizeof(FliteContext),
+.activate  = activate,
 .inputs= NULL,
 FILTER_OUTPUTS(flite_outputs),
 FILTER_QUERY_FUNC(query_formats),
-- 
2.42.1

From e8aad4411ee0f8bc4bd50d5e3a10b7f712687f60 Mon Sep 17 00:00:00 2001
From: Paul B Mahol 
Date: Sun, 3 Dec 2023 22:50:11 +0100
Subject: [PATCH 2/2] avfilter/asrc_flite: use streaming function

Fix continuous accumulation of audio samples for big txt inputs.

Signed-off-by: Paul B Mahol 
---
 libavfilter/asrc_flite.c | 84 ++--
 1 file changed, 64 insertions(+), 20 deletions(-)

diff --git a/libavfilter/asrc_flite.c b/libavfilter/asrc_flite.c
index 74c8414b5c..70a2fd3e40 100644
--- a/libavfilter/asrc_flite.c
+++ b/libavfilter/asrc_flite.c
@@ -24,6 +24,8 @@
  */
 
 #include 
+#include "libavutil/audio_fifo.h"
+#include "libavutil/avstring.h"
 #include "libavutil/channel_layout.h"
 #include "libavutil/file.h"
 #include "libavutil/opt.h"
@@ -39,11 +41,14 @@ typedef struct FliteContext {
 char *voice_str;
 char *textfile;
 char *text;
-cst_wave *wave;
-int16_t *wave_samples;
-int  wave_nb_samples;
+char *text_p;
+char *text_saveptr;
+int nb_channels;
+int sample_rate;
+AVAudioFifo *fifo;
 int list_voices;
 cst_voice *voice;
+cst_audio_streaming_info *asi;
 struct voice_entry *voice_entry;
 int64_t pts;
 int frame_nb_samples; ///< number of samples per frame
@@ -140,10 +145,30 @@ static int select_voice(struct voice_entry **entry_ret, const char *voice_name,
 return AVERROR(EINVAL);
 }
 
+static int audio_stream_chunk_by_word(const cst_wave *w, int start, int size,
+  int last, cst_audio_streaming_info *asi)
+{
+FliteContext *flite = asi->userdata;
+void *const ptr[8] = { >samples[start] };
+
+flite->nb_channels = w->num_channels;
+flite->sample_rate = w->sample_rate;
+if (!flite->fifo) {
+flite->fifo = av_audio_fifo_alloc(AV_SAMPLE_FMT_S16, flite->nb_channels, size);
+if (!flite->fifo)
+return CST_AUDIO_STREAM_STOP;
+}
+
+av_audio_fifo_write(flite->fifo, ptr, size);
+
+return CST_AUDIO_STREAM_CONT;
+}
+
 static av_cold int init(AVFilterContext *ctx)
 {
 FliteContext *flite = ctx->priv;
 int ret = 0;
+char *text;
 
 if (flite->list_voices) {
 list_voices(ctx, "\n");
@@ -197,10 +222,21 @@ static av_cold int init(AVFilterContext *ctx)
 return AVERROR(EINVAL);
 }
 
-/* synth all the file data in block */
-flite->wave = flite_text_to_wave(flite->text, flite->voice);
-

Re: [FFmpeg-devel] [PATCH 1/7] avutil/tests/imgutils: factorize basic tests to new function

2023-12-03 Thread Stefano Sabatini
On date Sunday 2023-12-03 01:27:20 +0100, Marton Balint wrote:
> Signed-off-by: Marton Balint 
> ---
>  libavutil/tests/imgutils.c | 68 ++
>  1 file changed, 39 insertions(+), 29 deletions(-)
> 
> diff --git a/libavutil/tests/imgutils.c b/libavutil/tests/imgutils.c
> index 748bd6c9d2..f3a433ac4a 100644
> --- a/libavutil/tests/imgutils.c
> +++ b/libavutil/tests/imgutils.c
> @@ -19,6 +19,41 @@
>  #include "libavutil/imgutils.c"
>  
>  #undef printf

> +static int basic_tests(enum AVPixelFormat pix_fmt, int w, int h) {

better be descriptive and follow the usual VERB_OBJECT convention,
this might be:
static inst check_image_fill(...)

[...]

LGTM otherwise.
___
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] Allow using stdin_interaction with pipe's

2023-12-03 Thread علی ساکی

---
 fftools/ffmpeg_demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 791952f120..00d7747c3c 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -1379,7 +1379,7 @@ int ifile_open(const OptionsContext *o, const char 
*filename)

 if (!strcmp(filename, "-"))
 filename = "fd:";
 -    stdin_interaction &= strncmp(filename, "pipe:", 5) &&
+    stdin_interaction &= strcmp(filename, "pipe:0") &&
  strcmp(filename, "fd:") &&
  strcmp(filename, "/dev/stdin");
___
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] lavc/Makefile: build vulkan decode code if vulkan_av1 has been enabled

2023-12-03 Thread Neal Gompa
On Sun, Dec 3, 2023 at 3:06 PM Lynne  wrote:
>
> Fixes builds with only vulkan_av1 enabled.
>

Thanks for this fix!

Reviewed-by: Neal Gompa 
Tested-by: Neal Gompa 


-- 
真実はいつも一つ!/ Always, there's only one truth!
___
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] lavc/ac3: add R-V Zbb extract_exponents

2023-12-03 Thread Rémi Denis-Courmont


Le 3 décembre 2023 19:50:18 GMT+02:00, Zhao Zhili  a 
écrit :
>
>
>> On Oct 3, 2023, at 00:47, Rémi Denis-Courmont  wrote:
>> 
>> 
>> diff --git a/libavcodec/riscv/ac3dsp_rvb.S b/libavcodec/riscv/ac3dsp_rvb.S
>> new file mode 100644
>> index 00..48f8bb101e
>> --- /dev/null
>> +++ b/libavcodec/riscv/ac3dsp_rvb.S
>> 
>> +func ff_extract_exponents_rvb, zbb
>> +1:
>> +lw   t0, (a1)
>> +addi a0, a0, 1
>> +neg  t1, t0
>> +addi a1, a1, 4
>> +max  t0, t0, t1
>> +addi a2, a2, -1
>> +clz  t0, t0
>> +addi t0, t0, 24 - __riscv_xlen
>> +sb   t0, -1(a0)
>> +bgtza2, 1b
>> +
>> +ret
>> +endfunc
>> —
>
>Got build failure with clang 14:
>
>:6:21: warning: unknown option, expected 'push', 'pop', 'rvc', 
>'norvc', 'relax' or 'norelax'
>.option arch, +zbb
>^
>src/libavcodec/riscv/ac3dsp_rvb.S:24:1: note: while in macro instantiation
>func ff_extract_exponents_rvb, zbb
>^
>src/libavcodec/riscv/ac3dsp_rvb.S:30:9: error: instruction requires the 
>following: 'Zbb' (Basic Bit-Manipulation)
>max t0, t0, t1
>^
>src/libavcodec/riscv/ac3dsp_rvb.S:32:9: error: instruction requires the 
>following: 'Zbb' (Basic Bit-Manipulation)
>clz t0, t0
>^
>make: *** [/home/quink/work/ffmpeg/ffbuild/common.mak:93: 
>libavcodec/riscv/ac3dsp_rvb.o] Error 1
>make: *** Waiting for unfinished jobs
>:6:21: warning: unknown option, expected 'push', 'pop', 'rvc', 
>'norvc', 'relax' or 'norelax'
>.option arch, +f
>^
>src/libavcodec/riscv/audiodsp_rvf.S:23:1: note: while in macro instantiation
>func ff_vector_clipf_rvf, f
>^
>
>Someone says clang 14 has Zbb extensions support. I don’t know what’s going on.

Forgot the explanation: the problem seems to be the arch option, not the Zbb 
extension.

I think you can get around it with -no-integrated-as, but then... what I said 
in the other mail.

Br,
___
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] Allow using stdin_interaction with pipe's

2023-12-03 Thread علی ساکی

Signed-off-by: Ali Saki <3alis...@gmail.com>
---
 fftools/ffmpeg_demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c
index 791952f120..00d7747c3c 100644
--- a/fftools/ffmpeg_demux.c
+++ b/fftools/ffmpeg_demux.c
@@ -1379,7 +1379,7 @@ int ifile_open(const OptionsContext *o, const char 
*filename)

 if (!strcmp(filename, "-"))
 filename = "fd:";
 -stdin_interaction &= strncmp(filename, "pipe:", 5) &&
+stdin_interaction &= strcmp(filename, "pipe:0") &&
  strcmp(filename, "fd:") &&
  strcmp(filename, "/dev/stdin");
 -- 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] lavc/ac3: add R-V Zbb extract_exponents

2023-12-03 Thread Rémi Denis-Courmont


Le 3 décembre 2023 19:50:18 GMT+02:00, Zhao Zhili  a 
écrit :
>
>
>> On Oct 3, 2023, at 00:47, Rémi Denis-Courmont  wrote:
>> 
>> 
>> diff --git a/libavcodec/riscv/ac3dsp_rvb.S b/libavcodec/riscv/ac3dsp_rvb.S
>> new file mode 100644
>> index 00..48f8bb101e
>> --- /dev/null
>> +++ b/libavcodec/riscv/ac3dsp_rvb.S
>> 
>> +func ff_extract_exponents_rvb, zbb
>> +1:
>> +lw   t0, (a1)
>> +addi a0, a0, 1
>> +neg  t1, t0
>> +addi a1, a1, 4
>> +max  t0, t0, t1
>> +addi a2, a2, -1
>> +clz  t0, t0
>> +addi t0, t0, 24 - __riscv_xlen
>> +sb   t0, -1(a0)
>> +bgtza2, 1b
>> +
>> +ret
>> +endfunc
>> —
>
>Got build failure with clang 14:
>
>:6:21: warning: unknown option, expected 'push', 'pop', 'rvc', 
>'norvc', 'relax' or 'norelax'
>.option arch, +zbb
>^
>src/libavcodec/riscv/ac3dsp_rvb.S:24:1: note: while in macro instantiation
>func ff_extract_exponents_rvb, zbb
>^
>src/libavcodec/riscv/ac3dsp_rvb.S:30:9: error: instruction requires the 
>following: 'Zbb' (Basic Bit-Manipulation)
>max t0, t0, t1
>^
>src/libavcodec/riscv/ac3dsp_rvb.S:32:9: error: instruction requires the 
>following: 'Zbb' (Basic Bit-Manipulation)
>clz t0, t0
>^
>make: *** [/home/quink/work/ffmpeg/ffbuild/common.mak:93: 
>libavcodec/riscv/ac3dsp_rvb.o] Error 1
>make: *** Waiting for unfinished jobs
>:6:21: warning: unknown option, expected 'push', 'pop', 'rvc', 
>'norvc', 'relax' or 'norelax'
>.option arch, +f
>^
>src/libavcodec/riscv/audiodsp_rvf.S:23:1: note: while in macro instantiation
>func ff_vector_clipf_rvf, f
>^
>
>Someone says clang 14 has Zbb extensions support. I don’t know what’s going on.

It's not practical to support such a broken assembler as LLVM built-in's until 
they get their act together. You can add tests in FFmpeg configure but that's 
just going to turn all optimisations off. You could also disable the integrated 
assembler and use binutils, but then you'll hit the limitation of FFmpeg's 
configure whereby it tests the inline assembler rather than the outline one.

So really you're better off with GCC. RISC-V support on LLVM is pretty sad, TBH.
___
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] avutil/mem: always align by at least 32 bytes

2023-12-03 Thread Timo Rothenpieler
FFmpeg has instances of DECLARE_ALIGNED(32, ...) in a lot of structs,
which then end up heap-allocated.
By declaring any variable in a struct, or tree of structs, to be 32 byte
aligned, it allows the compiler to safely assume the entire struct
itself is also 32 byte aligned.

This might make the compiler emit code which straight up crashes or
misbehaves in other ways, and at least in one instances is now
documented to actually do (see ticket 10549 on trac).
The issue there is that an unrelated variable in SingleChannelElement is
declared to have an alignment of 32 bytes. So if the compiler does a copy
in decode_cpe() with avx instructions, but ffmpeg is built with
--disable-avx, this results in a crash, since the memory is only 16 byte
aligned.
Mind you, even if the compiler does not emit avx instructions, the code
is still invalid and could misbehave. It just happens not to. Declaring
any variable in a struct with a 32 byte alignment promises 32 byte
alignment of the whole struct to the compiler.

Instead of now going through all instances of variables in structs
being declared as 32 byte aligned, this patch bumps the minimum alignment
to 32 bytes.
---
 libavutil/mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/mem.c b/libavutil/mem.c
index 36b8940a0c..26a9b9753b 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -62,7 +62,7 @@ void  free(void *ptr);
 
 #endif /* MALLOC_PREFIX */
 
-#define ALIGN (HAVE_AVX512 ? 64 : (HAVE_AVX ? 32 : 16))
+#define ALIGN (HAVE_AVX512 ? 64 : 32)
 
 /* NOTE: if you want to override these functions with your own
  * implementations (not recommended) you have to link libav* as
-- 
2.34.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] lavc/Makefile: build vulkan decode code if vulkan_av1 has been enabled

2023-12-03 Thread Lynne
Fixes builds with only vulkan_av1 enabled.

>From b7c696af10784110844cc3dbe0ec21538393f309 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sun, 3 Dec 2023 21:02:13 +0100
Subject: [PATCH] lavc/Makefile: build vulkan decode code if vulkan_av1 has
 been enabled

Forgotten.
---
 libavcodec/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 748806e702..fd9883d2ca 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -998,7 +998,7 @@ OBJS-$(CONFIG_AV1_DXVA2_HWACCEL)  += dxva2_av1.o
 OBJS-$(CONFIG_AV1_NVDEC_HWACCEL)  += nvdec_av1.o
 OBJS-$(CONFIG_AV1_VAAPI_HWACCEL)  += vaapi_av1.o
 OBJS-$(CONFIG_AV1_VDPAU_HWACCEL)  += vdpau_av1.o
-OBJS-$(CONFIG_AV1_VULKAN_HWACCEL) += vulkan_av1.o
+OBJS-$(CONFIG_AV1_VULKAN_HWACCEL) += vulkan_decode.o vulkan_av1.o
 OBJS-$(CONFIG_H263_VAAPI_HWACCEL) += vaapi_mpeg4.o
 OBJS-$(CONFIG_H263_VIDEOTOOLBOX_HWACCEL)  += videotoolbox.o
 OBJS-$(CONFIG_H264_D3D11VA_HWACCEL)   += dxva2_h264.o
-- 
2.43.0

___
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] [ANNOUNCE] upcoming vote: TC/CC elections

2023-12-03 Thread Anton Khirnov
As nobody seems to be arguing otherwise, we'll proceed with the votes
normally.

I intend to close them on Tuesday morning - please vote ASAP if you have
not done so yet.

Cheers,
-- 
Anton Khirnov
___
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] libavformat/vvc: Make probe more conservative

2023-12-03 Thread post
From: Frank Plowman 

Reduce false positives for VVC files by adding additional checks in
`vvc_probe`. Specifically, `nuh_temporal_id_plus1` is tested for valid
values in extra cases depending on the NAL unit type, as per ITU-T H.266
section 7.4.2.2.

Resolves trac #10703.

Signed-off-by: Frank Plowman 
---
 libavformat/vvcdec.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavformat/vvcdec.c b/libavformat/vvcdec.c
index 31c5ae1f14..57d2769465 100644
--- a/libavformat/vvcdec.c
+++ b/libavformat/vvcdec.c
@@ -35,11 +35,17 @@ static int vvc_probe(const AVProbeData *p)
 if ((code & 0xff00) == 0x100) {
 uint8_t nal2 = p->buf[i + 1];
 int type = (nal2 & 0xF8) >> 3;
+const uint8_t nuh_temporal_id_plus1 = nal2 & 0x7;
 
 if (code & 0x80) // forbidden_zero_bit
 return 0;
 
-if ((nal2 & 0x7) == 0) // nuh_temporal_id_plus1
+if (nuh_temporal_id_plus1 == 0) // nuh_temporal_id_plus1
+return 0;
+if (nuh_temporal_id_plus1 != 1 && (type >= VVC_IDR_W_RADL && type 
<= VVC_RSV_IRAP_11
+|| type == VVC_DCI_NUT || type == 
VVC_OPI_NUT
+|| type == VVC_VPS_NUT || type == 
VVC_SPS_NUT
+|| type == VVC_EOS_NUT || type == 
VVC_EOB_NUT))
 return 0;
 
 switch (type) {
-- 
2.43.0

___
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] lavc/ac3: add R-V Zbb extract_exponents

2023-12-03 Thread Zhao Zhili


> On Oct 3, 2023, at 00:47, Rémi Denis-Courmont  wrote:
> 
> 
> diff --git a/libavcodec/riscv/ac3dsp_rvb.S b/libavcodec/riscv/ac3dsp_rvb.S
> new file mode 100644
> index 00..48f8bb101e
> --- /dev/null
> +++ b/libavcodec/riscv/ac3dsp_rvb.S
> 
> +func ff_extract_exponents_rvb, zbb
> +1:
> +lw   t0, (a1)
> +addi a0, a0, 1
> +neg  t1, t0
> +addi a1, a1, 4
> +max  t0, t0, t1
> +addi a2, a2, -1
> +clz  t0, t0
> +addi t0, t0, 24 - __riscv_xlen
> +sb   t0, -1(a0)
> +bgtza2, 1b
> +
> +ret
> +endfunc
> —

Got build failure with clang 14:

:6:21: warning: unknown option, expected 'push', 'pop', 'rvc', 
'norvc', 'relax' or 'norelax'
.option arch, +zbb
^
src/libavcodec/riscv/ac3dsp_rvb.S:24:1: note: while in macro instantiation
func ff_extract_exponents_rvb, zbb
^
src/libavcodec/riscv/ac3dsp_rvb.S:30:9: error: instruction requires the 
following: 'Zbb' (Basic Bit-Manipulation)
max t0, t0, t1
^
src/libavcodec/riscv/ac3dsp_rvb.S:32:9: error: instruction requires the 
following: 'Zbb' (Basic Bit-Manipulation)
clz t0, t0
^
make: *** [/home/quink/work/ffmpeg/ffbuild/common.mak:93: 
libavcodec/riscv/ac3dsp_rvb.o] Error 1
make: *** Waiting for unfinished jobs
:6:21: warning: unknown option, expected 'push', 'pop', 'rvc', 
'norvc', 'relax' or 'norelax'
.option arch, +f
^
src/libavcodec/riscv/audiodsp_rvf.S:23:1: note: while in macro instantiation
func ff_vector_clipf_rvf, f
^

Someone says clang 14 has Zbb extensions support. I don’t know what’s going on.

https://discourse.llvm.org/t/how-to-run-clang-llvm-for-riscv-target-machine-for-bitmanip-extension/64662

> 2.42.0
> 
> ___
> 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".


Re: [FFmpeg-devel] [PATCH] lavc/vc1dsp: R-V V inv_trans

2023-12-03 Thread Rémi Denis-Courmont
Le sunnuntaina 3. joulukuuta 2023, 16.40.08 EET flow gg a écrit :
> c910
> vc1dsp.vc1_inv_trans_4x4_dc_c: 84.0
> vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 74.0
> vc1dsp.vc1_inv_trans_4x8_dc_c: 150.2
> vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 83.5
> vc1dsp.vc1_inv_trans_8x4_dc_c: 129.0
> vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 75.7
> vc1dsp.vc1_inv_trans_8x8_dc_c: 254.7
> vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 90.5

The code below uses fractional multipliers, so I infer that the benchmarked 
code was significantly different, and the measurements are not really worth the 
bother.

I know that supply is a problem at the moment, but I if you are going to keep 
this up, I would hope that ISCAS can get you access to an RVV 1.0 board.

In-line...

> diff --git a/libavcodec/riscv/vc1dsp_init.c b/libavcodec/riscv/vc1dsp_init.c
> new file mode 100644
> index 00..88e0434f0e
> --- /dev/null
> +++ b/libavcodec/riscv/vc1dsp_init.c
> @@ -0,0 +1,47 @@
> +/*
> + * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences
> (ISCAS).
> + *
> + * 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
> + */
> +
> +#include 
> +
> +#include "libavutil/attributes.h"
> +#include "libavutil/cpu.h"
> +#include "libavutil/riscv/cpu.h"
> +#include "libavcodec/vc1.h"
> +
> +void ff_vc1_inv_trans_8x8_dc_rvv(uint8_t *dest, ptrdiff_t stride, int16_t
> *block);
> +void ff_vc1_inv_trans_4x8_dc_rvv(uint8_t *dest, ptrdiff_t stride, int16_t
> *block);
> +void ff_vc1_inv_trans_8x4_dc_rvv(uint8_t *dest, ptrdiff_t stride, int16_t
> *block);
> +void ff_vc1_inv_trans_4x4_dc_rvv(uint8_t *dest, ptrdiff_t stride, int16_t
> *block);
> +
> +av_cold void ff_vc1dsp_init_riscv(VC1DSPContext *dsp)
> +{
> +#if HAVE_RVV
> +int flags = av_get_cpu_flags();
> +
> +if (flags & AV_CPU_FLAG_RVV_I64) {
> +dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_rvv;
> +dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_rvv;
> +}
> +if (flags & AV_CPU_FLAG_RVV_I32) {
> +dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_rvv;
> +dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_rvv;
> +}

Probably missing VLENB checks.

> +#endif
> +}
> diff --git a/libavcodec/riscv/vc1dsp_rvv.S b/libavcodec/riscv/vc1dsp_rvv.S
> new file mode 100644
> index 00..8a6b27192a
> --- /dev/null
> +++ b/libavcodec/riscv/vc1dsp_rvv.S
> @@ -0,0 +1,123 @@
> +/*
> + * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences
> (ISCAS).
> + *
> + * 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
> + */
> +
> +#include "libavutil/riscv/asm.S"
> +
> +func ff_vc1_inv_trans_8x8_dc_rvv, zve64x
> +lht2, (a2)
> +lit1, 3
> +mul   t2, t2, t1

You can multiply by 3, 5 or 9 with shift-and-add. By 12 with shift-and-add 
then shift, and by 17 with shift then add. You don't need multiplications.

> +addi  t2, t2, 1
> +srai  t2, t2, 1
> +mul   t2, t2, t1
> +addi  t2, t2, 16
> +srai  t2, t2, 5
> +vsetivli  zero, 8, e8, mf2, ta, ma
> +vlse64.v  v0, (a0), a1
> +lit0, 8*8
> +vsetvli   zero, t0, e16, m8, ta, ma
> +vmv.v.x   v8, t2

Do you really need to splat? Can't .vx or .wx be used instead?

> +vsetvli   zero, t0, e8, m4, ta, ma
> +vwaddu.wv v8, v8, v0
> +vsetvli   zero, t0, e16, m8, ta, ma
> +vmax.vx   

Re: [FFmpeg-devel] [PATCH] avfilter/avfilter: fix OOM case for default activate

2023-12-03 Thread Paul B Mahol
Will apply soon.
___
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 1/2] lavfi: introduce textutils

2023-12-03 Thread Stefano Sabatini
On date Thursday 2023-11-30 01:49:13 +0100, Stefano Sabatini wrote:
> Generalize drawtext utilities to make them usable in other filters.
> This will be needed to introduce the QR code source and filter without
> duplicating functionality.
> ---
>  libavfilter/Makefile  |   2 +-
>  libavfilter/textutils.c   | 379 +++
>  libavfilter/textutils.h   | 182 +
>  libavfilter/vf_drawtext.c | 533 ++
>  4 files changed, 693 insertions(+), 403 deletions(-)
>  create mode 100644 libavfilter/textutils.c
>  create mode 100644 libavfilter/textutils.h

Updated (with more doc and a more genric ff_print_formatted_eval_expr
function).
>From 09a6e80ef578f080dda4c5e57caef6feca2ba473 Mon Sep 17 00:00:00 2001
From: Stefano Sabatini 
Date: Mon, 20 Nov 2023 01:13:17 +0100
Subject: [PATCH 1/3] lavfi: introduce textutils

Generalize drawtext utilities to make them usable in other filters.
This will be needed to introduce the QR code source and filter without
duplicating functionality.
---
 libavfilter/Makefile  |   2 +-
 libavfilter/textutils.c   | 379 +++
 libavfilter/textutils.h   | 229 
 libavfilter/vf_drawtext.c | 533 ++
 4 files changed, 740 insertions(+), 403 deletions(-)
 create mode 100644 libavfilter/textutils.c
 create mode 100644 libavfilter/textutils.h

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 63725f91b4..1f9bbcc1af 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -291,7 +291,7 @@ OBJS-$(CONFIG_DOUBLEWEAVE_FILTER)+= vf_weave.o
 OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o
 OBJS-$(CONFIG_DRAWGRAPH_FILTER)  += f_drawgraph.o
 OBJS-$(CONFIG_DRAWGRID_FILTER)   += vf_drawbox.o
-OBJS-$(CONFIG_DRAWTEXT_FILTER)   += vf_drawtext.o
+OBJS-$(CONFIG_DRAWTEXT_FILTER)   += vf_drawtext.o textutils.o
 OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o edge_common.o
 OBJS-$(CONFIG_ELBG_FILTER)   += vf_elbg.o
 OBJS-$(CONFIG_ENTROPY_FILTER)+= vf_entropy.o
diff --git a/libavfilter/textutils.c b/libavfilter/textutils.c
new file mode 100644
index 00..696363190c
--- /dev/null
+++ b/libavfilter/textutils.c
@@ -0,0 +1,379 @@
+/*
+ * 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
+ */
+
+/**
+ * @file
+ * text expansion utilities
+ */
+
+#include 
+#include 
+#include 
+
+#include "textutils.h"
+#include "libavutil/avutil.h"
+#include "libavutil/error.h"
+#include "libavutil/file.h"
+#include "libavutil/time.h"
+
+static int ff_expand_text_function_internal(TextExpander *text_expander, AVBPrint *bp,
+char *name, unsigned argc, char **argv)
+{
+void *ctx = text_expander->ctx;
+TextExpanderFunction *functions = text_expander->functions;
+unsigned i;
+
+for (i = 0; i < text_expander->functions_nb; i++) {
+if (strcmp(name, functions[i].name))
+continue;
+if (argc < functions[i].argc_min) {
+av_log(ctx, AV_LOG_ERROR, "%%{%s} requires at least %d arguments\n",
+   name, functions[i].argc_min);
+return AVERROR(EINVAL);
+}
+if (argc > functions[i].argc_max) {
+av_log(ctx, AV_LOG_ERROR, "%%{%s} requires at most %d arguments\n",
+   name, functions[i].argc_max);
+return AVERROR(EINVAL);
+}
+break;
+}
+if (i >= text_expander->functions_nb) {
+av_log(ctx, AV_LOG_ERROR, "%%{%s} is not known\n", name);
+return AVERROR(EINVAL);
+}
+
+return functions[i].func(ctx, bp, name, argc, argv);
+}
+
+/**
+ * Expand text template pointed to by *rtext.
+ *
+ * Expand text template defined in text using the logic defined in a text
+ * expander object.
+ *
+ * This function expects the text to be in the format %{FUNCTION_NAME[:PARAMS]},
+ * where PARAMS is a sequence of strings separated by : and represents the function
+ * arguments to use for the function evaluation.
+ *
+ * @param text_expander TextExpander object used to expand the text
+ * @param bp   BPrint object where the expanded text is written to
+ * @param rtext 

Re: [FFmpeg-devel] [PATCH] avfilter: allow floating point formatting in expr_int_format (vf_drawtext.c)

2023-12-03 Thread Stefano Sabatini
On date Saturday 2023-12-02 15:54:34 +0100, Lennart Klebl wrote:
> Since I was trying for quite some time to get proper floating point
> formatting of positive and negative numbers working with the existing
> drawtext/expr_int_format implementation, I added the f format specifier
> that is only applied when used in conjunction with a width.
> 
> 

> From 14c438a2bcf2ea17a6818ef5cdc6a7ee9ef30184 Mon Sep 17 00:00:00 2001
> From: "lennart.kl...@t-online.de" 
> Date: Sat, 2 Dec 2023 15:53:20 +0100
> Subject: [PATCH] avfilter: allow floating point formatting in expr_int_format
>  (vf_drawtext.c)
> 
> ---
>  doc/filters.texi  | 12 
>  libavfilter/vf_drawtext.c | 19 ++-
>  2 files changed, 22 insertions(+), 9 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index de19d130cc..1b11124434 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -12807,14 +12807,18 @@ the constants @var{text_w} and @var{text_h} will 
> have an undefined
>  value.
>  
>  @item expr_int_format, eif
> -Evaluate the expression's value and output as formatted integer.
> +Evaluate the expression's value and output as formatted integer or floating
> +point number.
>  
>  The first argument is the expression to be evaluated, just as for the 
> @var{expr} function.
>  The second argument specifies the output format. Allowed values are @samp{x},
> -@samp{X}, @samp{d} and @samp{u}. They are treated exactly as in the
> +@samp{X}, @samp{d}, @samp{u}, and @samp{f}. They are treated exactly as in 
> the
>  @code{printf} function.
> -The third parameter is optional and sets the number of positions taken by 
> the output.
> -It can be used to add padding with zeros from the left.
> +

> +When specifying @samp{f}, the third parameter is required and specifies the
> +number of decimal places for floating point formatting. Otherwise, the third

I think we want to use a sane default when not specified, in this case
you can skip the specification of .N.

> +parameter is optional and sets the number of positions taken by the output. 
> It
> +can be used to add padding with zeros from the left.
>  
>  @item gmtime
>  The time at which the filter is running, expressed in UTC.
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index c5477cbff1..be0490bbb3 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -1359,6 +1359,7 @@ static int func_eval_expr_int_format(AVFilterContext 
> *ctx, AVBPrint *bp,
>  int ret;
>  unsigned int positions = 0;
>  char fmt_str[30] = "%";
> +char fmt_arg = argv[1][0];
>  
>  /*
>   * argv[0] expression to be converted to `int`
> @@ -1376,9 +1377,9 @@ static int func_eval_expr_int_format(AVFilterContext 
> *ctx, AVBPrint *bp,
>  return ret;
>  }
>  
> -if (!strchr("xXdu", argv[1][0])) {
> +if (!strchr("xXduf", fmt_arg)) {
>  av_log(ctx, AV_LOG_ERROR, "Invalid format '%c' specified,"
> -" allowed values: 'x', 'X', 'd', 'u'\n", argv[1][0]);
> +" allowed values: 'x', 'X', 'd', 'u', 'f'\n", fmt_arg);
>  return AVERROR(EINVAL);
>  }
>  
> @@ -1400,14 +1401,22 @@ static int func_eval_expr_int_format(AVFilterContext 
> *ctx, AVBPrint *bp,
>  }
>  #endif
>  

> +if (fmt_arg == 'f' && argc < 3) fmt_arg = 'd';
> +

We should avoid this unexpected fallback, just skip the .N
specification in this case.

>  if (argc == 3)
> -av_strlcatf(fmt_str, sizeof(fmt_str), "0%u", positions);
> -av_strlcatf(fmt_str, sizeof(fmt_str), "%c", argv[1][0]);
> +if (fmt_arg == 'f')
> +av_strlcatf(fmt_str, sizeof(fmt_str), ".%u", positions);
> +else
> +av_strlcatf(fmt_str, sizeof(fmt_str), "0%u", positions);
> +av_strlcatf(fmt_str, sizeof(fmt_str), "%c", fmt_arg);
___
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 v2 0/3] JPEG XL parser bug fixes

2023-12-03 Thread Leo Izen

On 11/27/23 09:10, Leo Izen wrote:

Two bug fixes related to the JPEG XL parser. They're not exactly related and
don't need to be applied in sequence.

v2 change: patches themselves are identical, but now there's a FATE test.

Leo Izen (3):
   avcodec/jpegxl_parse{,r}: use correct ISOBMFF extended size location
   avcodec/jpegxl_parser: fix parsing sequences of extremely small files
   fate/jpegxl: add parser test for extboxes and small files

  libavcodec/jpegxl_parse.c|  6 +++---
  libavcodec/jpegxl_parser.c   | 23 +++
  tests/fate/jxl.mak   |  8 
  tests/ref/fate/jxl-small-ext-box |  9 +
  4 files changed, 35 insertions(+), 11 deletions(-)
  create mode 100644 tests/ref/fate/jxl-small-ext-box



Will apply soon.

- Leo Izen
___
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] lavc/vc1dsp: R-V V inv_trans

2023-12-03 Thread flow gg
c910
vc1dsp.vc1_inv_trans_4x4_dc_c: 84.0
vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 74.0
vc1dsp.vc1_inv_trans_4x8_dc_c: 150.2
vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 83.5
vc1dsp.vc1_inv_trans_8x4_dc_c: 129.0
vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 75.7
vc1dsp.vc1_inv_trans_8x8_dc_c: 254.7
vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 90.5
From cba93503a6f0753b56c1d0cb00f642b3982ee656 Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Fri, 1 Dec 2023 10:07:40 +0800
Subject: [PATCH] lavc/vc1dsp: R-V V inv_trans

c910
vc1dsp.vc1_inv_trans_4x4_dc_c: 84.0
vc1dsp.vc1_inv_trans_4x4_dc_rvv_i32: 74.0
vc1dsp.vc1_inv_trans_4x8_dc_c: 150.2
vc1dsp.vc1_inv_trans_4x8_dc_rvv_i32: 83.5
vc1dsp.vc1_inv_trans_8x4_dc_c: 129.0
vc1dsp.vc1_inv_trans_8x4_dc_rvv_i64: 75.7
vc1dsp.vc1_inv_trans_8x8_dc_c: 254.7
vc1dsp.vc1_inv_trans_8x8_dc_rvv_i64: 90.5
---
 libavcodec/riscv/Makefile  |   2 +
 libavcodec/riscv/vc1dsp_init.c |  47 +
 libavcodec/riscv/vc1dsp_rvv.S  | 123 +
 libavcodec/vc1dsp.c|   2 +
 libavcodec/vc1dsp.h|   1 +
 5 files changed, 175 insertions(+)
 create mode 100644 libavcodec/riscv/vc1dsp_init.c
 create mode 100644 libavcodec/riscv/vc1dsp_rvv.S

diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index 2d0e6c19c8..442c5961ea 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -39,5 +39,7 @@ OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o \
 RVV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvv.o
 OBJS-$(CONFIG_UTVIDEO_DECODER) += riscv/utvideodsp_init.o
 RVV-OBJS-$(CONFIG_UTVIDEO_DECODER) += riscv/utvideodsp_rvv.o
+OBJS-$(CONFIG_VC1DSP) += riscv/vc1dsp_init.o
+RVV-OBJS-$(CONFIG_VC1DSP) += riscv/vc1dsp_rvv.o
 OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_init.o
 RVV-OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_rvv.o
diff --git a/libavcodec/riscv/vc1dsp_init.c b/libavcodec/riscv/vc1dsp_init.c
new file mode 100644
index 00..88e0434f0e
--- /dev/null
+++ b/libavcodec/riscv/vc1dsp_init.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * 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
+ */
+
+#include 
+
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavutil/riscv/cpu.h"
+#include "libavcodec/vc1.h"
+
+void ff_vc1_inv_trans_8x8_dc_rvv(uint8_t *dest, ptrdiff_t stride, int16_t *block);
+void ff_vc1_inv_trans_4x8_dc_rvv(uint8_t *dest, ptrdiff_t stride, int16_t *block);
+void ff_vc1_inv_trans_8x4_dc_rvv(uint8_t *dest, ptrdiff_t stride, int16_t *block);
+void ff_vc1_inv_trans_4x4_dc_rvv(uint8_t *dest, ptrdiff_t stride, int16_t *block);
+
+av_cold void ff_vc1dsp_init_riscv(VC1DSPContext *dsp)
+{
+#if HAVE_RVV
+int flags = av_get_cpu_flags();
+
+if (flags & AV_CPU_FLAG_RVV_I64) {
+dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_rvv;
+dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_rvv;
+}
+if (flags & AV_CPU_FLAG_RVV_I32) {
+dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_rvv;
+dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_rvv;
+}
+#endif
+}
diff --git a/libavcodec/riscv/vc1dsp_rvv.S b/libavcodec/riscv/vc1dsp_rvv.S
new file mode 100644
index 00..8a6b27192a
--- /dev/null
+++ b/libavcodec/riscv/vc1dsp_rvv.S
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * 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
+ */
+
+#include 

Re: [FFmpeg-devel] [PATCH 1/3] doc/encoders/libx264: review and extend option description

2023-12-03 Thread Stefano Sabatini
On date Sunday 2023-11-19 12:34:09 +0100, Stefano Sabatini wrote:
> On date Saturday 2023-11-04 22:26:27 +0100, Stefano Sabatini wrote:
[...]
> > From a11eafe5a61a572f4e9ab9e4ab9907bba98300e4 Mon Sep 17 00:00:00 2001
> > From: Stefano Sabatini 
> > Date: Sat, 26 Aug 2023 01:10:09 +0200
> > Subject: [PATCH] doc/encoders/libx264: review and extend option description
> > 
> > Also, merge x264opts and x264-opts option docs to avoid duplication
> > and make it clearer that they provide mostly the same functionality.
> > ---
> >  doc/encoders.texi | 65 ++-
> >  1 file changed, 36 insertions(+), 29 deletions(-)
> 
> Will apply in a few days if I see no comments.

Applied.
___
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] trac spam

2023-12-03 Thread Michael Koch
Perhaps the regex search is performed on the rendered text as opposed to 
the source text?  Taking the spam comment on #2104 as an example, the 
spammer appears to be using the `[ ]` or 
`[[|]]` markup, therefore `http` does not appear in 
the rendered text.


But on the other hand, the regex filter did match two times in the spam comment 
in ticket 2776.
Why?
This comment was only accepted after the spammer solved the captcha.

Michael


___
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] trac spam

2023-12-03 Thread Frank Plowman

On 03/12/2023 08:49, Michael Koch wrote:

Does anybody know why the last regex seach pattern in the list doesn't 
work?
I thought it should match if any of the keywords is followed by "http" 
in the same line, with any number of any characters before, between 
and after the keywords.


(?i)^.*(appreciate|amazing|great|regards|thank).*http.*$

Perhaps the regex search is performed on the rendered text as opposed to 
the source text?  Taking the spam comment on #2104 as an example, the 
spammer appears to be using the `[ ]` or 
`[[|]]` markup, therefore `http` does not appear in 
the rendered text.


--
https://www.frankplowman.com/

___
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] trac spam

2023-12-03 Thread Michael Koch

Are you talking based on the source of the email message?


I don't have the messages as email. I see only the comments in the trac 
timeline:
https://trac.ffmpeg.org/timeline

Michael

___
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] trac spam

2023-12-03 Thread Masaru Nomiya
Hello,

野宮です.

In the Message; 

  Subject: Re: [FFmpeg-devel] trac spam
  Message-ID : 
  Date & Time: Sun, 3 Dec 2023 10:57:40 +0100

[MK] == Michael Koch  has written:

MN>> I haven't seen the original email so I don't know, but I think it
MN>>  might be a character code issue.

MK>  Example:
MK>  Comment 14 in ticket 2104 contains "Great" and "amazing" and
MK>  "http" in the same line.
MK>  But the regex filter didn't match.

Are you talking based on the source of the email message?

I don't think so, do you?

Regards.

---
┏━━┓彡 野宮  賢   mail-to: nomiya @ lake.dti.ne.jp
┃\/彡
┗━━┛"Bill!
You married with Computer.
Not with Me!"
"No., with money."
___
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] trac spam

2023-12-03 Thread Michael Koch




I haven't seen the original email so I don't know, but I think it

might be a character code issue.

Example:
Comment 14 in ticket 2104 contains "Great" and "amazing" and "http" in 
the same line.

But the regex filter didn't match.

Michael

___
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] trac spam

2023-12-03 Thread Masaru Nomiya
Hello,

In the Message; 

  Subject: Re: [FFmpeg-devel] trac spam
  Message-ID : 
  Date & Time: Sun, 3 Dec 2023 09:49:55 +0100

[MH] == Michael Koch  has written:

MH>  Am 03.12.2023 um 09:39 schrieb Michael Koch:
MH>  > please delete:
MH>  > 
MH>  > comment 14 in ticket 2104
MH>  > comment 6 in ticket 2776
MH>  > user "bunnybellid"
MH>  > 
MH>  > I have updated the regex search patterns.

MH>  Does anybody know why the last regex seach pattern in the list doesn't 
work?
MH>  I thought it should match if any of the keywords is followed by "http" in 
the
MH>  same line, with any number of any characters before, between and after the
MH>  keywords.

MH>  (?i)^.*(appreciate|amazing|great|regards|thank).*http.*$

I haven't seen the original email so I don't know, but I think it
might be a character code issue.

In other words, does this filter work on UTF-8 emails?

Kind Regards.

---
┏━━┓彡 野宮  賢 mail-to: nomiya @ lake.dti.ne.jp
┃\/彡
┗━━┛  "Companies have come to view generative AI as a kind of monster that
  must be fed at all costs―even if it isn’t always clear what exactly
  that data is needed for or what those future AI systems might end up
  doing."
  
-- Generative AI Is Making Companies Even More Thirsty for Your 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] trac spam

2023-12-03 Thread Michael Koch

Am 03.12.2023 um 09:39 schrieb Michael Koch:

please delete:

comment 14 in ticket 2104
comment 6 in ticket 2776
user "bunnybellid"

I have updated the regex search patterns.


Does anybody know why the last regex seach pattern in the list doesn't work?
I thought it should match if any of the keywords is followed by "http" 
in the same line, with any number of any characters before, between and 
after the keywords.


(?i)^.*(appreciate|amazing|great|regards|thank).*http.*$

Michael

___
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] trac spam

2023-12-03 Thread Michael Koch

please delete:

comment 14 in ticket 2104
comment 6 in ticket 2776
user "bunnybellid"

I have updated the regex search patterns.

Michael
___
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".