From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_signalstats: Use av_dict_set_int() where appropriate
Date: Mon, 20 May 2024 11:41:52 +0200
Message-ID: <AS8P250MB0744D484594CD9C0BFABA9858FE92@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <AS8P250MB074478DAE48B5D615AEC218C8FEF2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>
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) {
Will apply this patchset tomorrow unless there are objections.
- Andreas
_______________________________________________
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".
prev parent reply other threads:[~2024-05-20 9:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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
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 ` Andreas Rheinhardt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AS8P250MB0744D484594CD9C0BFABA9858FE92@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM \
--to=andreas.rheinhardt@outlook.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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