avcodec/libx265: enable psnr reporting when requested by the user
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 9 Sep 2014 23:38:58 +0000 (01:38 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 28 Sep 2014 02:14:43 +0000 (04:14 +0200)
This is similar to what is done in libx264.c

Fixes Ticket3567

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/libx265.c

index 55019d4..923c750 100644 (file)
@@ -111,6 +111,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
     ctx->params->fpsDenom        = avctx->time_base.num * avctx->ticks_per_frame;
     ctx->params->sourceWidth     = avctx->width;
     ctx->params->sourceHeight    = avctx->height;
+    ctx->params->bEnablePsnr     = !!(avctx->flags & CODEC_FLAG_PSNR);
 
     if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
         av_reduce(&sar_num, &sar_den,