x264源码分析--avcintra-class参数

看这个参数前可以先看维基百科介绍:

https://en.wikipedia.org/wiki/AVC-Intra

这个参数控制的是一组参数:

h->param.i_keyint_max = 1;//最大关键帧间隔
h->param.b_intra_refresh = 0;//是否要把I帧拆分到多个sei里面分开发送,从而平衡码率,和每一帧的大小
h->param.analyse.i_weighted_pred = 0;//
h->param.i_frame_reference = 1;
h->param.i_dpb_size = 1;

h->param.b_bluray_compat = 0;
h->param.b_vfr_input = 0;
h->param.b_aud = 1;
h->param.vui.i_chroma_loc = 0;
h->param.i_nal_hrd = X264_NAL_HRD_NONE;
h->param.b_deblocking_filter = 0;
h->param.b_stitchable = 1;
h->param.b_pic_struct = 0;
h->param.analyse.b_transform_8x8 = 1;
h->param.analyse.intra = X264_ANALYSE_I8x8;
h->param.analyse.i_chroma_qp_offset = res && type ? 3 : 4;
h->param.b_cabac = !type;
        h->param.rc.i_vbv_buffer_size = avcintra_lut[type][res][i].frame_size;
        h->param.rc.i_vbv_max_bitrate =
        h->param.rc.i_bitrate = h->param.rc.i_vbv_buffer_size * fps_num / fps_den;
        h->param.rc.i_rc_method = X264_RC_ABR;
        h->param.rc.f_vbv_buffer_init = 1.0;
        h->param.rc.b_filler = 1;
        h->param.i_cqm_preset = X264_CQM_CUSTOM;
        memcpy( h->param.cqm_4iy, x264_cqm_jvt4i, sizeof(h->param.cqm_4iy) );
        memcpy( h->param.cqm_4ic, avcintra_lut[type][res][i].cqm_4ic, sizeof(h->param.cqm_4ic) );
        memcpy( h->param.cqm_8iy, avcintra_lut[type][res][i].cqm_8iy, sizeof(h->param.cqm_8iy) );


        /* Need exactly 10 slices of equal MB count... why?  $deity knows... */
        h->param.i_slice_max_mbs = ((h->param.i_width + 15) / 16) * ((h->param.i_height + 15) / 16) / 10;
        h->param.i_slice_max_size = 0;
        /* The slice structure only allows a maximum of 2 threads for 1080i/p
         * and 1 or 5 threads for 720p */
        if( h->param.b_sliced_threads )
        {
            if( res )
                h->param.i_threads = X264_MIN( 2, h->param.i_threads );
            else
            {
                h->param.i_threads = X264_MIN( 5, h->param.i_threads );
                if( h->param.i_threads < 5 )
                    h->param.i_threads = 1;
            }
        }


        if( type )
            h->param.vui.i_sar_width = h->param.vui.i_sar_height = 1;
        else
        {
            h->param.vui.i_sar_width  = 4;
            h->param.vui.i_sar_height = 3;
        }


        /* Official encoder doesn't appear to go under 13
         * and Avid cannot handle negative QPs */
        h->param.rc.i_qp_min = X264_MAX( h->param.rc.i_qp_min, QP_BD_OFFSET + 1 );


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值