[SCM] libav/experimental: libx264: Correctly manage constant rate factor params
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Aug 10 16:03:34 UTC 2014
The following commit has been merged in the experimental branch:
commit 0ef256d51518f0e483c38b9ee3b993cf0709d00e
Author: Luca Barbato <lu_zero at gentoo.org>
Date: Sat Jun 21 12:46:19 2014 +0200
libx264: Correctly manage constant rate factor params
By default they are set to -1.
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 06e917e..4f44a06 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -179,7 +179,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x264_encoder_reconfig(x4->enc, &x4->params);
}
- if (x4->params.rc.i_rc_method == X264_RC_CRF &&
+ if (x4->crf >= 0 &&
+ x4->params.rc.i_rc_method == X264_RC_CRF &&
x4->params.rc.f_rf_constant != x4->crf) {
x4->params.rc.f_rf_constant = x4->crf;
x264_encoder_reconfig(x4->enc, &x4->params);
@@ -191,7 +192,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
x264_encoder_reconfig(x4->enc, &x4->params);
}
- if (x4->crf_max &&
+ if (x4->crf_max >= 0 &&
x4->params.rc.f_rf_constant_max != x4->crf_max) {
x4->params.rc.f_rf_constant_max = x4->crf_max;
x264_encoder_reconfig(x4->enc, &x4->params);
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list