Use CamelCase for ratectrl_qmode.cc and the test

Bug: b/221916304
Change-Id: I43bef8c72e44af04fd0699e200257938989ce400
diff --git a/av1/ratectrl_qmode.cc b/av1/ratectrl_qmode.cc
index 989c5e4..44b6c15 100644
--- a/av1/ratectrl_qmode.cc
+++ b/av1/ratectrl_qmode.cc
@@ -23,12 +23,12 @@
 
 // This is used before division to ensure that the divisor isn't zero or
 // too close to zero.
-static double modify_divisor(double divisor) {
+static double ModifyDivisor(double divisor) {
   const double kEpsilon = 0.000001;
   return (divisor < 0 ? divisor - kEpsilon : divisor + kEpsilon);
 }
 
-GopFrame gop_frame_invalid() {
+GopFrame GopFrameInvalid() {
   GopFrame gop_frame = {};
   gop_frame.is_valid = false;
   gop_frame.coding_idx = -1;
@@ -36,7 +36,7 @@
   return gop_frame;
 }
 
-void set_gop_frame_by_type(GopFrameType gop_frame_type, GopFrame *gop_frame) {
+void SetGopFrameByType(GopFrameType gop_frame_type, GopFrame *gop_frame) {
   switch (gop_frame_type) {
     case GopFrameType::kRegularKey:
       gop_frame->is_key_frame = 1;
@@ -83,17 +83,16 @@
   }
 }
 
-GopFrame gop_frame_basic(int global_coding_idx_offset,
-                         int global_order_idx_offset, int coding_idx,
-                         int order_idx, int depth,
-                         GopFrameType gop_frame_type) {
+GopFrame GopFrameBasic(int global_coding_idx_offset,
+                       int global_order_idx_offset, int coding_idx,
+                       int order_idx, int depth, GopFrameType gop_frame_type) {
   GopFrame gop_frame = {};
   gop_frame.is_valid = true;
   gop_frame.coding_idx = coding_idx;
   gop_frame.order_idx = order_idx;
   gop_frame.global_coding_idx = global_coding_idx_offset + coding_idx;
   gop_frame.global_order_idx = global_order_idx_offset + order_idx;
-  set_gop_frame_by_type(gop_frame_type, &gop_frame);
+  SetGopFrameByType(gop_frame_type, &gop_frame);
   gop_frame.colocated_ref_idx = -1;
   gop_frame.update_ref_idx = -1;
   gop_frame.layer_depth = depth + kLayerDepthOffset;
@@ -105,10 +104,9 @@
 // intermediate ARF untill maximum depth is met or the number of regular frames
 // in between two ARFs are less than 3. Than the regular frames will be added
 // into the gop_struct.
-void construct_gop_multi_layer(GopStruct *gop_struct,
-                               RefFrameManager *ref_frame_manager,
-                               int max_depth, int depth, int order_start,
-                               int order_end) {
+void ConstructGopMultiLayer(GopStruct *gop_struct,
+                            RefFrameManager *ref_frame_manager, int max_depth,
+                            int depth, int order_start, int order_end) {
   int coding_idx = static_cast<int>(gop_struct->gop_frame_list.size());
   GopFrame gop_frame;
   int num_frames = order_end - order_start;
@@ -118,38 +116,37 @@
   if (depth < max_depth && num_frames >= kMinIntervalToAddArf) {
     int order_mid = (order_start + order_end) / 2;
     // intermediate ARF
-    gop_frame = gop_frame_basic(global_coding_idx_offset,
-                                global_order_idx_offset, coding_idx, order_mid,
-                                depth, GopFrameType::kIntermediateArf);
+    gop_frame = GopFrameBasic(global_coding_idx_offset, global_order_idx_offset,
+                              coding_idx, order_mid, depth,
+                              GopFrameType::kIntermediateArf);
     ref_frame_manager->UpdateRefFrameTable(&gop_frame);
     gop_struct->gop_frame_list.push_back(gop_frame);
-    construct_gop_multi_layer(gop_struct, ref_frame_manager, max_depth,
-                              depth + 1, order_start, order_mid);
+    ConstructGopMultiLayer(gop_struct, ref_frame_manager, max_depth, depth + 1,
+                           order_start, order_mid);
     // show existing intermediate ARF
-    gop_frame = gop_frame_basic(global_coding_idx_offset,
-                                global_order_idx_offset, coding_idx, order_mid,
-                                max_depth, GopFrameType::kShowExisting);
+    gop_frame = GopFrameBasic(global_coding_idx_offset, global_order_idx_offset,
+                              coding_idx, order_mid, max_depth,
+                              GopFrameType::kShowExisting);
     ref_frame_manager->UpdateRefFrameTable(&gop_frame);
     gop_struct->gop_frame_list.push_back(gop_frame);
-    construct_gop_multi_layer(gop_struct, ref_frame_manager, max_depth,
-                              depth + 1, order_mid + 1, order_end);
+    ConstructGopMultiLayer(gop_struct, ref_frame_manager, max_depth, depth + 1,
+                           order_mid + 1, order_end);
   } else {
     // regular frame
     for (int i = order_start; i < order_end; ++i) {
       coding_idx = static_cast<int>(gop_struct->gop_frame_list.size());
       gop_frame =
-          gop_frame_basic(global_coding_idx_offset, global_order_idx_offset,
-                          coding_idx, i, max_depth, GopFrameType::kRegularLeaf);
+          GopFrameBasic(global_coding_idx_offset, global_order_idx_offset,
+                        coding_idx, i, max_depth, GopFrameType::kRegularLeaf);
       ref_frame_manager->UpdateRefFrameTable(&gop_frame);
       gop_struct->gop_frame_list.push_back(gop_frame);
     }
   }
 }
 
-GopStruct construct_gop(RefFrameManager *ref_frame_manager,
-                        int show_frame_count, bool has_key_frame,
-                        int global_coding_idx_offset,
-                        int global_order_idx_offset) {
+GopStruct ConstructGop(RefFrameManager *ref_frame_manager, int show_frame_count,
+                       bool has_key_frame, int global_coding_idx_offset,
+                       int global_order_idx_offset) {
   GopStruct gop_struct;
   gop_struct.show_frame_count = show_frame_count;
   gop_struct.global_coding_idx_offset = global_coding_idx_offset;
@@ -162,9 +159,9 @@
     const int key_frame_depth = -1;
     ref_frame_manager->Reset();
     coding_idx = static_cast<int>(gop_struct.gop_frame_list.size());
-    gop_frame = gop_frame_basic(
-        global_coding_idx_offset, global_order_idx_offset, coding_idx,
-        order_start, key_frame_depth, GopFrameType::kRegularKey);
+    gop_frame = GopFrameBasic(global_coding_idx_offset, global_order_idx_offset,
+                              coding_idx, order_start, key_frame_depth,
+                              GopFrameType::kRegularKey);
     ref_frame_manager->UpdateRefFrameTable(&gop_frame);
     gop_struct.gop_frame_list.push_back(gop_frame);
     order_start++;
@@ -172,17 +169,17 @@
   // ARF
   const int arf_depth = 0;
   coding_idx = static_cast<int>(gop_struct.gop_frame_list.size());
-  gop_frame = gop_frame_basic(global_coding_idx_offset, global_order_idx_offset,
-                              coding_idx, order_arf, arf_depth,
-                              GopFrameType::kRegularArf);
+  gop_frame = GopFrameBasic(global_coding_idx_offset, global_order_idx_offset,
+                            coding_idx, order_arf, arf_depth,
+                            GopFrameType::kRegularArf);
   ref_frame_manager->UpdateRefFrameTable(&gop_frame);
   gop_struct.gop_frame_list.push_back(gop_frame);
-  construct_gop_multi_layer(&gop_struct, ref_frame_manager,
-                            ref_frame_manager->ForwardMaxSize(), arf_depth + 1,
-                            order_start, order_arf);
+  ConstructGopMultiLayer(&gop_struct, ref_frame_manager,
+                         ref_frame_manager->ForwardMaxSize(), arf_depth + 1,
+                         order_start, order_arf);
   // Overlay
   coding_idx = static_cast<int>(gop_struct.gop_frame_list.size());
-  gop_frame = gop_frame_basic(
+  gop_frame = GopFrameBasic(
       global_coding_idx_offset, global_order_idx_offset, coding_idx, order_arf,
       ref_frame_manager->ForwardMaxSize(), GopFrameType::kOverlay);
   ref_frame_manager->UpdateRefFrameTable(&gop_frame);
@@ -199,7 +196,7 @@
 // a real scene cut.
 // We adapt the threshold based on number of frames in this key-frame group so
 // far.
-static double get_second_ref_usage_threshold(int frame_count_so_far) {
+static double GetSecondRefUsageThreshold(int frame_count_so_far) {
   const int adapt_upto = 32;
   const double min_second_ref_usage_thresh = 0.085;
   const double second_ref_usage_thresh_max_delta = 0.035;
@@ -218,9 +215,9 @@
 // Also requires that intra and inter errors are very similar to help eliminate
 // harmful false positives.
 // It will not help if the transition is a fade or other multi-frame effect.
-static bool detect_slide_transition(const FIRSTPASS_STATS &this_frame,
-                                    const FIRSTPASS_STATS &last_frame,
-                                    const FIRSTPASS_STATS &next_frame) {
+static bool DetectSlideTransition(const FIRSTPASS_STATS &this_frame,
+                                  const FIRSTPASS_STATS &last_frame,
+                                  const FIRSTPASS_STATS &next_frame) {
   // Intra / Inter threshold very low
   constexpr double kVeryLowII = 1.5;
   // Clean slide transitions we expect a sharp single frame spike in error.
@@ -235,9 +232,9 @@
 // Check if there is a significant intra/inter error change between the current
 // frame and its neighbor. If so, we should further test whether the current
 // frame should be a key frame.
-static bool detect_intra_inter_error_change(const FIRSTPASS_STATS &this_stats,
-                                            const FIRSTPASS_STATS &last_stats,
-                                            const FIRSTPASS_STATS &next_stats) {
+static bool DetectIntraInterErrorChange(const FIRSTPASS_STATS &this_stats,
+                                        const FIRSTPASS_STATS &last_stats,
+                                        const FIRSTPASS_STATS &next_stats) {
   // Minimum % intra coding observed in first pass (1.0 = 100%)
   constexpr double kMinIntraLevel = 0.25;
   // Minimum ratio between the % of intra coding and inter coding in the first
@@ -256,23 +253,23 @@
   constexpr double kErrorChangeThreshold = 0.4;
   const double last_this_error_ratio =
       fabs(last_stats.coded_error - this_stats.coded_error) /
-      modify_divisor(this_stats.coded_error);
+      ModifyDivisor(this_stats.coded_error);
 
   const double this_next_error_ratio =
       fabs(last_stats.intra_error - this_stats.intra_error) /
-      modify_divisor(this_stats.intra_error);
+      ModifyDivisor(this_stats.intra_error);
 
   // Maximum threshold for the relative ratio of intra error score vs best
   // inter error score.
   constexpr double kThisIntraCodedErrorRatioMax = 1.9;
   const double this_intra_coded_error_ratio =
-      this_stats.intra_error / modify_divisor(this_stats.coded_error);
+      this_stats.intra_error / ModifyDivisor(this_stats.coded_error);
 
   // For real scene cuts we expect an improvment in the intra inter error
   // ratio in the next frame.
   constexpr double kNextIntraCodedErrorRatioMin = 3.5;
   const double next_intra_coded_error_ratio =
-      next_stats.intra_error / modify_divisor(next_stats.coded_error);
+      next_stats.intra_error / ModifyDivisor(next_stats.coded_error);
 
   double pcnt_intra = 1.0 - this_stats.pcnt_inter;
   return pcnt_intra > pcnt_intra_min &&
@@ -284,9 +281,8 @@
 
 // Check whether the candidate can be a key frame.
 // This is a rewrite of test_candidate_kf().
-static bool test_candidate_key(const FirstpassInfo &first_pass_info,
-                               int candidate_key_idx,
-                               int frames_since_prev_key) {
+static bool TestCandidateKey(const FirstpassInfo &first_pass_info,
+                             int candidate_key_idx, int frames_since_prev_key) {
   const auto &stats_list = first_pass_info.stats_list;
   const int stats_count = static_cast<int>(stats_list.size());
   if (candidate_key_idx + 1 >= stats_count || candidate_key_idx - 1 < 0) {
@@ -298,7 +294,7 @@
 
   if (frames_since_prev_key < 3) return false;
   const double second_ref_usage_threshold =
-      get_second_ref_usage_threshold(frames_since_prev_key);
+      GetSecondRefUsageThreshold(frames_since_prev_key);
   if (this_stats.pcnt_second_ref >= second_ref_usage_threshold) return false;
   if (next_stats.pcnt_second_ref >= second_ref_usage_threshold) return false;
 
@@ -307,8 +303,8 @@
   // may be a good option.
   constexpr double kVeryLowInterThreshold = 0.05;
   if (this_stats.pcnt_inter < kVeryLowInterThreshold ||
-      detect_slide_transition(this_stats, last_stats, next_stats) ||
-      detect_intra_inter_error_change(this_stats, last_stats, next_stats)) {
+      DetectSlideTransition(this_stats, last_stats, next_stats) ||
+      DetectIntraInterErrorChange(this_stats, last_stats, next_stats)) {
     double boost_score = 0.0;
     double decay_accumulator = 1.0;
 
@@ -336,8 +332,8 @@
       }
 
       constexpr double kBoostFactor = 12.5;
-      double next_iiratio = (kBoostFactor * stats.intra_error /
-                             modify_divisor(stats.coded_error));
+      double next_iiratio =
+          (kBoostFactor * stats.intra_error / ModifyDivisor(stats.coded_error));
       next_iiratio = std::min(next_iiratio, 128.0);
       double boost_score_increment = decay_accumulator * next_iiratio;
 
@@ -374,7 +370,7 @@
 }
 
 // Compute key frame location from first_pass_info.
-std::vector<int> get_key_frame_list(const FirstpassInfo &first_pass_info) {
+std::vector<int> GetKeyFrameList(const FirstpassInfo &first_pass_info) {
   std::vector<int> key_frame_list;
   key_frame_list.push_back(0);  // The first frame is always a key frame
   int candidate_key_idx = 1;
@@ -382,7 +378,7 @@
          static_cast<int>(first_pass_info.stats_list.size())) {
     const int frames_since_prev_key = candidate_key_idx - key_frame_list.back();
     // Check for a scene cut.
-    const bool scenecut_detected = test_candidate_key(
+    const bool scenecut_detected = TestCandidateKey(
         first_pass_info, candidate_key_idx, frames_since_prev_key);
     if (scenecut_detected) {
       key_frame_list.push_back(candidate_key_idx);
@@ -393,7 +389,7 @@
 }
 
 // initialize GF_GROUP_STATS
-static void init_gf_stats(GF_GROUP_STATS *gf_stats) {
+static void InitGFStats(GF_GROUP_STATS *gf_stats) {
   gf_stats->gf_group_err = 0.0;
   gf_stats->gf_group_raw_error = 0.0;
   gf_stats->gf_group_skip_pct = 0.0;
@@ -416,8 +412,7 @@
   gf_stats->non_zero_stdev_count = 0;
 }
 
-static int find_regions_index(const std::vector<REGIONS> &regions,
-                              int frame_idx) {
+static int FindRegionIndex(const std::vector<REGIONS> &regions, int frame_idx) {
   for (int k = 0; k < static_cast<int>(regions.size()); k++) {
     if (regions[k].start <= frame_idx && regions[k].last >= frame_idx) {
       return k;
@@ -442,7 +437,7 @@
  *
  * \return Returns a vector of decided GF group lengths.
  */
-static std::vector<int> partition_gop_intervals(
+static std::vector<int> PartitionGopIntervals(
     const RateControlParam &rc_param,
     const std::vector<FIRSTPASS_STATS> &stats_list,
     const std::vector<REGIONS> &regions_list, int order_index,
@@ -458,7 +453,7 @@
   std::vector<int> cut_pos(1, -1);
   int cut_here = 0;
   GF_GROUP_STATS gf_stats;
-  init_gf_stats(&gf_stats);
+  InitGFStats(&gf_stats);
   int num_regions = static_cast<int>(regions_list.size());
   int num_stats = static_cast<int>(stats_list.size());
   int stats_in_loop_index = order_index;
@@ -486,10 +481,8 @@
     if (cur_last - cur_start <= rc_param.max_gop_show_frame_count &&
         cur_last > cur_start) {
       // find the region indices of where the first and last frame belong.
-      int k_start =
-          find_regions_index(regions_list, cur_start + frames_since_key);
-      int k_last =
-          find_regions_index(regions_list, cur_last + frames_since_key);
+      int k_start = FindRegionIndex(regions_list, cur_start + frames_since_key);
+      int k_last = FindRegionIndex(regions_list, cur_last + frames_since_key);
       if (cur_start + frames_since_key == 0) k_start = 0;
 
       // See if we have a scenecut in between
@@ -552,8 +545,7 @@
             if (order_index + j >= num_stats) break;
             base_score =
                 (base_score + 1.0) * stats_list[order_index + j].cor_coeff;
-            int this_reg =
-                find_regions_index(regions_list, j + frames_since_key);
+            int this_reg = FindRegionIndex(regions_list, j + frames_since_key);
             if (this_reg < 0) continue;
             // A GOP should include at most 1 blending region.
             if (regions_list[this_reg].type == BLENDING_REGION) {
@@ -604,7 +596,7 @@
           // For blending areas, move one more frame in case we missed the
           // first blending frame.
           int best_reg =
-              find_regions_index(regions_list, best_j + frames_since_key);
+              FindRegionIndex(regions_list, best_j + frames_since_key);
           if (best_reg < num_regions - 1 && best_reg > 0) {
             if (regions_list[best_reg - 1].type == BLENDING_REGION &&
                 regions_list[best_reg + 1].type == BLENDING_REGION) {
@@ -632,13 +624,13 @@
     stats_in_loop_index = order_index + cur_last;
     cur_start = cur_last;
     int cur_region_idx =
-        find_regions_index(regions_list, cur_start + 1 + frames_since_key);
+        FindRegionIndex(regions_list, cur_start + 1 + frames_since_key);
     if (cur_region_idx >= 0)
       if (regions_list[cur_region_idx].type == SCENECUT_REGION) cur_start++;
 
     if (cut_here > 1 && cur_last == ori_last) break;
     // reset accumulators
-    init_gf_stats(&gf_stats);
+    InitGFStats(&gf_stats);
     i = cur_last + 1;
   }
   std::vector<int> gf_intervals;
@@ -658,7 +650,7 @@
   RefFrameManager ref_frame_manager(rc_param_.max_ref_frames);
   int global_coding_idx_offset = 0;
   int global_order_idx_offset = 0;
-  std::vector<int> key_frame_list = get_key_frame_list(firstpass_info);
+  std::vector<int> key_frame_list = GetKeyFrameList(firstpass_info);
   key_frame_list.push_back(stats_size);  // a sentinel value
   for (size_t ki = 0; ki + 1 < key_frame_list.size(); ++ki) {
     int frames_to_key = key_frame_list[ki + 1] - key_frame_list[ki];
@@ -675,15 +667,15 @@
     av1_identify_regions(firstpass_info.stats_list.data() + key_order_index,
                          frames_to_key, 0, regions_list.data(), &total_regions);
     regions_list.resize(total_regions);
-    std::vector<int> gf_intervals = partition_gop_intervals(
+    std::vector<int> gf_intervals = PartitionGopIntervals(
         rc_param_, firstpass_info.stats_list, regions_list, key_order_index,
         /*frames_since_key=*/0, frames_to_key);
     for (size_t gi = 0; gi < gf_intervals.size(); ++gi) {
       const bool has_key_frame = gi == 0;
       const int show_frame_count = gf_intervals[gi];
       GopStruct gop =
-          construct_gop(&ref_frame_manager, show_frame_count, has_key_frame,
-                        global_coding_idx_offset, global_order_idx_offset);
+          ConstructGop(&ref_frame_manager, show_frame_count, has_key_frame,
+                       global_coding_idx_offset, global_order_idx_offset);
       assert(gop.show_frame_count == show_frame_count);
       global_coding_idx_offset += static_cast<int>(gop.gop_frame_list.size());
       global_order_idx_offset += gop.show_frame_count;
@@ -693,9 +685,8 @@
   return gop_list;
 }
 
-TplFrameDepStats create_tpl_frame_dep_stats_empty(int frame_height,
-                                                  int frame_width,
-                                                  int min_block_size) {
+TplFrameDepStats CreateTplFrameDepStats(int frame_height, int frame_width,
+                                        int min_block_size) {
   const int unit_rows =
       frame_height / min_block_size + !!(frame_height % min_block_size);
   const int unit_cols =
@@ -707,10 +698,10 @@
   return frame_dep_stats;
 }
 
-TplFrameDepStats create_tpl_frame_dep_stats_wo_propagation(
+TplFrameDepStats CreateTplFrameDepStatsWithoutPropagation(
     const TplFrameStats &frame_stats) {
   const int min_block_size = frame_stats.min_block_size;
-  TplFrameDepStats frame_dep_stats = create_tpl_frame_dep_stats_empty(
+  TplFrameDepStats frame_dep_stats = CreateTplFrameDepStats(
       frame_stats.frame_height, frame_stats.frame_width, min_block_size);
   for (const TplBlockStats &block_stats : frame_stats.block_stats_list) {
     const int block_unit_rows = block_stats.height / min_block_size;
@@ -730,9 +721,9 @@
   return frame_dep_stats;
 }
 
-int get_ref_coding_idx_list(const TplBlockStats &block_stats,
-                            const RefFrameTable &ref_frame_table,
-                            int *ref_coding_idx_list) {
+int GetRefCodingIdxList(const TplBlockStats &block_stats,
+                        const RefFrameTable &ref_frame_table,
+                        int *ref_coding_idx_list) {
   int ref_frame_count = 0;
   for (int i = 0; i < kBlockRefCount; ++i) {
     ref_coding_idx_list[i] = -1;
@@ -745,7 +736,7 @@
   return ref_frame_count;
 }
 
-int get_block_overlap_area(int r0, int c0, int r1, int c1, int size) {
+int GetBlockOverlapArea(int r0, int c0, int r1, int c1, int size) {
   const int r_low = std::max(r0, r1);
   const int r_high = std::min(r0 + size, r1 + size);
   const int c_low = std::max(c0, c1);
@@ -756,7 +747,7 @@
   return 0;
 }
 
-double tpl_frame_stats_accumulate(const TplFrameStats &frame_stats) {
+double TplFrameStatsAccumulate(const TplFrameStats &frame_stats) {
   double ref_sum_cost_diff = 0;
   for (auto &block_stats : frame_stats.block_stats_list) {
     ref_sum_cost_diff += block_stats.inter_cost - block_stats.intra_cost;
@@ -764,7 +755,7 @@
   return ref_sum_cost_diff;
 }
 
-double tpl_frame_dep_stats_accumulate(const TplFrameDepStats &frame_dep_stats) {
+double TplFrameDepStatsAccumulate(const TplFrameDepStats &frame_dep_stats) {
   double sum = 0;
   for (const auto &row : frame_dep_stats.unit_stats) {
     sum = std::accumulate(row.begin(), row.end(), sum);
@@ -775,7 +766,7 @@
 // This is a generalization of GET_MV_RAWPEL that allows for an arbitrary
 // number of fractional bits.
 // TODO(angiebird): Add unit test to this function
-int get_fullpel_value(int subpel_value, int subpel_bits) {
+int GetFullpelValue(int subpel_value, int subpel_bits) {
   const int subpel_scale = (1 << subpel_bits);
   const int sign = subpel_value >= 0 ? 1 : -1;
   int fullpel_value = (abs(subpel_value) + subpel_scale / 2) >> subpel_bits;
@@ -783,9 +774,9 @@
   return fullpel_value;
 }
 
-void tpl_frame_dep_stats_propagate(const TplFrameStats &frame_stats,
-                                   const RefFrameTable &ref_frame_table,
-                                   TplGopDepStats *tpl_gop_dep_stats) {
+void TplFrameDepStatsPropagate(const TplFrameStats &frame_stats,
+                               const RefFrameTable &ref_frame_table,
+                               TplGopDepStats *tpl_gop_dep_stats) {
   const int min_block_size = frame_stats.min_block_size;
   const int frame_unit_rows =
       frame_stats.frame_height / frame_stats.min_block_size;
@@ -793,8 +784,8 @@
       frame_stats.frame_width / frame_stats.min_block_size;
   for (const TplBlockStats &block_stats : frame_stats.block_stats_list) {
     int ref_coding_idx_list[kBlockRefCount] = { -1, -1 };
-    int ref_frame_count = get_ref_coding_idx_list(block_stats, ref_frame_table,
-                                                  ref_coding_idx_list);
+    int ref_frame_count =
+        GetRefCodingIdxList(block_stats, ref_frame_table, ref_coding_idx_list);
     if (ref_frame_count > 0) {
       double propagation_ratio = 1.0 / ref_frame_count;
       for (int i = 0; i < kBlockRefCount; ++i) {
@@ -802,8 +793,8 @@
           auto &ref_frame_dep_stats =
               tpl_gop_dep_stats->frame_dep_stats_list[ref_coding_idx_list[i]];
           const auto &mv = block_stats.mv[i];
-          const int mv_row = get_fullpel_value(mv.row, mv.subpel_bits);
-          const int mv_col = get_fullpel_value(mv.col, mv.subpel_bits);
+          const int mv_row = GetFullpelValue(mv.row, mv.subpel_bits);
+          const int mv_col = GetFullpelValue(mv.col, mv.subpel_bits);
           const int block_unit_rows = block_stats.height / min_block_size;
           const int block_unit_cols = block_stats.width / min_block_size;
           const int unit_count = block_unit_rows * block_unit_cols;
@@ -824,7 +815,7 @@
                   const int unit_col = ref_unit_col_low + k;
                   if (unit_row >= 0 && unit_row < frame_unit_rows &&
                       unit_col >= 0 && unit_col < frame_unit_cols) {
-                    const int overlap_area = get_block_overlap_area(
+                    const int overlap_area = GetBlockOverlapArea(
                         unit_row * min_block_size, unit_col * min_block_size,
                         ref_block_row, ref_block_col, min_block_size);
                     const double overlap_ratio =
@@ -843,8 +834,8 @@
 }
 
 // TODO(angiebird): Add unit test for this function
-std::vector<RefFrameTable> get_ref_frame_table_list(
-    const GopStruct &gop_struct, RefFrameTable ref_frame_table) {
+std::vector<RefFrameTable> GetRefFrameTableList(const GopStruct &gop_struct,
+                                                RefFrameTable ref_frame_table) {
   const int frame_count = static_cast<int>(gop_struct.gop_frame_list.size());
   std::vector<RefFrameTable> ref_frame_table_list;
   ref_frame_table_list.push_back(ref_frame_table);
@@ -858,7 +849,7 @@
   return ref_frame_table_list;
 }
 
-TplGopDepStats compute_tpl_gop_dep_stats(
+TplGopDepStats ComputeTplGopDepStats(
     const TplGopStats &tpl_gop_stats,
     const std::vector<RefFrameTable> &ref_frame_table_list) {
   const int frame_count = static_cast<int>(ref_frame_table_list.size());
@@ -867,7 +858,7 @@
   TplGopDepStats tpl_gop_dep_stats;
   for (int coding_idx = 0; coding_idx < frame_count; coding_idx++) {
     tpl_gop_dep_stats.frame_dep_stats_list.push_back(
-        create_tpl_frame_dep_stats_wo_propagation(
+        CreateTplFrameDepStatsWithoutPropagation(
             tpl_gop_stats.frame_stats_list[coding_idx]));
   }
 
@@ -876,13 +867,13 @@
     auto &ref_frame_table = ref_frame_table_list[coding_idx];
     // TODO(angiebird): Handle/test the case where reference frame
     // is in the previous GOP
-    tpl_frame_dep_stats_propagate(tpl_gop_stats.frame_stats_list[coding_idx],
-                                  ref_frame_table, &tpl_gop_dep_stats);
+    TplFrameDepStatsPropagate(tpl_gop_stats.frame_stats_list[coding_idx],
+                              ref_frame_table, &tpl_gop_dep_stats);
   }
   return tpl_gop_dep_stats;
 }
 
-static int get_rdmult(const GopFrame &gop_frame, int qindex) {
+static int GetRDMult(const GopFrame &gop_frame, int qindex) {
   // TODO(angiebird):
   // 1) Check if these rdmult rules are good in our use case.
   // 2) Support high-bit-depth mode
@@ -902,12 +893,12 @@
     const GopStruct &gop_struct, const TplGopStats &tpl_gop_stats,
     const RefFrameTable &ref_frame_table_snapshot_init) {
   const std::vector<RefFrameTable> ref_frame_table_list =
-      get_ref_frame_table_list(gop_struct, ref_frame_table_snapshot_init);
+      GetRefFrameTableList(gop_struct, ref_frame_table_snapshot_init);
 
   GopEncodeInfo gop_encode_info;
   gop_encode_info.final_snapshot = ref_frame_table_list.back();
   TplGopDepStats gop_dep_stats =
-      compute_tpl_gop_dep_stats(tpl_gop_stats, ref_frame_table_list);
+      ComputeTplGopDepStats(tpl_gop_stats, ref_frame_table_list);
   const int frame_count =
       static_cast<int>(tpl_gop_stats.frame_stats_list.size());
   for (int i = 0; i < frame_count; i++) {
@@ -915,9 +906,9 @@
     const TplFrameDepStats &frame_dep_stats =
         gop_dep_stats.frame_dep_stats_list[i];
     const double cost_without_propagation =
-        tpl_frame_stats_accumulate(frame_stats);
+        TplFrameStatsAccumulate(frame_stats);
     const double cost_with_propagation =
-        tpl_frame_dep_stats_accumulate(frame_dep_stats);
+        TplFrameDepStatsAccumulate(frame_dep_stats);
     // TODO(angiebird): This part is still a draft. Check whether this makes
     // sense mathematically.
     const double frame_importance =
@@ -928,7 +919,7 @@
     param.q_index = av1_get_q_index_from_qstep_ratio(rc_param_.base_q_index,
                                                      qstep_ratio, AOM_BITS_8);
     const GopFrame &gop_frame = gop_struct.gop_frame_list[i];
-    param.rdmult = get_rdmult(gop_frame, param.q_index);
+    param.rdmult = GetRDMult(gop_frame, param.q_index);
     gop_encode_info.param_list.push_back(param);
   }
   return gop_encode_info;
diff --git a/av1/ratectrl_qmode.h b/av1/ratectrl_qmode.h
index d18e9e3..eaab68f 100644
--- a/av1/ratectrl_qmode.h
+++ b/av1/ratectrl_qmode.h
@@ -34,7 +34,7 @@
   std::vector<TplFrameDepStats> frame_dep_stats_list;
 };
 
-GopFrame gop_frame_invalid();
+GopFrame GopFrameInvalid();
 
 // gop frame type used for facilitate setting up GopFrame
 // TODO(angiebird): Define names for forward key frame and
@@ -52,37 +52,35 @@
 
 // Set up is_key_frame, is_arf_frame, is_show_frame, is_golden_frame and
 // encode_ref_mode in GopFrame based on gop_frame_type
-void set_gop_frame_by_type(GopFrameType gop_frame_type, GopFrame *gop_frame);
+void SetGopFrameByType(GopFrameType gop_frame_type, GopFrame *gop_frame);
 
-GopFrame gop_frame_basic(int global_coding_idx_offset,
-                         int global_order_idx_offset, int coding_idx,
-                         int order_idx, int depth, GopFrameType gop_frame_type);
+GopFrame GopFrameBasic(int global_coding_idx_offset,
+                       int global_order_idx_offset, int coding_idx,
+                       int order_idx, int depth, GopFrameType gop_frame_type);
 
-GopStruct construct_gop(RefFrameManager *ref_frame_manager,
-                        int show_frame_count, bool has_key_frame,
-                        int global_coding_idx_offset,
-                        int global_order_idx_offset);
+GopStruct ConstructGop(RefFrameManager *ref_frame_manager, int show_frame_count,
+                       bool has_key_frame, int global_coding_idx_offset,
+                       int global_order_idx_offset);
 
-TplFrameDepStats create_tpl_frame_dep_stats_empty(int frame_height,
-                                                  int frame_width,
-                                                  int min_block_size);
+TplFrameDepStats CreateTplFrameDepStats(int frame_height, int frame_width,
+                                        int min_block_size);
 
-TplFrameDepStats create_tpl_frame_dep_stats_wo_propagation(
+TplFrameDepStats CreateTplFrameDepStatsWithoutPropagation(
     const TplFrameStats &frame_stats);
 
-std::vector<int> get_key_frame_list(const FirstpassInfo &first_pass_info);
+std::vector<int> GetKeyFrameList(const FirstpassInfo &first_pass_info);
 
-double tpl_frame_stats_accumulate(const TplFrameStats &frame_stats);
+double TplFrameStatsAccumulate(const TplFrameStats &frame_stats);
 
-double tpl_frame_dep_stats_accumulate(const TplFrameDepStats &frame_dep_stats);
+double TplFrameDepStatsAccumulate(const TplFrameDepStats &frame_dep_stats);
 
-void tpl_frame_dep_stats_propagate(const TplFrameStats &frame_stats,
-                                   const RefFrameTable &ref_frame_table,
-                                   TplGopDepStats *tpl_gop_dep_stats);
+void TplFrameDepStatsPropagate(const TplFrameStats &frame_stats,
+                               const RefFrameTable &ref_frame_table,
+                               TplGopDepStats *tpl_gop_dep_stats);
 
-int get_block_overlap_area(int r0, int c0, int r1, int c1, int size);
+int GetBlockOverlapArea(int r0, int c0, int r1, int c1, int size);
 
-TplGopDepStats compute_tpl_gop_dep_stats(
+TplGopDepStats ComputeTplGopDepStats(
     const TplGopStats &tpl_gop_stats,
     const std::vector<RefFrameTable> &ref_frame_table_list);
 
diff --git a/av1/reference_manager.cc b/av1/reference_manager.cc
index 85ab5f2..0ed524a 100644
--- a/av1/reference_manager.cc
+++ b/av1/reference_manager.cc
@@ -24,7 +24,7 @@
   free_ref_idx_list_.clear();
   for (int i = 0; i < kRefFrameTableSize; ++i) {
     free_ref_idx_list_.push_back(i);
-    ref_frame_table_[i] = gop_frame_invalid();
+    ref_frame_table_[i] = GopFrameInvalid();
   }
   forward_stack_.clear();
   backward_queue_.clear();
@@ -105,7 +105,7 @@
                                                 int priority_idx) const {
   int ref_idx = GetRefFrameIdxByPriority(ref_update_type, priority_idx);
   if (ref_idx == -1) {
-    return gop_frame_invalid();
+    return GopFrameInvalid();
   }
   assert(ref_frame_table_[ref_idx].update_ref_idx == ref_idx);
   return ref_frame_table_[ref_idx];
diff --git a/test/ratectrl_qmode_test.cc b/test/ratectrl_qmode_test.cc
index 99a790e..91cb008 100644
--- a/test/ratectrl_qmode_test.cc
+++ b/test/ratectrl_qmode_test.cc
@@ -28,7 +28,7 @@
 using ::testing::Field;
 using ::testing::Return;
 
-void test_gop_display_order(const GopStruct &gop_struct) {
+void TestGopDisplayOrder(const GopStruct &gop_struct) {
   // Test whether show frames' order indices are sequential
   int expected_order_idx = 0;
   int expected_show_frame_count = 0;
@@ -42,8 +42,8 @@
   EXPECT_EQ(gop_struct.show_frame_count, expected_show_frame_count);
 }
 
-void test_gop_global_order_idx(const GopStruct &gop_struct,
-                               int global_order_idx_offset) {
+void TestGopGlobalOrderIdx(const GopStruct &gop_struct,
+                           int global_order_idx_offset) {
   // Test whether show frames' global order indices are sequential
   EXPECT_EQ(gop_struct.global_order_idx_offset, global_order_idx_offset);
   int expected_global_order_idx = global_order_idx_offset;
@@ -55,8 +55,8 @@
   }
 }
 
-void test_gop_global_coding_idx(const GopStruct &gop_struct,
-                                int global_coding_idx_offset) {
+void TestGopGlobalCodingIdx(const GopStruct &gop_struct,
+                            int global_coding_idx_offset) {
   EXPECT_EQ(gop_struct.global_coding_idx_offset, global_coding_idx_offset);
   for (const auto &gop_frame : gop_struct.gop_frame_list) {
     EXPECT_EQ(gop_frame.global_coding_idx,
@@ -64,7 +64,7 @@
   }
 }
 
-void test_colocated_show_frame(const GopStruct &gop_struct) {
+void TestColocatedShowFrame(const GopStruct &gop_struct) {
   // Test whether each non show frame has a colocated show frame
   int gop_size = static_cast<int>(gop_struct.gop_frame_list.size());
   for (int gop_idx = 0; gop_idx < gop_size; ++gop_idx) {
@@ -87,7 +87,7 @@
   }
 }
 
-void test_layer_depth(const GopStruct &gop_struct, int max_layer_depth) {
+void TestLayerDepth(const GopStruct &gop_struct, int max_layer_depth) {
   int gop_size = static_cast<int>(gop_struct.gop_frame_list.size());
   for (int gop_idx = 0; gop_idx < gop_size; ++gop_idx) {
     const auto &gop_frame = gop_struct.gop_frame_list[gop_idx];
@@ -105,7 +105,7 @@
   }
 }
 
-void test_arf_interval(const GopStruct &gop_struct) {
+void TestArfInterval(const GopStruct &gop_struct) {
   std::vector<int> arf_order_idx_list;
   for (const auto &gop_frame : gop_struct.gop_frame_list) {
     if (gop_frame.is_arf_frame) {
@@ -127,17 +127,17 @@
   const int global_order_idx_offset = 20;
   RefFrameManager ref_frame_manager(kRefFrameTableSize);
   GopStruct gop_struct =
-      construct_gop(&ref_frame_manager, show_frame_count, has_key_frame,
-                    global_coding_idx_offset, global_order_idx_offset);
+      ConstructGop(&ref_frame_manager, show_frame_count, has_key_frame,
+                   global_coding_idx_offset, global_order_idx_offset);
   EXPECT_EQ(gop_struct.show_frame_count, show_frame_count);
-  test_gop_display_order(gop_struct);
-  test_gop_global_order_idx(gop_struct, global_order_idx_offset);
-  test_gop_global_coding_idx(gop_struct, global_coding_idx_offset);
-  test_colocated_show_frame(gop_struct);
+  TestGopDisplayOrder(gop_struct);
+  TestGopGlobalOrderIdx(gop_struct, global_order_idx_offset);
+  TestGopGlobalCodingIdx(gop_struct, global_coding_idx_offset);
+  TestColocatedShowFrame(gop_struct);
   const int max_layer_depth =
       ref_frame_manager.ForwardMaxSize() + kLayerDepthOffset;
-  test_layer_depth(gop_struct, max_layer_depth);
-  test_arf_interval(gop_struct);
+  TestLayerDepth(gop_struct, max_layer_depth);
+  TestArfInterval(gop_struct);
 }
 
 TEST(RateControlQModeTest, ConstructGopKey) {
@@ -147,21 +147,21 @@
   const int global_order_idx_offset = 8;
   RefFrameManager ref_frame_manager(kRefFrameTableSize);
   GopStruct gop_struct =
-      construct_gop(&ref_frame_manager, show_frame_count, has_key_frame,
-                    global_coding_idx_offset, global_order_idx_offset);
+      ConstructGop(&ref_frame_manager, show_frame_count, has_key_frame,
+                   global_coding_idx_offset, global_order_idx_offset);
   EXPECT_EQ(gop_struct.show_frame_count, show_frame_count);
-  test_gop_display_order(gop_struct);
-  test_gop_global_order_idx(gop_struct, global_order_idx_offset);
-  test_gop_global_coding_idx(gop_struct, global_coding_idx_offset);
-  test_colocated_show_frame(gop_struct);
+  TestGopDisplayOrder(gop_struct);
+  TestGopGlobalOrderIdx(gop_struct, global_order_idx_offset);
+  TestGopGlobalCodingIdx(gop_struct, global_coding_idx_offset);
+  TestColocatedShowFrame(gop_struct);
   const int max_layer_depth =
       ref_frame_manager.ForwardMaxSize() + kLayerDepthOffset;
-  test_layer_depth(gop_struct, max_layer_depth);
-  test_arf_interval(gop_struct);
+  TestLayerDepth(gop_struct, max_layer_depth);
+  TestArfInterval(gop_struct);
 }
 
-static TplBlockStats create_toy_tpl_block_stats(int h, int w, int r, int c,
-                                                int cost_diff) {
+static TplBlockStats CreateToyTplBlockStats(int h, int w, int r, int c,
+                                            int cost_diff) {
   TplBlockStats tpl_block_stats = {};
   tpl_block_stats.height = h;
   tpl_block_stats.width = w;
@@ -174,8 +174,8 @@
   return tpl_block_stats;
 }
 
-static TplFrameStats create_toy_tpl_frame_stats_with_diff_sizes(
-    int min_block_size, int max_block_size) {
+static TplFrameStats CreateToyTplFrameStatsWithDiffSizes(int min_block_size,
+                                                         int max_block_size) {
   TplFrameStats frame_stats;
   const int max_h = max_block_size;
   const int max_w = max_h;
@@ -193,7 +193,7 @@
           int c = max_w * j + w * v;
           int cost_diff = std::rand() % 16;
           TplBlockStats block_stats =
-              create_toy_tpl_block_stats(h, w, r, c, cost_diff);
+              CreateToyTplBlockStats(h, w, r, c, cost_diff);
           frame_stats.block_stats_list.push_back(block_stats);
         }
       }
@@ -202,14 +202,14 @@
   return frame_stats;
 }
 
-static void augment_tpl_frame_stats_with_ref_frames(
+static void AugmentTplFrameStatsWithRefFrames(
     TplFrameStats *tpl_frame_stats,
     const std::array<int, kBlockRefCount> &ref_frame_index) {
   for (auto &block_stats : tpl_frame_stats->block_stats_list) {
     block_stats.ref_frame_index = ref_frame_index;
   }
 }
-static void augment_tpl_frame_stats_with_motion_vector(
+static void AugmentTplFrameStatsWithMotionVector(
     TplFrameStats *tpl_frame_stats,
     const std::array<MotionVector, kBlockRefCount> &mv) {
   for (auto &block_stats : tpl_frame_stats->block_stats_list) {
@@ -217,36 +217,36 @@
   }
 }
 
-static RefFrameTable create_toy_ref_frame_table(int frame_count) {
+static RefFrameTable CreateToyRefFrameTable(int frame_count) {
   RefFrameTable ref_frame_table;
   const int ref_frame_table_size = static_cast<int>(ref_frame_table.size());
   EXPECT_LE(frame_count, ref_frame_table_size);
   for (int i = 0; i < frame_count; ++i) {
     ref_frame_table[i] =
-        gop_frame_basic(0, 0, i, i, 0, GopFrameType::kRegularLeaf);
+        GopFrameBasic(0, 0, i, i, 0, GopFrameType::kRegularLeaf);
   }
   for (int i = frame_count; i < ref_frame_table_size; ++i) {
-    ref_frame_table[i] = gop_frame_invalid();
+    ref_frame_table[i] = GopFrameInvalid();
   }
   return ref_frame_table;
 }
 
-static MotionVector create_fullpel_mv(int row, int col) {
+static MotionVector CreateFullpelMv(int row, int col) {
   return { row, col, 0 };
 }
 
 TEST(RateControlQModeTest, CreateTplFrameDepStats) {
-  TplFrameStats frame_stats = create_toy_tpl_frame_stats_with_diff_sizes(8, 16);
+  TplFrameStats frame_stats = CreateToyTplFrameStatsWithDiffSizes(8, 16);
   TplFrameDepStats frame_dep_stats =
-      create_tpl_frame_dep_stats_wo_propagation(frame_stats);
+      CreateTplFrameDepStatsWithoutPropagation(frame_stats);
   EXPECT_EQ(frame_stats.min_block_size, frame_dep_stats.unit_size);
   const int unit_rows = static_cast<int>(frame_dep_stats.unit_stats.size());
   const int unit_cols = static_cast<int>(frame_dep_stats.unit_stats[0].size());
   EXPECT_EQ(frame_stats.frame_height, unit_rows * frame_dep_stats.unit_size);
   EXPECT_EQ(frame_stats.frame_width, unit_cols * frame_dep_stats.unit_size);
-  const double sum_cost_diff = tpl_frame_dep_stats_accumulate(frame_dep_stats);
+  const double sum_cost_diff = TplFrameDepStatsAccumulate(frame_dep_stats);
 
-  const double ref_sum_cost_diff = tpl_frame_stats_accumulate(frame_stats);
+  const double ref_sum_cost_diff = TplFrameStatsAccumulate(frame_stats);
   EXPECT_NEAR(sum_cost_diff, ref_sum_cost_diff, 0.0000001);
 }
 
@@ -258,8 +258,8 @@
   std::vector<int> c1 = { 9, 12, 17, 5, 100, 9 };
   std::vector<int> ref_overlap = { 64, 30, 0, 24, 0, 0 };
   for (int i = 0; i < static_cast<int>(r1.size()); ++i) {
-    const int overlap0 = get_block_overlap_area(r0, c0, r1[i], c1[i], size);
-    const int overlap1 = get_block_overlap_area(r1[i], c1[i], r0, c0, size);
+    const int overlap0 = GetBlockOverlapArea(r0, c0, r1[i], c1[i], size);
+    const int overlap1 = GetBlockOverlapArea(r1[i], c1[i], r0, c0, size);
     EXPECT_EQ(overlap0, ref_overlap[i]);
     EXPECT_EQ(overlap1, ref_overlap[i]);
   }
@@ -268,31 +268,31 @@
 TEST(RateControlQModeTest, TplFrameDepStatsPropagateSingleZeroMotion) {
   // cur frame with coding_idx 1 use ref frame with coding_idx 0
   const std::array<int, kBlockRefCount> ref_frame_index = { 0, -1 };
-  TplFrameStats frame_stats = create_toy_tpl_frame_stats_with_diff_sizes(8, 16);
-  augment_tpl_frame_stats_with_ref_frames(&frame_stats, ref_frame_index);
+  TplFrameStats frame_stats = CreateToyTplFrameStatsWithDiffSizes(8, 16);
+  AugmentTplFrameStatsWithRefFrames(&frame_stats, ref_frame_index);
 
   TplGopDepStats gop_dep_stats;
   const int frame_count = 2;
   // ref frame with coding_idx 0
-  TplFrameDepStats frame_dep_stats0 = create_tpl_frame_dep_stats_empty(
-      frame_stats.frame_height, frame_stats.frame_width,
-      frame_stats.min_block_size);
+  TplFrameDepStats frame_dep_stats0 =
+      CreateTplFrameDepStats(frame_stats.frame_height, frame_stats.frame_width,
+                             frame_stats.min_block_size);
   gop_dep_stats.frame_dep_stats_list.push_back(frame_dep_stats0);
 
   // cur frame with coding_idx 1
   const TplFrameDepStats frame_dep_stats1 =
-      create_tpl_frame_dep_stats_wo_propagation(frame_stats);
+      CreateTplFrameDepStatsWithoutPropagation(frame_stats);
   gop_dep_stats.frame_dep_stats_list.push_back(frame_dep_stats1);
 
-  const RefFrameTable ref_frame_table = create_toy_ref_frame_table(frame_count);
-  tpl_frame_dep_stats_propagate(frame_stats, ref_frame_table, &gop_dep_stats);
+  const RefFrameTable ref_frame_table = CreateToyRefFrameTable(frame_count);
+  TplFrameDepStatsPropagate(frame_stats, ref_frame_table, &gop_dep_stats);
 
   // cur frame with coding_idx 1
-  const double ref_sum_cost_diff = tpl_frame_stats_accumulate(frame_stats);
+  const double ref_sum_cost_diff = TplFrameStatsAccumulate(frame_stats);
 
   // ref frame with coding_idx 0
   const double sum_cost_diff =
-      tpl_frame_dep_stats_accumulate(gop_dep_stats.frame_dep_stats_list[0]);
+      TplFrameDepStatsAccumulate(gop_dep_stats.frame_dep_stats_list[0]);
 
   // The sum_cost_diff between coding_idx 0 and coding_idx 1 should be equal
   // because every block in cur frame has zero motion, use ref frame with
@@ -303,42 +303,42 @@
 TEST(RateControlQModeTest, TplFrameDepStatsPropagateCompoundZeroMotion) {
   // cur frame with coding_idx 2 use two ref frames with coding_idx 0 and 1
   const std::array<int, kBlockRefCount> ref_frame_index = { 0, 1 };
-  TplFrameStats frame_stats = create_toy_tpl_frame_stats_with_diff_sizes(8, 16);
-  augment_tpl_frame_stats_with_ref_frames(&frame_stats, ref_frame_index);
+  TplFrameStats frame_stats = CreateToyTplFrameStatsWithDiffSizes(8, 16);
+  AugmentTplFrameStatsWithRefFrames(&frame_stats, ref_frame_index);
 
   TplGopDepStats gop_dep_stats;
   const int frame_count = 3;
   // ref frame with coding_idx 0
-  const TplFrameDepStats frame_dep_stats0 = create_tpl_frame_dep_stats_empty(
-      frame_stats.frame_height, frame_stats.frame_width,
-      frame_stats.min_block_size);
+  const TplFrameDepStats frame_dep_stats0 =
+      CreateTplFrameDepStats(frame_stats.frame_height, frame_stats.frame_width,
+                             frame_stats.min_block_size);
   gop_dep_stats.frame_dep_stats_list.push_back(frame_dep_stats0);
 
   // ref frame with coding_idx 1
-  const TplFrameDepStats frame_dep_stats1 = create_tpl_frame_dep_stats_empty(
-      frame_stats.frame_height, frame_stats.frame_width,
-      frame_stats.min_block_size);
+  const TplFrameDepStats frame_dep_stats1 =
+      CreateTplFrameDepStats(frame_stats.frame_height, frame_stats.frame_width,
+                             frame_stats.min_block_size);
   gop_dep_stats.frame_dep_stats_list.push_back(frame_dep_stats1);
 
   // cur frame with coding_idx 2
   const TplFrameDepStats frame_dep_stats2 =
-      create_tpl_frame_dep_stats_wo_propagation(frame_stats);
+      CreateTplFrameDepStatsWithoutPropagation(frame_stats);
   gop_dep_stats.frame_dep_stats_list.push_back(frame_dep_stats2);
 
-  const RefFrameTable ref_frame_table = create_toy_ref_frame_table(frame_count);
-  tpl_frame_dep_stats_propagate(frame_stats, ref_frame_table, &gop_dep_stats);
+  const RefFrameTable ref_frame_table = CreateToyRefFrameTable(frame_count);
+  TplFrameDepStatsPropagate(frame_stats, ref_frame_table, &gop_dep_stats);
 
   // cur frame with coding_idx 1
-  const double ref_sum_cost_diff = tpl_frame_stats_accumulate(frame_stats);
+  const double ref_sum_cost_diff = TplFrameStatsAccumulate(frame_stats);
 
   // ref frame with coding_idx 0
   const double sum_cost_diff0 =
-      tpl_frame_dep_stats_accumulate(gop_dep_stats.frame_dep_stats_list[0]);
+      TplFrameDepStatsAccumulate(gop_dep_stats.frame_dep_stats_list[0]);
   EXPECT_NEAR(sum_cost_diff0, ref_sum_cost_diff * 0.5, 0.0000001);
 
   // ref frame with coding_idx 1
   const double sum_cost_diff1 =
-      tpl_frame_dep_stats_accumulate(gop_dep_stats.frame_dep_stats_list[1]);
+      TplFrameDepStatsAccumulate(gop_dep_stats.frame_dep_stats_list[1]);
   EXPECT_NEAR(sum_cost_diff1, ref_sum_cost_diff * 0.5, 0.0000001);
 }
 
@@ -346,32 +346,32 @@
   // cur frame with coding_idx 1 use ref frame with coding_idx 0
   const std::array<int, kBlockRefCount> ref_frame_index = { 0, -1 };
   const int min_block_size = 8;
-  TplFrameStats frame_stats = create_toy_tpl_frame_stats_with_diff_sizes(
-      min_block_size, min_block_size * 2);
-  augment_tpl_frame_stats_with_ref_frames(&frame_stats, ref_frame_index);
+  TplFrameStats frame_stats =
+      CreateToyTplFrameStatsWithDiffSizes(min_block_size, min_block_size * 2);
+  AugmentTplFrameStatsWithRefFrames(&frame_stats, ref_frame_index);
 
   const int mv_row = min_block_size / 2;
   const int mv_col = min_block_size / 4;
   const double r_ratio = 1.0 / 2;
   const double c_ratio = 1.0 / 4;
   std::array<MotionVector, kBlockRefCount> mv;
-  mv[0] = create_fullpel_mv(mv_row, mv_col);
-  mv[1] = create_fullpel_mv(0, 0);
-  augment_tpl_frame_stats_with_motion_vector(&frame_stats, mv);
+  mv[0] = CreateFullpelMv(mv_row, mv_col);
+  mv[1] = CreateFullpelMv(0, 0);
+  AugmentTplFrameStatsWithMotionVector(&frame_stats, mv);
 
   TplGopDepStats gop_dep_stats;
   const int frame_count = 2;
   // ref frame with coding_idx 0
-  gop_dep_stats.frame_dep_stats_list.push_back(create_tpl_frame_dep_stats_empty(
-      frame_stats.frame_height, frame_stats.frame_width,
-      frame_stats.min_block_size));
+  gop_dep_stats.frame_dep_stats_list.push_back(
+      CreateTplFrameDepStats(frame_stats.frame_height, frame_stats.frame_width,
+                             frame_stats.min_block_size));
 
   // cur frame with coding_idx 1
   gop_dep_stats.frame_dep_stats_list.push_back(
-      create_tpl_frame_dep_stats_wo_propagation(frame_stats));
+      CreateTplFrameDepStatsWithoutPropagation(frame_stats));
 
-  const RefFrameTable ref_frame_table = create_toy_ref_frame_table(frame_count);
-  tpl_frame_dep_stats_propagate(frame_stats, ref_frame_table, &gop_dep_stats);
+  const RefFrameTable ref_frame_table = CreateToyRefFrameTable(frame_count);
+  TplFrameDepStatsPropagate(frame_stats, ref_frame_table, &gop_dep_stats);
 
   const auto &dep_stats0 = gop_dep_stats.frame_dep_stats_list[0];
   const auto &dep_stats1 = gop_dep_stats.frame_dep_stats_list[1];
@@ -402,23 +402,23 @@
     // Use the previous frame as reference
     const std::array<int, kBlockRefCount> ref_frame_index = { i - 1, -1 };
     int min_block_size = 8;
-    TplFrameStats frame_stats = create_toy_tpl_frame_stats_with_diff_sizes(
-        min_block_size, min_block_size * 2);
-    augment_tpl_frame_stats_with_ref_frames(&frame_stats, ref_frame_index);
+    TplFrameStats frame_stats =
+        CreateToyTplFrameStatsWithDiffSizes(min_block_size, min_block_size * 2);
+    AugmentTplFrameStatsWithRefFrames(&frame_stats, ref_frame_index);
     tpl_gop_stats.frame_stats_list.push_back(frame_stats);
 
-    ref_frame_table_list.push_back(create_toy_ref_frame_table(i));
+    ref_frame_table_list.push_back(CreateToyRefFrameTable(i));
   }
   const TplGopDepStats &gop_dep_stats =
-      compute_tpl_gop_dep_stats(tpl_gop_stats, ref_frame_table_list);
+      ComputeTplGopDepStats(tpl_gop_stats, ref_frame_table_list);
 
   double ref_sum = 0;
   for (int i = 2; i >= 0; i--) {
     // Due to the linear propagation with zero motion, we can add the
     // frame_stats value and use it as reference sum for dependency stats
-    ref_sum += tpl_frame_stats_accumulate(tpl_gop_stats.frame_stats_list[i]);
+    ref_sum += TplFrameStatsAccumulate(tpl_gop_stats.frame_stats_list[i]);
     const double sum =
-        tpl_frame_dep_stats_accumulate(gop_dep_stats.frame_dep_stats_list[i]);
+        TplFrameDepStatsAccumulate(gop_dep_stats.frame_dep_stats_list[i]);
     EXPECT_NEAR(sum, ref_sum, 0.0000001);
     break;
   }
@@ -438,7 +438,7 @@
   EXPECT_EQ(type_list[first_leaf_idx], GopFrameType::kRegularLeaf);
   // update reference frame until we see the first kRegularLeaf frame
   for (; coding_idx <= first_leaf_idx; ++coding_idx) {
-    GopFrame gop_frame = gop_frame_basic(
+    GopFrame gop_frame = GopFrameBasic(
         0, 0, coding_idx, order_idx_list[coding_idx], 0, type_list[coding_idx]);
     ref_manager.UpdateRefFrameTable(&gop_frame);
   }
@@ -452,7 +452,7 @@
   const int first_show_existing_idx = 4;
   EXPECT_EQ(type_list[first_show_existing_idx], GopFrameType::kShowExisting);
   for (; coding_idx <= first_show_existing_idx; ++coding_idx) {
-    GopFrame gop_frame = gop_frame_basic(
+    GopFrame gop_frame = GopFrameBasic(
         0, 0, coding_idx, order_idx_list[coding_idx], 0, type_list[coding_idx]);
     ref_manager.UpdateRefFrameTable(&gop_frame);
   }
@@ -467,7 +467,7 @@
   const int second_leaf_idx = 5;
   EXPECT_EQ(type_list[second_leaf_idx], GopFrameType::kRegularLeaf);
   for (; coding_idx <= second_leaf_idx; ++coding_idx) {
-    GopFrame gop_frame = gop_frame_basic(
+    GopFrame gop_frame = GopFrameBasic(
         0, 0, coding_idx, order_idx_list[coding_idx], 0, type_list[coding_idx]);
     ref_manager.UpdateRefFrameTable(&gop_frame);
   }
@@ -481,7 +481,7 @@
   const int first_overlay_idx = 6;
   EXPECT_EQ(type_list[first_overlay_idx], GopFrameType::kOverlay);
   for (; coding_idx <= first_overlay_idx; ++coding_idx) {
-    GopFrame gop_frame = gop_frame_basic(
+    GopFrame gop_frame = GopFrameBasic(
         0, 0, coding_idx, order_idx_list[coding_idx], 0, type_list[coding_idx]);
     ref_manager.UpdateRefFrameTable(&gop_frame);
   }
@@ -495,8 +495,8 @@
   EXPECT_EQ(ref_manager.GetRefFrameCountByType(RefUpdateType::kLast), 3);
 }
 
-void test_ref_frame_manager_priority(const RefFrameManager &ref_manager,
-                                     RefUpdateType type) {
+void TestRefFrameManagerPriority(const RefFrameManager &ref_manager,
+                                 RefUpdateType type) {
   int ref_count = ref_manager.GetRefFrameCountByType(type);
   int prev_global_order_idx = ref_manager.CurGlobalOrderIdx();
   // The lower the priority is, the closer the gop_frame.global_order_idx should
@@ -530,25 +530,25 @@
   EXPECT_EQ(type_list[first_leaf_idx], GopFrameType::kRegularLeaf);
   // update reference frame until we see the first kRegularLeaf frame
   for (; coding_idx <= first_leaf_idx; ++coding_idx) {
-    GopFrame gop_frame = gop_frame_basic(
+    GopFrame gop_frame = GopFrameBasic(
         0, 0, coding_idx, order_idx_list[coding_idx], 0, type_list[coding_idx]);
     ref_manager.UpdateRefFrameTable(&gop_frame);
   }
   EXPECT_EQ(ref_manager.GetRefFrameCountByType(RefUpdateType::kForward), 2);
-  test_ref_frame_manager_priority(ref_manager, RefUpdateType::kForward);
+  TestRefFrameManagerPriority(ref_manager, RefUpdateType::kForward);
 
   const int first_overlay_idx = 6;
   EXPECT_EQ(type_list[first_overlay_idx], GopFrameType::kOverlay);
   for (; coding_idx <= first_overlay_idx; ++coding_idx) {
-    GopFrame gop_frame = gop_frame_basic(
+    GopFrame gop_frame = GopFrameBasic(
         0, 0, coding_idx, order_idx_list[coding_idx], 0, type_list[coding_idx]);
     ref_manager.UpdateRefFrameTable(&gop_frame);
   }
 
   EXPECT_EQ(ref_manager.GetRefFrameCountByType(RefUpdateType::kBackward), 2);
-  test_ref_frame_manager_priority(ref_manager, RefUpdateType::kBackward);
+  TestRefFrameManagerPriority(ref_manager, RefUpdateType::kBackward);
   EXPECT_EQ(ref_manager.GetRefFrameCountByType(RefUpdateType::kLast), 3);
-  test_ref_frame_manager_priority(ref_manager, RefUpdateType::kLast);
+  TestRefFrameManagerPriority(ref_manager, RefUpdateType::kLast);
 }
 
 TEST(RefFrameManagerTest, GetRefFrameListByPriority) {
@@ -560,7 +560,7 @@
                                                 GopFrameType::kRegularLeaf };
   RefFrameManager ref_manager(kRefFrameTableSize);
   for (int coding_idx = 0; coding_idx < frame_count; ++coding_idx) {
-    GopFrame gop_frame = gop_frame_basic(
+    GopFrame gop_frame = GopFrameBasic(
         0, 0, coding_idx, order_idx_list[coding_idx], 0, type_list[coding_idx]);
     ref_manager.UpdateRefFrameTable(&gop_frame);
   }
@@ -595,8 +595,8 @@
   RefFrameManager ref_manager(kRefFrameTableSize);
   for (int coding_idx = 0; coding_idx < frame_count; ++coding_idx) {
     GopFrame gop_frame =
-        gop_frame_basic(0, 0, coding_idx, order_idx_list[coding_idx],
-                        layer_depth_list[coding_idx], type_list[coding_idx]);
+        GopFrameBasic(0, 0, coding_idx, order_idx_list[coding_idx],
+                      layer_depth_list[coding_idx], type_list[coding_idx]);
     ref_manager.UpdateRefFrameTable(&gop_frame);
   }
 
@@ -605,7 +605,7 @@
     int layer_depth = layer_depth_list[i];
     // Set different frame type
     GopFrameType type = type_list[(i + 1) % frame_count];
-    GopFrame gop_frame = gop_frame_basic(0, 0, 0, 0, layer_depth, type);
+    GopFrame gop_frame = GopFrameBasic(0, 0, 0, 0, layer_depth, type);
     ReferenceFrame ref_frame = ref_manager.GetPrimaryRefFrame(gop_frame);
     GopFrame primary_ref_frame =
         ref_manager.GetRefFrameByIndex(ref_frame.index);
@@ -620,7 +620,7 @@
     GopFrameType type = type_list[i];
     // Let the frame layer_depth sit in the middle of two reference frames
     int layer_depth = mid_layer_depth_list[i];
-    GopFrame gop_frame = gop_frame_basic(0, 0, 0, 0, layer_depth, type);
+    GopFrame gop_frame = GopFrameBasic(0, 0, 0, 0, layer_depth, type);
     ReferenceFrame ref_frame = ref_manager.GetPrimaryRefFrame(gop_frame);
     GopFrame primary_ref_frame =
         ref_manager.GetRefFrameByIndex(ref_frame.index);
@@ -700,7 +700,7 @@
                            << newline;
     firstpass_info.stats_list.push_back(firstpass_stats_input);
   }
-  EXPECT_THAT(get_key_frame_list(firstpass_info),
+  EXPECT_THAT(GetKeyFrameList(firstpass_info),
               ElementsAre(0, 30, 60, 90, 120, 150, 180, 210, 240));
 }