summaryrefslogtreecommitdiff
path: root/vp9/simple_encode.h
diff options
context:
space:
mode:
authorCheng Chen <chengchen@google.com>2020-11-05 15:26:54 -0800
committerCheng Chen <chengchen@google.com>2020-11-09 13:14:19 -0800
commitb1d704f12af9b96b39ce1e1493c36bb4b3a3fb2a (patch)
tree372ec0f8fc21df24a98e4956151092ac1583469a /vp9/simple_encode.h
parent220e4331bd4896e1cefabc713326ab28bc781f90 (diff)
downloadlibvpx-b1d704f12af9b96b39ce1e1493c36bb4b3a3fb2a.tar
libvpx-b1d704f12af9b96b39ce1e1493c36bb4b3a3fb2a.tar.gz
libvpx-b1d704f12af9b96b39ce1e1493c36bb4b3a3fb2a.tar.bz2
libvpx-b1d704f12af9b96b39ce1e1493c36bb4b3a3fb2a.zip
Accumulate frame tpl stats and pass through rate control api
Tpl stats is computed at the beginning of encoding the altref frame. We aggregate tpl stats of all blocks for every frame of the current group of picture. After the altref frame is encoded, the tpl stats is passed through the encode frame result to external environment. Change-Id: I2284f8cf9c45d35ba02f3ea45f0187edbbf48294
Diffstat (limited to 'vp9/simple_encode.h')
-rw-r--r--vp9/simple_encode.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/vp9/simple_encode.h b/vp9/simple_encode.h
index ce370a795..380e8118f 100644
--- a/vp9/simple_encode.h
+++ b/vp9/simple_encode.h
@@ -87,6 +87,24 @@ struct MotionVectorInfo {
double mv_column[2];
};
+// Accumulated tpl stats of all blocks in one frame.
+// For each frame, the tpl stats are computed per 32x32 block.
+struct TplStatsInfo {
+ // Intra complexity: the sum of absolute transform difference (SATD) of
+ // intra predicted residuals.
+ int64_t intra_cost;
+ // Inter complexity: the SATD of inter predicted residuals.
+ int64_t inter_cost;
+ // Motion compensated information flow. It measures how much information
+ // is propagated from the current frame to other frames.
+ int64_t mc_flow;
+ // Motion compensated dependency cost. It equals to its own intra_cost
+ // plus the mc_flow.
+ int64_t mc_dep_cost;
+ // Motion compensated reference cost.
+ int64_t mc_ref_cost;
+};
+
struct RefFrameInfo {
int coding_indexes[kRefFrameTypeMax];
@@ -261,6 +279,18 @@ struct EncodeFrameResult {
// Similar to partition info, all 4x4 blocks inside the same partition block
// share the same motion vector information.
std::vector<MotionVectorInfo> motion_vector_info;
+ // A vector of the tpl stats information.
+ // The tpl stats measure the complexity of a frame, as well as the
+ // informatioin propagated along the motion trajactory between frames, in
+ // the reference frame structure.
+ // The tpl stats could be used as a more accurate spatial and temporal
+ // complexity measure in addition to the first pass stats.
+ // The vector contains tpl stats for all show frames in a GOP.
+ // The tpl stats stored in the vector is according to the encoding order.
+ // For example, suppose there are N show frames for the current GOP.
+ // Then tpl_stats_info[0] stores the information of the first frame to be
+ // encoded for this GOP, i.e, the AltRef frame.
+ std::vector<TplStatsInfo> tpl_stats_info;
ImageBuffer coded_frame;
// recode_count, q_index_history and rate_history are only available when