博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
x265-1.7版本-common/framedata.h注释
阅读量:2189 次
发布时间:2019-05-02

本文共 4732 字,大约阅读时间需要 15 分钟。

注:问号以及未注释部分 会在x265-1.8版本内更新 

/****************************************************************************** Copyright (C) 2013 x265 project** Author: Steve Borho 
** This program is free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with this program; if not, write to the Free Software* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.** This program is also available under a commercial proprietary license.* For more information, contact us at license @ x265.com.*****************************************************************************/#ifndef X265_FRAMEDATA_H#define X265_FRAMEDATA_H#include "common.h"#include "slice.h"#include "cudata.h"namespace x265 {// private namespaceclass PicYuv;class JobProvider;/* Per-frame data that is used during encodes and referenced while the picture * is available for reference. A FrameData instance is attached to a Frame as it * comes out of the lookahead. Frames which are not being encoded do not have a * FrameData instance. These instances are re-used once the encoded frame has * no active references. They hold the Slice instance and the 'official' CTU * data structures. They are maintained in a free-list pool along together with * a reconstructed image PicYuv in order to conserve memory. */class FrameData{public: Slice* m_slice; //slice数据,在本类中会实例化 SAOParam* m_saoParam; x265_param* m_param; //配置参数 FrameData* m_freeListNext; PicYuv* m_reconPic; //重构帧数据首地址 (只是指针,指向 frame->m_reconPic) bool m_bHasReferences; // 表示是否有帧参考它(如果后向帧不再参考它设为false) 如果是X265_TYPE_B(不可参考B帧) 设置为false 否则为true 在新来帧计算RPS时会用到(对已经确定RPS的帧,其状态是不可靠的) /* used during DPB/RPS updates */ int m_frameEncoderID; //当前任务的job id /* the ID of the FrameEncoder encoding this frame */ JobProvider* m_jobProvider; //当前帧所在的线程位置 CUDataMemPool m_cuMemPool; //存储一帧CTU的全部空间 CUData* m_picCTU; //存储当前帧的全部CTU (空间为一帧CTU个数,在本类中会实例化) /* Rate control data used during encode and by references */ struct RCStatCU { uint32_t totalBits; /* total bits to encode this CTU */ uint32_t vbvCost; /* sum of lowres costs for 16x16 sub-blocks */ uint32_t intraVbvCost; /* sum of lowres intra costs for 16x16 sub-blocks */ uint64_t avgCost[4]; /* stores the avg cost of CU's in frame for each depth */ uint32_t count[4]; /* count and avgCost only used by Analysis at RD0..4 */ double baseQp; /* Qp of Cu set from RateControl/Vbv (only used by frame encoder) */ }; struct RCStatRow//只在FrameData类中应用 { uint32_t numEncodedCUs; /* ctuAddr of last encoded CTU in row */ uint32_t encodedBits; /* sum of 'totalBits' of encoded CTUs */ uint32_t satdForVbv; //在Lookahead::getEstimatedPictureCost函数中存储每个CTU行对应所有8x8块的cost累加值 /* sum of lowres (estimated) costs for entire row */ uint32_t intraSatdForVbv;//在Lookahead::getEstimatedPictureCost函数中存储每个CTU行对应所有8x8块的intracost累加值 /* sum of lowres (estimated) intra costs for entire row */ uint32_t diagSatd; uint32_t diagIntraSatd; double diagQp; double diagQpScale; double sumQpRc; double sumQpAq; }; RCStatCU* m_cuStat; //申请空间为一帧CTU个数??? RCStatRow* m_rowStat;//申请空间为一帧CTU行数??? double m_avgQpRc; /* avg QP as decided by rate-control */ double m_avgQpAq; /* avg QP as decided by AQ in addition to rate-control */ double m_rateFactor; /* calculated based on the Frame QP */ /** 函数功能 :初始化 /* 调用范围 :只在Frame::allocEncodeData函数中被调用 */ FrameData(); /** 函数功能 :申请一帧CTU的存储空间,初始化CTU、初始化统计信息 /* 调用范围 :只在Frame::allocEncodeData函数中被调用 * \返回值 :申请空间成功为ture,否则为false */ bool create(x265_param *param, const SPS& sps); /** 函数功能 :初始化统计信息为0 /* 调用范围 :只在FrameData::create和Frame::reinit函数中被调用 * \返回值 :null */ void reinit(const SPS& sps); /** 函数功能 :释放内存 /* 调用范围 :只在Frame::destroy()和DPB::~DPB()函数中被调用 */ void destroy(); /** 函数功能 :获取在当前帧对应号的CTU * \参数 ctuAddr: CTU在帧中的编号 */ CUData* getPicCTU(uint32_t ctuAddr) { return &m_picCTU[ctuAddr]; }};}#endif // ifndef X265_FRAMEDATA_H

转载地址:http://qauub.baihongyu.com/

你可能感兴趣的文章
分析C语言的声明
查看>>
TCP为什么是三次握手,为什么不是两次或者四次 && TCP四次挥手
查看>>
C结构体、C++结构体、C++类的区别
查看>>
进程和线程的概念、区别和联系
查看>>
CMake 入门实战
查看>>
绑定CPU逻辑核心的利器——taskset
查看>>
Linux下perf性能测试火焰图只显示函数地址不显示函数名的问题
查看>>
c结构体、c++结构体和c++类的区别以及错误纠正
查看>>
Linux下查看根目录各文件内存占用情况
查看>>
A星算法详解(个人认为最详细,最通俗易懂的一个版本)
查看>>
利用栈实现DFS
查看>>
逆序对的数量(递归+归并思想)
查看>>
数的范围(二分查找上下界)
查看>>
算法导论阅读顺序
查看>>
Windows程序设计:直线绘制
查看>>
linux之CentOS下文件解压方式
查看>>
Django字段的创建并连接MYSQL
查看>>
div标签布局的使用
查看>>
HTML中表格的使用
查看>>
(模板 重要)Tarjan算法解决LCA问题(PAT 1151 LCA in a Binary Tree)
查看>>