x265-1.8版本-common/framedata.cpp注释
2016-01-29 21:18
435 查看
注:问号以及未注释部分 会在x265-1.9版本内更新
/***************************************************************************** * Copyright (C) 2013 x265 project * * Author: Steve Borho <steve@borho.org> * * 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. *****************************************************************************/ #include "framedata.h" #include "picyuv.h" using namespace X265_NS; /** 函数功能 :初始化 /* 调用范围 :只在Frame::allocEncodeData函数中被调用 */ FrameData::FrameData() { memset(this, 0, sizeof(*this)); } /** 函数功能 :申请一帧CTU的存储空间,初始化CTU、初始化统计信息 /* 调用范围 :只在Frame::allocEncodeData函数中被调用 * \返回值 :申请空间成功为ture,否则为false */ bool FrameData::create(x265_param *param, const SPS& sps) { m_param = param; //获取配置参数 m_slice = new Slice;//实例化 m_picCTU = new CUData[sps.numCUsInFrame];//申请一帧CTU个数的空间 m_cuMemPool.create(0, param->internalCsp, sps.numCUsInFrame);//申请CTU内存空间 for (uint32_t ctuAddr = 0; ctuAddr < sps.numCUsInFrame; ctuAddr++) m_picCTU[ctuAddr].initialize(m_cuMemPool, 0, param->internalCsp, ctuAddr);//初始化函数指针,获取CTU数据相应存储位置 CHECKED_MALLOC(m_cuStat, RCStatCU, sps.numCUsInFrame); CHECKED_MALLOC(m_rowStat, RCStatRow, sps.numCuInHeight); reinit(sps);//初始化统计信息 return true; fail: return false; } /** 函数功能 :初始化统计信息为0 /* 调用范围 :只在FrameData::create和Frame::reinit函数中被调用 * \返回值 :null */ void FrameData::reinit(const SPS& sps) { memset(m_cuStat, 0, sps.numCUsInFrame * sizeof(*m_cuStat)); memset(m_rowStat, 0, sps.numCuInHeight * sizeof(*m_rowStat)); } /** 函数功能 :释放内存 /* 调用范围 :只在Frame::destroy()和DPB::~DPB()函数中被调用 */ void FrameData::destroy() { delete [] m_picCTU; delete m_slice; delete m_saoParam; m_cuMemPool.destroy(); X265_FREE(m_cuStat); X265_FREE(m_rowStat); }
相关文章推荐
- x265-1.8版本-common/dct.cpp注释
- x265-1.8版本-common/cudata.cpp注释
- C语言学习笔记 运算符初步介绍
- C语言文件操作
- C++ 11 右值引用以及std::move
- C++ lambda笔记
- C++ 知识点
- C语言学习笔记 类型修饰符
- map(c++)
- string专题(c++)【1】
- 11条最全面的C/C++编码规范总结
- C++ 编程模块
- C语言不用任何参数遍历数组的方法
- c语言中static 用法
- c++之枚举
- Information on the C++ language
- C语言字符检测函数:isalnum、isalpha、isascii、iscntrl、isdigit、isgraph、islower、isspace、ispunct、isupper
- 石子合并问题
- C++ eclipse 开发环境搭建
- POJ 3259 Wormholes 链式前向星+SPFA