diff mbox series

[FFmpeg-devel,2/8] avfilter/vf_showinfo: small adjustments for the HDR10+ dump

Message ID 1634216942-20329-2-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit b22b8e5489bcd4c19ca6beecf1ec055f39cb5c59
Headers show
Series [FFmpeg-devel,1/8] avfilter/af_replaygain: use fabsf() instead of fabs()
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Limin Wang Oct. 14, 2021, 1:08 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

summary for the adjustments:
1, remove the extra "," in the ,}
...{0.2004,0.3001,0.4008,0.5005,0.6002,0.7009,0.8006,0.9013,}
to
...{0.2004,0.3001,0.4008,0.5005,0.6002,0.7009,0.8006,0.9013}

2, add "," between the } and new field
} fraction_bright_pixels
to
}, fraction_bright_pixels

3, remove the extra space between "} }"
...{0.2004,0.3001,0.4008,0.5005,0.6002,0.7009,0.8006,0.9013,} }
to
...{0.2004,0.3001,0.4008,0.5005,0.6002,0.7009,0.8006,0.9013,}}

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavfilter/vf_showinfo.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index c8c7b98..ff438e7 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -221,7 +221,7 @@  static void dump_dynamic_hdr_plus(AVFilterContext *ctx, AVFrameSideData *sd)
     av_log(ctx, AV_LOG_INFO, "num_windows: %d, ", hdr_plus->num_windows);
     for (int w = 1; w < hdr_plus->num_windows; w++) {
         AVHDRPlusColorTransformParams *params = &hdr_plus->params[w];
-        av_log(ctx, AV_LOG_INFO, "window %d { ", w);
+        av_log(ctx, AV_LOG_INFO, w > 1 ? ", window %d { " : "window %d { ", w);
         av_log(ctx, AV_LOG_INFO, "window_upper_left_corner: (%5.4f,%5.4f),",
                av_q2d(params->window_upper_left_corner_x),
                av_q2d(params->window_upper_left_corner_y));
@@ -242,7 +242,7 @@  static void dump_dynamic_hdr_plus(AVFilterContext *ctx, AVFrameSideData *sd)
                params->semimajor_axis_external_ellipse);
         av_log(ctx, AV_LOG_INFO, "semiminor_axis_external_ellipse: %d, ",
                params->semiminor_axis_external_ellipse);
-        av_log(ctx, AV_LOG_INFO, "overlap_process_option: %d}, ",
+        av_log(ctx, AV_LOG_INFO, "overlap_process_option: %d}",
                params->overlap_process_option);
     }
     av_log(ctx, AV_LOG_INFO, "targeted_system_display_maximum_luminance: %9.4f, ",
@@ -252,7 +252,7 @@  static void dump_dynamic_hdr_plus(AVFilterContext *ctx, AVFrameSideData *sd)
         for (int i = 0; i < hdr_plus->num_rows_targeted_system_display_actual_peak_luminance; i++) {
             av_log(ctx, AV_LOG_INFO, "(");
             for (int j = 0; j < hdr_plus->num_cols_targeted_system_display_actual_peak_luminance; j++) {
-                av_log(ctx, AV_LOG_INFO, "%5.4f,",
+                av_log(ctx, AV_LOG_INFO, i ? ",%5.4f" : "%5.4f",
                        av_q2d(hdr_plus->targeted_system_display_actual_peak_luminance[i][j]));
             }
             av_log(ctx, AV_LOG_INFO, ")");
@@ -264,9 +264,9 @@  static void dump_dynamic_hdr_plus(AVFilterContext *ctx, AVFrameSideData *sd)
         AVHDRPlusColorTransformParams *params = &hdr_plus->params[w];
         av_log(ctx, AV_LOG_INFO, "window %d {maxscl: {", w);
         for (int i = 0; i < 3; i++) {
-            av_log(ctx, AV_LOG_INFO, "%5.4f,",av_q2d(params->maxscl[i]));
+            av_log(ctx, AV_LOG_INFO, i ? ",%5.4f" : "%5.4f",av_q2d(params->maxscl[i]));
         }
-        av_log(ctx, AV_LOG_INFO, "} average_maxrgb: %5.4f, ",
+        av_log(ctx, AV_LOG_INFO, "}, average_maxrgb: %5.4f, ",
                av_q2d(params->average_maxrgb));
         av_log(ctx, AV_LOG_INFO, "distribution_maxrgb: {");
         for (int i = 0; i < params->num_distribution_maxrgb_percentiles; i++) {
@@ -274,35 +274,35 @@  static void dump_dynamic_hdr_plus(AVFilterContext *ctx, AVFrameSideData *sd)
                    params->distribution_maxrgb[i].percentage,
                    av_q2d(params->distribution_maxrgb[i].percentile));
         }
-        av_log(ctx, AV_LOG_INFO, "} fraction_bright_pixels: %5.4f, ",
+        av_log(ctx, AV_LOG_INFO, "}, fraction_bright_pixels: %5.4f",
                av_q2d(params->fraction_bright_pixels));
         if (params->tone_mapping_flag) {
-            av_log(ctx, AV_LOG_INFO, "knee_point: (%5.4f,%5.4f), ", av_q2d(params->knee_point_x), av_q2d(params->knee_point_y));
+            av_log(ctx, AV_LOG_INFO, ", knee_point: (%5.4f,%5.4f), ", av_q2d(params->knee_point_x), av_q2d(params->knee_point_y));
             av_log(ctx, AV_LOG_INFO, "bezier_curve_anchors: {");
             for (int i = 0; i < params->num_bezier_curve_anchors; i++) {
-                av_log(ctx, AV_LOG_INFO, "%5.4f,",
+                av_log(ctx, AV_LOG_INFO, i ? ",%5.4f" : "%5.4f",
                        av_q2d(params->bezier_curve_anchors[i]));
             }
-            av_log(ctx, AV_LOG_INFO, "} ");
+            av_log(ctx, AV_LOG_INFO, "}");
         }
         if (params->color_saturation_mapping_flag) {
-            av_log(ctx, AV_LOG_INFO, "color_saturation_weight: %5.4f",
+            av_log(ctx, AV_LOG_INFO, ", color_saturation_weight: %5.4f",
                    av_q2d(params->color_saturation_weight));
         }
-        av_log(ctx, AV_LOG_INFO, "} ");
+        av_log(ctx, AV_LOG_INFO, "}");
     }
 
     if (hdr_plus->mastering_display_actual_peak_luminance_flag) {
-        av_log(ctx, AV_LOG_INFO, "mastering_display_actual_peak_luminance: {");
+        av_log(ctx, AV_LOG_INFO, ", mastering_display_actual_peak_luminance: {");
         for (int i = 0; i < hdr_plus->num_rows_mastering_display_actual_peak_luminance; i++) {
             av_log(ctx, AV_LOG_INFO, "(");
             for (int j = 0; j <  hdr_plus->num_cols_mastering_display_actual_peak_luminance; j++) {
-                av_log(ctx, AV_LOG_INFO, " %5.4f,",
+                av_log(ctx, AV_LOG_INFO, i ? ",%5.4f" : "%5.4f",
                        av_q2d(hdr_plus->mastering_display_actual_peak_luminance[i][j]));
             }
             av_log(ctx, AV_LOG_INFO, ")");
         }
-        av_log(ctx, AV_LOG_INFO, "} ");
+        av_log(ctx, AV_LOG_INFO, "}");
     }
 }