From cb544f1990dc502b87d75a1da6aa43e649bd45d1 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Tue, 11 Sep 2018 10:50:49 -0700 Subject: [PATCH] Simplify vp9_frame_type_qdelta() Make direct use of frame type in the available VP9_COMMON structure. Eliminate the need to map through rf_level to fetch the frame type. This change doesn't alter the coding stats. It simplifies the vp9_frame_type_qdelta() function logic and removes unnecessary reference to rf_level. Change-Id: I1a7b2f5abcae39aa4a60d08a6011dde38ecf3b58 --- vp9/encoder/vp9_ratectrl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index cc798e9f1..86d2fa18c 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -1188,13 +1188,10 @@ int vp9_frame_type_qdelta(const VP9_COMP *cpi, int rf_level, int q) { 1.75, // GF_ARF_STD 2.00, // KF_STD }; - static const FRAME_TYPE frame_type[RATE_FACTOR_LEVELS] = { - INTER_FRAME, INTER_FRAME, INTER_FRAME, INTER_FRAME, KEY_FRAME - }; const VP9_COMMON *const cm = &cpi->common; - int qdelta = - vp9_compute_qdelta_by_rate(&cpi->rc, frame_type[rf_level], q, - rate_factor_deltas[rf_level], cm->bit_depth); + + int qdelta = vp9_compute_qdelta_by_rate( + &cpi->rc, cm->frame_type, q, rate_factor_deltas[rf_level], cm->bit_depth); return qdelta; } -- 2.40.0