[FFmpeg-cvslog] vF_psnr: move set_meta() calls out of loop.

Ronald S. Bultje git at videolan.org
Sat Jul 11 12:56:30 CEST 2015


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Fri Jul 10 22:47:24 2015 -0400| [c381af77c5a9581750b2534a95a1249c8f8953d3] | committer: Michael Niedermayer

vF_psnr: move set_meta() calls out of loop.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c381af77c5a9581750b2534a95a1249c8f8953d3
---

 libavfilter/vf_psnr.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index b2c6531..0c2c950 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -173,10 +173,10 @@ static AVFrame *do_psnr(AVFilterContext *ctx, AVFrame *main,
     for (j = 0; j < s->nb_components; j++) {
         c = s->is_rgb ? s->rgba_map[j] : j;
         set_meta(metadata, "lavfi.psnr.mse.", s->comps[j], comp_mse[c]);
-        set_meta(metadata, "lavfi.psnr.mse_avg", 0, mse);
         set_meta(metadata, "lavfi.psnr.psnr.", s->comps[j], get_psnr(comp_mse[c], 1, s->max[c]));
-        set_meta(metadata, "lavfi.psnr.psnr_avg", 0, get_psnr(mse, 1, s->average_max));
     }
+    set_meta(metadata, "lavfi.psnr.mse_avg", 0, mse);
+    set_meta(metadata, "lavfi.psnr.psnr_avg", 0, get_psnr(mse, 1, s->average_max));
 
     if (s->stats_file) {
         fprintf(s->stats_file, "n:%"PRId64" mse_avg:%0.2f ", s->nb_frames, mse);



More information about the ffmpeg-cvslog mailing list