x264源码分析--ref参数

参数含义:参考帧个数 最大值X264_REF_MAX 16
参考帧越大,视频质量越好,但是运算复杂度越高。
参数解析:"ref", "frameref"
OPT2("ref", "frameref")
        p->i_frame_reference = atoi(value);
代码逻辑:
/* frames used for reference + sentinels */
        x264_frame_t *reference[X264_REF_MAX+2];参考帧缓存数组


for( int i = 0; i < 2; i++ )
{
     int i_refs = X264_MIN(X264_REF_MAX, (i ? 1 + !!h->param.i_bframe_pyramid : h->param.i_frame_reference) ) << PARAM_INTERLACED;
     if( h->param.analyse.i_weighted_pred == X264_WEIGHTP_SMART )
            i_refs = X264_MIN(X264_REF_MAX, i_refs + 1 + (BIT_DEPTH == 8)); //smart weights add two duplicate frames, one in >8-bit


     for( int j = !i; j < i_refs; j++ )
     {
         M32( h->mb.mvr[i][j][0] ) = 0;
         h->mb.mvr[i][j]++;
     }
}
循环计算运动向量

猜你喜欢

转载自blog.csdn.net/fantasy_ARM9/article/details/80271187
今日推荐