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:26 +0200
commit5d4a1048ee251cf7cb2da7d24f23da6d8a34459a (patch)
treede9ba27495746f14e901a5f76184f5f810c5698b /libavcodec/libx264.c
parentfaaecd47082413bcbd94a66ead544c4227fe243e (diff)
libx264: add 'intra-refresh' private option.
Deprecate CODEC_FLAG2_INTRA_REFRESH.
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 7c4db79959..2cf3009e4d 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -50,6 +50,7 @@ typedef struct X264Context {
int rc_lookahead;
int weightp;
int ssim;
+ int intra_refresh;
} X264Context;
static void X264_log(void *p, int level, const char *fmt, va_list args)
@@ -266,7 +267,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.p_log_private = avctx;
x4->params.i_log_level = X264_LOG_DEBUG;
- x4->params.b_intra_refresh = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH;
if (avctx->bit_rate) {
x4->params.rc.i_bitrate = avctx->bit_rate / 1000;
x4->params.rc.i_rc_method = X264_RC_ABR;
@@ -325,6 +325,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
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;
+ x4->params.b_intra_refresh = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH;
#endif
if (x4->aq_mode >= 0)
@@ -342,6 +343,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
if (x4->ssim >= 0)
x4->params.analyse.b_ssim = x4->ssim;
+ if (x4->intra_refresh >= 0)
+ x4->params.b_intra_refresh = x4->intra_refresh;
if (x4->fastfirstpass)
@@ -430,6 +433,7 @@ static const AVOption options[] = {
{ "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 },
+ { "intra-refresh", "Use Periodic Intra Refresh instead of IDR frames.",OFFSET(intra_refresh),FF_OPT_TYPE_INT, {-1 }, -1, 1, VE },
{ NULL },
};