Commit 7a77a1e7 authored by Loren Merritt's avatar Loren Merritt

adjust coded buffer size based on input resolution and QP (old default wasn't...

adjust coded buffer size based on input resolution and QP (old default wasn't enough for HD lossless)


git-svn-id: svn://svn.videolan.org/x264/trunk@268 df754926-b1dd-0310-bc7b-ec298dee348c
parent ca8ead2e
......@@ -515,7 +515,9 @@ x264_t *x264_encoder_open ( x264_param_t *param )
/* Init x264_t */
h->out.i_nal = 0;
h->out.i_bitstream = 1000000; /* FIXME estimate max size (idth/height) */
h->out.i_bitstream = X264_MAX( 1000000, h->param.i_width * h->param.i_height * 1.7
* ( h->param.rc.b_cbr ? pow( 0.5, h->param.rc.i_qp_min )
: pow( 0.5, h->param.rc.i_qp_constant ) * X264_MAX( 1, h->param.rc.f_ip_factor )));
h->out.p_bitstream = x264_malloc( h->out.i_bitstream );
h->i_frame = 0;
......
......@@ -501,9 +501,13 @@ static int Parse( int argc, char **argv,
break;
case 'i':
param->i_keyint_min = atol( optarg );
if( param->i_keyint_max < param->i_keyint_min )
param->i_keyint_max = param->i_keyint_min;
break;
case 'I':
param->i_keyint_max = atol( optarg );
if( param->i_keyint_min > param->i_keyint_max )
param->i_keyint_min = param->i_keyint_max;
break;
case OPT_SCENECUT:
param->i_scenecut_threshold = atol( optarg );
......
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