summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-28 02:13:39 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-28 02:22:22 +0200
commit27294bc203a4e1de9b8047c340f51c76f8f9a0af (patch)
treeb91af9850cfa3a22f14597e425751c122dd4c2eb /libavcodec/mpegvideo_enc.c
parent5d95f32bff86bea453e623e7b241b3c5455af896 (diff)
avcodec/mpegvideo_enc: export per frame PSNR through side data
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 05e79c990a..e39114244c 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1831,8 +1831,6 @@ vbv_retry:
av_assert0(s->avctx->rc_max_rate);
}
- ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, NULL, 0, s->pict_type);
-
if (s->avctx->flags & AV_CODEC_FLAG_PASS1)
ff_write_pass1_stats(s);
@@ -1842,6 +1840,10 @@ vbv_retry:
s->current_picture.error[i];
avctx->error[i] += s->current_picture_ptr->f->error[i];
}
+ ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality,
+ s->current_picture_ptr->f->error,
+ (s->avctx->flags&AV_CODEC_FLAG_PSNR) ? 4 : 0,
+ s->pict_type);
if (s->avctx->flags & AV_CODEC_FLAG_PASS1)
assert(avctx->header_bits + avctx->mv_bits + avctx->misc_bits +