}
}
- vpx_codec_err_t AllocateTplList(TplFrameStats **data) {
- // Allocate MAX_ARF_GOP_SIZE * sizeof(TplFrameStats) that will be filled
+ vpx_codec_err_t AllocateTplList(VpxTplFrameStats **data) {
+ // Allocate MAX_ARF_GOP_SIZE * sizeof(VpxTplFrameStats) that will be filled
// by VP9E_GET_TPL_STATS
- *data = static_cast<TplFrameStats *>(calloc(50, sizeof(TplFrameStats)));
+ *data =
+ static_cast<VpxTplFrameStats *>(calloc(50, sizeof(VpxTplFrameStats)));
if (*data == nullptr) return VPX_CODEC_MEM_ERROR;
return VPX_CODEC_OK;
}
while (const vpx_codec_cx_pkt_t *pkt = iter.Next()) {
switch (pkt->kind) {
case VPX_CODEC_CX_FRAME_PKT: {
- TplFrameStats *tpl_stats = NULL;
+ VpxTplFrameStats *tpl_stats = NULL;
EXPECT_EQ(AllocateTplList(&tpl_stats), VPX_CODEC_OK);
encoder->Control(VP9E_GET_TPL_STATS, tpl_stats);
bool stats_not_all_zero = false;
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
- void Control(int ctrl_id, TplFrameStats *arg) {
+ void Control(int ctrl_id, VpxTplFrameStats *arg) {
const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
BLOCK_SIZE tpl_bsize;
TplDepFrame tpl_stats[MAX_ARF_GOP_SIZE];
// Used to store TPL stats before propagation
- TplFrameStats tpl_frame_stats[MAX_ARF_GOP_SIZE];
+ VpxTplFrameStats tpl_frame_stats[MAX_ARF_GOP_SIZE];
YV12_BUFFER_CONFIG *tpl_recon_frames[REF_FRAMES];
EncFrameBuf enc_frame_buf[REF_FRAMES];
#if CONFIG_MULTITHREAD
int frame_idx;
for (frame_idx = 0; frame_idx < MAX_ARF_GOP_SIZE; ++frame_idx) {
TplDepFrame *tpl_frame = &cpi->tpl_stats[frame_idx];
- TplFrameStats *tpl_frame_stats = &cpi->tpl_frame_stats[frame_idx];
+ VpxTplFrameStats *tpl_frame_stats = &cpi->tpl_frame_stats[frame_idx];
memset(tpl_frame->tpl_stats_ptr, 0,
tpl_frame->height * tpl_frame->width *
sizeof(*tpl_frame->tpl_stats_ptr));
}
}
-static void tpl_store_before_propagation(TplBlockStats *tpl_block_stats,
+static void tpl_store_before_propagation(VpxTplBlockStats *tpl_block_stats,
TplDepStats *tpl_stats, int mi_row,
int mi_col, BLOCK_SIZE bsize,
int stride, int64_t recon_error,
for (idy = 0; idy < mi_height; ++idy) {
for (idx = 0; idx < mi_width; ++idx) {
- TplBlockStats *tpl_block_stats_ptr =
+ VpxTplBlockStats *tpl_block_stats_ptr =
&tpl_block_stats[(mi_row + idy) * stride + mi_col + idx];
tpl_block_stats_ptr->inter_cost = src_stats->inter_cost;
tpl_block_stats_ptr->intra_cost = src_stats->intra_cost;
static void mc_flow_dispenser(VP9_COMP *cpi, GF_PICTURE *gf_picture,
int frame_idx, BLOCK_SIZE bsize) {
TplDepFrame *tpl_frame = &cpi->tpl_stats[frame_idx];
- TplFrameStats *tpl_frame_stats_before_propagation =
+ VpxTplFrameStats *tpl_frame_stats_before_propagation =
&cpi->tpl_frame_stats[frame_idx];
YV12_BUFFER_CONFIG *this_frame = gf_picture[frame_idx].frame;
YV12_BUFFER_CONFIG *ref_frame[MAX_INTER_REF_FRAMES] = { NULL, NULL, NULL };
static vpx_codec_err_t ctrl_get_tpl_stats(vpx_codec_alg_priv_t *ctx,
va_list args) {
VP9_COMP *const cpi = ctx->cpi;
- TplFrameStats *data = va_arg(args, TplFrameStats *);
+ VpxTplFrameStats *data = va_arg(args, VpxTplFrameStats *);
int i;
if (data == NULL) {
return VPX_CODEC_INVALID_PARAM;
/*!\brief Codec control to get TPL stats for the current GOP.
*
* Allocation and free of memory of size MAX_ARF_GOP_SIZE (50) *
- * sizeof(TplFrameStats) should be done by applications.
+ * sizeof(VpxTplFrameStats) should be done by applications.
*
* VPX_CODEC_INVALID_PARAM will be returned if the pointer passed in is NULL.
*
};
/*!\brief Temporal dependency model stats for each block before propagation */
-typedef struct TplBlockStats {
+typedef struct VpxTplBlockStats {
int64_t intra_cost; /**< Intra cost */
int64_t inter_cost; /**< Inter cost */
int16_t mv_r; /**< Motion vector row */
int64_t recrf_rate; /**< Rate from reconstructed ref frame */
int64_t recrf_dist; /**< Distortion from reconstructed ref frame */
int ref_frame_index; /**< Ref frame index */
-} TplBlockStats;
+} VpxTplBlockStats;
/*!\brief Temporal dependency model stats for each frame before propagation */
-typedef struct TplFrameStats {
+typedef struct VpxTplFrameStats {
int frame_width; /**< Frame width */
int frame_height; /**< Frame height */
// Size of the list can be calculated from frame_width and frame_height.
- TplBlockStats *block_stats_list; /**< List of tpl stats for each block */
-} TplFrameStats;
+ VpxTplBlockStats *block_stats_list; /**< List of tpl stats for each block */
+} VpxTplFrameStats;
/*!\brief Encoded Frame Flags
*