x264源码分析之list0和list1管理

本文分析了x264编码器中list0和list1的管理方式,JM方案与x264略有不同。在x264中,list0保存比current_poc小的帧并按降序排列,而list1则存储大于current_poc的帧按升序排列。同时指出,fdec是以解码后的帧作为参考帧。
摘要由CSDN通过智能技术生成

list0和list1帧内排序情况
JM采用和上图一致的方案,但是x264对参考队列管理比较简单,ref0中存放小于current_poc的帧,且按降序排列;ref1中存放大于current_poc的帧,且按升序排列

//参考队列freference复位
static inline void x264_reference_reset( x264_t *h )
{
   
    int i;

    /* reset ref pictures */
    for( i = 1; i < h->param.i_frame_reference+2; i++ )
    {
   
        h->freference[i]->i_poc = -1;
    }
    h->freference[0]->i_poc = 0;
}


/*下面部分,没编码一帧都会被执行到*/
//初始化fref0和fref1,会根据当前帧的poc重排参考帧
static inline void x264_reference_build_list( x264_t *h, int i_poc )
{
   
    int i;
    int b_ok;

    /* build ref list 0/1 */
    h->i_ref0 = 0;
    h->i_ref1 = 0;
    for( i = 1; i < h->param.i_frame_reference+2; i++ )//先用参考队列freference初始化ref0和ref1
    {
   
        if( h->freference[i]->i_poc >= 0 )
        {
   
            if( h->freference[i]->i_poc < i_poc )
            {
   
                h->fref0[h->i_ref0++] = h->freference[i]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值