Commit 47812070 authored by Luca Barbato's avatar Luca Barbato
Browse files

libx264: use the library specific default rc_initial_buffer_occupancy



By default libav sets it to 3/4 while x264 sets it to 9/10.

CC: libav-stable@libav.org
Signed-off-by: default avatarLuca Barbato <lu_zero@gentoo.org>
parent bff36075
...@@ -272,7 +272,7 @@ static av_cold int X264_init(AVCodecContext *avctx) ...@@ -272,7 +272,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.rc.f_rf_constant_max = x4->crf_max; x4->params.rc.f_rf_constant_max = x4->crf_max;
} }
if (avctx->rc_buffer_size && avctx->rc_initial_buffer_occupancy && if (avctx->rc_buffer_size && avctx->rc_initial_buffer_occupancy > 0 &&
(avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) { (avctx->rc_initial_buffer_occupancy <= avctx->rc_buffer_size)) {
x4->params.rc.f_vbv_buffer_init = x4->params.rc.f_vbv_buffer_init =
(float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size; (float)avctx->rc_initial_buffer_occupancy / avctx->rc_buffer_size;
...@@ -560,6 +560,7 @@ static const AVCodecDefault x264_defaults[] = { ...@@ -560,6 +560,7 @@ static const AVCodecDefault x264_defaults[] = {
{ "threads", AV_STRINGIFY(X264_THREADS_AUTO) }, { "threads", AV_STRINGIFY(X264_THREADS_AUTO) },
{ "thread_type", "0" }, { "thread_type", "0" },
{ "flags", "+cgop" }, { "flags", "+cgop" },
{ "rc_init_occupancy","-1" },
{ NULL }, { NULL },
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment