f07ae119155603c1951a5a2d4320d15ae630ce85
1 /*****************************************************************************
2 * Copyright (C) 2013 x265 project
4 * Author: Steve Borho <steve@borho.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
20 * This program is also available under a commercial proprietary license.
21 * For more information, contact us at license @ x265.com.
22 *****************************************************************************/
24 #include "framedata.h"
29 FrameData::FrameData()
31 memset(this, 0, sizeof(*this));
34 bool FrameData::create(x265_param
*param
, const SPS
& sps
)
38 m_picCTU
= new CUData
[sps
.numCUsInFrame
];
40 m_cuMemPool
.create(0, param
->internalCsp
, sps
.numCUsInFrame
);
41 for (uint32_t ctuAddr
= 0; ctuAddr
< sps
.numCUsInFrame
; ctuAddr
++)
42 m_picCTU
[ctuAddr
].initialize(m_cuMemPool
, 0, param
->internalCsp
, ctuAddr
);
44 CHECKED_MALLOC(m_cuStat
, RCStatCU
, sps
.numCUsInFrame
);
45 CHECKED_MALLOC(m_rowStat
, RCStatRow
, sps
.numCuInHeight
);
53 void FrameData::reinit(const SPS
& sps
)
55 memset(m_cuStat
, 0, sps
.numCUsInFrame
* sizeof(*m_cuStat
));
56 memset(m_rowStat
, 0, sps
.numCuInHeight
* sizeof(*m_rowStat
));
59 void FrameData::destroy()
65 m_cuMemPool
.destroy();