Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/3] avfilter/vf_signalstats: Use av_dict_set_int() where appropriate
@ 2024-05-18 15:24 Andreas Rheinhardt
  2024-05-18 15:25 ` [FFmpeg-devel] [PATCH 2/3] avfilter/vf_signalstats: Deduplicate <= 8 and > 8 bit code Andreas Rheinhardt
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andreas Rheinhardt @ 2024-05-18 15:24 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Andreas Rheinhardt

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/vf_signalstats.c | 80 ++++++++++++++++++------------------
 1 file changed, 40 insertions(+), 40 deletions(-)

diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c
index c2358c66cb..960899596f 100644
--- a/libavfilter/vf_signalstats.c
+++ b/libavfilter/vf_signalstats.c
@@ -720,40 +720,40 @@ static int filter_frame8(AVFilterLink *link, AVFrame *in)
     av_dict_set(&out->metadata, "lavfi.signalstats." key, metabuf, 0);   \
 } while (0)
 
-    SET_META("YMIN",    "%d", miny);
-    SET_META("YLOW",    "%d", lowy);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YMIN", miny, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YLOW", lowy, 0);
     SET_META("YAVG",    "%g", 1.0 * toty / s->fs);
-    SET_META("YHIGH",   "%d", highy);
-    SET_META("YMAX",    "%d", maxy);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YHIGH", highy, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YMAX", maxy, 0);
 
-    SET_META("UMIN",    "%d", minu);
-    SET_META("ULOW",    "%d", lowu);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.UMIN", minu, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.ULOW", lowu, 0);
     SET_META("UAVG",    "%g", 1.0 * totu / s->cfs);
-    SET_META("UHIGH",   "%d", highu);
-    SET_META("UMAX",    "%d", maxu);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.UHIGH", highu, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.UMAX", maxu, 0);
 
-    SET_META("VMIN",    "%d", minv);
-    SET_META("VLOW",    "%d", lowv);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VMIN", minv, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VLOW", lowv, 0);
     SET_META("VAVG",    "%g", 1.0 * totv / s->cfs);
-    SET_META("VHIGH",   "%d", highv);
-    SET_META("VMAX",    "%d", maxv);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VHIGH", highv, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VMAX", maxv, 0);
 
-    SET_META("SATMIN",  "%d", minsat);
-    SET_META("SATLOW",  "%d", lowsat);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMIN", minsat, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.SATLOW", lowsat, 0);
     SET_META("SATAVG",  "%g", 1.0 * totsat / s->cfs);
-    SET_META("SATHIGH", "%d", highsat);
-    SET_META("SATMAX",  "%d", maxsat);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.SATHIGH", highsat, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMAX", maxsat, 0);
 
-    SET_META("HUEMED",  "%d", medhue);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.HUEMED", medhue, 0);
     SET_META("HUEAVG",  "%g", 1.0 * tothue / s->cfs);
 
     SET_META("YDIF",    "%g", 1.0 * dify / s->fs);
     SET_META("UDIF",    "%g", 1.0 * difu / s->cfs);
     SET_META("VDIF",    "%g", 1.0 * difv / s->cfs);
 
-    SET_META("YBITDEPTH", "%d", compute_bit_depth(masky));
-    SET_META("UBITDEPTH", "%d", compute_bit_depth(masku));
-    SET_META("VBITDEPTH", "%d", compute_bit_depth(maskv));
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YBITDEPTH", compute_bit_depth(masky), 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.UBITDEPTH", compute_bit_depth(masku), 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VBITDEPTH", compute_bit_depth(maskv), 0);
 
     for (fil = 0; fil < FILT_NUMB; fil ++) {
         if (s->filters & 1<<fil) {
@@ -946,40 +946,40 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in)
     av_frame_free(&s->frame_prev);
     s->frame_prev = av_frame_clone(in);
 
-    SET_META("YMIN",    "%d", miny);
-    SET_META("YLOW",    "%d", lowy);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YMIN", miny, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YLOW", lowy, 0);
     SET_META("YAVG",    "%g", 1.0 * toty / s->fs);
-    SET_META("YHIGH",   "%d", highy);
-    SET_META("YMAX",    "%d", maxy);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YHIGH", highy, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YMAX", maxy, 0);
 
-    SET_META("UMIN",    "%d", minu);
-    SET_META("ULOW",    "%d", lowu);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.UMIN", minu, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.ULOW", lowu, 0);
     SET_META("UAVG",    "%g", 1.0 * totu / s->cfs);
-    SET_META("UHIGH",   "%d", highu);
-    SET_META("UMAX",    "%d", maxu);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.UHIGH", highu, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.UMAX", maxu, 0);
 
-    SET_META("VMIN",    "%d", minv);
-    SET_META("VLOW",    "%d", lowv);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VMIN", minv, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VLOW", lowv, 0);
     SET_META("VAVG",    "%g", 1.0 * totv / s->cfs);
-    SET_META("VHIGH",   "%d", highv);
-    SET_META("VMAX",    "%d", maxv);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VHIGH", highv, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VMAX", maxv, 0);
 
-    SET_META("SATMIN",  "%d", minsat);
-    SET_META("SATLOW",  "%d", lowsat);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMIN", minsat, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.SATLOW", lowsat, 0);
     SET_META("SATAVG",  "%g", 1.0 * totsat / s->cfs);
-    SET_META("SATHIGH", "%d", highsat);
-    SET_META("SATMAX",  "%d", maxsat);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.SATHIGH", highsat, 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.SATMAX", maxsat, 0);
 
-    SET_META("HUEMED",  "%d", medhue);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.HUEMED", medhue, 0);
     SET_META("HUEAVG",  "%g", 1.0 * tothue / s->cfs);
 
     SET_META("YDIF",    "%g", 1.0 * dify / s->fs);
     SET_META("UDIF",    "%g", 1.0 * difu / s->cfs);
     SET_META("VDIF",    "%g", 1.0 * difv / s->cfs);
 
-    SET_META("YBITDEPTH", "%d", compute_bit_depth(masky));
-    SET_META("UBITDEPTH", "%d", compute_bit_depth(masku));
-    SET_META("VBITDEPTH", "%d", compute_bit_depth(maskv));
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.YBITDEPTH", compute_bit_depth(masky), 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.UBITDEPTH", compute_bit_depth(masku), 0);
+    av_dict_set_int(&out->metadata, "lavfi.signalstats.VBITDEPTH", compute_bit_depth(maskv), 0);
 
     for (fil = 0; fil < FILT_NUMB; fil ++) {
         if (s->filters & 1<<fil) {
-- 
2.40.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-20  9:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-18 15:24 [FFmpeg-devel] [PATCH 1/3] avfilter/vf_signalstats: Use av_dict_set_int() where appropriate Andreas Rheinhardt
2024-05-18 15:25 ` [FFmpeg-devel] [PATCH 2/3] avfilter/vf_signalstats: Deduplicate <= 8 and > 8 bit code Andreas Rheinhardt
2024-05-18 15:25 ` [FFmpeg-devel] [PATCH 3/3] avfilter/vf_signalstats: Reindent after the previous commit Andreas Rheinhardt
2024-05-20  9:41 ` [FFmpeg-devel] [PATCH 1/3] avfilter/vf_signalstats: Use av_dict_set_int() where appropriate Andreas Rheinhardt

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git