12 + 6 * log2((double) avctx->global_quality / FF_QP2LAMBDA);
12 + 6 * av_log2((double) avctx->global_quality / FF_QP2LAMBDA);
X264_init(AVCodecContext *avctx){    X264Context *x4 = avctx->priv_data;    x264_param_default(&x4->params);    x4->params.pf_log = X264_log;    x4->params.p_log_private = avctx;    x4->params.i_keyint_max = avctx->gop_size;    x4->params.rc.i_bitrate = avctx->bit_rate / 1000;    x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;    x4->params.rc.i_vbv_max_bitrate = avctx->rc_max_rate / 1000;    if(avctx->rc_buffer_size)        x4->params.rc.b_cbr = 1;    x4->params.i_bframe = avctx->max_b_frames;    x4->params.b_cabac = avctx->coder_type == FF_CODER_TYPE_AC;    x4->params.rc.i_qp_min = avctx->qmin;    x4->params.rc.i_qp_max = avctx->qmax;    x4->params.rc.i_qp_step = avctx->max_qdiff;    x4->params.rc.f_qcompress = avctx->qcompress;  /* 0.0 => cbr, 1.0 => constant qp */    x4->params.rc.f_qblur = avctx->qblur;        /* temporally blur quants */    if(avctx->flags & CODEC_FLAG_QSCALE && avctx->global_quality > 0)        x4->params.rc.i_qp_constant =            12 + 6 * log2((double) avctx->global_quality / FF_QP2LAMBDA);    x4->params.i_width = avctx->width;    x4->params.i_height = avctx->height;    x4->params.vui.i_sar_width = avctx->sample_aspect_ratio.num;    x4->params.vui.i_sar_height = avctx->sample_aspect_ratio.den;    x4->params.i_fps_num = avctx->time_base.den;    x4->params.i_fps_den = avctx->time_base.num;    x4->params.i_threads = avctx->thread_count;    x4->enc = x264_encoder_open(&x4->params);    if(!x4->enc)        return -1;    avctx->coded_frame = &x4->out_pic;    return 0;}