summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-08-22 07:55:34 +0200
committerAnton Khirnov <anton@khirnov.net>2011-08-31 10:23:03 +0200
commitfaaecd47082413bcbd94a66ead544c4227fe243e (patch)
tree677b00d713a7726f8f5ae3be77cb2823415fefe6 /libavcodec/libx264.c
parent3b81636f33e9df53153d7e7add02167c0544e695 (diff)
libx264: add 'ssim' private option.
Deprecate CODEC_FLAG2_SSIM.
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index fc751a4fd8..7c4db79959 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -49,6 +49,7 @@ typedef struct X264Context {
char *psy_rd;
int rc_lookahead;
int weightp;
+ int ssim;
} X264Context;
static void X264_log(void *p, int level, const char *fmt, va_list args)
@@ -323,6 +324,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.rc.i_lookahead = avctx->rc_lookahead;
if (avctx->weighted_p_pred >= 0)
x4->params.analyse.i_weighted_pred = avctx->weighted_p_pred;
+ x4->params.analyse.b_ssim = avctx->flags2 & CODEC_FLAG2_SSIM;
#endif
if (x4->aq_mode >= 0)
@@ -338,6 +340,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (x4->weightp >= 0)
x4->params.analyse.i_weighted_pred = x4->weightp;
+ if (x4->ssim >= 0)
+ x4->params.analyse.b_ssim = x4->ssim;
if (x4->fastfirstpass)
@@ -357,7 +361,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.i_fps_den = x4->params.i_timebase_num = avctx->time_base.num;
x4->params.analyse.b_psnr = avctx->flags & CODEC_FLAG_PSNR;
- x4->params.analyse.b_ssim = avctx->flags2 & CODEC_FLAG2_SSIM;
x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD;
@@ -426,6 +429,7 @@ static const AVOption options[] = {
{ "none", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_NONE}, INT_MIN, INT_MAX, VE, "weightp" },
{ "simple", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_SIMPLE}, INT_MIN, INT_MAX, VE, "weightp" },
{ "smart", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_SMART}, INT_MIN, INT_MAX, VE, "weightp" },
+ { "ssim", "Calculate and print SSIM stats.", OFFSET(ssim), FF_OPT_TYPE_INT, {-1 }, -1, 1, VE },
{ NULL },
};