Add `avm` or `av2` prefix to some public symbols

Some symbols exist in both libaom and AVM without any prefix. So, they can result in symbol conflicts.

To solve this, either `avm` or `av2` prefix is added for these functions. These include:

* arg parsing helpers
* CDEF functions
* CFL functions
* Some default CDF tables
* od_ec\* functions
* One symbols for intra prediction
* One symbol for ransac

Related to #150
diff --git a/av2/av2_cx_iface.c b/av2/av2_cx_iface.c
index 1119810..4942879 100644
--- a/av2/av2_cx_iface.c
+++ b/av2/av2_cx_iface.c
@@ -3673,9 +3673,10 @@
   // We use the keyword _Static_assert because clang-cl does not allow the
   // convenience macro static_assert to be used in function scope. See
   // https://bugs.llvm.org/show_bug.cgi?id=48904.
-  _Static_assert(sizeof(ctx->cpi->common.error.detail) >= ARG_ERR_MSG_MAX_LEN,
-                 "The size of the err_msg buffer for arg_match_helper must be "
-                 "at least ARG_ERR_MSG_MAX_LEN");
+  _Static_assert(
+      sizeof(ctx->cpi->common.error.detail) >= ARG_ERR_MSG_MAX_LEN,
+      "The size of the err_msg buffer for avm_arg_match_helper must be "
+      "at least ARG_ERR_MSG_MAX_LEN");
 #else
   assert(sizeof(ctx->cpi->common.error.detail) >= ARG_ERR_MSG_MAX_LEN);
 #endif
@@ -3685,567 +3686,643 @@
   struct arg arg;
 
   int match = 1;
-  if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_keyframe_filtering,
-                       argv, err_string)) {
+  if (avm_arg_match_helper(&arg,
+                           &g_av2_codec_arg_defs.enable_keyframe_filtering,
+                           argv, err_string)) {
     extra_cfg.enable_keyframe_filtering =
-        arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.min_gf_interval, argv,
-                              err_string)) {
-    extra_cfg.min_gf_interval = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.max_gf_interval, argv,
-                              err_string)) {
-    extra_cfg.max_gf_interval = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.gf_min_pyr_height,
-                              argv, err_string)) {
-    extra_cfg.gf_min_pyr_height = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.gf_max_pyr_height,
-                              argv, err_string)) {
-    extra_cfg.gf_max_pyr_height = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.cpu_used_av2, argv,
-                              err_string)) {
-    extra_cfg.cpu_used = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.auto_altref, argv,
-                              err_string)) {
-    extra_cfg.enable_auto_alt_ref = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.noise_sens, argv,
-                              err_string)) {
-    extra_cfg.noise_sensitivity = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.sharpness, argv,
-                              err_string)) {
-    extra_cfg.sharpness = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.static_thresh, argv,
-                              err_string)) {
-    extra_cfg.static_thresh = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.rowmtarg, argv,
-                              err_string)) {
-    extra_cfg.row_mt = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.tile_cols, argv,
-                              err_string)) {
-    extra_cfg.tile_columns = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.tile_rows, argv,
-                              err_string)) {
-    extra_cfg.tile_rows = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_tpl_model,
-                              argv, err_string)) {
-    extra_cfg.enable_tpl_model = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.arnr_maxframes, argv,
-                              err_string)) {
-    extra_cfg.arnr_max_frames = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.arnr_strength, argv,
-                              err_string)) {
-    extra_cfg.arnr_strength = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.tune_metric, argv,
-                              err_string)) {
-    extra_cfg.tuning = arg_parse_enum_helper(&arg, err_string);
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.min_gf_interval,
+                                  argv, err_string)) {
+    extra_cfg.min_gf_interval = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.max_gf_interval,
+                                  argv, err_string)) {
+    extra_cfg.max_gf_interval = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.gf_min_pyr_height,
+                                  argv, err_string)) {
+    extra_cfg.gf_min_pyr_height = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.gf_max_pyr_height,
+                                  argv, err_string)) {
+    extra_cfg.gf_max_pyr_height = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.cpu_used_av2,
+                                  argv, err_string)) {
+    extra_cfg.cpu_used = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.auto_altref, argv,
+                                  err_string)) {
+    extra_cfg.enable_auto_alt_ref = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.noise_sens, argv,
+                                  err_string)) {
+    extra_cfg.noise_sensitivity = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.sharpness, argv,
+                                  err_string)) {
+    extra_cfg.sharpness = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.static_thresh,
+                                  argv, err_string)) {
+    extra_cfg.static_thresh = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.rowmtarg, argv,
+                                  err_string)) {
+    extra_cfg.row_mt = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.tile_cols, argv,
+                                  err_string)) {
+    extra_cfg.tile_columns = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.tile_rows, argv,
+                                  err_string)) {
+    extra_cfg.tile_rows = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_tpl_model,
+                                  argv, err_string)) {
+    extra_cfg.enable_tpl_model = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.arnr_maxframes,
+                                  argv, err_string)) {
+    extra_cfg.arnr_max_frames = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.arnr_strength,
+                                  argv, err_string)) {
+    extra_cfg.arnr_strength = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.tune_metric, argv,
+                                  err_string)) {
+    extra_cfg.tuning = avm_arg_parse_enum_helper(&arg, err_string);
 #if CONFIG_TUNE_VMAF
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.vmaf_model_path, argv,
-                              err_string)) {
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.vmaf_model_path,
+                                  argv, err_string)) {
     extra_cfg.vmaf_model_path = value;
 #endif
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.qp_level, argv,
-                              err_string)) {
-    extra_cfg.qp = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.max_intra_rate_pct,
-                              argv, err_string)) {
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.qp_level, argv,
+                                  err_string)) {
+    extra_cfg.qp = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.max_intra_rate_pct,
+                                  argv, err_string)) {
     extra_cfg.rc_max_intra_bitrate_pct =
-        arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.max_inter_rate_pct,
-                              argv, err_string)) {
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.max_inter_rate_pct,
+                                  argv, err_string)) {
     extra_cfg.rc_max_inter_bitrate_pct =
-        arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.gf_cbr_boost_pct,
-                              argv, err_string)) {
-    extra_cfg.gf_cbr_boost_pct = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.lossless, argv,
-                              err_string)) {
-    extra_cfg.lossless = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_deblocking,
-                              argv, err_string)) {
-    extra_cfg.enable_deblocking = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_cdef, argv,
-                              err_string)) {
-    extra_cfg.enable_cdef = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_gdf, argv,
-                              err_string)) {
-    extra_cfg.enable_gdf = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_restoration,
-                              argv, err_string)) {
-    extra_cfg.enable_restoration = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_pc_wiener,
-                              argv, err_string)) {
-    extra_cfg.enable_pc_wiener = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_wiener_nonsep,
-                              argv, err_string)) {
-    extra_cfg.enable_wiener_nonsep = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ccso, argv,
-                              err_string)) {
-    extra_cfg.enable_ccso = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_lf_sub_pu,
-                              argv, err_string)) {
-    extra_cfg.enable_lf_sub_pu = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.force_video_mode,
-                              argv, err_string)) {
-    extra_cfg.force_video_mode = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_trellis_quant,
-                              argv, err_string)) {
-    extra_cfg.enable_trellis_quant = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_qm, argv,
-                              err_string)) {
-    extra_cfg.enable_qm = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.qm_max, argv,
-                              err_string)) {
-    extra_cfg.qm_max = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.qm_min, argv,
-                              err_string)) {
-    extra_cfg.qm_min = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.num_tg, argv,
-                              err_string)) {
-    extra_cfg.num_tg = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.mtu_size, argv,
-                              err_string)) {
-    extra_cfg.mtu_size = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.timing_info, argv,
-                              err_string)) {
-    extra_cfg.timing_info_type = arg_parse_enum_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.frame_parallel_decoding,
-                              argv, err_string)) {
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.gf_cbr_boost_pct,
+                                  argv, err_string)) {
+    extra_cfg.gf_cbr_boost_pct = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.lossless, argv,
+                                  err_string)) {
+    extra_cfg.lossless = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_deblocking,
+                                  argv, err_string)) {
+    extra_cfg.enable_deblocking = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_cdef, argv,
+                                  err_string)) {
+    extra_cfg.enable_cdef = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_gdf, argv,
+                                  err_string)) {
+    extra_cfg.enable_gdf = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_restoration,
+                                  argv, err_string)) {
+    extra_cfg.enable_restoration = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_pc_wiener,
+                                  argv, err_string)) {
+    extra_cfg.enable_pc_wiener = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_wiener_nonsep,
+                                  argv, err_string)) {
+    extra_cfg.enable_wiener_nonsep =
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ccso, argv,
+                                  err_string)) {
+    extra_cfg.enable_ccso = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_lf_sub_pu,
+                                  argv, err_string)) {
+    extra_cfg.enable_lf_sub_pu = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.force_video_mode,
+                                  argv, err_string)) {
+    extra_cfg.force_video_mode = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_trellis_quant,
+                                  argv, err_string)) {
+    extra_cfg.enable_trellis_quant =
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_qm, argv,
+                                  err_string)) {
+    extra_cfg.enable_qm = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.qm_max, argv,
+                                  err_string)) {
+    extra_cfg.qm_max = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.qm_min, argv,
+                                  err_string)) {
+    extra_cfg.qm_min = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.num_tg, argv,
+                                  err_string)) {
+    extra_cfg.num_tg = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.mtu_size, argv,
+                                  err_string)) {
+    extra_cfg.mtu_size = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.timing_info, argv,
+                                  err_string)) {
+    extra_cfg.timing_info_type = avm_arg_parse_enum_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.frame_parallel_decoding,
+                                  argv, err_string)) {
     extra_cfg.frame_parallel_decoding_mode =
-        arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_chroma_deltaq,
-                              argv, err_string)) {
-    extra_cfg.enable_chroma_deltaq = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.aq_mode, argv,
-                              err_string)) {
-    extra_cfg.aq_mode = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.deltaq_mode, argv,
-                              err_string)) {
-    extra_cfg.deltaq_mode = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.frame_periodic_boost,
-                              argv, err_string)) {
-    extra_cfg.frame_periodic_boost = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.tune_content, argv,
-                              err_string)) {
-    extra_cfg.content = arg_parse_enum_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.input_color_primaries,
-                              argv, err_string)) {
-    extra_cfg.color_primaries = arg_parse_enum_helper(&arg, err_string);
-  } else if (arg_match_helper(
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_chroma_deltaq,
+                                  argv, err_string)) {
+    extra_cfg.enable_chroma_deltaq =
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.aq_mode, argv,
+                                  err_string)) {
+    extra_cfg.aq_mode = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.deltaq_mode, argv,
+                                  err_string)) {
+    extra_cfg.deltaq_mode = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.frame_periodic_boost,
+                                  argv, err_string)) {
+    extra_cfg.frame_periodic_boost =
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.tune_content,
+                                  argv, err_string)) {
+    extra_cfg.content = avm_arg_parse_enum_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.input_color_primaries,
+                                  argv, err_string)) {
+    extra_cfg.color_primaries = avm_arg_parse_enum_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
                  &arg, &g_av2_codec_arg_defs.input_transfer_characteristics,
                  argv, err_string)) {
     extra_cfg.transfer_characteristics =
-        arg_parse_enum_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.input_matrix_coefficients,
-                              argv, err_string)) {
-    extra_cfg.matrix_coefficients = arg_parse_enum_helper(&arg, err_string);
-  } else if (arg_match_helper(
+        avm_arg_parse_enum_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.input_matrix_coefficients, argv,
+                 err_string)) {
+    extra_cfg.matrix_coefficients = avm_arg_parse_enum_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
                  &arg, &g_av2_codec_arg_defs.input_chroma_sample_position, argv,
                  err_string)) {
-    extra_cfg.chroma_sample_position = arg_parse_enum_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.superblock_size, argv,
-                              err_string)) {
-    extra_cfg.superblock_size = arg_parse_enum_helper(&arg, err_string);
-    extra_cfg.error_resilient_mode = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.sframe_mode, argv,
-                              err_string)) {
-    extra_cfg.s_frame_mode = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.film_grain_test, argv,
-                              err_string)) {
-    extra_cfg.film_grain_test_vector = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.film_grain_table,
-                              argv, err_string)) {
+    extra_cfg.chroma_sample_position =
+        avm_arg_parse_enum_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.superblock_size,
+                                  argv, err_string)) {
+    extra_cfg.superblock_size = avm_arg_parse_enum_helper(&arg, err_string);
+    extra_cfg.error_resilient_mode = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.sframe_mode, argv,
+                                  err_string)) {
+    extra_cfg.s_frame_mode = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.film_grain_test,
+                                  argv, err_string)) {
+    extra_cfg.film_grain_test_vector =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.film_grain_table,
+                                  argv, err_string)) {
     extra_cfg.film_grain_table_filename = value;
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.film_grain_block_size,
-                              argv, err_string)) {
-    extra_cfg.film_grain_block_size = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.cdf_update_mode, argv,
-                              err_string)) {
-    extra_cfg.cdf_update_mode = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.cross_frame_cdf_init_mode,
-                              argv, err_string)) {
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.film_grain_block_size,
+                                  argv, err_string)) {
+    extra_cfg.film_grain_block_size =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.cdf_update_mode,
+                                  argv, err_string)) {
+    extra_cfg.cdf_update_mode = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.cross_frame_cdf_init_mode, argv,
+                 err_string)) {
     extra_cfg.cross_frame_cdf_init_mode =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_rect_partitions,
-                              argv, err_string)) {
-    extra_cfg.enable_rect_partitions = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_rect_partitions,
+                                  argv, err_string)) {
+    extra_cfg.enable_rect_partitions =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
                  &arg, &g_av2_codec_arg_defs.enable_uneven_4way_partitions,
                  argv, err_string)) {
     extra_cfg.enable_uneven_4way_partitions =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
                  &arg,
                  &g_av2_codec_arg_defs.disable_ml_partition_speed_features,
                  argv, err_string)) {
     extra_cfg.disable_ml_partition_speed_features =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.erp_pruning_level,
-                              argv, err_string)) {
-    extra_cfg.erp_pruning_level = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.use_ml_erp_pruning,
-                              argv, err_string)) {
-    extra_cfg.use_ml_erp_pruning = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ext_partitions,
-                              argv, err_string)) {
-    extra_cfg.enable_ext_partitions = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_tx_partition,
-                              argv, err_string)) {
-    extra_cfg.enable_tx_partition = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.max_partition_aspect_ratio,
-                              argv, err_string)) {
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.erp_pruning_level,
+                                  argv, err_string)) {
+    extra_cfg.erp_pruning_level = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.use_ml_erp_pruning,
+                                  argv, err_string)) {
+    extra_cfg.use_ml_erp_pruning = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_ext_partitions,
+                                  argv, err_string)) {
+    extra_cfg.enable_ext_partitions =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_tx_partition,
+                                  argv, err_string)) {
+    extra_cfg.enable_tx_partition = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.max_partition_aspect_ratio, argv,
+                 err_string)) {
     extra_cfg.max_partition_aspect_ratio =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
                  &arg,
                  &g_av2_codec_arg_defs.disable_ml_transform_speed_features,
                  argv, err_string)) {
     extra_cfg.disable_ml_transform_speed_features =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_sdp, argv,
-                              err_string)) {
-    extra_cfg.enable_sdp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_extended_sdp,
-                              argv, err_string)) {
-    extra_cfg.enable_extended_sdp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_mrls, argv,
-                              err_string)) {
-    extra_cfg.enable_mrls = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_tip, argv,
-                              err_string)) {
-    extra_cfg.enable_tip = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_tip_refinemv,
-                              argv, err_string)) {
-    extra_cfg.enable_tip_refinemv = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_mv_traj, argv,
-                              err_string)) {
-    extra_cfg.enable_mv_traj = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_high_motion,
-                              argv, err_string)) {
-    extra_cfg.enable_high_motion = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_bawp, argv,
-                              err_string)) {
-    extra_cfg.enable_bawp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_cwp, argv,
-                              err_string)) {
-    extra_cfg.enable_cwp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_imp_msk_bld,
-                              argv, err_string)) {
-    extra_cfg.enable_imp_msk_bld = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_fsc, argv,
-                              err_string)) {
-    extra_cfg.enable_fsc = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_idtx_intra,
-                              argv, err_string)) {
-    extra_cfg.enable_idtx_intra = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ist, argv,
-                              err_string)) {
-    extra_cfg.enable_ist = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_inter_ist,
-                              argv, err_string)) {
-    extra_cfg.enable_inter_ist = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_chroma_dctonly,
-                              argv, err_string)) {
-    extra_cfg.enable_chroma_dctonly = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_inter_ddt,
-                              argv, err_string)) {
-    extra_cfg.enable_inter_ddt = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_cctx, argv,
-                              err_string)) {
-    extra_cfg.enable_cctx = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ibp, argv,
-                              err_string)) {
-    extra_cfg.enable_ibp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_adaptive_mvd,
-                              argv, err_string)) {
-    extra_cfg.enable_adaptive_mvd = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_flex_mvres,
-                              argv, err_string)) {
-    extra_cfg.enable_flex_mvres = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.select_cfl_ds_filter,
-                              argv, err_string)) {
-    extra_cfg.select_cfl_ds_filter = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_joint_mvd,
-                              argv, err_string)) {
-    extra_cfg.enable_joint_mvd = arg_parse_int_helper(&arg, err_string);
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_sdp, argv,
+                                  err_string)) {
+    extra_cfg.enable_sdp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_extended_sdp,
+                                  argv, err_string)) {
+    extra_cfg.enable_extended_sdp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_mrls, argv,
+                                  err_string)) {
+    extra_cfg.enable_mrls = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_tip, argv,
+                                  err_string)) {
+    extra_cfg.enable_tip = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_tip_refinemv,
+                                  argv, err_string)) {
+    extra_cfg.enable_tip_refinemv = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_mv_traj,
+                                  argv, err_string)) {
+    extra_cfg.enable_mv_traj = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_high_motion,
+                                  argv, err_string)) {
+    extra_cfg.enable_high_motion = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_bawp, argv,
+                                  err_string)) {
+    extra_cfg.enable_bawp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_cwp, argv,
+                                  err_string)) {
+    extra_cfg.enable_cwp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_imp_msk_bld,
+                                  argv, err_string)) {
+    extra_cfg.enable_imp_msk_bld = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_fsc, argv,
+                                  err_string)) {
+    extra_cfg.enable_fsc = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_idtx_intra,
+                                  argv, err_string)) {
+    extra_cfg.enable_idtx_intra = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ist, argv,
+                                  err_string)) {
+    extra_cfg.enable_ist = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_inter_ist,
+                                  argv, err_string)) {
+    extra_cfg.enable_inter_ist = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_chroma_dctonly,
+                                  argv, err_string)) {
+    extra_cfg.enable_chroma_dctonly =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_inter_ddt,
+                                  argv, err_string)) {
+    extra_cfg.enable_inter_ddt = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_cctx, argv,
+                                  err_string)) {
+    extra_cfg.enable_cctx = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ibp, argv,
+                                  err_string)) {
+    extra_cfg.enable_ibp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_adaptive_mvd,
+                                  argv, err_string)) {
+    extra_cfg.enable_adaptive_mvd = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_flex_mvres,
+                                  argv, err_string)) {
+    extra_cfg.enable_flex_mvres = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.select_cfl_ds_filter,
+                                  argv, err_string)) {
+    extra_cfg.select_cfl_ds_filter = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_joint_mvd,
+                                  argv, err_string)) {
+    extra_cfg.enable_joint_mvd = avm_arg_parse_int_helper(&arg, err_string);
 
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_refinemv, argv,
-                              err_string)) {
-    extra_cfg.enable_refinemv = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_mvd_sign_derive,
-                              argv, err_string)) {
-    extra_cfg.enable_mvd_sign_derive = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.min_partition_size,
-                              argv, err_string)) {
-    extra_cfg.min_partition_size = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.max_partition_size,
-                              argv, err_string)) {
-    extra_cfg.max_partition_size = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_intra_edge_filter,
-                              argv, err_string)) {
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_refinemv,
+                                  argv, err_string)) {
+    extra_cfg.enable_refinemv = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_mvd_sign_derive,
+                                  argv, err_string)) {
+    extra_cfg.enable_mvd_sign_derive =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.min_partition_size,
+                                  argv, err_string)) {
+    extra_cfg.min_partition_size = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.max_partition_size,
+                                  argv, err_string)) {
+    extra_cfg.max_partition_size = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.enable_intra_edge_filter, argv,
+                 err_string)) {
     extra_cfg.enable_intra_edge_filter =
-        arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_tx64, argv,
-                              err_string)) {
-    extra_cfg.enable_tx64 = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.reduced_tx_part_set,
-                              argv, err_string)) {
-    extra_cfg.reduced_tx_part_set = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_flip_idtx,
-                              argv, err_string)) {
-    extra_cfg.enable_flip_idtx = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_cropping_window,
-                              argv, err_string)) {
-    extra_cfg.enable_cropping_window = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.crop_win_left_offset,
-                              argv, err_string)) {
-    extra_cfg.crop_win_left_offset = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.crop_win_right_offset,
-                              argv, err_string)) {
-    extra_cfg.crop_win_right_offset = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.crop_win_top_offset,
-                              argv, err_string)) {
-    extra_cfg.crop_win_top_offset = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.crop_win_bottom_offset,
-                              argv, err_string)) {
-    extra_cfg.crop_win_bottom_offset = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.max_reference_frames,
-                              argv, err_string)) {
-    extra_cfg.max_reference_frames = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.reduced_reference_set,
-                              argv, err_string)) {
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_tx64, argv,
+                                  err_string)) {
+    extra_cfg.enable_tx64 = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.reduced_tx_part_set,
+                                  argv, err_string)) {
+    extra_cfg.reduced_tx_part_set = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_flip_idtx,
+                                  argv, err_string)) {
+    extra_cfg.enable_flip_idtx = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_cropping_window,
+                                  argv, err_string)) {
+    extra_cfg.enable_cropping_window =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.crop_win_left_offset,
+                                  argv, err_string)) {
+    extra_cfg.crop_win_left_offset = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.crop_win_right_offset,
+                                  argv, err_string)) {
+    extra_cfg.crop_win_right_offset =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.crop_win_top_offset,
+                                  argv, err_string)) {
+    extra_cfg.crop_win_top_offset = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.crop_win_bottom_offset,
+                                  argv, err_string)) {
+    extra_cfg.crop_win_bottom_offset =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.max_reference_frames,
+                                  argv, err_string)) {
+    extra_cfg.max_reference_frames = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.reduced_reference_set,
+                                  argv, err_string)) {
     extra_cfg.enable_reduced_reference_set =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.explicit_ref_frame_map,
-                              argv, err_string)) {
-    extra_cfg.explicit_ref_frame_map = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_generation_sef_obu,
-                              argv, err_string)) {
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.explicit_ref_frame_map,
+                                  argv, err_string)) {
+    extra_cfg.explicit_ref_frame_map =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.enable_generation_sef_obu, argv,
+                 err_string)) {
     extra_cfg.enable_generation_sef_obu =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ref_frame_mvs,
-                              argv, err_string)) {
-    extra_cfg.enable_ref_frame_mvs = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.reduced_ref_frame_mvs_mode,
-                              argv, err_string)) {
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_ref_frame_mvs,
+                                  argv, err_string)) {
+    extra_cfg.enable_ref_frame_mvs = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.reduced_ref_frame_mvs_mode, argv,
+                 err_string)) {
     extra_cfg.reduced_ref_frame_mvs_mode =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_masked_comp,
-                              argv, err_string)) {
-    extra_cfg.enable_masked_comp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_onesided_comp,
-                              argv, err_string)) {
-    extra_cfg.enable_onesided_comp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_interintra_comp,
-                              argv, err_string)) {
-    extra_cfg.enable_interintra_comp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_smooth_interintra,
-                              argv, err_string)) {
-    extra_cfg.enable_smooth_interintra = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_diff_wtd_comp,
-                              argv, err_string)) {
-    extra_cfg.enable_diff_wtd_comp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_interinter_wedge,
-                              argv, err_string)) {
-    extra_cfg.enable_interinter_wedge = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_interintra_wedge,
-                              argv, err_string)) {
-    extra_cfg.enable_interintra_wedge = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_global_motion,
-                              argv, err_string)) {
-    extra_cfg.enable_global_motion = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_skip_mode,
-                              argv, err_string)) {
-    extra_cfg.enable_skip_mode = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_warped_motion,
-                              argv, err_string)) {
-    extra_cfg.enable_warped_motion = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_warp_causal,
-                              argv, err_string)) {
-    extra_cfg.enable_warp_causal = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_warp_delta,
-                              argv, err_string)) {
-    extra_cfg.enable_warp_delta = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_six_param_warp_delta,
-                              argv, err_string)) {
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_masked_comp,
+                                  argv, err_string)) {
+    extra_cfg.enable_masked_comp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_onesided_comp,
+                                  argv, err_string)) {
+    extra_cfg.enable_onesided_comp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_interintra_comp,
+                                  argv, err_string)) {
+    extra_cfg.enable_interintra_comp =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.enable_smooth_interintra, argv,
+                 err_string)) {
+    extra_cfg.enable_smooth_interintra =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_diff_wtd_comp,
+                                  argv, err_string)) {
+    extra_cfg.enable_diff_wtd_comp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_interinter_wedge,
+                                  argv, err_string)) {
+    extra_cfg.enable_interinter_wedge =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_interintra_wedge,
+                                  argv, err_string)) {
+    extra_cfg.enable_interintra_wedge =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_global_motion,
+                                  argv, err_string)) {
+    extra_cfg.enable_global_motion = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_skip_mode,
+                                  argv, err_string)) {
+    extra_cfg.enable_skip_mode = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_warped_motion,
+                                  argv, err_string)) {
+    extra_cfg.enable_warped_motion = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_warp_causal,
+                                  argv, err_string)) {
+    extra_cfg.enable_warp_causal = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_warp_delta,
+                                  argv, err_string)) {
+    extra_cfg.enable_warp_delta = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.enable_six_param_warp_delta, argv,
+                 err_string)) {
     extra_cfg.enable_six_param_warp_delta =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_warp_extend,
-                              argv, err_string)) {
-    extra_cfg.enable_warp_extend = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_intra_dip,
-                              argv, err_string)) {
-    extra_cfg.enable_intra_dip = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_smooth_intra,
-                              argv, err_string)) {
-    extra_cfg.enable_smooth_intra = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_paeth_intra,
-                              argv, err_string)) {
-    extra_cfg.enable_paeth_intra = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_cfl_intra,
-                              argv, err_string)) {
-    extra_cfg.enable_cfl_intra = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_mhccp, argv,
-                              err_string)) {
-    extra_cfg.enable_mhccp = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_overlay, argv,
-                              err_string)) {
-    extra_cfg.enable_overlay = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_palette, argv,
-                              err_string)) {
-    extra_cfg.enable_palette = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_intrabc, argv,
-                              err_string)) {
-    extra_cfg.enable_intrabc = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_intrabc_ext,
-                              argv, err_string)) {
-    extra_cfg.enable_intrabc_ext = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_angle_delta,
-                              argv, err_string)) {
-    extra_cfg.enable_angle_delta = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_opfl_refine,
-                              argv, err_string)) {
-    extra_cfg.enable_opfl_refine = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.reduced_tx_type_set,
-                              argv, err_string)) {
-    extra_cfg.reduced_tx_type_set = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.use_intra_dct_only,
-                              argv, err_string)) {
-    extra_cfg.use_intra_dct_only = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.use_inter_dct_only,
-                              argv, err_string)) {
-    extra_cfg.use_inter_dct_only = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.use_intra_default_tx_only,
-                              argv, err_string)) {
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_warp_extend,
+                                  argv, err_string)) {
+    extra_cfg.enable_warp_extend = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_intra_dip,
+                                  argv, err_string)) {
+    extra_cfg.enable_intra_dip = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_smooth_intra,
+                                  argv, err_string)) {
+    extra_cfg.enable_smooth_intra = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_paeth_intra,
+                                  argv, err_string)) {
+    extra_cfg.enable_paeth_intra = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_cfl_intra,
+                                  argv, err_string)) {
+    extra_cfg.enable_cfl_intra = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_mhccp,
+                                  argv, err_string)) {
+    extra_cfg.enable_mhccp = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_overlay,
+                                  argv, err_string)) {
+    extra_cfg.enable_overlay = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_palette,
+                                  argv, err_string)) {
+    extra_cfg.enable_palette = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_intrabc,
+                                  argv, err_string)) {
+    extra_cfg.enable_intrabc = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_intrabc_ext,
+                                  argv, err_string)) {
+    extra_cfg.enable_intrabc_ext = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_angle_delta,
+                                  argv, err_string)) {
+    extra_cfg.enable_angle_delta = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_opfl_refine,
+                                  argv, err_string)) {
+    extra_cfg.enable_opfl_refine = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.reduced_tx_type_set,
+                                  argv, err_string)) {
+    extra_cfg.reduced_tx_type_set = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.use_intra_dct_only,
+                                  argv, err_string)) {
+    extra_cfg.use_intra_dct_only = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.use_inter_dct_only,
+                                  argv, err_string)) {
+    extra_cfg.use_inter_dct_only = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.use_intra_default_tx_only, argv,
+                 err_string)) {
     extra_cfg.use_intra_default_tx_only =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.quant_b_adapt, argv,
-                              err_string)) {
-    extra_cfg.quant_b_adapt = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.vbr_corpus_complexity_lap,
-                              argv, err_string)) {
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.quant_b_adapt,
+                                  argv, err_string)) {
+    extra_cfg.quant_b_adapt = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.vbr_corpus_complexity_lap, argv,
+                 err_string)) {
     extra_cfg.vbr_corpus_complexity_lap =
-        arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.set_tier_mask, argv,
-                              err_string)) {
-    extra_cfg.tier_mask = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.set_min_cr, argv,
-                              err_string)) {
-    extra_cfg.min_cr = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.coeff_cost_upd_freq,
-                              argv, err_string)) {
-    extra_cfg.coeff_cost_upd_freq = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.mode_cost_upd_freq,
-                              argv, err_string)) {
-    extra_cfg.mode_cost_upd_freq = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.mv_cost_upd_freq,
-                              argv, err_string)) {
-    extra_cfg.mv_cost_upd_freq = arg_parse_uint_helper(&arg, err_string);
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.set_tier_mask,
+                                  argv, err_string)) {
+    extra_cfg.tier_mask = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.set_min_cr, argv,
+                                  err_string)) {
+    extra_cfg.min_cr = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.coeff_cost_upd_freq,
+                                  argv, err_string)) {
+    extra_cfg.coeff_cost_upd_freq = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.mode_cost_upd_freq,
+                                  argv, err_string)) {
+    extra_cfg.mode_cost_upd_freq = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.mv_cost_upd_freq,
+                                  argv, err_string)) {
+    extra_cfg.mv_cost_upd_freq = avm_arg_parse_uint_helper(&arg, err_string);
   }
 #if CONFIG_DENOISE
-  else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.denoise_noise_level,
-                            argv, err_string)) {
+  else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.denoise_noise_level,
+                                argv, err_string)) {
     extra_cfg.noise_level =
-        (float)arg_parse_int_helper(&arg, err_string) / 10.0f;
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.denoise_block_size,
-                              argv, err_string)) {
-    extra_cfg.noise_block_size = arg_parse_uint_helper(&arg, err_string);
+        (float)avm_arg_parse_int_helper(&arg, err_string) / 10.0f;
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.denoise_block_size,
+                                  argv, err_string)) {
+    extra_cfg.noise_block_size = avm_arg_parse_uint_helper(&arg, err_string);
   }
 #endif
-  else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.target_seq_level_idx,
-                            argv, err_string)) {
-    const int val = arg_parse_int_helper(&arg, err_string);
+  else if (avm_arg_match_helper(&arg,
+                                &g_av2_codec_arg_defs.target_seq_level_idx,
+                                argv, err_string)) {
+    const int val = avm_arg_parse_int_helper(&arg, err_string);
     const int level = val % 100;
     const int operating_point_idx = val / 100;
     if (operating_point_idx >= 0 &&
         operating_point_idx < MAX_NUM_OPERATING_POINTS) {
       extra_cfg.target_seq_level_idx[operating_point_idx] = (AV2_LEVEL)level;
     }
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.input_chroma_subsampling_x,
-                              argv, err_string)) {
-    extra_cfg.chroma_subsampling_x = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.input_chroma_subsampling_y,
-                              argv, err_string)) {
-    extra_cfg.chroma_subsampling_y = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.max_drl_refmvs, argv,
-                              err_string)) {
-    extra_cfg.max_drl_refmvs = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.max_drl_refbvs, argv,
-                              err_string)) {
-    extra_cfg.max_drl_refbvs = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_refmvbank,
-                              argv, err_string)) {
-    extra_cfg.enable_refmvbank = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_drl_reorder,
-                              argv, err_string)) {
-    extra_cfg.enable_drl_reorder = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_cdef_on_skip_txfm,
-                              argv, err_string)) {
-    extra_cfg.enable_cdef_on_skip_txfm = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_avg_cdf, argv,
-                              err_string)) {
-    extra_cfg.enable_avg_cdf = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.avg_cdf_type, argv,
-                              err_string)) {
-    extra_cfg.avg_cdf_type = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_parity_hiding,
-                              argv, err_string)) {
-    extra_cfg.enable_parity_hiding = arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.input_chroma_subsampling_x, argv,
+                 err_string)) {
+    extra_cfg.chroma_subsampling_x =
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.input_chroma_subsampling_y, argv,
+                 err_string)) {
+    extra_cfg.chroma_subsampling_y =
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.max_drl_refmvs,
+                                  argv, err_string)) {
+    extra_cfg.max_drl_refmvs = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.max_drl_refbvs,
+                                  argv, err_string)) {
+    extra_cfg.max_drl_refbvs = avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_refmvbank,
+                                  argv, err_string)) {
+    extra_cfg.enable_refmvbank = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_drl_reorder,
+                                  argv, err_string)) {
+    extra_cfg.enable_drl_reorder = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.enable_cdef_on_skip_txfm, argv,
+                 err_string)) {
+    extra_cfg.enable_cdef_on_skip_txfm =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_avg_cdf,
+                                  argv, err_string)) {
+    extra_cfg.enable_avg_cdf = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.avg_cdf_type,
+                                  argv, err_string)) {
+    extra_cfg.avg_cdf_type = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.enable_parity_hiding,
+                                  argv, err_string)) {
+    extra_cfg.enable_parity_hiding =
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
                  &arg, &g_av2_codec_arg_defs.enable_short_refresh_frame_flags,
                  argv, err_string)) {
     extra_cfg.enable_short_refresh_frame_flags =
-        arg_parse_uint_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ext_seg, argv,
-                              err_string)) {
-    extra_cfg.enable_ext_seg = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.dpb_size, argv,
-                              err_string)) {
-    extra_cfg.dpb_size = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_bru, argv,
-                              err_string)) {
-    extra_cfg.enable_bru = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(
+        avm_arg_parse_uint_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_ext_seg,
+                                  argv, err_string)) {
+    extra_cfg.enable_ext_seg = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.dpb_size, argv,
+                                  err_string)) {
+    extra_cfg.dpb_size = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg, &g_av2_codec_arg_defs.enable_bru, argv,
+                                  err_string)) {
+    extra_cfg.enable_bru = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
                  &arg, &g_av2_codec_arg_defs.disable_loopfilters_across_tiles,
                  argv, err_string)) {
     extra_cfg.disable_loopfilters_across_tiles =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.scan_type_info_present_flag,
-                              argv, err_string)) {
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.scan_type_info_present_flag, argv,
+                 err_string)) {
     extra_cfg.scan_type_info_present_flag =
-        arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg, &g_av2_codec_arg_defs.use_short_metadata,
-                              argv, err_string)) {
-    ctx->cfg.use_short_metadata = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.enable_mfh_obu_signaling,
-                              argv, err_string)) {
-    extra_cfg.enable_mfh_obu_signaling = arg_parse_int_helper(&arg, err_string);
-  } else if (arg_match_helper(&arg,
-                              &g_av2_codec_arg_defs.operating_points_count,
-                              argv, err_string)) {
-    extra_cfg.operating_points_count = arg_parse_int_helper(&arg, err_string);
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.use_short_metadata,
+                                  argv, err_string)) {
+    ctx->cfg.use_short_metadata = avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(
+                 &arg, &g_av2_codec_arg_defs.enable_mfh_obu_signaling, argv,
+                 err_string)) {
+    extra_cfg.enable_mfh_obu_signaling =
+        avm_arg_parse_int_helper(&arg, err_string);
+  } else if (avm_arg_match_helper(&arg,
+                                  &g_av2_codec_arg_defs.operating_points_count,
+                                  argv, err_string)) {
+    extra_cfg.operating_points_count =
+        avm_arg_parse_int_helper(&arg, err_string);
   } else {
     match = 0;
     snprintf(err_string, ARG_ERR_MSG_MAX_LEN, "Cannot find avm option %s",
diff --git a/av2/common/arm/cfl_neon.c b/av2/common/arm/cfl_neon.c
index 8e40642..d91fb2d 100644
--- a/av2/common/arm/cfl_neon.c
+++ b/av2/common/arm/cfl_neon.c
@@ -397,10 +397,10 @@
   return result;
 }
 
-static INLINE void cfl_predict_hbd_neon(const int16_t *pred_buf_q3,
-                                        uint16_t *dst, int dst_stride,
-                                        int alpha_q3, int bd, int width,
-                                        int height) {
+static INLINE void av2_cfl_predict_hbd_neon(const int16_t *pred_buf_q3,
+                                            uint16_t *dst, int dst_stride,
+                                            int alpha_q3, int bd, int width,
+                                            int height) {
   const int max = (1 << bd) - 1;
   const int16_t abs_alpha_q12 = abs(alpha_q3) << (9 - CFL_ADD_BITS_ALPHA);
   const int16_t *const end = pred_buf_q3 + height * CFL_BUF_LINE;
diff --git a/av2/common/av2_common_int.h b/av2/common/av2_common_int.h
index ee33431..060e8ef 100644
--- a/av2/common/av2_common_int.h
+++ b/av2/common/av2_common_int.h
@@ -3395,7 +3395,7 @@
   }
 }
 
-void cfl_init(CFL_CTX *cfl, const SequenceHeader *seq_params);
+void av2_cfl_init(CFL_CTX *cfl, const SequenceHeader *seq_params);
 
 static INLINE int av2_num_planes(const AV2_COMMON *cm) {
   return cm->seq_params.monochrome ? 1 : MAX_MB_PLANE;
@@ -3437,7 +3437,7 @@
   }
   xd->mi_stride = cm->mi_params.mi_stride;
   xd->error_info = &cm->error;
-  cfl_init(&xd->cfl, &cm->seq_params);
+  av2_cfl_init(&xd->cfl, &cm->seq_params);
 }
 
 static INLINE void set_entropy_context(MACROBLOCKD *xd, int mi_row, int mi_col,
diff --git a/av2/common/av2_rtcd_defs.pl b/av2/common/av2_rtcd_defs.pl
index 149372e..c1ead36 100644
--- a/av2/common/av2_rtcd_defs.pl
+++ b/av2/common/av2_rtcd_defs.pl
@@ -65,13 +65,13 @@
 typedef struct CNN_MULTI_OUT CNN_MULTI_OUT;
 
 /* Function pointers return by CfL functions */
-typedef void (*cfl_subsample_hbd_fn)(const uint16_t *input, int input_stride,
+typedef void (*av2_cfl_subsample_hbd_fn)(const uint16_t *input, int input_stride,
                                      uint16_t *output_q3);
 
-typedef void (*cfl_predict_hbd_fn)(const int16_t *src, uint16_t *dst,
+typedef void (*av2_cfl_predict_hbd_fn)(const int16_t *src, uint16_t *dst,
                                    int dst_stride, int alpha_q3, int bd);
 
-typedef void (*cfl_subtract_average_fn)(const uint16_t *src, int16_t *dst);
+typedef void (*av2_cfl_subtract_average_fn)(const uint16_t *src, int16_t *dst);
 
 EOF
 }
@@ -325,30 +325,30 @@
 
 # Deringing Functions
 
-add_proto qw/int cdef_find_dir/, "const uint16_t *img, int stride, int32_t *var, int coeff_shift";
-add_proto qw/void cdef_find_dir_dual/, "const uint16_t *img1, const uint16_t *img2, int stride, int32_t *var1, int32_t *var2, int coeff_shift, int *out1, int *out2";
+add_proto qw/int av2_cdef_find_dir/, "const uint16_t *img, int stride, int32_t *var, int coeff_shift";
+add_proto qw/void av2_cdef_find_dir_dual/, "const uint16_t *img1, const uint16_t *img2, int stride, int32_t *var1, int32_t *var2, int coeff_shift, int *out1, int *out2";
 
 # 16 bit dst
-add_proto qw/void cdef_filter_16_0/, "uint16_t *const dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int coeff_shift, int block_width, int block_height";
-add_proto qw/void cdef_filter_16_1/, "uint16_t *const dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int coeff_shift, int block_width, int block_height";
-add_proto qw/void cdef_filter_16_2/, "uint16_t *const dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int coeff_shift, int block_width, int block_height";
-add_proto qw/void cdef_filter_16_3/, "uint16_t *const dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int coeff_shift, int block_width, int block_height";
+add_proto qw/void av2_cdef_filter_16_0/, "uint16_t *const dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int coeff_shift, int block_width, int block_height";
+add_proto qw/void av2_cdef_filter_16_1/, "uint16_t *const dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int coeff_shift, int block_width, int block_height";
+add_proto qw/void av2_cdef_filter_16_2/, "uint16_t *const dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int coeff_shift, int block_width, int block_height";
+add_proto qw/void av2_cdef_filter_16_3/, "uint16_t *const dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int coeff_shift, int block_width, int block_height";
 
-add_proto qw/void cdef_copy_rect8_16bit_to_16bit/, "uint16_t *const dst, int dstride, const uint16_t *src, int sstride, int v, int h";
+add_proto qw/void av2_cdef_copy_rect8_16bit_to_16bit/, "uint16_t *const dst, int dstride, const uint16_t *src, int sstride, int v, int h";
 
 # VS compiling for 32 bit targets does not support vector types in
 # structs as arguments, which makes the v256 type of the intrinsics
 # hard to support, so optimizations for this target are disabled.
 if ($opts{config} !~ /libs-x86-win32-vs.*/) {
-  specialize qw/cdef_find_dir sse2 ssse3 sse4_1 avx2 neon/;
-  specialize qw/cdef_find_dir_dual sse2 ssse3 sse4_1 avx2 neon/;
+  specialize qw/av2_cdef_find_dir sse2 ssse3 sse4_1 avx2 neon/;
+  specialize qw/av2_cdef_find_dir_dual sse2 ssse3 sse4_1 avx2 neon/;
 
-  specialize qw/cdef_filter_16_0 sse2 ssse3 sse4_1 avx2 neon/;
-  specialize qw/cdef_filter_16_1 sse2 ssse3 sse4_1 avx2 neon/;
-  specialize qw/cdef_filter_16_2 sse2 ssse3 sse4_1 avx2 neon/;
-  specialize qw/cdef_filter_16_3 sse2 ssse3 sse4_1 avx2 neon/;
+  specialize qw/av2_cdef_filter_16_0 sse2 ssse3 sse4_1 avx2 neon/;
+  specialize qw/av2_cdef_filter_16_1 sse2 ssse3 sse4_1 avx2 neon/;
+  specialize qw/av2_cdef_filter_16_2 sse2 ssse3 sse4_1 avx2 neon/;
+  specialize qw/av2_cdef_filter_16_3 sse2 ssse3 sse4_1 avx2 neon/;
 
-  specialize qw/cdef_copy_rect8_16bit_to_16bit sse2 ssse3 sse4_1 avx2 neon/;
+  specialize qw/av2_cdef_copy_rect8_16bit_to_16bit sse2 ssse3 sse4_1 avx2 neon/;
 }
   add_proto qw/void gdf_set_lap_and_cls_unit/, "const int i_min, const int i_max, const int j_min, const int j_max, const uint16_t *rec_pnt, const int rec_stride, const int bit_depth, uint16_t *const *gdf_lap_y, const int gdf_lap_y_stride, uint32_t *gdf_cls_y, const int gdf_cls_y_stride";
   specialize qw/gdf_set_lap_and_cls_unit avx2/;
@@ -449,25 +449,25 @@
 add_proto qw/void av2_mhccp_derive_multi_param_hv/, "MACROBLOCKD *const xd, int plane,int above_lines, int left_lines, int ref_width,int ref_height, int dir, int is_top_sb_boundary";
 specialize qw/av2_mhccp_derive_multi_param_hv avx2/;
 
-add_proto qw/cfl_subtract_average_fn cfl_get_subtract_average_fn/, "TX_SIZE tx_size";
-specialize qw/cfl_get_subtract_average_fn sse2 avx2 neon vsx/;
+add_proto qw/av2_cfl_subtract_average_fn av2_cfl_get_subtract_average_fn/, "TX_SIZE tx_size";
+specialize qw/av2_cfl_get_subtract_average_fn sse2 avx2 neon vsx/;
 
-add_proto qw/cfl_subsample_hbd_fn cfl_get_luma_subsampling_420_hbd/, "TX_SIZE tx_size";
-specialize qw/cfl_get_luma_subsampling_420_hbd ssse3 avx2 neon/;
+add_proto qw/av2_cfl_subsample_hbd_fn av2_cfl_get_luma_subsampling_420_hbd/, "TX_SIZE tx_size";
+specialize qw/av2_cfl_get_luma_subsampling_420_hbd ssse3 avx2 neon/;
 
-add_proto qw/cfl_subsample_hbd_fn cfl_get_luma_subsampling_420_hbd_121/, "TX_SIZE tx_size";
-specialize qw/cfl_get_luma_subsampling_420_hbd_121 avx2/;
+add_proto qw/av2_cfl_subsample_hbd_fn av2_cfl_get_luma_subsampling_420_hbd_121/, "TX_SIZE tx_size";
+specialize qw/av2_cfl_get_luma_subsampling_420_hbd_121 avx2/;
 
-add_proto qw/cfl_subsample_hbd_fn cfl_get_luma_subsampling_420_hbd_colocated/, "TX_SIZE tx_size";
-specialize qw/cfl_get_luma_subsampling_420_hbd_colocated avx2/;
+add_proto qw/av2_cfl_subsample_hbd_fn av2_cfl_get_luma_subsampling_420_hbd_colocated/, "TX_SIZE tx_size";
+specialize qw/av2_cfl_get_luma_subsampling_420_hbd_colocated avx2/;
 
-add_proto qw/cfl_subsample_hbd_fn cfl_get_luma_subsampling_422_hbd/, "TX_SIZE tx_size";
-specialize qw/cfl_get_luma_subsampling_422_hbd ssse3 avx2 neon/;
+add_proto qw/av2_cfl_subsample_hbd_fn av2_cfl_get_luma_subsampling_422_hbd/, "TX_SIZE tx_size";
+specialize qw/av2_cfl_get_luma_subsampling_422_hbd ssse3 avx2 neon/;
 
-add_proto qw/cfl_subsample_hbd_fn cfl_get_luma_subsampling_444_hbd/, "TX_SIZE tx_size";
-specialize qw/cfl_get_luma_subsampling_444_hbd ssse3 avx2 neon/;
+add_proto qw/av2_cfl_subsample_hbd_fn av2_cfl_get_luma_subsampling_444_hbd/, "TX_SIZE tx_size";
+specialize qw/av2_cfl_get_luma_subsampling_444_hbd ssse3 avx2 neon/;
 
-add_proto qw/cfl_predict_hbd_fn cfl_get_predict_hbd_fn/, "TX_SIZE tx_size";
-specialize qw/cfl_get_predict_hbd_fn avx2 neon/;
+add_proto qw/av2_cfl_predict_hbd_fn av2_cfl_get_predict_hbd_fn/, "TX_SIZE tx_size";
+specialize qw/av2_cfl_get_predict_hbd_fn avx2 neon/;
 
 1;
diff --git a/av2/common/cdef.c b/av2/common/cdef.c
index 0ca1b82..dc9943f 100644
--- a/av2/common/cdef.c
+++ b/av2/common/cdef.c
@@ -102,9 +102,9 @@
   return count;
 }
 
-void cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride,
-                                      const uint16_t *src, int sstride, int v,
-                                      int h) {
+void av2_cdef_copy_rect8_16bit_to_16bit_c(uint16_t *dst, int dstride,
+                                          const uint16_t *src, int sstride,
+                                          int v, int h) {
   for (int i = 0; i < v; i++) {
     for (int j = 0; j < h; j++) {
       dst[i * dstride + j] = src[i * sstride + j];
@@ -117,7 +117,7 @@
                           int src_hoffset, int sstride, int vsize, int hsize) {
   (void)cm;
   const uint16_t *base = &src[src_voffset * sstride + src_hoffset];
-  cdef_copy_rect8_16bit_to_16bit(dst, dstride, base, sstride, vsize, hsize);
+  av2_cdef_copy_rect8_16bit_to_16bit(dst, dstride, base, sstride, vsize, hsize);
 }
 
 static INLINE void fill_rect(uint16_t *dst, int dstride, int v, int h,
diff --git a/av2/common/cdef_block.c b/av2/common/cdef_block.c
index 3202d37..0a39170 100644
--- a/av2/common/cdef_block.c
+++ b/av2/common/cdef_block.c
@@ -22,13 +22,13 @@
 beginning and end of the table. The cdef direction range is [0, 7] and the
 first index is offset +/-2. This removes the need to constrain the first
 index to the same range using e.g., & 7. */
-DECLARE_ALIGNED(16, const int, cdef_directions_padded[12][2]) = {
-  /* Padding: cdef_directions[6] */
+DECLARE_ALIGNED(16, const int, av2_cdef_directions_padded[12][2]) = {
+  /* Padding: av2_cdef_directions[6] */
   { 1 * CDEF_BSTRIDE + 0, 2 * CDEF_BSTRIDE + 0 },
-  /* Padding: cdef_directions[7] */
+  /* Padding: av2_cdef_directions[7] */
   { 1 * CDEF_BSTRIDE + 0, 2 * CDEF_BSTRIDE - 1 },
 
-  /* Begin cdef_directions */
+  /* Begin av2_cdef_directions */
   { -1 * CDEF_BSTRIDE + 1, -2 * CDEF_BSTRIDE + 2 },
   { 0 * CDEF_BSTRIDE + 1, -1 * CDEF_BSTRIDE + 2 },
   { 0 * CDEF_BSTRIDE + 1, 0 * CDEF_BSTRIDE + 2 },
@@ -37,15 +37,15 @@
   { 1 * CDEF_BSTRIDE + 0, 2 * CDEF_BSTRIDE + 1 },
   { 1 * CDEF_BSTRIDE + 0, 2 * CDEF_BSTRIDE + 0 },
   { 1 * CDEF_BSTRIDE + 0, 2 * CDEF_BSTRIDE - 1 },
-  /* End cdef_directions */
+  /* End av2_cdef_directions */
 
-  /* Padding: cdef_directions[0] */
+  /* Padding: av2_cdef_directions[0] */
   { -1 * CDEF_BSTRIDE + 1, -2 * CDEF_BSTRIDE + 2 },
-  /* Padding: cdef_directions[1] */
+  /* Padding: av2_cdef_directions[1] */
   { 0 * CDEF_BSTRIDE + 1, -1 * CDEF_BSTRIDE + 2 },
 };
 
-const int (*const cdef_directions)[2] = cdef_directions_padded + 2;
+const int (*const av2_cdef_directions)[2] = av2_cdef_directions_padded + 2;
 
 /* Detect direction. 0 means 45-degree up-right, 2 is horizontal, and so on.
    The search minimizes the weighted variance along all the lines in a
@@ -54,8 +54,8 @@
    in a particular direction. Since each direction have the same sum(x^2) term,
    that term is never computed. See Section 2, step 2, of:
    http://jmvalin.ca/notes/intra_paint.pdf */
-int cdef_find_dir_c(const uint16_t *img, int stride, int32_t *var,
-                    int coeff_shift) {
+int av2_cdef_find_dir_c(const uint16_t *img, int stride, int32_t *var,
+                        int coeff_shift) {
   int i;
   int32_t cost[8] = { 0 };
   int partial[8][15] = { { 0 } };
@@ -126,15 +126,15 @@
 }
 
 /* Computes the CDEF directions of 2 consecutive 8x8 blocks. */
-void cdef_find_dir_dual_c(const uint16_t *img1, const uint16_t *img2,
-                          int stride, int32_t *var1, int32_t *var2,
-                          int coeff_shift, int *out1, int *out2) {
-  *out1 = cdef_find_dir_c(img1, stride, var1, coeff_shift);
-  *out2 = cdef_find_dir_c(img2, stride, var2, coeff_shift);
+void av2_cdef_find_dir_dual_c(const uint16_t *img1, const uint16_t *img2,
+                              int stride, int32_t *var1, int32_t *var2,
+                              int coeff_shift, int *out1, int *out2) {
+  *out1 = av2_cdef_find_dir_c(img1, stride, var1, coeff_shift);
+  *out2 = av2_cdef_find_dir_c(img2, stride, var2, coeff_shift);
 }
 
-const int cdef_pri_taps[2][2] = { { 4, 2 }, { 3, 3 } };
-const int cdef_sec_taps[2] = { 2, 1 };
+const int av2_cdef_pri_taps[2][2] = { { 4, 2 }, { 3, 3 } };
+const int av2_cdef_sec_taps[2] = { 2, 1 };
 
 /* Smooth in the direction detected. */
 static void cdef_filter_block_internal(uint16_t *const dst16, int dstride,
@@ -147,8 +147,8 @@
   const int clipping_required = (enable_primary && enable_secondary);
   int i, j, k;
   const int s = CDEF_BSTRIDE;
-  const int *pri_taps = cdef_pri_taps[(pri_strength >> coeff_shift) & 1];
-  const int *sec_taps = cdef_sec_taps;
+  const int *pri_taps = av2_cdef_pri_taps[(pri_strength >> coeff_shift) & 1];
+  const int *sec_taps = av2_cdef_sec_taps;
   for (i = 0; i < block_height; i++) {
     for (j = 0; j < block_width; j++) {
       int16_t sum = 0;
@@ -158,8 +158,8 @@
       int min = x;
       for (k = 0; k < 2; k++) {
         if (enable_primary) {
-          int16_t p0 = in[i * s + j + cdef_directions[dir][k]];
-          int16_t p1 = in[i * s + j - cdef_directions[dir][k]];
+          int16_t p0 = in[i * s + j + av2_cdef_directions[dir][k]];
+          int16_t p1 = in[i * s + j - av2_cdef_directions[dir][k]];
           sum += pri_taps[k] * constrain(p0 - x, pri_strength, pri_damping);
           sum += pri_taps[k] * constrain(p1 - x, pri_strength, pri_damping);
           if (clipping_required) {
@@ -170,10 +170,10 @@
           }
         }
         if (enable_secondary) {
-          int16_t s0 = in[i * s + j + cdef_directions[dir + 2][k]];
-          int16_t s1 = in[i * s + j - cdef_directions[dir + 2][k]];
-          int16_t s2 = in[i * s + j + cdef_directions[dir - 2][k]];
-          int16_t s3 = in[i * s + j - cdef_directions[dir - 2][k]];
+          int16_t s0 = in[i * s + j + av2_cdef_directions[dir + 2][k]];
+          int16_t s1 = in[i * s + j - av2_cdef_directions[dir + 2][k]];
+          int16_t s2 = in[i * s + j + av2_cdef_directions[dir - 2][k]];
+          int16_t s3 = in[i * s + j - av2_cdef_directions[dir - 2][k]];
           if (clipping_required) {
             if (s0 != CDEF_VERY_LARGE) max = AVMMAX(s0, max);
             if (s1 != CDEF_VERY_LARGE) max = AVMMAX(s1, max);
@@ -202,10 +202,11 @@
 
 /* Wrapper function which invokes cdef_filter_block_internal() when both primary
  * and secondary strengths are non-zero. */
-void cdef_filter_16_0_c(uint16_t *const dst16, int dstride, const uint16_t *in,
-                        int pri_strength, int sec_strength, int dir,
-                        int pri_damping, int sec_damping, int coeff_shift,
-                        int block_width, int block_height) {
+void av2_cdef_filter_16_0_c(uint16_t *const dst16, int dstride,
+                            const uint16_t *in, int pri_strength,
+                            int sec_strength, int dir, int pri_damping,
+                            int sec_damping, int coeff_shift, int block_width,
+                            int block_height) {
   cdef_filter_block_internal(dst16, dstride, in, pri_strength, sec_strength,
                              dir, pri_damping, sec_damping, coeff_shift,
                              block_width, block_height,
@@ -214,10 +215,11 @@
 
 /* Wrapper function which invokes cdef_filter_block_internal() when primary
  * strength is non-zero and secondary strength is zero. */
-void cdef_filter_16_1_c(uint16_t *const dst16, int dstride, const uint16_t *in,
-                        int pri_strength, int sec_strength, int dir,
-                        int pri_damping, int sec_damping, int coeff_shift,
-                        int block_width, int block_height) {
+void av2_cdef_filter_16_1_c(uint16_t *const dst16, int dstride,
+                            const uint16_t *in, int pri_strength,
+                            int sec_strength, int dir, int pri_damping,
+                            int sec_damping, int coeff_shift, int block_width,
+                            int block_height) {
   cdef_filter_block_internal(dst16, dstride, in, pri_strength, sec_strength,
                              dir, pri_damping, sec_damping, coeff_shift,
                              block_width, block_height,
@@ -226,10 +228,11 @@
 
 /* Wrapper function which invokes cdef_filter_block_internal() when primary
  * strength is zero and secondary strength is non-zero. */
-void cdef_filter_16_2_c(uint16_t *const dst16, int dstride, const uint16_t *in,
-                        int pri_strength, int sec_strength, int dir,
-                        int pri_damping, int sec_damping, int coeff_shift,
-                        int block_width, int block_height) {
+void av2_cdef_filter_16_2_c(uint16_t *const dst16, int dstride,
+                            const uint16_t *in, int pri_strength,
+                            int sec_strength, int dir, int pri_damping,
+                            int sec_damping, int coeff_shift, int block_width,
+                            int block_height) {
   cdef_filter_block_internal(dst16, dstride, in, pri_strength, sec_strength,
                              dir, pri_damping, sec_damping, coeff_shift,
                              block_width, block_height,
@@ -238,10 +241,11 @@
 
 /* Wrapper function which invokes cdef_filter_block_internal() when both primary
  * and secondary strengths are zero. */
-void cdef_filter_16_3_c(uint16_t *const dst16, int dstride, const uint16_t *in,
-                        int pri_strength, int sec_strength, int dir,
-                        int pri_damping, int sec_damping, int coeff_shift,
-                        int block_width, int block_height) {
+void av2_cdef_filter_16_3_c(uint16_t *const dst16, int dstride,
+                            const uint16_t *in, int pri_strength,
+                            int sec_strength, int dir, int pri_damping,
+                            int sec_damping, int coeff_shift, int block_width,
+                            int block_height) {
   cdef_filter_block_internal(dst16, dstride, in, pri_strength, sec_strength,
                              dir, pri_damping, sec_damping, coeff_shift,
                              block_width, block_height,
@@ -260,13 +264,14 @@
   return var ? (strength * (4 + i) + 8) >> 4 : 0;
 }
 
-/* Computes CDEF direction of each 8x8 block by invoking cdef_find_dir_dual()
- * for the adjacent 8x8 blocks and cdef_find_dir() for the remaining 8x8 block.
+/* Computes CDEF direction of each 8x8 block by invoking
+ * av2_cdef_find_dir_dual() for the adjacent 8x8 blocks and av2_cdef_find_dir()
+ * for the remaining 8x8 block.
  */
-static inline void avm_cdef_find_dir(const uint16_t *in, cdef_list *dlist,
-                                     int var[CDEF_NBLOCKS][CDEF_NBLOCKS],
-                                     int cdef_count, int coeff_shift,
-                                     int dir[CDEF_NBLOCKS][CDEF_NBLOCKS]) {
+static inline void avm_av2_cdef_find_dir(const uint16_t *in, cdef_list *dlist,
+                                         int var[CDEF_NBLOCKS][CDEF_NBLOCKS],
+                                         int cdef_count, int coeff_shift,
+                                         int dir[CDEF_NBLOCKS][CDEF_NBLOCKS]) {
   int bi;
 
   // Find direction of two 8x8 blocks together.
@@ -277,17 +282,17 @@
     const int bx2 = dlist[bi + 1].bx;
     const int pos1 = 8 * by * CDEF_BSTRIDE + 8 * bx;
     const int pos2 = 8 * by2 * CDEF_BSTRIDE + 8 * bx2;
-    cdef_find_dir_dual(&in[pos1], &in[pos2], CDEF_BSTRIDE, &var[by][bx],
-                       &var[by2][bx2], coeff_shift, &dir[by][bx],
-                       &dir[by2][bx2]);
+    av2_cdef_find_dir_dual(&in[pos1], &in[pos2], CDEF_BSTRIDE, &var[by][bx],
+                           &var[by2][bx2], coeff_shift, &dir[by][bx],
+                           &dir[by2][bx2]);
   }
 
   // Process remaining 8x8 blocks here. One 8x8 at a time.
   if (cdef_count % 2) {
     const int by = dlist[bi].by;
     const int bx = dlist[bi].bx;
-    dir[by][bx] = cdef_find_dir(&in[8 * by * CDEF_BSTRIDE + 8 * bx],
-                                CDEF_BSTRIDE, &var[by][bx], coeff_shift);
+    dir[by][bx] = av2_cdef_find_dir(&in[8 * by * CDEF_BSTRIDE + 8 * bx],
+                                    CDEF_BSTRIDE, &var[by][bx], coeff_shift);
   }
 }
 
@@ -333,7 +338,7 @@
 
   if (pli == 0) {
     if (!dirinit || !*dirinit) {
-      avm_cdef_find_dir(in, dlist, var, cdef_count, coeff_shift, dir);
+      avm_av2_cdef_find_dir(in, dlist, var, cdef_count, coeff_shift, dir);
       if (dirinit) *dirinit = 1;
     }
   }
@@ -355,9 +360,10 @@
    * strength_index == 2 : enable_primary = 0, enable_secondary = 1
    * strength_index == 3 : enable_primary = 0, enable_secondary = 0
    */
-  const cdef_filter_block_func cdef_filter_fn[4] = {
-    cdef_filter_16_0, cdef_filter_16_1, cdef_filter_16_2, cdef_filter_16_3
-  };
+  const cdef_filter_block_func cdef_filter_fn[4] = { av2_cdef_filter_16_0,
+                                                     av2_cdef_filter_16_1,
+                                                     av2_cdef_filter_16_2,
+                                                     av2_cdef_filter_16_3 };
   for (bi = 0; bi < cdef_count; bi++) {
     by = dlist[bi].by;
     bx = dlist[bi].bx;
diff --git a/av2/common/cdef_block.h b/av2/common/cdef_block.h
index 3c194a8..d648682 100644
--- a/av2/common/cdef_block.h
+++ b/av2/common/cdef_block.h
@@ -35,9 +35,9 @@
 #define CDEF_INBUF_SIZE \
   (CDEF_BSTRIDE * ((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_VBORDER))
 
-extern const int cdef_pri_taps[2][2];
-extern const int cdef_sec_taps[2];
-extern const int (*const cdef_directions)[2];
+extern const int av2_cdef_pri_taps[2][2];
+extern const int av2_cdef_sec_taps[2];
+extern const int (*const av2_cdef_directions)[2];
 
 typedef struct {
   uint8_t by;
diff --git a/av2/common/cdef_block_avx2.c b/av2/common/cdef_block_avx2.c
index eff525c..eaea1c9 100644
--- a/av2/common/cdef_block_avx2.c
+++ b/av2/common/cdef_block_avx2.c
@@ -181,10 +181,10 @@
 
 /* AVX2 function which computes the CDEF directions of two 8x8 blocks together.
  */
-void cdef_find_dir_dual_avx2(const uint16_t *img1, const uint16_t *img2,
-                             int stride, int32_t *var_out_1st,
-                             int32_t *var_out_2nd, int coeff_shift,
-                             int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
+void av2_cdef_find_dir_dual_avx2(const uint16_t *img1, const uint16_t *img2,
+                                 int stride, int32_t *var_out_1st,
+                                 int32_t *var_out_2nd, int coeff_shift,
+                                 int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
   int32_t cost_first_8x8[8];
   int32_t cost_second_8x8[8];
   // Used to store the best cost for 2 8x8's.
diff --git a/av2/common/cdef_block_neon.c b/av2/common/cdef_block_neon.c
index 07f3e99..8243fdd 100644
--- a/av2/common/cdef_block_neon.c
+++ b/av2/common/cdef_block_neon.c
@@ -15,13 +15,13 @@
 #include "av2/common/cdef_block_simd.h"
 
 /* NEON function which computes the CDEF directions of two 8x8 blocks. */
-void cdef_find_dir_dual_neon(const uint16_t *img1, const uint16_t *img2,
-                             int stride, int32_t *var_out_1st,
-                             int32_t *var_out_2nd, int coeff_shift,
-                             int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
+void av2_cdef_find_dir_dual_neon(const uint16_t *img1, const uint16_t *img2,
+                                 int stride, int32_t *var_out_1st,
+                                 int32_t *var_out_2nd, int coeff_shift,
+                                 int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
   // Process first 8x8.
-  *out_dir_1st_8x8 = cdef_find_dir(img1, stride, var_out_1st, coeff_shift);
+  *out_dir_1st_8x8 = av2_cdef_find_dir(img1, stride, var_out_1st, coeff_shift);
 
   // Process second 8x8.
-  *out_dir_2nd_8x8 = cdef_find_dir(img2, stride, var_out_2nd, coeff_shift);
+  *out_dir_2nd_8x8 = av2_cdef_find_dir(img2, stride, var_out_2nd, coeff_shift);
 }
diff --git a/av2/common/cdef_block_simd.h b/av2/common/cdef_block_simd.h
index 2a4f61f..676d07f 100644
--- a/av2/common/cdef_block_simd.h
+++ b/av2/common/cdef_block_simd.h
@@ -159,8 +159,8 @@
   res[0] = v128_ziphi_64(tr1_7, tr1_6);
 }
 
-int SIMD_FUNC(cdef_find_dir)(const uint16_t *img, int stride, int32_t *var,
-                             int coeff_shift) {
+int SIMD_FUNC(av2_cdef_find_dir)(const uint16_t *img, int stride, int32_t *var,
+                                 int coeff_shift) {
   int i;
   int32_t cost[8];
   int32_t best_cost = 0;
@@ -246,14 +246,14 @@
   v256 sum, row, res;
   const v256 cdef_large_value_mask = v256_dup_16((uint16_t)~CDEF_VERY_LARGE);
   v256 max, min;
-  const int po1 = cdef_directions[dir][0];
-  const int po2 = cdef_directions[dir][1];
-  const int s1o1 = cdef_directions[dir + 2][0];
-  const int s1o2 = cdef_directions[dir + 2][1];
-  const int s2o1 = cdef_directions[dir - 2][0];
-  const int s2o2 = cdef_directions[dir - 2][1];
-  const int *pri_taps = cdef_pri_taps[(pri_strength >> coeff_shift) & 1];
-  const int *sec_taps = cdef_sec_taps;
+  const int po1 = av2_cdef_directions[dir][0];
+  const int po2 = av2_cdef_directions[dir][1];
+  const int s1o1 = av2_cdef_directions[dir + 2][0];
+  const int s1o2 = av2_cdef_directions[dir + 2][1];
+  const int s2o1 = av2_cdef_directions[dir - 2][0];
+  const int s2o2 = av2_cdef_directions[dir - 2][1];
+  const int *pri_taps = av2_cdef_pri_taps[(pri_strength >> coeff_shift) & 1];
+  const int *sec_taps = av2_cdef_sec_taps;
   int i;
 
   if (enable_primary && pri_strength)
@@ -424,14 +424,14 @@
   v256 sum, p0, p1, p2, p3, row, res;
   const v256 cdef_large_value_mask = v256_dup_16((uint16_t)~CDEF_VERY_LARGE);
   v256 max, min;
-  const int po1 = cdef_directions[dir][0];
-  const int po2 = cdef_directions[dir][1];
-  const int s1o1 = cdef_directions[dir + 2][0];
-  const int s1o2 = cdef_directions[dir + 2][1];
-  const int s2o1 = cdef_directions[dir - 2][0];
-  const int s2o2 = cdef_directions[dir - 2][1];
-  const int *pri_taps = cdef_pri_taps[(pri_strength >> coeff_shift) & 1];
-  const int *sec_taps = cdef_sec_taps;
+  const int po1 = av2_cdef_directions[dir][0];
+  const int po2 = av2_cdef_directions[dir][1];
+  const int s1o1 = av2_cdef_directions[dir + 2][0];
+  const int s1o2 = av2_cdef_directions[dir + 2][1];
+  const int s2o1 = av2_cdef_directions[dir - 2][0];
+  const int s2o2 = av2_cdef_directions[dir - 2][1];
+  const int *pri_taps = av2_cdef_pri_taps[(pri_strength >> coeff_shift) & 1];
+  const int *sec_taps = av2_cdef_sec_taps;
 
   if (enable_primary && pri_strength)
     pri_damping = AVMMAX(0, pri_damping - get_msb(pri_strength));
@@ -593,11 +593,11 @@
 
 /* Wrapper function which invokes block width specific CDEF SIMD functions when
  * primary and secondary strengths are non-zero. */
-void SIMD_FUNC(cdef_filter_16_0)(uint16_t *const dest, int dstride,
-                                 const uint16_t *in, int pri_strength,
-                                 int sec_strength, int dir, int pri_damping,
-                                 int sec_damping, int coeff_shift,
-                                 int block_width, int block_height) {
+void SIMD_FUNC(av2_cdef_filter_16_0)(uint16_t *const dest, int dstride,
+                                     const uint16_t *in, int pri_strength,
+                                     int sec_strength, int dir, int pri_damping,
+                                     int sec_damping, int coeff_shift,
+                                     int block_width, int block_height) {
   if (block_width == 8) {
     filter_block_8x8(dest, dstride, in, pri_strength, sec_strength, dir,
                      pri_damping, sec_damping, coeff_shift, block_height,
@@ -613,11 +613,11 @@
 
 /* Wrapper function which invokes block width specific CDEF SIMD functions when
  * primary strength is non-zero and secondary strength is zero. */
-void SIMD_FUNC(cdef_filter_16_1)(uint16_t *const dest, int dstride,
-                                 const uint16_t *in, int pri_strength,
-                                 int sec_strength, int dir, int pri_damping,
-                                 int sec_damping, int coeff_shift,
-                                 int block_width, int block_height) {
+void SIMD_FUNC(av2_cdef_filter_16_1)(uint16_t *const dest, int dstride,
+                                     const uint16_t *in, int pri_strength,
+                                     int sec_strength, int dir, int pri_damping,
+                                     int sec_damping, int coeff_shift,
+                                     int block_width, int block_height) {
   if (block_width == 8) {
     filter_block_8x8(dest, dstride, in, pri_strength, sec_strength, dir,
                      pri_damping, sec_damping, coeff_shift, block_height,
@@ -633,11 +633,11 @@
 
 /* Wrapper function which invokes block width specific CDEF SIMD functions when
  * primary strength is zero and secondary strength is non-zero. */
-void SIMD_FUNC(cdef_filter_16_2)(uint16_t *const dest, int dstride,
-                                 const uint16_t *in, int pri_strength,
-                                 int sec_strength, int dir, int pri_damping,
-                                 int sec_damping, int coeff_shift,
-                                 int block_width, int block_height) {
+void SIMD_FUNC(av2_cdef_filter_16_2)(uint16_t *const dest, int dstride,
+                                     const uint16_t *in, int pri_strength,
+                                     int sec_strength, int dir, int pri_damping,
+                                     int sec_damping, int coeff_shift,
+                                     int block_width, int block_height) {
   if (block_width == 8) {
     filter_block_8x8(dest, dstride, in, pri_strength, sec_strength, dir,
                      pri_damping, sec_damping, coeff_shift, block_height,
@@ -653,11 +653,11 @@
 
 /* Wrapper function which invokes block width specific CDEF SIMD functions when
  * both primary and secondary strengths are zero. */
-void SIMD_FUNC(cdef_filter_16_3)(uint16_t *const dest, int dstride,
-                                 const uint16_t *in, int pri_strength,
-                                 int sec_strength, int dir, int pri_damping,
-                                 int sec_damping, int coeff_shift,
-                                 int block_width, int block_height) {
+void SIMD_FUNC(av2_cdef_filter_16_3)(uint16_t *const dest, int dstride,
+                                     const uint16_t *in, int pri_strength,
+                                     int sec_strength, int dir, int pri_damping,
+                                     int sec_damping, int coeff_shift,
+                                     int block_width, int block_height) {
   (void)pri_strength;
   (void)sec_strength;
   (void)dir;
@@ -672,9 +672,10 @@
   }
 }
 
-void SIMD_FUNC(cdef_copy_rect8_16bit_to_16bit)(uint16_t *const dst, int dstride,
-                                               const uint16_t *src, int sstride,
-                                               int v, int h) {
+void SIMD_FUNC(av2_cdef_copy_rect8_16bit_to_16bit)(uint16_t *const dst,
+                                                   int dstride,
+                                                   const uint16_t *src,
+                                                   int sstride, int v, int h) {
   int i, j;
   for (i = 0; i < v; i++) {
     for (j = 0; j < (h & ~0x7); j += 8) {
diff --git a/av2/common/cdef_block_sse2.c b/av2/common/cdef_block_sse2.c
index f4c0c55..915799c 100644
--- a/av2/common/cdef_block_sse2.c
+++ b/av2/common/cdef_block_sse2.c
@@ -15,13 +15,13 @@
 #include "av2/common/cdef_block_simd.h"
 
 /* SSE2 function which computes the CDEF directions of two 8x8 blocks. */
-void cdef_find_dir_dual_sse2(const uint16_t *img1, const uint16_t *img2,
-                             int stride, int32_t *var_out_1st,
-                             int32_t *var_out_2nd, int coeff_shift,
-                             int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
+void av2_cdef_find_dir_dual_sse2(const uint16_t *img1, const uint16_t *img2,
+                                 int stride, int32_t *var_out_1st,
+                                 int32_t *var_out_2nd, int coeff_shift,
+                                 int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
   // Process first 8x8.
-  *out_dir_1st_8x8 = cdef_find_dir(img1, stride, var_out_1st, coeff_shift);
+  *out_dir_1st_8x8 = av2_cdef_find_dir(img1, stride, var_out_1st, coeff_shift);
 
   // Process second 8x8.
-  *out_dir_2nd_8x8 = cdef_find_dir(img2, stride, var_out_2nd, coeff_shift);
+  *out_dir_2nd_8x8 = av2_cdef_find_dir(img2, stride, var_out_2nd, coeff_shift);
 }
diff --git a/av2/common/cdef_block_sse4.c b/av2/common/cdef_block_sse4.c
index a245fb9..4fbe8da 100644
--- a/av2/common/cdef_block_sse4.c
+++ b/av2/common/cdef_block_sse4.c
@@ -15,13 +15,13 @@
 #include "av2/common/cdef_block_simd.h"
 
 /* SSE4_1 function which computes the CDEF directions of two 8x8 blocks */
-void cdef_find_dir_dual_sse4_1(const uint16_t *img1, const uint16_t *img2,
-                               int stride, int32_t *var_out_1st,
-                               int32_t *var_out_2nd, int coeff_shift,
-                               int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
+void av2_cdef_find_dir_dual_sse4_1(const uint16_t *img1, const uint16_t *img2,
+                                   int stride, int32_t *var_out_1st,
+                                   int32_t *var_out_2nd, int coeff_shift,
+                                   int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
   // Process first 8x8.
-  *out_dir_1st_8x8 = cdef_find_dir(img1, stride, var_out_1st, coeff_shift);
+  *out_dir_1st_8x8 = av2_cdef_find_dir(img1, stride, var_out_1st, coeff_shift);
 
   // Process second 8x8.
-  *out_dir_2nd_8x8 = cdef_find_dir(img2, stride, var_out_2nd, coeff_shift);
+  *out_dir_2nd_8x8 = av2_cdef_find_dir(img2, stride, var_out_2nd, coeff_shift);
 }
diff --git a/av2/common/cdef_block_ssse3.c b/av2/common/cdef_block_ssse3.c
index 3fb097e..2b5f5a4 100644
--- a/av2/common/cdef_block_ssse3.c
+++ b/av2/common/cdef_block_ssse3.c
@@ -15,13 +15,13 @@
 #include "av2/common/cdef_block_simd.h"
 
 /* SSSE3 function which computes the CDEF directions of two 8x8 blocks */
-void cdef_find_dir_dual_ssse3(const uint16_t *img1, const uint16_t *img2,
-                              int stride, int32_t *var_out_1st,
-                              int32_t *var_out_2nd, int coeff_shift,
-                              int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
+void av2_cdef_find_dir_dual_ssse3(const uint16_t *img1, const uint16_t *img2,
+                                  int stride, int32_t *var_out_1st,
+                                  int32_t *var_out_2nd, int coeff_shift,
+                                  int *out_dir_1st_8x8, int *out_dir_2nd_8x8) {
   // Process first 8x8.
-  *out_dir_1st_8x8 = cdef_find_dir(img1, stride, var_out_1st, coeff_shift);
+  *out_dir_1st_8x8 = av2_cdef_find_dir(img1, stride, var_out_1st, coeff_shift);
 
   // Process second 8x8.
-  *out_dir_2nd_8x8 = cdef_find_dir(img2, stride, var_out_2nd, coeff_shift);
+  *out_dir_2nd_8x8 = av2_cdef_find_dir(img2, stride, var_out_2nd, coeff_shift);
 }
diff --git a/av2/common/cfl.c b/av2/common/cfl.c
index 8418664..6ecafda 100644
--- a/av2/common/cfl.c
+++ b/av2/common/cfl.c
@@ -70,7 +70,7 @@
   }
 }
 
-void cfl_init(CFL_CTX *cfl, const SequenceHeader *seq_params) {
+void av2_cfl_init(CFL_CTX *cfl, const SequenceHeader *seq_params) {
   assert(block_size_wide[CFL_MAX_BLOCK_SIZE] == CFL_BUF_LINE);
   assert(block_size_high[CFL_MAX_BLOCK_SIZE] == CFL_BUF_LINE);
 
@@ -87,8 +87,8 @@
   cfl->dc_pred_is_cached[CFL_PRED_V] = 0;
 }
 
-void cfl_store_dc_pred(MACROBLOCKD *const xd, const uint16_t *input,
-                       CFL_PRED_TYPE pred_plane, int width) {
+void av2_cfl_store_dc_pred(MACROBLOCKD *const xd, const uint16_t *input,
+                           CFL_PRED_TYPE pred_plane, int width) {
   assert(pred_plane < CFL_PRED_PLANES);
   assert(width <= CFL_BUF_LINE);
 
@@ -96,23 +96,24 @@
   return;
 }
 
-static void cfl_load_dc_pred_hbd(const uint16_t *dc_pred_cache, uint16_t *dst,
-                                 int dst_stride, int width, int height) {
+static void av2_cfl_load_dc_pred_hbd(const uint16_t *dc_pred_cache,
+                                     uint16_t *dst, int dst_stride, int width,
+                                     int height) {
   const size_t num_bytes = width * sizeof(*dst);
   for (int j = 0; j < height; j++) {
     memcpy(dst, dc_pred_cache, num_bytes);
     dst += dst_stride;
   }
 }
-void cfl_load_dc_pred(MACROBLOCKD *const xd, uint16_t *dst, int dst_stride,
-                      TX_SIZE tx_size, CFL_PRED_TYPE pred_plane) {
+void av2_cfl_load_dc_pred(MACROBLOCKD *const xd, uint16_t *dst, int dst_stride,
+                          TX_SIZE tx_size, CFL_PRED_TYPE pred_plane) {
   const int width = tx_size_wide[tx_size];
   const int height = tx_size_high[tx_size];
   assert(pred_plane < CFL_PRED_PLANES);
   assert(width <= CFL_BUF_LINE);
   assert(height <= CFL_BUF_LINE);
-  cfl_load_dc_pred_hbd(xd->cfl.dc_pred_cache[pred_plane], dst, dst_stride,
-                       width, height);
+  av2_cfl_load_dc_pred_hbd(xd->cfl.dc_pred_cache[pred_plane], dst, dst_stride,
+                           width, height);
 }
 
 // Due to frame boundary issues, it is possible that the total area covered by
@@ -182,8 +183,9 @@
   return (alpha_sign == CFL_SIGN_POS) ? abs_alpha_q3 + 1 : -abs_alpha_q3 - 1;
 }
 
-void cfl_predict_hbd_c(const int16_t *ac_buf_q3, uint16_t *dst, int dst_stride,
-                       int alpha_q3, int bit_depth, int width, int height) {
+void av2_cfl_predict_hbd_c(const int16_t *ac_buf_q3, uint16_t *dst,
+                           int dst_stride, int alpha_q3, int bit_depth,
+                           int width, int height) {
   for (int j = 0; j < height; j++) {
     for (int i = 0; i < width; i++) {
       dst[i] = clip_pixel_highbd(
@@ -603,10 +605,10 @@
                                           shift);
 }
 
-void cfl_predict_block(bool seq_enable_cfl_intra, bool seq_enable_mhccp,
-                       MACROBLOCKD *const xd, uint16_t *dst, int dst_stride,
-                       TX_SIZE tx_size, int plane, bool have_top,
-                       bool have_left, int above_lines, int left_lines) {
+void av2_cfl_predict_block(bool seq_enable_cfl_intra, bool seq_enable_mhccp,
+                           MACROBLOCKD *const xd, uint16_t *dst, int dst_stride,
+                           TX_SIZE tx_size, int plane, bool have_top,
+                           bool have_left, int above_lines, int left_lines) {
   CFL_CTX *const cfl = &xd->cfl;
   MB_MODE_INFO *mbmi = xd->mi[0];
 
@@ -636,11 +638,11 @@
   const int width = tx_size_wide[tx_size];
   const int height = tx_size_high[tx_size];
   if (AVMMAX(width, height) > 32) {
-    cfl_predict_hbd_c(cfl->ac_buf_q3, dst, dst_stride, alpha_q3, xd->bd, width,
-                      height);
+    av2_cfl_predict_hbd_c(cfl->ac_buf_q3, dst, dst_stride, alpha_q3, xd->bd,
+                          width, height);
   } else
-    cfl_get_predict_hbd_fn(tx_size)(cfl->ac_buf_q3, dst, dst_stride, alpha_q3,
-                                    xd->bd);
+    av2_cfl_get_predict_hbd_fn(tx_size)(cfl->ac_buf_q3, dst, dst_stride,
+                                        alpha_q3, xd->bd);
 }
 
 static void cfl_luma_subsampling_420_hbd_c(const uint16_t *input,
@@ -745,15 +747,16 @@
 
 CFL_GET_SUBSAMPLE_COLOCATED_FUNCTION(c)
 
-static INLINE cfl_subsample_hbd_fn cfl_subsampling_hbd(TX_SIZE tx_size,
-                                                       int sub_x, int sub_y) {
+static INLINE av2_cfl_subsample_hbd_fn cfl_subsampling_hbd(TX_SIZE tx_size,
+                                                           int sub_x,
+                                                           int sub_y) {
   if (sub_x == 1) {
     if (sub_y == 1) {
-      return cfl_get_luma_subsampling_420_hbd(tx_size);
+      return av2_cfl_get_luma_subsampling_420_hbd(tx_size);
     }
-    return cfl_get_luma_subsampling_422_hbd(tx_size);
+    return av2_cfl_get_luma_subsampling_422_hbd(tx_size);
   }
-  return cfl_get_luma_subsampling_444_hbd(tx_size);
+  return av2_cfl_get_luma_subsampling_444_hbd(tx_size);
 }
 
 void cfl_store(MACROBLOCKD *const xd, CFL_CTX *cfl, const uint16_t *input,
@@ -814,8 +817,8 @@
         cfl_luma_subsampling_420_hbd_121_c(input, input_stride, recon_buf_q3,
                                            width, height);
       } else {
-        cfl_get_luma_subsampling_420_hbd_121(tx_size)(input, input_stride,
-                                                      recon_buf_q3);
+        av2_cfl_get_luma_subsampling_420_hbd_121(tx_size)(input, input_stride,
+                                                          recon_buf_q3);
       }
     } else {
       if (AVMMAX(width, height) > 64) {
@@ -832,8 +835,8 @@
         cfl_luma_subsampling_420_hbd_colocated_c(input, input_stride,
                                                  recon_buf_q3, width, height);
       } else {
-        cfl_get_luma_subsampling_420_hbd_colocated(tx_size)(input, input_stride,
-                                                            recon_buf_q3);
+        av2_cfl_get_luma_subsampling_420_hbd_colocated(tx_size)(
+            input, input_stride, recon_buf_q3);
       }
     } else {
       if (AVMMAX(width, height) > 64) {
@@ -855,8 +858,8 @@
   }
 }
 
-void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size,
-                     int filter_type) {
+void av2_cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize,
+                         TX_SIZE tx_size, int filter_type) {
   CFL_CTX *const cfl = &xd->cfl;
   struct macroblockd_plane *const pd = &xd->plane[AVM_PLANE_Y];
   // Always store full block, even if partially outside frame boundary.
diff --git a/av2/common/cfl.h b/av2/common/cfl.h
index 16b6049..c9c7c74 100644
--- a/av2/common/cfl.h
+++ b/av2/common/cfl.h
@@ -192,13 +192,13 @@
   return (CFL_PRED_TYPE)(plane - 1);
 }
 
-void cfl_predict_block(bool seq_enable_cfl_intra, bool seq_enable_mhccp,
-                       MACROBLOCKD *const xd, uint16_t *dst, int dst_stride,
-                       TX_SIZE tx_size, int plane, bool have_top,
-                       bool have_left, int above_lines, int left_lines);
+void av2_cfl_predict_block(bool seq_enable_cfl_intra, bool seq_enable_mhccp,
+                           MACROBLOCKD *const xd, uint16_t *dst, int dst_stride,
+                           TX_SIZE tx_size, int plane, bool have_top,
+                           bool have_left, int above_lines, int left_lines);
 
-void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size,
-                     int filter_type);
+void av2_cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize,
+                         TX_SIZE tx_size, int filter_type);
 
 void cfl_store(MACROBLOCKD *const xd, CFL_CTX *cfl, const uint16_t *input,
                int input_stride, int row, int col, int width, int height,
@@ -245,11 +245,11 @@
                                               uint16_t *output_q3, int width,
                                               int height);
 
-void cfl_store_dc_pred(MACROBLOCKD *const xd, const uint16_t *input,
-                       CFL_PRED_TYPE pred_plane, int width);
+void av2_cfl_store_dc_pred(MACROBLOCKD *const xd, const uint16_t *input,
+                           CFL_PRED_TYPE pred_plane, int width);
 
-void cfl_load_dc_pred(MACROBLOCKD *const xd, uint16_t *dst, int dst_stride,
-                      TX_SIZE tx_size, CFL_PRED_TYPE pred_plane);
+void av2_cfl_load_dc_pred(MACROBLOCKD *const xd, uint16_t *dst, int dst_stride,
+                          TX_SIZE tx_size, CFL_PRED_TYPE pred_plane);
 
 // Allows the CFL_SUBSAMPLE function to switch types depending on the bitdepth.
 #define CFL_lbd_TYPE uint8_t *cfl_type
@@ -260,113 +260,114 @@
 // will be constant allowing for loop unrolling and other constant propagated
 // goodness.
 #define CFL_SUBSAMPLE(arch, sub, bd, width, height)                       \
-  void cfl_subsample_##bd##_##sub##_##width##x##height##_##arch(          \
+  void av2_cfl_subsample_##bd##_##sub##_##width##x##height##_##arch(      \
       const CFL_##bd##_TYPE, int input_stride, uint16_t *output_q3) {     \
     cfl_luma_subsampling_##sub##_##bd##_##arch(cfl_type, input_stride,    \
                                                output_q3, width, height); \
   }
 
 // Declare size-specific wrappers for all valid CfL sizes.
-#define CFL_SUBSAMPLE_FUNCTIONS(arch, sub, bd)                            \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 4)                                      \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 8)                                      \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 16)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 32)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 8)                                      \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 4)                                      \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 16)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 8)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 32)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 16)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 16)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 4)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 32)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 8)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 32)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 4)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 64)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 64)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 64)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 64)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 64)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 32)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 16)                                    \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 8)                                     \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 4)                                     \
-  cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_##arch( \
-      TX_SIZE tx_size) {                                                  \
-    CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd)                           \
-    return subfn_##sub[tx_size];                                          \
+#define CFL_SUBSAMPLE_FUNCTIONS(arch, sub, bd)                              \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 4)                                        \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 8)                                        \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 16)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 32)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 8)                                        \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 4)                                        \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 16)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 8)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 32)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 16)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 16)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 4)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 32)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 8)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 32)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 4)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 64)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 64)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 64)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 64)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 64)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 32)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 16)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 8)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 4)                                       \
+  av2_cfl_subsample_##bd##_fn                                               \
+      av2_cfl_get_luma_subsampling_##sub##_##bd##_##arch(TX_SIZE tx_size) { \
+    CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd)                             \
+    return subfn_##sub[tx_size];                                            \
   }
 
-#define CFL_SUBSAMPLE_FUNCTIONS_NEON(arch, sub, bd)                            \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 4)                                           \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 8)                                           \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 16)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 32)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 8)                                           \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 4)                                           \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 16)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 8)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 32)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 16)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 16)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 4)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 32)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 8)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 32)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 4)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 64)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 32, 64)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 16, 64)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 8, 64)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 4, 64)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 32)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 16)                                         \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 8)                                          \
-  CFL_SUBSAMPLE(arch, sub, bd, 64, 4)                                          \
-  cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_##arch(      \
-      TX_SIZE tx_size) {                                                       \
-    CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd)                                \
-    switch (tx_size) {                                                         \
-      case TX_64X64:                                                           \
-      case TX_64X32:                                                           \
-      case TX_64X16:                                                           \
-      case TX_64X8:                                                            \
-      case TX_64X4: return cfl_get_luma_subsampling_##sub##_##bd##_c(tx_size); \
-    }                                                                          \
-    return subfn_##sub[tx_size];                                               \
+#define CFL_SUBSAMPLE_FUNCTIONS_NEON(arch, sub, bd)                         \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 4)                                        \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 8)                                        \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 16)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 32)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 8)                                        \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 4)                                        \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 16)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 8)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 32)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 16)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 16)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 4)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 32)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 8)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 32)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 4)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 64)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 32, 64)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 16, 64)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 8, 64)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 4, 64)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 32)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 16)                                      \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 8)                                       \
+  CFL_SUBSAMPLE(arch, sub, bd, 64, 4)                                       \
+  av2_cfl_subsample_##bd##_fn                                               \
+      av2_cfl_get_luma_subsampling_##sub##_##bd##_##arch(TX_SIZE tx_size) { \
+    CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd)                             \
+    switch (tx_size) {                                                      \
+      case TX_64X64:                                                        \
+      case TX_64X32:                                                        \
+      case TX_64X16:                                                        \
+      case TX_64X8:                                                         \
+      case TX_64X4:                                                         \
+        return av2_cfl_get_luma_subsampling_##sub##_##bd##_c(tx_size);      \
+    }                                                                       \
+    return subfn_##sub[tx_size];                                            \
   }
 
 // Declare an architecture-specific array of function pointers for size-specific
 // wrappers.
-#define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd)                  \
-  static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \
-    cfl_subsample_##bd##_##sub##_4x4_##arch,   /* 4x4 */             \
-    cfl_subsample_##bd##_##sub##_8x8_##arch,   /* 8x8 */             \
-    cfl_subsample_##bd##_##sub##_16x16_##arch, /* 16x16 */           \
-    cfl_subsample_##bd##_##sub##_32x32_##arch, /* 32x32 */           \
-    cfl_subsample_##bd##_##sub##_64x64_##arch, /* 64x64 */           \
-    cfl_subsample_##bd##_##sub##_4x8_##arch,   /* 4x8 */             \
-    cfl_subsample_##bd##_##sub##_8x4_##arch,   /* 8x4 */             \
-    cfl_subsample_##bd##_##sub##_8x16_##arch,  /* 8x16 */            \
-    cfl_subsample_##bd##_##sub##_16x8_##arch,  /* 16x8 */            \
-    cfl_subsample_##bd##_##sub##_16x32_##arch, /* 16x32 */           \
-    cfl_subsample_##bd##_##sub##_32x16_##arch, /* 32x16 */           \
-    cfl_subsample_##bd##_##sub##_32x64_##arch, /* 32x64 */           \
-    cfl_subsample_##bd##_##sub##_64x32_##arch, /* 64x32 */           \
-    cfl_subsample_##bd##_##sub##_4x16_##arch,  /* 4x16  */           \
-    cfl_subsample_##bd##_##sub##_16x4_##arch,  /* 16x4  */           \
-    cfl_subsample_##bd##_##sub##_8x32_##arch,  /* 8x32  */           \
-    cfl_subsample_##bd##_##sub##_32x8_##arch,  /* 32x8  */           \
-    cfl_subsample_##bd##_##sub##_16x64_##arch, /* 16x64 */           \
-    cfl_subsample_##bd##_##sub##_64x16_##arch, /* 64x16 */           \
-    cfl_subsample_##bd##_##sub##_4x32_##arch,  /* 4x32 */            \
-    cfl_subsample_##bd##_##sub##_32x4_##arch,  /* 32x4 */            \
-    cfl_subsample_##bd##_##sub##_8x64_##arch,  /* 8x64 */            \
-    cfl_subsample_##bd##_##sub##_64x8_##arch,  /* 64x8 */            \
-    cfl_subsample_##bd##_##sub##_4x64_##arch,  /* 4x64 */            \
-    cfl_subsample_##bd##_##sub##_64x4_##arch,  /* 64x4 */            \
+#define CFL_SUBSAMPLE_FUNCTION_ARRAY(arch, sub, bd)                      \
+  static const av2_cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \
+    av2_cfl_subsample_##bd##_##sub##_4x4_##arch,   /* 4x4 */             \
+    av2_cfl_subsample_##bd##_##sub##_8x8_##arch,   /* 8x8 */             \
+    av2_cfl_subsample_##bd##_##sub##_16x16_##arch, /* 16x16 */           \
+    av2_cfl_subsample_##bd##_##sub##_32x32_##arch, /* 32x32 */           \
+    av2_cfl_subsample_##bd##_##sub##_64x64_##arch, /* 64x64 */           \
+    av2_cfl_subsample_##bd##_##sub##_4x8_##arch,   /* 4x8 */             \
+    av2_cfl_subsample_##bd##_##sub##_8x4_##arch,   /* 8x4 */             \
+    av2_cfl_subsample_##bd##_##sub##_8x16_##arch,  /* 8x16 */            \
+    av2_cfl_subsample_##bd##_##sub##_16x8_##arch,  /* 16x8 */            \
+    av2_cfl_subsample_##bd##_##sub##_16x32_##arch, /* 16x32 */           \
+    av2_cfl_subsample_##bd##_##sub##_32x16_##arch, /* 32x16 */           \
+    av2_cfl_subsample_##bd##_##sub##_32x64_##arch, /* 32x64 */           \
+    av2_cfl_subsample_##bd##_##sub##_64x32_##arch, /* 64x32 */           \
+    av2_cfl_subsample_##bd##_##sub##_4x16_##arch,  /* 4x16  */           \
+    av2_cfl_subsample_##bd##_##sub##_16x4_##arch,  /* 16x4  */           \
+    av2_cfl_subsample_##bd##_##sub##_8x32_##arch,  /* 8x32  */           \
+    av2_cfl_subsample_##bd##_##sub##_32x8_##arch,  /* 32x8  */           \
+    av2_cfl_subsample_##bd##_##sub##_16x64_##arch, /* 16x64 */           \
+    av2_cfl_subsample_##bd##_##sub##_64x16_##arch, /* 64x16 */           \
+    av2_cfl_subsample_##bd##_##sub##_4x32_##arch,  /* 4x32 */            \
+    av2_cfl_subsample_##bd##_##sub##_32x4_##arch,  /* 32x4 */            \
+    av2_cfl_subsample_##bd##_##sub##_8x64_##arch,  /* 8x64 */            \
+    av2_cfl_subsample_##bd##_##sub##_64x8_##arch,  /* 64x8 */            \
+    av2_cfl_subsample_##bd##_##sub##_4x64_##arch,  /* 4x64 */            \
+    av2_cfl_subsample_##bd##_##sub##_64x4_##arch,  /* 64x4 */            \
   };
 
 // The RTCD script does not support passing in an array, so we wrap it in this
@@ -382,141 +383,141 @@
   CFL_SUBSAMPLE_FUNCTIONS_NEON(arch, 444, hbd)
 
 #define CFL_SUBSAMPLE_121(arch, width, height)                              \
-  void cfl_subsample_hbd_420_121_##width##x##height##_##arch(               \
+  void av2_cfl_subsample_hbd_420_121_##width##x##height##_##arch(           \
       const uint16_t *input, int input_stride, uint16_t *output_q3) {       \
     cfl_luma_subsampling_420_hbd_121_##arch(input, input_stride, output_q3, \
                                             width, height);                 \
   }
 
-#define CFL_SUBSAMPLE_121_FUNCTIONS(arch)                           \
-  CFL_SUBSAMPLE_121(arch, 4, 4)                                     \
-  CFL_SUBSAMPLE_121(arch, 8, 8)                                     \
-  CFL_SUBSAMPLE_121(arch, 16, 16)                                   \
-  CFL_SUBSAMPLE_121(arch, 32, 32)                                   \
-  CFL_SUBSAMPLE_121(arch, 64, 64)                                   \
-  CFL_SUBSAMPLE_121(arch, 4, 8)                                     \
-  CFL_SUBSAMPLE_121(arch, 8, 4)                                     \
-  CFL_SUBSAMPLE_121(arch, 8, 16)                                    \
-  CFL_SUBSAMPLE_121(arch, 16, 8)                                    \
-  CFL_SUBSAMPLE_121(arch, 16, 32)                                   \
-  CFL_SUBSAMPLE_121(arch, 32, 16)                                   \
-  CFL_SUBSAMPLE_121(arch, 32, 64)                                   \
-  CFL_SUBSAMPLE_121(arch, 64, 32)                                   \
-  CFL_SUBSAMPLE_121(arch, 4, 16)                                    \
-  CFL_SUBSAMPLE_121(arch, 16, 4)                                    \
-  CFL_SUBSAMPLE_121(arch, 8, 32)                                    \
-  CFL_SUBSAMPLE_121(arch, 32, 8)                                    \
-  CFL_SUBSAMPLE_121(arch, 16, 64)                                   \
-  CFL_SUBSAMPLE_121(arch, 64, 16)                                   \
-  CFL_SUBSAMPLE_121(arch, 4, 32)                                    \
-  CFL_SUBSAMPLE_121(arch, 32, 4)                                    \
-  CFL_SUBSAMPLE_121(arch, 8, 64)                                    \
-  CFL_SUBSAMPLE_121(arch, 64, 8)                                    \
-  CFL_SUBSAMPLE_121(arch, 4, 64)                                    \
-  CFL_SUBSAMPLE_121(arch, 64, 4)                                    \
-  cfl_subsample_hbd_fn cfl_get_luma_subsampling_420_hbd_121_##arch( \
-      TX_SIZE tx_size) {                                            \
-    CFL_SUBSAMPLE_121_FUNCTION_ARRAY(arch)                          \
-    return subfn_420_121[tx_size];                                  \
+#define CFL_SUBSAMPLE_121_FUNCTIONS(arch)                                   \
+  CFL_SUBSAMPLE_121(arch, 4, 4)                                             \
+  CFL_SUBSAMPLE_121(arch, 8, 8)                                             \
+  CFL_SUBSAMPLE_121(arch, 16, 16)                                           \
+  CFL_SUBSAMPLE_121(arch, 32, 32)                                           \
+  CFL_SUBSAMPLE_121(arch, 64, 64)                                           \
+  CFL_SUBSAMPLE_121(arch, 4, 8)                                             \
+  CFL_SUBSAMPLE_121(arch, 8, 4)                                             \
+  CFL_SUBSAMPLE_121(arch, 8, 16)                                            \
+  CFL_SUBSAMPLE_121(arch, 16, 8)                                            \
+  CFL_SUBSAMPLE_121(arch, 16, 32)                                           \
+  CFL_SUBSAMPLE_121(arch, 32, 16)                                           \
+  CFL_SUBSAMPLE_121(arch, 32, 64)                                           \
+  CFL_SUBSAMPLE_121(arch, 64, 32)                                           \
+  CFL_SUBSAMPLE_121(arch, 4, 16)                                            \
+  CFL_SUBSAMPLE_121(arch, 16, 4)                                            \
+  CFL_SUBSAMPLE_121(arch, 8, 32)                                            \
+  CFL_SUBSAMPLE_121(arch, 32, 8)                                            \
+  CFL_SUBSAMPLE_121(arch, 16, 64)                                           \
+  CFL_SUBSAMPLE_121(arch, 64, 16)                                           \
+  CFL_SUBSAMPLE_121(arch, 4, 32)                                            \
+  CFL_SUBSAMPLE_121(arch, 32, 4)                                            \
+  CFL_SUBSAMPLE_121(arch, 8, 64)                                            \
+  CFL_SUBSAMPLE_121(arch, 64, 8)                                            \
+  CFL_SUBSAMPLE_121(arch, 4, 64)                                            \
+  CFL_SUBSAMPLE_121(arch, 64, 4)                                            \
+  av2_cfl_subsample_hbd_fn av2_cfl_get_luma_subsampling_420_hbd_121_##arch( \
+      TX_SIZE tx_size) {                                                    \
+    CFL_SUBSAMPLE_121_FUNCTION_ARRAY(arch)                                  \
+    return subfn_420_121[tx_size];                                          \
   }
 
-#define CFL_SUBSAMPLE_121_FUNCTION_ARRAY(arch)                      \
-  static const cfl_subsample_hbd_fn subfn_420_121[TX_SIZES_ALL] = { \
-    cfl_subsample_hbd_420_121_4x4_##arch,   /* 4x4 */               \
-    cfl_subsample_hbd_420_121_8x8_##arch,   /* 8x8 */               \
-    cfl_subsample_hbd_420_121_16x16_##arch, /* 16x16 */             \
-    cfl_subsample_hbd_420_121_32x32_##arch, /* 32x32 */             \
-    cfl_subsample_hbd_420_121_64x64_##arch, /* 64x64 */             \
-    cfl_subsample_hbd_420_121_4x8_##arch,   /* 4x8 */               \
-    cfl_subsample_hbd_420_121_8x4_##arch,   /* 8x4 */               \
-    cfl_subsample_hbd_420_121_8x16_##arch,  /* 8x16 */              \
-    cfl_subsample_hbd_420_121_16x8_##arch,  /* 16x8 */              \
-    cfl_subsample_hbd_420_121_16x32_##arch, /* 16x32 */             \
-    cfl_subsample_hbd_420_121_32x16_##arch, /* 32x16 */             \
-    cfl_subsample_hbd_420_121_32x64_##arch, /* 32x64 */             \
-    cfl_subsample_hbd_420_121_64x32_##arch, /* 64x32 */             \
-    cfl_subsample_hbd_420_121_4x16_##arch,  /* 4x16  */             \
-    cfl_subsample_hbd_420_121_16x4_##arch,  /* 16x4  */             \
-    cfl_subsample_hbd_420_121_8x32_##arch,  /* 8x32  */             \
-    cfl_subsample_hbd_420_121_32x8_##arch,  /* 32x8  */             \
-    cfl_subsample_hbd_420_121_16x64_##arch, /* 16x64 */             \
-    cfl_subsample_hbd_420_121_64x16_##arch, /* 64x16 */             \
-    cfl_subsample_hbd_420_121_4x32_##arch,  /* 4x32 */              \
-    cfl_subsample_hbd_420_121_32x4_##arch,  /* 32x4 */              \
-    cfl_subsample_hbd_420_121_8x64_##arch,  /* 8x64 */              \
-    cfl_subsample_hbd_420_121_64x8_##arch,  /* 64x8 */              \
-    cfl_subsample_hbd_420_121_4x64_##arch,  /* 4x64 */              \
-    cfl_subsample_hbd_420_121_64x4_##arch,  /* 64x4 */              \
+#define CFL_SUBSAMPLE_121_FUNCTION_ARRAY(arch)                          \
+  static const av2_cfl_subsample_hbd_fn subfn_420_121[TX_SIZES_ALL] = { \
+    av2_cfl_subsample_hbd_420_121_4x4_##arch,   /* 4x4 */               \
+    av2_cfl_subsample_hbd_420_121_8x8_##arch,   /* 8x8 */               \
+    av2_cfl_subsample_hbd_420_121_16x16_##arch, /* 16x16 */             \
+    av2_cfl_subsample_hbd_420_121_32x32_##arch, /* 32x32 */             \
+    av2_cfl_subsample_hbd_420_121_64x64_##arch, /* 64x64 */             \
+    av2_cfl_subsample_hbd_420_121_4x8_##arch,   /* 4x8 */               \
+    av2_cfl_subsample_hbd_420_121_8x4_##arch,   /* 8x4 */               \
+    av2_cfl_subsample_hbd_420_121_8x16_##arch,  /* 8x16 */              \
+    av2_cfl_subsample_hbd_420_121_16x8_##arch,  /* 16x8 */              \
+    av2_cfl_subsample_hbd_420_121_16x32_##arch, /* 16x32 */             \
+    av2_cfl_subsample_hbd_420_121_32x16_##arch, /* 32x16 */             \
+    av2_cfl_subsample_hbd_420_121_32x64_##arch, /* 32x64 */             \
+    av2_cfl_subsample_hbd_420_121_64x32_##arch, /* 64x32 */             \
+    av2_cfl_subsample_hbd_420_121_4x16_##arch,  /* 4x16  */             \
+    av2_cfl_subsample_hbd_420_121_16x4_##arch,  /* 16x4  */             \
+    av2_cfl_subsample_hbd_420_121_8x32_##arch,  /* 8x32  */             \
+    av2_cfl_subsample_hbd_420_121_32x8_##arch,  /* 32x8  */             \
+    av2_cfl_subsample_hbd_420_121_16x64_##arch, /* 16x64 */             \
+    av2_cfl_subsample_hbd_420_121_64x16_##arch, /* 64x16 */             \
+    av2_cfl_subsample_hbd_420_121_4x32_##arch,  /* 4x32 */              \
+    av2_cfl_subsample_hbd_420_121_32x4_##arch,  /* 32x4 */              \
+    av2_cfl_subsample_hbd_420_121_8x64_##arch,  /* 8x64 */              \
+    av2_cfl_subsample_hbd_420_121_64x8_##arch,  /* 64x8 */              \
+    av2_cfl_subsample_hbd_420_121_4x64_##arch,  /* 4x64 */              \
+    av2_cfl_subsample_hbd_420_121_64x4_##arch,  /* 64x4 */              \
   };
 
 #define CFL_GET_SUBSAMPLE_121_FUNCTION(arch) CFL_SUBSAMPLE_121_FUNCTIONS(arch)
 
 #define CFL_SUBSAMPLE_COLOCATED(arch, width, height)                         \
-  void cfl_subsample_hbd_420_colocated_##width##x##height##_##arch(          \
+  void av2_cfl_subsample_hbd_420_colocated_##width##x##height##_##arch(      \
       const uint16_t *input, int input_stride, uint16_t *output_q3) {        \
     cfl_luma_subsampling_420_hbd_colocated_##arch(input, input_stride,       \
                                                   output_q3, width, height); \
   }
 
-#define CFL_SUBSAMPLE_COLOCATED_FUNCTIONS(arch)                           \
-  CFL_SUBSAMPLE_COLOCATED(arch, 4, 4)                                     \
-  CFL_SUBSAMPLE_COLOCATED(arch, 8, 8)                                     \
-  CFL_SUBSAMPLE_COLOCATED(arch, 16, 16)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 32, 32)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 64, 64)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 4, 8)                                     \
-  CFL_SUBSAMPLE_COLOCATED(arch, 8, 4)                                     \
-  CFL_SUBSAMPLE_COLOCATED(arch, 8, 16)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 16, 8)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 16, 32)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 32, 16)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 32, 64)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 64, 32)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 4, 16)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 16, 4)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 8, 32)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 32, 8)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 16, 64)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 64, 16)                                   \
-  CFL_SUBSAMPLE_COLOCATED(arch, 4, 32)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 32, 4)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 8, 64)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 64, 8)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 4, 64)                                    \
-  CFL_SUBSAMPLE_COLOCATED(arch, 64, 4)                                    \
-  cfl_subsample_hbd_fn cfl_get_luma_subsampling_420_hbd_colocated_##arch( \
-      TX_SIZE tx_size) {                                                  \
-    CFL_SUBSAMPLE_COLOCATED_FUNCTION_ARRAY(arch)                          \
-    return subfn_420_colocated[tx_size];                                  \
+#define CFL_SUBSAMPLE_COLOCATED_FUNCTIONS(arch)                                \
+  CFL_SUBSAMPLE_COLOCATED(arch, 4, 4)                                          \
+  CFL_SUBSAMPLE_COLOCATED(arch, 8, 8)                                          \
+  CFL_SUBSAMPLE_COLOCATED(arch, 16, 16)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 32, 32)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 64, 64)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 4, 8)                                          \
+  CFL_SUBSAMPLE_COLOCATED(arch, 8, 4)                                          \
+  CFL_SUBSAMPLE_COLOCATED(arch, 8, 16)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 16, 8)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 16, 32)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 32, 16)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 32, 64)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 64, 32)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 4, 16)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 16, 4)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 8, 32)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 32, 8)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 16, 64)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 64, 16)                                        \
+  CFL_SUBSAMPLE_COLOCATED(arch, 4, 32)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 32, 4)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 8, 64)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 64, 8)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 4, 64)                                         \
+  CFL_SUBSAMPLE_COLOCATED(arch, 64, 4)                                         \
+  av2_cfl_subsample_hbd_fn                                                     \
+      av2_cfl_get_luma_subsampling_420_hbd_colocated_##arch(TX_SIZE tx_size) { \
+    CFL_SUBSAMPLE_COLOCATED_FUNCTION_ARRAY(arch)                               \
+    return subfn_420_colocated[tx_size];                                       \
   }
 
-#define CFL_SUBSAMPLE_COLOCATED_FUNCTION_ARRAY(arch)                      \
-  static const cfl_subsample_hbd_fn subfn_420_colocated[TX_SIZES_ALL] = { \
-    cfl_subsample_hbd_420_colocated_4x4_##arch,   /* 4x4 */               \
-    cfl_subsample_hbd_420_colocated_8x8_##arch,   /* 8x8 */               \
-    cfl_subsample_hbd_420_colocated_16x16_##arch, /* 16x16 */             \
-    cfl_subsample_hbd_420_colocated_32x32_##arch, /* 32x32 */             \
-    cfl_subsample_hbd_420_colocated_64x64_##arch, /* 64x64 */             \
-    cfl_subsample_hbd_420_colocated_4x8_##arch,   /* 4x8 */               \
-    cfl_subsample_hbd_420_colocated_8x4_##arch,   /* 8x4 */               \
-    cfl_subsample_hbd_420_colocated_8x16_##arch,  /* 8x16 */              \
-    cfl_subsample_hbd_420_colocated_16x8_##arch,  /* 16x8 */              \
-    cfl_subsample_hbd_420_colocated_16x32_##arch, /* 16x32 */             \
-    cfl_subsample_hbd_420_colocated_32x16_##arch, /* 32x16 */             \
-    cfl_subsample_hbd_420_colocated_32x64_##arch, /* 32x64 */             \
-    cfl_subsample_hbd_420_colocated_64x32_##arch, /* 64x32 */             \
-    cfl_subsample_hbd_420_colocated_4x16_##arch,  /* 4x16  */             \
-    cfl_subsample_hbd_420_colocated_16x4_##arch,  /* 16x4  */             \
-    cfl_subsample_hbd_420_colocated_8x32_##arch,  /* 8x32  */             \
-    cfl_subsample_hbd_420_colocated_32x8_##arch,  /* 32x8  */             \
-    cfl_subsample_hbd_420_colocated_16x64_##arch, /* 16x64 */             \
-    cfl_subsample_hbd_420_colocated_64x16_##arch, /* 64x16 */             \
-    cfl_subsample_hbd_420_colocated_4x32_##arch,  /* 4x32 */              \
-    cfl_subsample_hbd_420_colocated_32x4_##arch,  /* 32x4 */              \
-    cfl_subsample_hbd_420_colocated_8x64_##arch,  /* 8x64 */              \
-    cfl_subsample_hbd_420_colocated_64x8_##arch,  /* 64x8 */              \
-    cfl_subsample_hbd_420_colocated_4x64_##arch,  /* 4x64 */              \
-    cfl_subsample_hbd_420_colocated_64x4_##arch,  /* 64x4 */              \
+#define CFL_SUBSAMPLE_COLOCATED_FUNCTION_ARRAY(arch)                          \
+  static const av2_cfl_subsample_hbd_fn subfn_420_colocated[TX_SIZES_ALL] = { \
+    av2_cfl_subsample_hbd_420_colocated_4x4_##arch,   /* 4x4 */               \
+    av2_cfl_subsample_hbd_420_colocated_8x8_##arch,   /* 8x8 */               \
+    av2_cfl_subsample_hbd_420_colocated_16x16_##arch, /* 16x16 */             \
+    av2_cfl_subsample_hbd_420_colocated_32x32_##arch, /* 32x32 */             \
+    av2_cfl_subsample_hbd_420_colocated_64x64_##arch, /* 64x64 */             \
+    av2_cfl_subsample_hbd_420_colocated_4x8_##arch,   /* 4x8 */               \
+    av2_cfl_subsample_hbd_420_colocated_8x4_##arch,   /* 8x4 */               \
+    av2_cfl_subsample_hbd_420_colocated_8x16_##arch,  /* 8x16 */              \
+    av2_cfl_subsample_hbd_420_colocated_16x8_##arch,  /* 16x8 */              \
+    av2_cfl_subsample_hbd_420_colocated_16x32_##arch, /* 16x32 */             \
+    av2_cfl_subsample_hbd_420_colocated_32x16_##arch, /* 32x16 */             \
+    av2_cfl_subsample_hbd_420_colocated_32x64_##arch, /* 32x64 */             \
+    av2_cfl_subsample_hbd_420_colocated_64x32_##arch, /* 64x32 */             \
+    av2_cfl_subsample_hbd_420_colocated_4x16_##arch,  /* 4x16  */             \
+    av2_cfl_subsample_hbd_420_colocated_16x4_##arch,  /* 16x4  */             \
+    av2_cfl_subsample_hbd_420_colocated_8x32_##arch,  /* 8x32  */             \
+    av2_cfl_subsample_hbd_420_colocated_32x8_##arch,  /* 32x8  */             \
+    av2_cfl_subsample_hbd_420_colocated_16x64_##arch, /* 16x64 */             \
+    av2_cfl_subsample_hbd_420_colocated_64x16_##arch, /* 64x16 */             \
+    av2_cfl_subsample_hbd_420_colocated_4x32_##arch,  /* 4x32 */              \
+    av2_cfl_subsample_hbd_420_colocated_32x4_##arch,  /* 32x4 */              \
+    av2_cfl_subsample_hbd_420_colocated_8x64_##arch,  /* 8x64 */              \
+    av2_cfl_subsample_hbd_420_colocated_64x8_##arch,  /* 64x8 */              \
+    av2_cfl_subsample_hbd_420_colocated_4x64_##arch,  /* 4x64 */              \
+    av2_cfl_subsample_hbd_420_colocated_64x4_##arch,  /* 64x4 */              \
   };
 
 #define CFL_GET_SUBSAMPLE_COLOCATED_FUNCTION(arch) \
@@ -526,11 +527,11 @@
 // will inline the size generic function in here, the advantage is that the size
 // will be constant allowing for loop unrolling and other constant propagated
 // goodness.
-#define CFL_SUB_AVG_X(arch, width, height, round_offset, num_pel_log2)       \
-  void cfl_subtract_average_##width##x##height##_##arch(const uint16_t *src, \
-                                                        int16_t *dst) {      \
-    subtract_average_##arch(src, dst, width, height, round_offset,           \
-                            num_pel_log2);                                   \
+#define CFL_SUB_AVG_X(arch, width, height, round_offset, num_pel_log2) \
+  void av2_cfl_subtract_average_##width##x##height##_##arch(           \
+      const uint16_t *src, int16_t *dst) {                             \
+    subtract_average_##arch(src, dst, width, height, round_offset,     \
+                            num_pel_log2);                             \
   }
 
 // Declare size-specific wrappers for all valid CfL sizes.
@@ -560,34 +561,34 @@
   CFL_SUB_AVG_X(arch, 16, 64, 512, 10)                                    \
   CFL_SUB_AVG_X(arch, 8, 64, 256, 9)                                      \
   CFL_SUB_AVG_X(arch, 4, 64, 128, 8)                                      \
-  cfl_subtract_average_fn cfl_get_subtract_average_fn_##arch(             \
+  av2_cfl_subtract_average_fn av2_cfl_get_subtract_average_fn_##arch(     \
       TX_SIZE tx_size) {                                                  \
-    static const cfl_subtract_average_fn sub_avg[TX_SIZES_ALL] = {        \
-      cfl_subtract_average_4x4_##arch,   /* 4x4 */                        \
-      cfl_subtract_average_8x8_##arch,   /* 8x8 */                        \
-      cfl_subtract_average_16x16_##arch, /* 16x16 */                      \
-      cfl_subtract_average_32x32_##arch, /* 32x32 */                      \
-      cfl_subtract_average_64x64_##arch, /* 64x64 */                      \
-      cfl_subtract_average_4x8_##arch,   /* 4x8 */                        \
-      cfl_subtract_average_8x4_##arch,   /* 8x4 */                        \
-      cfl_subtract_average_8x16_##arch,  /* 8x16 */                       \
-      cfl_subtract_average_16x8_##arch,  /* 16x8 */                       \
-      cfl_subtract_average_16x32_##arch, /* 16x32 */                      \
-      cfl_subtract_average_32x16_##arch, /* 32x16 */                      \
-      cfl_subtract_average_32x64_##arch, /* 32x64 */                      \
-      cfl_subtract_average_64x32_##arch, /* 64x32 */                      \
-      cfl_subtract_average_4x16_##arch,  /* 4x16 */                       \
-      cfl_subtract_average_16x4_##arch,  /* 16x4 */                       \
-      cfl_subtract_average_8x32_##arch,  /* 8x32 */                       \
-      cfl_subtract_average_32x8_##arch,  /* 32x8 */                       \
-      cfl_subtract_average_16x64_##arch, /* 16x64 */                      \
-      cfl_subtract_average_64x16_##arch, /* 64x16 */                      \
-      cfl_subtract_average_4x32_##arch,  /* 4x32 */                       \
-      cfl_subtract_average_32x4_##arch,  /* 32x4 */                       \
-      cfl_subtract_average_8x64_##arch,  /* 8x64 */                       \
-      cfl_subtract_average_64x8_##arch,  /* 64x8 */                       \
-      cfl_subtract_average_4x64_##arch,  /* 4x64 */                       \
-      cfl_subtract_average_64x4_##arch,  /* 64x4 */                       \
+    static const av2_cfl_subtract_average_fn sub_avg[TX_SIZES_ALL] = {    \
+      av2_cfl_subtract_average_4x4_##arch,   /* 4x4 */                    \
+      av2_cfl_subtract_average_8x8_##arch,   /* 8x8 */                    \
+      av2_cfl_subtract_average_16x16_##arch, /* 16x16 */                  \
+      av2_cfl_subtract_average_32x32_##arch, /* 32x32 */                  \
+      av2_cfl_subtract_average_64x64_##arch, /* 64x64 */                  \
+      av2_cfl_subtract_average_4x8_##arch,   /* 4x8 */                    \
+      av2_cfl_subtract_average_8x4_##arch,   /* 8x4 */                    \
+      av2_cfl_subtract_average_8x16_##arch,  /* 8x16 */                   \
+      av2_cfl_subtract_average_16x8_##arch,  /* 16x8 */                   \
+      av2_cfl_subtract_average_16x32_##arch, /* 16x32 */                  \
+      av2_cfl_subtract_average_32x16_##arch, /* 32x16 */                  \
+      av2_cfl_subtract_average_32x64_##arch, /* 32x64 */                  \
+      av2_cfl_subtract_average_64x32_##arch, /* 64x32 */                  \
+      av2_cfl_subtract_average_4x16_##arch,  /* 4x16 */                   \
+      av2_cfl_subtract_average_16x4_##arch,  /* 16x4 */                   \
+      av2_cfl_subtract_average_8x32_##arch,  /* 8x32 */                   \
+      av2_cfl_subtract_average_32x8_##arch,  /* 32x8 */                   \
+      av2_cfl_subtract_average_16x64_##arch, /* 16x64 */                  \
+      av2_cfl_subtract_average_64x16_##arch, /* 64x16 */                  \
+      av2_cfl_subtract_average_4x32_##arch,  /* 4x32 */                   \
+      av2_cfl_subtract_average_32x4_##arch,  /* 32x4 */                   \
+      av2_cfl_subtract_average_8x64_##arch,  /* 8x64 */                   \
+      av2_cfl_subtract_average_64x8_##arch,  /* 64x8 */                   \
+      av2_cfl_subtract_average_4x64_##arch,  /* 4x64 */                   \
+      av2_cfl_subtract_average_64x4_##arch,  /* 64x4 */                   \
     };                                                                    \
     /* Modulo TX_SIZES_ALL to ensure that an attacker won't be able to */ \
     /* index the function pointer array out of bounds. */                 \
@@ -596,16 +597,16 @@
 
 // For VSX SIMD optimization, the C versions of width == 4 subtract are
 // faster than the VSX. As such, the VSX code calls the C versions.
-void cfl_subtract_average_4x4_c(const uint16_t *src, int16_t *dst);
-void cfl_subtract_average_4x8_c(const uint16_t *src, int16_t *dst);
-void cfl_subtract_average_4x16_c(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_4x4_c(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_4x8_c(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_4x16_c(const uint16_t *src, int16_t *dst);
 
 #define CFL_PREDICT_hbd(arch, width, height)                                   \
-  void cfl_predict_hbd_##width##x##height##_##arch(                            \
+  void av2_cfl_predict_hbd_##width##x##height##_##arch(                        \
       const int16_t *pred_buf_q3, uint16_t *dst, int dst_stride, int alpha_q3, \
       int bd) {                                                                \
-    cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd, width,  \
-                           height);                                            \
+    av2_cfl_predict_hbd_##arch(pred_buf_q3, dst, dst_stride, alpha_q3, bd,     \
+                               width, height);                                 \
   }
 
 // This wrapper exists because clang format does not like calling macros with
@@ -613,63 +614,64 @@
 #define CFL_PREDICT_X(arch, width, height, bd) \
   CFL_PREDICT_##bd(arch, width, height)
 
-#define CFL_PREDICT_FN(arch, bd)                                            \
-  CFL_PREDICT_X(arch, 4, 4, bd)                                             \
-  CFL_PREDICT_X(arch, 4, 8, bd)                                             \
-  CFL_PREDICT_X(arch, 4, 16, bd)                                            \
-  CFL_PREDICT_X(arch, 4, 32, bd)                                            \
-  CFL_PREDICT_X(arch, 8, 4, bd)                                             \
-  CFL_PREDICT_X(arch, 8, 8, bd)                                             \
-  CFL_PREDICT_X(arch, 8, 16, bd)                                            \
-  CFL_PREDICT_X(arch, 8, 32, bd)                                            \
-  CFL_PREDICT_X(arch, 16, 4, bd)                                            \
-  CFL_PREDICT_X(arch, 16, 8, bd)                                            \
-  CFL_PREDICT_X(arch, 16, 16, bd)                                           \
-  CFL_PREDICT_X(arch, 16, 32, bd)                                           \
-  CFL_PREDICT_X(arch, 32, 4, bd)                                            \
-  CFL_PREDICT_X(arch, 32, 8, bd)                                            \
-  CFL_PREDICT_X(arch, 32, 16, bd)                                           \
-  CFL_PREDICT_X(arch, 32, 32, bd)                                           \
-  CFL_PREDICT_X(arch, 64, 64, bd)                                           \
-  CFL_PREDICT_X(arch, 64, 32, bd)                                           \
-  CFL_PREDICT_X(arch, 64, 16, bd)                                           \
-  CFL_PREDICT_X(arch, 64, 8, bd)                                            \
-  CFL_PREDICT_X(arch, 64, 4, bd)                                            \
-  CFL_PREDICT_X(arch, 32, 64, bd)                                           \
-  CFL_PREDICT_X(arch, 16, 64, bd)                                           \
-  CFL_PREDICT_X(arch, 8, 64, bd)                                            \
-  CFL_PREDICT_X(arch, 4, 64, bd)                                            \
-  cfl_predict_##bd##_fn cfl_get_predict_##bd##_fn_##arch(TX_SIZE tx_size) { \
-    static const cfl_predict_##bd##_fn pred[TX_SIZES_ALL] = {               \
-      cfl_predict_##bd##_4x4_##arch,   /* 4x4 */                            \
-      cfl_predict_##bd##_8x8_##arch,   /* 8x8 */                            \
-      cfl_predict_##bd##_16x16_##arch, /* 16x16 */                          \
-      cfl_predict_##bd##_32x32_##arch, /* 32x32 */                          \
-      cfl_predict_##bd##_64x64_##arch, /* 64x64 */                          \
-      cfl_predict_##bd##_4x8_##arch,   /* 4x8 */                            \
-      cfl_predict_##bd##_8x4_##arch,   /* 8x4 */                            \
-      cfl_predict_##bd##_8x16_##arch,  /* 8x16 */                           \
-      cfl_predict_##bd##_16x8_##arch,  /* 16x8 */                           \
-      cfl_predict_##bd##_16x32_##arch, /* 16x32 */                          \
-      cfl_predict_##bd##_32x16_##arch, /* 32x16 */                          \
-      cfl_predict_##bd##_32x64_##arch, /* 32x64 */                          \
-      cfl_predict_##bd##_64x32_##arch, /* 64x32 */                          \
-      cfl_predict_##bd##_4x16_##arch,  /* 4x16  */                          \
-      cfl_predict_##bd##_16x4_##arch,  /* 16x4  */                          \
-      cfl_predict_##bd##_8x32_##arch,  /* 8x32  */                          \
-      cfl_predict_##bd##_32x8_##arch,  /* 32x8  */                          \
-      cfl_predict_##bd##_16x64_##arch, /* 16x64 */                          \
-      cfl_predict_##bd##_64x16_##arch, /* 64x16 */                          \
-      cfl_predict_##bd##_4x32_##arch,  /* 4x32 */                           \
-      cfl_predict_##bd##_32x4_##arch,  /* 32x4 */                           \
-      cfl_predict_##bd##_8x64_##arch,  /* 8x64 */                           \
-      cfl_predict_##bd##_64x8_##arch,  /* 64x8 */                           \
-      cfl_predict_##bd##_4x64_##arch,  /* 4x64 */                           \
-      cfl_predict_##bd##_64x4_##arch,  /* 64x4 */                           \
-    };                                                                      \
-    /* Modulo TX_SIZES_ALL to ensure that an attacker won't be able to */   \
-    /* index the function pointer array out of bounds. */                   \
-    return pred[tx_size % TX_SIZES_ALL];                                    \
+#define CFL_PREDICT_FN(arch, bd)                                          \
+  CFL_PREDICT_X(arch, 4, 4, bd)                                           \
+  CFL_PREDICT_X(arch, 4, 8, bd)                                           \
+  CFL_PREDICT_X(arch, 4, 16, bd)                                          \
+  CFL_PREDICT_X(arch, 4, 32, bd)                                          \
+  CFL_PREDICT_X(arch, 8, 4, bd)                                           \
+  CFL_PREDICT_X(arch, 8, 8, bd)                                           \
+  CFL_PREDICT_X(arch, 8, 16, bd)                                          \
+  CFL_PREDICT_X(arch, 8, 32, bd)                                          \
+  CFL_PREDICT_X(arch, 16, 4, bd)                                          \
+  CFL_PREDICT_X(arch, 16, 8, bd)                                          \
+  CFL_PREDICT_X(arch, 16, 16, bd)                                         \
+  CFL_PREDICT_X(arch, 16, 32, bd)                                         \
+  CFL_PREDICT_X(arch, 32, 4, bd)                                          \
+  CFL_PREDICT_X(arch, 32, 8, bd)                                          \
+  CFL_PREDICT_X(arch, 32, 16, bd)                                         \
+  CFL_PREDICT_X(arch, 32, 32, bd)                                         \
+  CFL_PREDICT_X(arch, 64, 64, bd)                                         \
+  CFL_PREDICT_X(arch, 64, 32, bd)                                         \
+  CFL_PREDICT_X(arch, 64, 16, bd)                                         \
+  CFL_PREDICT_X(arch, 64, 8, bd)                                          \
+  CFL_PREDICT_X(arch, 64, 4, bd)                                          \
+  CFL_PREDICT_X(arch, 32, 64, bd)                                         \
+  CFL_PREDICT_X(arch, 16, 64, bd)                                         \
+  CFL_PREDICT_X(arch, 8, 64, bd)                                          \
+  CFL_PREDICT_X(arch, 4, 64, bd)                                          \
+  av2_cfl_predict_##bd##_fn av2_cfl_get_predict_##bd##_fn_##arch(         \
+      TX_SIZE tx_size) {                                                  \
+    static const av2_cfl_predict_##bd##_fn pred[TX_SIZES_ALL] = {         \
+      av2_cfl_predict_##bd##_4x4_##arch,   /* 4x4 */                      \
+      av2_cfl_predict_##bd##_8x8_##arch,   /* 8x8 */                      \
+      av2_cfl_predict_##bd##_16x16_##arch, /* 16x16 */                    \
+      av2_cfl_predict_##bd##_32x32_##arch, /* 32x32 */                    \
+      av2_cfl_predict_##bd##_64x64_##arch, /* 64x64 */                    \
+      av2_cfl_predict_##bd##_4x8_##arch,   /* 4x8 */                      \
+      av2_cfl_predict_##bd##_8x4_##arch,   /* 8x4 */                      \
+      av2_cfl_predict_##bd##_8x16_##arch,  /* 8x16 */                     \
+      av2_cfl_predict_##bd##_16x8_##arch,  /* 16x8 */                     \
+      av2_cfl_predict_##bd##_16x32_##arch, /* 16x32 */                    \
+      av2_cfl_predict_##bd##_32x16_##arch, /* 32x16 */                    \
+      av2_cfl_predict_##bd##_32x64_##arch, /* 32x64 */                    \
+      av2_cfl_predict_##bd##_64x32_##arch, /* 64x32 */                    \
+      av2_cfl_predict_##bd##_4x16_##arch,  /* 4x16  */                    \
+      av2_cfl_predict_##bd##_16x4_##arch,  /* 16x4  */                    \
+      av2_cfl_predict_##bd##_8x32_##arch,  /* 8x32  */                    \
+      av2_cfl_predict_##bd##_32x8_##arch,  /* 32x8  */                    \
+      av2_cfl_predict_##bd##_16x64_##arch, /* 16x64 */                    \
+      av2_cfl_predict_##bd##_64x16_##arch, /* 64x16 */                    \
+      av2_cfl_predict_##bd##_4x32_##arch,  /* 4x32 */                     \
+      av2_cfl_predict_##bd##_32x4_##arch,  /* 32x4 */                     \
+      av2_cfl_predict_##bd##_8x64_##arch,  /* 8x64 */                     \
+      av2_cfl_predict_##bd##_64x8_##arch,  /* 64x8 */                     \
+      av2_cfl_predict_##bd##_4x64_##arch,  /* 4x64 */                     \
+      av2_cfl_predict_##bd##_64x4_##arch,  /* 64x4 */                     \
+    };                                                                    \
+    /* Modulo TX_SIZES_ALL to ensure that an attacker won't be able to */ \
+    /* index the function pointer array out of bounds. */                 \
+    return pred[tx_size % TX_SIZES_ALL];                                  \
   }
 
 #endif  // AVM_AV2_COMMON_CFL_H_
diff --git a/av2/common/odintrin.c b/av2/common/odintrin.c
index 66da9b5..448493c 100644
--- a/av2/common/odintrin.c
+++ b/av2/common/odintrin.c
@@ -26,7 +26,7 @@
     month=Jun,
     year=2005
   }*/
-uint32_t OD_DIVU_SMALL_CONSTS[OD_DIVU_DMAX][2] = {
+uint32_t AVM_OD_DIVU_SMALL_CONSTS[OD_DIVU_DMAX][2] = {
   { 0xFFFFFFFF, 0xFFFFFFFF }, { 0xFFFFFFFF, 0xFFFFFFFF },
   { 0xAAAAAAAB, 0 },          { 0xFFFFFFFF, 0xFFFFFFFF },
   { 0xCCCCCCCD, 0 },          { 0xAAAAAAAB, 0 },
diff --git a/av2/common/odintrin.h b/av2/common/odintrin.h
index 2df8c5f..0f922ee 100644
--- a/av2/common/odintrin.h
+++ b/av2/common/odintrin.h
@@ -31,12 +31,12 @@
 
 #define OD_DIVU_DMAX (1024)
 
-extern uint32_t OD_DIVU_SMALL_CONSTS[OD_DIVU_DMAX][2];
+extern uint32_t AVM_OD_DIVU_SMALL_CONSTS[OD_DIVU_DMAX][2];
 
 /*Translate unsigned division by small divisors into multiplications.*/
 #define OD_DIVU_SMALL(_x, _d)                                     \
-  ((uint32_t)((OD_DIVU_SMALL_CONSTS[(_d)-1][0] * (uint64_t)(_x) + \
-               OD_DIVU_SMALL_CONSTS[(_d)-1][1]) >>                \
+  ((uint32_t)((AVM_OD_DIVU_SMALL_CONSTS[(_d)-1][0] * (uint64_t)(_x) + \
+               AVM_OD_DIVU_SMALL_CONSTS[(_d)-1][1]) >>                \
               32) >>                                              \
    (OD_ILOG_NZ(_d) - 1))
 
diff --git a/av2/common/ppc/cfl_ppc.c b/av2/common/ppc/cfl_ppc.c
index fe5aa8d..431357e 100644
--- a/av2/common/ppc/cfl_ppc.c
+++ b/av2/common/ppc/cfl_ppc.c
@@ -125,27 +125,28 @@
 
 // Based on observation, for small blocks VSX does not outperform C (no 64bit
 // load and store intrinsics). So we call the C code for block widths 4.
-cfl_subtract_average_fn cfl_get_subtract_average_fn_vsx(TX_SIZE tx_size) {
-  static const cfl_subtract_average_fn sub_avg[TX_SIZES_ALL] = {
-    cfl_subtract_average_4x4_c,     /* 4x4 */
-    cfl_subtract_average_8x8_vsx,   /* 8x8 */
-    cfl_subtract_average_16x16_vsx, /* 16x16 */
-    cfl_subtract_average_32x32_vsx, /* 32x32 */
-    NULL,                           /* 64x64 (invalid CFL size) */
-    cfl_subtract_average_4x8_c,     /* 4x8 */
-    cfl_subtract_average_8x4_vsx,   /* 8x4 */
-    cfl_subtract_average_8x16_vsx,  /* 8x16 */
-    cfl_subtract_average_16x8_vsx,  /* 16x8 */
-    cfl_subtract_average_16x32_vsx, /* 16x32 */
-    cfl_subtract_average_32x16_vsx, /* 32x16 */
-    NULL,                           /* 32x64 (invalid CFL size) */
-    NULL,                           /* 64x32 (invalid CFL size) */
-    cfl_subtract_average_4x16_c,    /* 4x16 */
-    cfl_subtract_average_16x4_vsx,  /* 16x4 */
-    cfl_subtract_average_8x32_vsx,  /* 8x32 */
-    cfl_subtract_average_32x8_vsx,  /* 32x8 */
-    NULL,                           /* 16x64 (invalid CFL size) */
-    NULL,                           /* 64x16 (invalid CFL size) */
+av2_cfl_subtract_average_fn av2_cfl_get_subtract_average_fn_vsx(
+    TX_SIZE tx_size) {
+  static const av2_cfl_subtract_average_fn sub_avg[TX_SIZES_ALL] = {
+    av2_cfl_subtract_average_4x4_c,     /* 4x4 */
+    av2_cfl_subtract_average_8x8_vsx,   /* 8x8 */
+    av2_cfl_subtract_average_16x16_vsx, /* 16x16 */
+    av2_cfl_subtract_average_32x32_vsx, /* 32x32 */
+    NULL,                               /* 64x64 (invalid CFL size) */
+    av2_cfl_subtract_average_4x8_c,     /* 4x8 */
+    av2_cfl_subtract_average_8x4_vsx,   /* 8x4 */
+    av2_cfl_subtract_average_8x16_vsx,  /* 8x16 */
+    av2_cfl_subtract_average_16x8_vsx,  /* 16x8 */
+    av2_cfl_subtract_average_16x32_vsx, /* 16x32 */
+    av2_cfl_subtract_average_32x16_vsx, /* 32x16 */
+    NULL,                               /* 32x64 (invalid CFL size) */
+    NULL,                               /* 64x32 (invalid CFL size) */
+    av2_cfl_subtract_average_4x16_c,    /* 4x16 */
+    av2_cfl_subtract_average_16x4_vsx,  /* 16x4 */
+    av2_cfl_subtract_average_8x32_vsx,  /* 8x32 */
+    av2_cfl_subtract_average_32x8_vsx,  /* 32x8 */
+    NULL,                               /* 16x64 (invalid CFL size) */
+    NULL,                               /* 64x16 (invalid CFL size) */
   };
   // Modulo TX_SIZES_ALL to ensure that an attacker won't be able to
   // index the function pointer array out of bounds.
diff --git a/av2/common/reconintra.c b/av2/common/reconintra.c
index edf41d9..27fbd50 100644
--- a/av2/common/reconintra.c
+++ b/av2/common/reconintra.c
@@ -369,7 +369,8 @@
  * \param[in]    mbmi               Pointer to structure holding
  *                                  the mode info for the current macroblock.
  */
-void set_y_mode_and_delta_angle(const int mode_idx, MB_MODE_INFO *const mbmi) {
+void av2_set_y_mode_and_delta_angle(const int mode_idx,
+                                    MB_MODE_INFO *const mbmi) {
   if (mode_idx < NON_DIRECTIONAL_MODES_COUNT) {
     mbmi->mode = mode_idx;
     mbmi->angle_delta[PLANE_TYPE_Y] = 0;
@@ -1892,11 +1893,11 @@
                               angle_delta, use_palette, dst, dst_stride, dst,
                               dst_stride, blk_col, blk_row, plane);
       if (cfl->use_dc_pred_cache) {
-        cfl_store_dc_pred(xd, dst, pred_plane, tx_size_wide[tx_size]);
+        av2_cfl_store_dc_pred(xd, dst, pred_plane, tx_size_wide[tx_size]);
         cfl->dc_pred_is_cached[pred_plane] = 1;
       }
     } else {
-      cfl_load_dc_pred(xd, dst, dst_stride, tx_size, pred_plane);
+      av2_cfl_load_dc_pred(xd, dst, dst_stride, tx_size, pred_plane);
     }
     const int sub_x = cfl->subsampling_x;
     const int sub_y = cfl->subsampling_y;
@@ -1938,10 +1939,10 @@
                                         is_top_sb_boundary);
       }
     }
-    cfl_predict_block(cm->seq_params.enable_cfl_intra,
-                      cm->seq_params.enable_mhccp, xd, dst, dst_stride, tx_size,
-                      plane, above_lines > 0, left_lines > 0, above_lines,
-                      left_lines);
+    av2_cfl_predict_block(cm->seq_params.enable_cfl_intra,
+                          cm->seq_params.enable_mhccp, xd, dst, dst_stride,
+                          tx_size, plane, above_lines > 0, left_lines > 0,
+                          above_lines, left_lines);
 
     return;
   }
diff --git a/av2/common/reconintra.h b/av2/common/reconintra.h
index ac71832..545421f 100644
--- a/av2/common/reconintra.h
+++ b/av2/common/reconintra.h
@@ -31,7 +31,8 @@
  * \param[in]    mbmi               Pointer to structure holding
  *                                  the mode info for the current macroblock.
  */
-void set_y_mode_and_delta_angle(const int mode_idx, MB_MODE_INFO *const mbmi);
+void av2_set_y_mode_and_delta_angle(const int mode_idx,
+                                    MB_MODE_INFO *const mbmi);
 int get_y_mode_idx_ctx(MACROBLOCKD *const xd);
 void get_y_intra_mode_set(MB_MODE_INFO *mi, MACROBLOCKD *const xd);
 void get_uv_intra_mode_set(MB_MODE_INFO *mi);
diff --git a/av2/common/x86/cfl_avx2.c b/av2/common/x86/cfl_avx2.c
index 051ca45..5835dda 100644
--- a/av2/common/x86/cfl_avx2.c
+++ b/av2/common/x86/cfl_avx2.c
@@ -17,47 +17,47 @@
 
 #include "av2/common/x86/cfl_simd.h"
 
-#define CFL_GET_SUBSAMPLE_FUNCTION_AVX2(sub, bd)                        \
-  CFL_SUBSAMPLE(avx2, sub, bd, 32, 32)                                  \
-  CFL_SUBSAMPLE(avx2, sub, bd, 32, 16)                                  \
-  CFL_SUBSAMPLE(avx2, sub, bd, 32, 8)                                   \
-  CFL_SUBSAMPLE(avx2, sub, bd, 32, 4)                                   \
-  CFL_SUBSAMPLE(avx2, sub, bd, 64, 64)                                  \
-  CFL_SUBSAMPLE(avx2, sub, bd, 64, 32)                                  \
-  CFL_SUBSAMPLE(avx2, sub, bd, 32, 64)                                  \
-  CFL_SUBSAMPLE(avx2, sub, bd, 64, 4)                                   \
-  CFL_SUBSAMPLE(avx2, sub, bd, 64, 8)                                   \
-  CFL_SUBSAMPLE(avx2, sub, bd, 64, 16)                                  \
-  cfl_subsample_##bd##_fn cfl_get_luma_subsampling_##sub##_##bd##_avx2( \
-      TX_SIZE tx_size) {                                                \
-    static const cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = {  \
-      cfl_subsample_##bd##_##sub##_4x4_ssse3,   /* 4x4 */               \
-      cfl_subsample_##bd##_##sub##_8x8_ssse3,   /* 8x8 */               \
-      cfl_subsample_##bd##_##sub##_16x16_ssse3, /* 16x16 */             \
-      cfl_subsample_##bd##_##sub##_32x32_avx2,  /* 32x32 */             \
-      cfl_subsample_##bd##_##sub##_64x64_avx2,  /* 64x64 */             \
-      cfl_subsample_##bd##_##sub##_4x8_ssse3,   /* 4x8 */               \
-      cfl_subsample_##bd##_##sub##_8x4_ssse3,   /* 8x4 */               \
-      cfl_subsample_##bd##_##sub##_8x16_ssse3,  /* 8x16 */              \
-      cfl_subsample_##bd##_##sub##_16x8_ssse3,  /* 16x8 */              \
-      cfl_subsample_##bd##_##sub##_16x32_ssse3, /* 16x32 */             \
-      cfl_subsample_##bd##_##sub##_32x16_avx2,  /* 32x16 */             \
-      cfl_subsample_##bd##_##sub##_32x64_avx2,  /* 32x64 */             \
-      cfl_subsample_##bd##_##sub##_64x32_avx2,  /* 64x32 */             \
-      cfl_subsample_##bd##_##sub##_4x16_ssse3,  /* 4x16  */             \
-      cfl_subsample_##bd##_##sub##_16x4_ssse3,  /* 16x4  */             \
-      cfl_subsample_##bd##_##sub##_8x32_ssse3,  /* 8x32  */             \
-      cfl_subsample_##bd##_##sub##_32x8_avx2,   /* 32x8  */             \
-      cfl_subsample_##bd##_##sub##_16x64_ssse3, /* 16x64 */             \
-      cfl_subsample_##bd##_##sub##_64x16_avx2,  /* 64x16 */             \
-      cfl_subsample_##bd##_##sub##_4x32_ssse3,  /* 4x32  */             \
-      cfl_subsample_##bd##_##sub##_32x4_avx2,   /* 32x4  */             \
-      cfl_subsample_##bd##_##sub##_8x64_ssse3,  /* 8x64 */              \
-      cfl_subsample_##bd##_##sub##_64x8_avx2,   /* 64x8 */              \
-      cfl_subsample_##bd##_##sub##_4x64_ssse3,  /* 4x64 */              \
-      cfl_subsample_##bd##_##sub##_64x4_avx2,   /* 64x4 */              \
-    };                                                                  \
-    return subfn_##sub[tx_size];                                        \
+#define CFL_GET_SUBSAMPLE_FUNCTION_AVX2(sub, bd)                           \
+  CFL_SUBSAMPLE(avx2, sub, bd, 32, 32)                                     \
+  CFL_SUBSAMPLE(avx2, sub, bd, 32, 16)                                     \
+  CFL_SUBSAMPLE(avx2, sub, bd, 32, 8)                                      \
+  CFL_SUBSAMPLE(avx2, sub, bd, 32, 4)                                      \
+  CFL_SUBSAMPLE(avx2, sub, bd, 64, 64)                                     \
+  CFL_SUBSAMPLE(avx2, sub, bd, 64, 32)                                     \
+  CFL_SUBSAMPLE(avx2, sub, bd, 32, 64)                                     \
+  CFL_SUBSAMPLE(avx2, sub, bd, 64, 4)                                      \
+  CFL_SUBSAMPLE(avx2, sub, bd, 64, 8)                                      \
+  CFL_SUBSAMPLE(avx2, sub, bd, 64, 16)                                     \
+  av2_cfl_subsample_##bd##_fn                                              \
+      av2_cfl_get_luma_subsampling_##sub##_##bd##_avx2(TX_SIZE tx_size) {  \
+    static const av2_cfl_subsample_##bd##_fn subfn_##sub[TX_SIZES_ALL] = { \
+      av2_cfl_subsample_##bd##_##sub##_4x4_ssse3,   /* 4x4 */              \
+      av2_cfl_subsample_##bd##_##sub##_8x8_ssse3,   /* 8x8 */              \
+      av2_cfl_subsample_##bd##_##sub##_16x16_ssse3, /* 16x16 */            \
+      av2_cfl_subsample_##bd##_##sub##_32x32_avx2,  /* 32x32 */            \
+      av2_cfl_subsample_##bd##_##sub##_64x64_avx2,  /* 64x64 */            \
+      av2_cfl_subsample_##bd##_##sub##_4x8_ssse3,   /* 4x8 */              \
+      av2_cfl_subsample_##bd##_##sub##_8x4_ssse3,   /* 8x4 */              \
+      av2_cfl_subsample_##bd##_##sub##_8x16_ssse3,  /* 8x16 */             \
+      av2_cfl_subsample_##bd##_##sub##_16x8_ssse3,  /* 16x8 */             \
+      av2_cfl_subsample_##bd##_##sub##_16x32_ssse3, /* 16x32 */            \
+      av2_cfl_subsample_##bd##_##sub##_32x16_avx2,  /* 32x16 */            \
+      av2_cfl_subsample_##bd##_##sub##_32x64_avx2,  /* 32x64 */            \
+      av2_cfl_subsample_##bd##_##sub##_64x32_avx2,  /* 64x32 */            \
+      av2_cfl_subsample_##bd##_##sub##_4x16_ssse3,  /* 4x16  */            \
+      av2_cfl_subsample_##bd##_##sub##_16x4_ssse3,  /* 16x4  */            \
+      av2_cfl_subsample_##bd##_##sub##_8x32_ssse3,  /* 8x32  */            \
+      av2_cfl_subsample_##bd##_##sub##_32x8_avx2,   /* 32x8  */            \
+      av2_cfl_subsample_##bd##_##sub##_16x64_ssse3, /* 16x64 */            \
+      av2_cfl_subsample_##bd##_##sub##_64x16_avx2,  /* 64x16 */            \
+      av2_cfl_subsample_##bd##_##sub##_4x32_ssse3,  /* 4x32  */            \
+      av2_cfl_subsample_##bd##_##sub##_32x4_avx2,   /* 32x4  */            \
+      av2_cfl_subsample_##bd##_##sub##_8x64_ssse3,  /* 8x64 */             \
+      av2_cfl_subsample_##bd##_##sub##_64x8_avx2,   /* 64x8 */             \
+      av2_cfl_subsample_##bd##_##sub##_4x64_ssse3,  /* 4x64 */             \
+      av2_cfl_subsample_##bd##_##sub##_64x4_avx2,   /* 64x4 */             \
+    };                                                                     \
+    return subfn_##sub[tx_size];                                           \
   }
 
 #define ACCUMULATE_SUMS_64(a0, a1, a2, y)                                      \
@@ -1228,10 +1228,10 @@
   return _mm256_max_epi16(_mm256_min_epi16(u, max), zero);
 }
 
-static INLINE void cfl_predict_hbd_avx2(const int16_t *pred_buf_q3,
-                                        uint16_t *dst, int dst_stride,
-                                        int alpha_q3, int bd, int width,
-                                        int height) {
+static INLINE void av2_cfl_predict_hbd_avx2(const int16_t *pred_buf_q3,
+                                            uint16_t *dst, int dst_stride,
+                                            int alpha_q3, int bd, int width,
+                                            int height) {
   // Use SSSE3 version for smaller widths
   assert(width == 16 || width == 32);
   const __m256i alpha_sign = _mm256_set1_epi16(alpha_q3);
@@ -1266,33 +1266,33 @@
 CFL_PREDICT_X(avx2, 32, 32, hbd)
 CFL_PREDICT_X(avx2, 32, 4, hbd)
 
-cfl_predict_hbd_fn cfl_get_predict_hbd_fn_avx2(TX_SIZE tx_size) {
-  static const cfl_predict_hbd_fn pred[TX_SIZES_ALL] = {
-    cfl_predict_hbd_4x4_ssse3,  /* 4x4 */
-    cfl_predict_hbd_8x8_ssse3,  /* 8x8 */
-    cfl_predict_hbd_16x16_avx2, /* 16x16 */
-    cfl_predict_hbd_32x32_avx2, /* 32x32 */
-    NULL,                       /* 64x64 (invalid CFL size) */
-    cfl_predict_hbd_4x8_ssse3,  /* 4x8 */
-    cfl_predict_hbd_8x4_ssse3,  /* 8x4 */
-    cfl_predict_hbd_8x16_ssse3, /* 8x16 */
-    cfl_predict_hbd_16x8_avx2,  /* 16x8 */
-    cfl_predict_hbd_16x32_avx2, /* 16x32 */
-    cfl_predict_hbd_32x16_avx2, /* 32x16 */
-    NULL,                       /* 32x64 (invalid CFL size) */
-    NULL,                       /* 64x32 (invalid CFL size) */
-    cfl_predict_hbd_4x16_ssse3, /* 4x16  */
-    cfl_predict_hbd_16x4_avx2,  /* 16x4  */
-    cfl_predict_hbd_8x32_ssse3, /* 8x32  */
-    cfl_predict_hbd_32x8_avx2,  /* 32x8  */
-    NULL,                       /* 16x64 (invalid CFL size) */
-    NULL,                       /* 64x16 (invalid CFL size) */
-    cfl_predict_hbd_4x32_ssse3, /* 4x32  */
-    cfl_predict_hbd_32x4_avx2,  /* 32x4  */
-    NULL,                       /* 8x64 (invalid CFL size) */
-    NULL,                       /* 64x8 (invalid CFL size) */
-    NULL,                       /* 4x64 (invalid CFL size) */
-    NULL,                       /* 64x4 (invalid CFL size) */
+av2_cfl_predict_hbd_fn av2_cfl_get_predict_hbd_fn_avx2(TX_SIZE tx_size) {
+  static const av2_cfl_predict_hbd_fn pred[TX_SIZES_ALL] = {
+    av2_cfl_predict_hbd_4x4_ssse3,  /* 4x4 */
+    av2_cfl_predict_hbd_8x8_ssse3,  /* 8x8 */
+    av2_cfl_predict_hbd_16x16_avx2, /* 16x16 */
+    av2_cfl_predict_hbd_32x32_avx2, /* 32x32 */
+    NULL,                           /* 64x64 (invalid CFL size) */
+    av2_cfl_predict_hbd_4x8_ssse3,  /* 4x8 */
+    av2_cfl_predict_hbd_8x4_ssse3,  /* 8x4 */
+    av2_cfl_predict_hbd_8x16_ssse3, /* 8x16 */
+    av2_cfl_predict_hbd_16x8_avx2,  /* 16x8 */
+    av2_cfl_predict_hbd_16x32_avx2, /* 16x32 */
+    av2_cfl_predict_hbd_32x16_avx2, /* 32x16 */
+    NULL,                           /* 32x64 (invalid CFL size) */
+    NULL,                           /* 64x32 (invalid CFL size) */
+    av2_cfl_predict_hbd_4x16_ssse3, /* 4x16  */
+    av2_cfl_predict_hbd_16x4_avx2,  /* 16x4  */
+    av2_cfl_predict_hbd_8x32_ssse3, /* 8x32  */
+    av2_cfl_predict_hbd_32x8_avx2,  /* 32x8  */
+    NULL,                           /* 16x64 (invalid CFL size) */
+    NULL,                           /* 64x16 (invalid CFL size) */
+    av2_cfl_predict_hbd_4x32_ssse3, /* 4x32  */
+    av2_cfl_predict_hbd_32x4_avx2,  /* 32x4  */
+    NULL,                           /* 8x64 (invalid CFL size) */
+    NULL,                           /* 64x8 (invalid CFL size) */
+    NULL,                           /* 4x64 (invalid CFL size) */
+    NULL,                           /* 64x4 (invalid CFL size) */
   };
   // Modulo TX_SIZES_ALL to ensure that an attacker won't be able to index the
   // function pointer array out of bounds.
@@ -1390,33 +1390,34 @@
 
 // Based on the observation that for small blocks AVX2 does not outperform
 // SSE2, we call the SSE2 code for block widths 4 and 8.
-cfl_subtract_average_fn cfl_get_subtract_average_fn_avx2(TX_SIZE tx_size) {
-  static const cfl_subtract_average_fn sub_avg[TX_SIZES_ALL] = {
-    cfl_subtract_average_4x4_sse2,   /* 4x4 */
-    cfl_subtract_average_8x8_sse2,   /* 8x8 */
-    cfl_subtract_average_16x16_avx2, /* 16x16 */
-    cfl_subtract_average_32x32_avx2, /* 32x32 */
-    NULL,                            /* 64x64 (invalid CFL size) */
-    cfl_subtract_average_4x8_sse2,   /* 4x8 */
-    cfl_subtract_average_8x4_sse2,   /* 8x4 */
-    cfl_subtract_average_8x16_sse2,  /* 8x16 */
-    cfl_subtract_average_16x8_avx2,  /* 16x8 */
-    cfl_subtract_average_16x32_avx2, /* 16x32 */
-    cfl_subtract_average_32x16_avx2, /* 32x16 */
-    NULL,                            /* 32x64 (invalid CFL size) */
-    NULL,                            /* 64x32 (invalid CFL size) */
-    cfl_subtract_average_4x16_sse2,  /* 4x16 */
-    cfl_subtract_average_16x4_avx2,  /* 16x4 */
-    cfl_subtract_average_8x32_sse2,  /* 8x32 */
-    cfl_subtract_average_32x8_avx2,  /* 32x8 */
-    NULL,                            /* 16x64 (invalid CFL size) */
-    NULL,                            /* 64x16 (invalid CFL size) */
-    cfl_subtract_average_4x32_sse2,  /* 4x32  */
-    cfl_subtract_average_32x4_avx2,  /* 32x4  */
-    NULL,                            /* 8x64 (invalid CFL size) */
-    NULL,                            /* 64x8 (invalid CFL size) */
-    NULL,                            /* 4x64 (invalid CFL size) */
-    NULL,                            /* 64x4 (invalid CFL size) */
+av2_cfl_subtract_average_fn av2_cfl_get_subtract_average_fn_avx2(
+    TX_SIZE tx_size) {
+  static const av2_cfl_subtract_average_fn sub_avg[TX_SIZES_ALL] = {
+    av2_cfl_subtract_average_4x4_sse2,   /* 4x4 */
+    av2_cfl_subtract_average_8x8_sse2,   /* 8x8 */
+    av2_cfl_subtract_average_16x16_avx2, /* 16x16 */
+    av2_cfl_subtract_average_32x32_avx2, /* 32x32 */
+    NULL,                                /* 64x64 (invalid CFL size) */
+    av2_cfl_subtract_average_4x8_sse2,   /* 4x8 */
+    av2_cfl_subtract_average_8x4_sse2,   /* 8x4 */
+    av2_cfl_subtract_average_8x16_sse2,  /* 8x16 */
+    av2_cfl_subtract_average_16x8_avx2,  /* 16x8 */
+    av2_cfl_subtract_average_16x32_avx2, /* 16x32 */
+    av2_cfl_subtract_average_32x16_avx2, /* 32x16 */
+    NULL,                                /* 32x64 (invalid CFL size) */
+    NULL,                                /* 64x32 (invalid CFL size) */
+    av2_cfl_subtract_average_4x16_sse2,  /* 4x16 */
+    av2_cfl_subtract_average_16x4_avx2,  /* 16x4 */
+    av2_cfl_subtract_average_8x32_sse2,  /* 8x32 */
+    av2_cfl_subtract_average_32x8_avx2,  /* 32x8 */
+    NULL,                                /* 16x64 (invalid CFL size) */
+    NULL,                                /* 64x16 (invalid CFL size) */
+    av2_cfl_subtract_average_4x32_sse2,  /* 4x32  */
+    av2_cfl_subtract_average_32x4_avx2,  /* 32x4  */
+    NULL,                                /* 8x64 (invalid CFL size) */
+    NULL,                                /* 64x8 (invalid CFL size) */
+    NULL,                                /* 4x64 (invalid CFL size) */
+    NULL,                                /* 64x4 (invalid CFL size) */
   };
   // Modulo TX_SIZES_ALL to ensure that an attacker won't be able to
   // index the function pointer array out of bounds.
diff --git a/av2/common/x86/cfl_simd.h b/av2/common/x86/cfl_simd.h
index b08513a..75e4de1 100644
--- a/av2/common/x86/cfl_simd.h
+++ b/av2/common/x86/cfl_simd.h
@@ -15,147 +15,180 @@
 
 #include "av2/common/blockd.h"
 
-void cfl_subsample_hbd_420_4x4_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_420_4x8_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_420_4x16_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_420_4x32_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_420_4x64_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_4x4_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_4x8_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_4x16_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_4x32_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_4x64_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
 
 // SSSE3 version is optimal for with == 8, we reuse it in AVX2
-void cfl_subsample_hbd_420_8x4_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_420_8x8_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_420_8x16_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_420_8x32_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_420_8x64_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_8x4_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_8x8_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_8x16_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_8x32_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_8x64_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
 
 // SSSE3 version is faster for with == 16, we reuse it in AVX2
-void cfl_subsample_hbd_420_16x4_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_420_16x8_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_420_16x16_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_420_16x32_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_420_16x64_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_16x4_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_16x8_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_16x16_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_16x32_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
+void av2_cfl_subsample_hbd_420_16x64_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
 
-void cfl_subsample_hbd_422_4x4_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_422_4x8_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_422_4x16_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_422_4x32_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_422_4x64_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_4x4_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_4x8_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_4x16_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_4x32_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_4x64_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
 
 // SSSE3 version is optimal for with == 8, we reuse it in AVX2
-void cfl_subsample_hbd_422_8x4_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_422_8x8_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_422_8x16_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_422_8x32_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_422_8x64_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_8x4_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_8x8_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_8x16_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_8x32_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_8x64_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
 
 // SSSE3 version is faster for with == 16, we reuse it in AVX2
-void cfl_subsample_hbd_422_16x4_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_422_16x8_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_422_16x16_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_422_16x32_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_422_16x64_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_16x4_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_16x8_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_16x16_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_16x32_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
+void av2_cfl_subsample_hbd_422_16x64_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
 
-void cfl_subsample_hbd_444_4x4_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_444_4x8_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_444_4x16_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_444_4x32_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_444_4x64_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_4x4_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_4x8_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_4x16_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_4x32_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_4x64_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
 
 // SSSE3 version is optimal for with == 8, we reuse it in AVX2
-void cfl_subsample_hbd_444_8x4_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_444_8x8_ssse3(const uint16_t *cfl_type, int input_stride,
-                                     uint16_t *output_q3);
-void cfl_subsample_hbd_444_8x16_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_444_8x32_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_444_8x64_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_8x4_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_8x8_ssse3(const uint16_t *cfl_type,
+                                         int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_8x16_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_8x32_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_8x64_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
 
 // SSSE3 version is faster for with == 16, we reuse it in AVX2
-void cfl_subsample_hbd_444_16x4_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_444_16x8_ssse3(const uint16_t *cfl_type,
-                                      int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_444_16x16_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_444_16x32_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
-void cfl_subsample_hbd_444_16x64_ssse3(const uint16_t *cfl_type,
-                                       int input_stride, uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_16x4_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_16x8_ssse3(const uint16_t *cfl_type,
+                                          int input_stride,
+                                          uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_16x16_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_16x32_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
+void av2_cfl_subsample_hbd_444_16x64_ssse3(const uint16_t *cfl_type,
+                                           int input_stride,
+                                           uint16_t *output_q3);
 
 // SSE2 version is optimal for with == 4, we reuse them in AVX2
-void cfl_subtract_average_4x4_sse2(const uint16_t *src, int16_t *dst);
-void cfl_subtract_average_4x8_sse2(const uint16_t *src, int16_t *dst);
-void cfl_subtract_average_4x16_sse2(const uint16_t *src, int16_t *dst);
-void cfl_subtract_average_4x32_sse2(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_4x4_sse2(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_4x8_sse2(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_4x16_sse2(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_4x32_sse2(const uint16_t *src, int16_t *dst);
 
 // SSE2 version is optimal for with == 8, we reuse them in AVX2
-void cfl_subtract_average_8x4_sse2(const uint16_t *src, int16_t *dst);
-void cfl_subtract_average_8x8_sse2(const uint16_t *src, int16_t *dst);
-void cfl_subtract_average_8x16_sse2(const uint16_t *src, int16_t *dst);
-void cfl_subtract_average_8x32_sse2(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_8x4_sse2(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_8x8_sse2(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_8x16_sse2(const uint16_t *src, int16_t *dst);
+void av2_cfl_subtract_average_8x32_sse2(const uint16_t *src, int16_t *dst);
 
-void cfl_predict_hbd_4x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                               int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_4x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                               int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_4x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                                int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_4x32_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                                int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_4x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                   int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_4x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                   int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_4x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                    int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_4x32_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                    int dst_stride, int alpha_q3, int bd);
 
-void cfl_predict_hbd_8x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                               int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_8x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                               int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_8x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                                int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_8x32_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                                int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_8x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                   int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_8x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                   int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_8x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                    int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_8x32_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                    int dst_stride, int alpha_q3, int bd);
 
-void cfl_predict_hbd_16x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                                int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_16x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                                int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_16x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                                 int dst_stride, int alpha_q3, int bd);
-void cfl_predict_hbd_16x32_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
-                                 int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_16x4_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                    int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_16x8_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                    int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_16x16_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                     int dst_stride, int alpha_q3, int bd);
+void av2_cfl_predict_hbd_16x32_ssse3(const int16_t *pred_buf_q3, uint16_t *dst,
+                                     int dst_stride, int alpha_q3, int bd);
 #endif  // AVM_AV2_COMMON_X86_CFL_SIMD_H_
diff --git a/av2/common/x86/cfl_ssse3.c b/av2/common/x86/cfl_ssse3.c
index 3cb4a4f..8e7ebae 100644
--- a/av2/common/x86/cfl_ssse3.c
+++ b/av2/common/x86/cfl_ssse3.c
@@ -241,10 +241,10 @@
   return _mm_max_epi16(_mm_min_epi16(u, max), zero);
 }
 
-static INLINE void cfl_predict_hbd_ssse3(const int16_t *pred_buf_q3,
-                                         uint16_t *dst, int dst_stride,
-                                         int alpha_q3, int bd, int width,
-                                         int height) {
+static INLINE void av2_cfl_predict_hbd_ssse3(const int16_t *pred_buf_q3,
+                                             uint16_t *dst, int dst_stride,
+                                             int alpha_q3, int bd, int width,
+                                             int height) {
   const __m128i alpha_sign = _mm_set1_epi16(alpha_q3);
   const __m128i alpha_q12 =
       _mm_slli_epi16(_mm_abs_epi16(alpha_sign), (9 - CFL_ADD_BITS_ALPHA));
diff --git a/av2/decoder/decodeframe.c b/av2/decoder/decodeframe.c
index 300d0de..4bb2545 100644
--- a/av2/decoder/decodeframe.c
+++ b/av2/decoder/decodeframe.c
@@ -266,8 +266,8 @@
   (void)bsize;
 }
 
-static AVM_INLINE void cfl_store_inter_block_void(AV2_COMMON *const cm,
-                                                  MACROBLOCKD *const xd) {
+static AVM_INLINE void av2_cfl_store_inter_block_void(AV2_COMMON *const cm,
+                                                      MACROBLOCKD *const xd) {
   (void)cm;
   (void)xd;
 }
@@ -791,12 +791,12 @@
   }
 }
 
-static AVM_INLINE void cfl_store_inter_block(AV2_COMMON *const cm,
-                                             MACROBLOCKD *const xd) {
+static AVM_INLINE void av2_cfl_store_inter_block(AV2_COMMON *const cm,
+                                                 MACROBLOCKD *const xd) {
   MB_MODE_INFO *mbmi = xd->mi[0];
   if (store_cfl_required(cm, xd) && xd->tree_type == SHARED_PART) {
-    cfl_store_block(xd, mbmi->sb_type[PLANE_TYPE_Y], mbmi->tx_size,
-                    cm->seq_params.cfl_ds_filter_index);
+    av2_cfl_store_block(xd, mbmi->sb_type[PLANE_TYPE_Y], mbmi->tx_size,
+                        cm->seq_params.cfl_ds_filter_index);
   }
 }
 
@@ -4602,7 +4602,7 @@
   td->inverse_cctx_block_visit = decode_block_void;
   td->predict_inter_block_visit = predict_inter_block_void;
   td->copy_frame_mvs_block_visit = predict_inter_block_void;
-  td->cfl_store_inter_block_visit = cfl_store_inter_block_void;
+  td->av2_cfl_store_inter_block_visit = av2_cfl_store_inter_block_void;
 
   if (parse_decode_flag & 0x1) {
     td->read_coeffs_tx_intra_block_visit = read_coeffs_tx_intra_block;
@@ -4615,7 +4615,7 @@
     td->inverse_cctx_block_visit = inverse_cross_chroma_transform_block;
     td->predict_inter_block_visit = predict_inter_block;
     td->copy_frame_mvs_block_visit = copy_frame_mvs_inter_block;
-    td->cfl_store_inter_block_visit = cfl_store_inter_block;
+    td->av2_cfl_store_inter_block_visit = av2_cfl_store_inter_block;
   }
 }
 
diff --git a/av2/decoder/decodemv.c b/av2/decoder/decodemv.c
index f28fa64..a918b81 100644
--- a/av2/decoder/decodemv.c
+++ b/av2/decoder/decodemv.c
@@ -1539,7 +1539,7 @@
   assert(mode_idx < LUMA_MODE_COUNT);
   get_y_intra_mode_set(mbmi, xd);
   mbmi->joint_y_mode_delta_angle = mbmi->y_intra_mode_list[mode_idx];
-  set_y_mode_and_delta_angle(mbmi->joint_y_mode_delta_angle, mbmi);
+  av2_set_y_mode_and_delta_angle(mbmi->joint_y_mode_delta_angle, mbmi);
   mbmi->y_mode_idx = mode_idx;
   if (mbmi->joint_y_mode_delta_angle < NON_DIRECTIONAL_MODES_COUNT)
     assert(mbmi->joint_y_mode_delta_angle == mbmi->y_mode_idx);
diff --git a/av2/decoder/decoder.h b/av2/decoder/decoder.h
index 5d2db96..883af85 100644
--- a/av2/decoder/decoder.h
+++ b/av2/decoder/decoder.h
@@ -108,8 +108,8 @@
                                                  DecoderCodingBlock *dcb,
                                                  BLOCK_SIZE bsize);
 
-typedef void (*cfl_store_inter_block_visitor_fn_t)(AV2_COMMON *const cm,
-                                                   MACROBLOCKD *const xd);
+typedef void (*av2_cfl_store_inter_block_visitor_fn_t)(AV2_COMMON *const cm,
+                                                       MACROBLOCKD *const xd);
 
 typedef struct ThreadData {
   DecoderCodingBlock dcb;
@@ -144,7 +144,7 @@
   decode_block_visitor_fn_t inverse_tx_inter_block_visit;
   predict_inter_block_visitor_fn_t predict_inter_block_visit;
   predict_inter_block_visitor_fn_t copy_frame_mvs_block_visit;
-  cfl_store_inter_block_visitor_fn_t cfl_store_inter_block_visit;
+  av2_cfl_store_inter_block_visitor_fn_t av2_cfl_store_inter_block_visit;
 
   REF_MV_BANK ref_mv_bank;
   WARP_PARAM_BANK warp_param_bank;
diff --git a/av2/encoder/encodeframe.c b/av2/encoder/encodeframe.c
index 6a26980..5f715f7 100644
--- a/av2/encoder/encodeframe.c
+++ b/av2/encoder/encodeframe.c
@@ -1697,7 +1697,7 @@
                          &td->mb.e_mbd);
 
   if (cpi->oxcf.intra_mode_cfg.enable_cfl_intra)
-    cfl_init(&td->mb.e_mbd.cfl, &cm->seq_params);
+    av2_cfl_init(&td->mb.e_mbd.cfl, &cm->seq_params);
 
   av2_crc32c_calculator_init(
       &td->mb.txfm_search_info.mb_rd_record.crc_calculator);
diff --git a/av2/encoder/encoder.c b/av2/encoder/encoder.c
index 1a6f720..141ada6 100644
--- a/av2/encoder/encoder.c
+++ b/av2/encoder/encoder.c
@@ -2140,10 +2140,10 @@
   return sad;
 }
 
-static void cfl_predict_hbd_pre_analysis(const int16_t *ac_buf_q3,
-                                         uint16_t *dst, int dst_stride,
-                                         int alpha_q3, int bit_depth, int width,
-                                         int height) {
+static void av2_cfl_predict_hbd_pre_analysis(const int16_t *ac_buf_q3,
+                                             uint16_t *dst, int dst_stride,
+                                             int alpha_q3, int bit_depth,
+                                             int width, int height) {
   for (int j = 0; j < height; ++j) {
     for (int i = 0; i < width; ++i) {
       dst[i] = clip_pixel_highbd(
@@ -2154,8 +2154,8 @@
   }
 }
 
-static void cfl_predict_hbd_dc(const uint16_t *src, uint16_t *dst,
-                               int src_stride, int width, int height) {
+static void av2_cfl_predict_hbd_dc(const uint16_t *src, uint16_t *dst,
+                                   int src_stride, int width, int height) {
   int dc_val = 0;
   const uint16_t *chroma = src;
   for (int i = 0; i < width; ++i) {
@@ -2266,12 +2266,12 @@
               recon_buf_q3, ac_buf_q3, blk_w >> subsampling_x,
               blk_h >> subsampling_y, 4,
               (blk_w >> subsampling_x) * (blk_h >> subsampling_y));
-          cfl_predict_hbd_dc(this_src_chroma - chroma_stride, dc_buf_q3,
-                             chroma_stride, blk_w >> subsampling_x,
-                             blk_h >> subsampling_y);
-          cfl_predict_hbd_pre_analysis(ac_buf_q3, dc_buf_q3, CFL_BUF_LINE,
-                                       alpha, bd, blk_w >> subsampling_x,
-                                       blk_h >> subsampling_y);
+          av2_cfl_predict_hbd_dc(this_src_chroma - chroma_stride, dc_buf_q3,
+                                 chroma_stride, blk_w >> subsampling_x,
+                                 blk_h >> subsampling_y);
+          av2_cfl_predict_hbd_pre_analysis(ac_buf_q3, dc_buf_q3, CFL_BUF_LINE,
+                                           alpha, bd, blk_w >> subsampling_x,
+                                           blk_h >> subsampling_y);
           int64_t filter_cost =
               compute_sad(dc_buf_q3, this_src_chroma, blk_w >> 1, blk_h >> 1, 2,
                           chroma_stride);
diff --git a/av2/encoder/encoder_utils.c b/av2/encoder/encoder_utils.c
index c4552a2..b23232e 100644
--- a/av2/encoder/encoder_utils.c
+++ b/av2/encoder/encoder_utils.c
@@ -37,263 +37,145 @@
 #define MAX_BOOST_COMBINE_FACTOR 12.0
 // TODO(urvang): Augment array for FLEX_PARTITION: used in speed >= 3.
 
-const int default_tx_type_probs[FRAME_UPDATE_TYPES][TX_SIZES_ALL][TX_TYPES] = {
-  { { 221, 189, 214, 292, 0, 0, 0, 0, 0, 2, 38, 68, 0, 0, 0, 0 },
-    { 262, 203, 216, 239, 0, 0, 0, 0, 0, 1, 37, 66, 0, 0, 0, 0 },
-    { 315, 231, 239, 226, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 222, 188, 214, 287, 0, 0, 0, 0, 0, 2, 50, 61, 0, 0, 0, 0 },
-    { 256, 182, 205, 282, 0, 0, 0, 0, 0, 2, 21, 76, 0, 0, 0, 0 },
-    { 281, 214, 217, 222, 0, 0, 0, 0, 0, 1, 48, 41, 0, 0, 0, 0 },
-    { 263, 194, 225, 225, 0, 0, 0, 0, 0, 2, 15, 100, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 170, 192, 242, 293, 0, 0, 0, 0, 0, 1, 68, 58, 0, 0, 0, 0 },
-    { 199, 210, 213, 291, 0, 0, 0, 0, 0, 1, 14, 96, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
-  { { 106, 69, 107, 278, 9, 15, 20, 45, 49, 23, 23, 88, 36, 74, 25, 57 },
-    { 105, 72, 81, 98, 45, 49, 47, 50, 56, 72, 30, 81, 33, 95, 27, 83 },
-    { 211, 105, 109, 120, 57, 62, 43, 49, 52, 58, 42, 116, 0, 0, 0, 0 },
-    { 1008, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 131, 57, 98, 172, 19, 40, 37, 64, 69, 22, 41, 52, 51, 77, 35, 59 },
-    { 176, 83, 93, 202, 22, 24, 28, 47, 50, 16, 12, 93, 26, 76, 17, 59 },
-    { 136, 72, 89, 95, 46, 59, 47, 56, 61, 68, 35, 51, 32, 82, 26, 69 },
-    { 122, 80, 87, 105, 49, 47, 46, 46, 57, 52, 13, 90, 19, 103, 15, 93 },
-    { 1009, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0 },
-    { 1011, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 202, 20, 84, 114, 14, 60, 41, 79, 99, 21, 41, 15, 50, 84, 34, 66 },
-    { 196, 44, 23, 72, 30, 22, 28, 57, 67, 13, 4, 165, 15, 148, 9, 131 },
-    { 882, 0, 0, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0 },
-    { 840, 0, 0, 0, 0, 0, 0, 0, 0, 184, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
-  { { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 } },
-  { { 213, 110, 141, 269, 12, 16, 15, 19, 21, 11, 38, 68, 22, 29, 16, 24 },
-    { 216, 119, 128, 143, 38, 41, 26, 30, 31, 30, 42, 70, 23, 36, 19, 32 },
-    { 367, 149, 154, 154, 38, 35, 17, 21, 21, 10, 22, 36, 0, 0, 0, 0 },
-    { 1022, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 219, 96, 127, 191, 21, 40, 25, 32, 34, 18, 45, 45, 33, 39, 26, 33 },
-    { 296, 99, 122, 198, 23, 21, 19, 24, 25, 13, 20, 64, 23, 32, 18, 27 },
-    { 275, 128, 142, 143, 35, 48, 23, 30, 29, 18, 42, 36, 18, 23, 14, 20 },
-    { 239, 132, 166, 175, 36, 27, 19, 21, 24, 14, 13, 85, 9, 31, 8, 25 },
-    { 1022, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 },
-    { 1022, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 309, 25, 79, 59, 25, 80, 34, 53, 61, 25, 49, 23, 43, 64, 36, 59 },
-    { 270, 57, 40, 54, 50, 42, 41, 53, 56, 28, 17, 81, 45, 86, 34, 70 },
-    { 1005, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0 },
-    { 992, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
-  { { 133, 63, 55, 83, 57, 87, 58, 72, 68, 16, 24, 35, 29, 105, 25, 114 },
-    { 131, 75, 74, 60, 71, 77, 65, 66, 73, 33, 21, 79, 20, 83, 18, 78 },
-    { 276, 95, 82, 58, 86, 93, 63, 60, 64, 17, 38, 92, 0, 0, 0, 0 },
-    { 1006, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 147, 49, 75, 78, 50, 97, 60, 67, 76, 17, 42, 35, 31, 93, 27, 80 },
-    { 157, 49, 58, 75, 61, 52, 56, 67, 69, 12, 15, 79, 24, 119, 11, 120 },
-    { 178, 69, 83, 77, 69, 85, 72, 77, 77, 20, 35, 40, 25, 48, 23, 46 },
-    { 174, 55, 64, 57, 73, 68, 62, 61, 75, 15, 12, 90, 17, 99, 16, 86 },
-    { 1008, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0 },
-    { 1018, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 266, 31, 63, 64, 21, 52, 39, 54, 63, 30, 52, 31, 48, 89, 46, 75 },
-    { 272, 26, 32, 44, 29, 31, 32, 53, 51, 13, 13, 88, 22, 153, 16, 149 },
-    { 923, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0 },
-    { 969, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
-  { { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
-    { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 } },
-  { { 158, 92, 125, 298, 12, 15, 20, 29, 31, 12, 29, 67, 34, 44, 23, 35 },
-    { 147, 94, 103, 123, 45, 48, 38, 41, 46, 48, 37, 78, 33, 63, 27, 53 },
-    { 268, 126, 125, 136, 54, 53, 31, 38, 38, 33, 35, 87, 0, 0, 0, 0 },
-    { 1018, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 159, 72, 103, 194, 20, 35, 37, 50, 56, 21, 39, 40, 51, 61, 38, 48 },
-    { 259, 86, 95, 188, 32, 20, 25, 34, 37, 13, 12, 85, 25, 53, 17, 43 },
-    { 189, 99, 113, 123, 45, 59, 37, 46, 48, 44, 39, 41, 31, 47, 26, 37 },
-    { 175, 110, 113, 128, 58, 38, 33, 33, 43, 29, 13, 100, 14, 68, 12, 57 },
-    { 1017, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0 },
-    { 1019, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 208, 22, 84, 101, 21, 59, 44, 70, 90, 25, 59, 13, 64, 67, 49, 48 },
-    { 277, 52, 32, 63, 43, 26, 33, 48, 54, 11, 6, 130, 18, 119, 11, 101 },
-    { 963, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0 },
-    { 979, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-    { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
-};
+const int
+    av2_default_tx_type_probs[FRAME_UPDATE_TYPES][TX_SIZES_ALL][TX_TYPES] = {
+      { { 221, 189, 214, 292, 0, 0, 0, 0, 0, 2, 38, 68, 0, 0, 0, 0 },
+        { 262, 203, 216, 239, 0, 0, 0, 0, 0, 1, 37, 66, 0, 0, 0, 0 },
+        { 315, 231, 239, 226, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 222, 188, 214, 287, 0, 0, 0, 0, 0, 2, 50, 61, 0, 0, 0, 0 },
+        { 256, 182, 205, 282, 0, 0, 0, 0, 0, 2, 21, 76, 0, 0, 0, 0 },
+        { 281, 214, 217, 222, 0, 0, 0, 0, 0, 1, 48, 41, 0, 0, 0, 0 },
+        { 263, 194, 225, 225, 0, 0, 0, 0, 0, 2, 15, 100, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 170, 192, 242, 293, 0, 0, 0, 0, 0, 1, 68, 58, 0, 0, 0, 0 },
+        { 199, 210, 213, 291, 0, 0, 0, 0, 0, 1, 14, 96, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+      { { 106, 69, 107, 278, 9, 15, 20, 45, 49, 23, 23, 88, 36, 74, 25, 57 },
+        { 105, 72, 81, 98, 45, 49, 47, 50, 56, 72, 30, 81, 33, 95, 27, 83 },
+        { 211, 105, 109, 120, 57, 62, 43, 49, 52, 58, 42, 116, 0, 0, 0, 0 },
+        { 1008, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 131, 57, 98, 172, 19, 40, 37, 64, 69, 22, 41, 52, 51, 77, 35, 59 },
+        { 176, 83, 93, 202, 22, 24, 28, 47, 50, 16, 12, 93, 26, 76, 17, 59 },
+        { 136, 72, 89, 95, 46, 59, 47, 56, 61, 68, 35, 51, 32, 82, 26, 69 },
+        { 122, 80, 87, 105, 49, 47, 46, 46, 57, 52, 13, 90, 19, 103, 15, 93 },
+        { 1009, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0 },
+        { 1011, 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 202, 20, 84, 114, 14, 60, 41, 79, 99, 21, 41, 15, 50, 84, 34, 66 },
+        { 196, 44, 23, 72, 30, 22, 28, 57, 67, 13, 4, 165, 15, 148, 9, 131 },
+        { 882, 0, 0, 0, 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, 0, 0 },
+        { 840, 0, 0, 0, 0, 0, 0, 0, 0, 184, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+      { { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 } },
+      { { 213, 110, 141, 269, 12, 16, 15, 19, 21, 11, 38, 68, 22, 29, 16, 24 },
+        { 216, 119, 128, 143, 38, 41, 26, 30, 31, 30, 42, 70, 23, 36, 19, 32 },
+        { 367, 149, 154, 154, 38, 35, 17, 21, 21, 10, 22, 36, 0, 0, 0, 0 },
+        { 1022, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 219, 96, 127, 191, 21, 40, 25, 32, 34, 18, 45, 45, 33, 39, 26, 33 },
+        { 296, 99, 122, 198, 23, 21, 19, 24, 25, 13, 20, 64, 23, 32, 18, 27 },
+        { 275, 128, 142, 143, 35, 48, 23, 30, 29, 18, 42, 36, 18, 23, 14, 20 },
+        { 239, 132, 166, 175, 36, 27, 19, 21, 24, 14, 13, 85, 9, 31, 8, 25 },
+        { 1022, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 },
+        { 1022, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 309, 25, 79, 59, 25, 80, 34, 53, 61, 25, 49, 23, 43, 64, 36, 59 },
+        { 270, 57, 40, 54, 50, 42, 41, 53, 56, 28, 17, 81, 45, 86, 34, 70 },
+        { 1005, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0 },
+        { 992, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+      { { 133, 63, 55, 83, 57, 87, 58, 72, 68, 16, 24, 35, 29, 105, 25, 114 },
+        { 131, 75, 74, 60, 71, 77, 65, 66, 73, 33, 21, 79, 20, 83, 18, 78 },
+        { 276, 95, 82, 58, 86, 93, 63, 60, 64, 17, 38, 92, 0, 0, 0, 0 },
+        { 1006, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 147, 49, 75, 78, 50, 97, 60, 67, 76, 17, 42, 35, 31, 93, 27, 80 },
+        { 157, 49, 58, 75, 61, 52, 56, 67, 69, 12, 15, 79, 24, 119, 11, 120 },
+        { 178, 69, 83, 77, 69, 85, 72, 77, 77, 20, 35, 40, 25, 48, 23, 46 },
+        { 174, 55, 64, 57, 73, 68, 62, 61, 75, 15, 12, 90, 17, 99, 16, 86 },
+        { 1008, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0 },
+        { 1018, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 266, 31, 63, 64, 21, 52, 39, 54, 63, 30, 52, 31, 48, 89, 46, 75 },
+        { 272, 26, 32, 44, 29, 31, 32, 53, 51, 13, 13, 88, 22, 153, 16, 149 },
+        { 923, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0 },
+        { 969, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } },
+      { { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 },
+        { 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 } },
+      { { 158, 92, 125, 298, 12, 15, 20, 29, 31, 12, 29, 67, 34, 44, 23, 35 },
+        { 147, 94, 103, 123, 45, 48, 38, 41, 46, 48, 37, 78, 33, 63, 27, 53 },
+        { 268, 126, 125, 136, 54, 53, 31, 38, 38, 33, 35, 87, 0, 0, 0, 0 },
+        { 1018, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 159, 72, 103, 194, 20, 35, 37, 50, 56, 21, 39, 40, 51, 61, 38, 48 },
+        { 259, 86, 95, 188, 32, 20, 25, 34, 37, 13, 12, 85, 25, 53, 17, 43 },
+        { 189, 99, 113, 123, 45, 59, 37, 46, 48, 44, 39, 41, 31, 47, 26, 37 },
+        { 175, 110, 113, 128, 58, 38, 33, 33, 43, 29, 13, 100, 14, 68, 12, 57 },
+        { 1017, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0 },
+        { 1019, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 208, 22, 84, 101, 21, 59, 44, 70, 90, 25, 59, 13, 64, 67, 49, 48 },
+        { 277, 52, 32, 63, 43, 26, 33, 48, 54, 11, 6, 130, 18, 119, 11, 101 },
+        { 963, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 0 },
+        { 979, 0, 0, 0, 0, 0, 0, 0, 0, 45, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
+        { 1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+    };
 
-const int default_warped_probs[FRAME_UPDATE_TYPES] = { 64, 64, 64, 64,
-                                                       64, 64, 64 };
-
-// TODO(yunqing): the default probs can be trained later from better
-// performance.
-const int default_switchable_interp_probs[FRAME_UPDATE_TYPES]
-                                         [SWITCHABLE_FILTER_CONTEXTS]
-                                         [SWITCHABLE_FILTERS] = {
-                                           { { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 } },
-                                           { { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 } },
-                                           { { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 } },
-                                           { { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 } },
-                                           { { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 } },
-                                           { { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 } },
-                                           { { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 },
-                                             { 512, 512, 512 } }
-                                         };
+const int av2_default_warped_probs[FRAME_UPDATE_TYPES] = { 64, 64, 64, 64,
+                                                           64, 64, 64 };
 
 /* Convert cpi->active_map to BRU active map (SB-by-SB) */
 void set_ard_active_map(AV2_COMP *cpi) {
diff --git a/av2/encoder/encoder_utils.h b/av2/encoder/encoder_utils.h
index 38ff192..0a0a8fb 100644
--- a/av2/encoder/encoder_utils.h
+++ b/av2/encoder/encoder_utils.h
@@ -26,14 +26,10 @@
 #define AM_SEGMENT_ID_INACTIVE 7
 #define AM_SEGMENT_ID_ACTIVE 0
 
-extern const int default_tx_type_probs[FRAME_UPDATE_TYPES][TX_SIZES_ALL]
-                                      [TX_TYPES];
+extern const int av2_default_tx_type_probs[FRAME_UPDATE_TYPES][TX_SIZES_ALL]
+                                          [TX_TYPES];
 
-extern const int default_warped_probs[FRAME_UPDATE_TYPES];
-
-extern const int default_switchable_interp_probs[FRAME_UPDATE_TYPES]
-                                                [SWITCHABLE_FILTER_CONTEXTS]
-                                                [SWITCHABLE_FILTERS];
+extern const int av2_default_warped_probs[FRAME_UPDATE_TYPES];
 
 // Mark all inactive blocks as active. Other segmentation features may be set
 // so memset cannot be used, instead only inactive blocks should be reset.
@@ -827,11 +823,11 @@
 static AVM_INLINE void copy_frame_prob_info(AV2_COMP *cpi) {
   FrameProbInfo *const frame_probs = &cpi->frame_probs;
   if (cpi->sf.tx_sf.tx_type_search.prune_tx_type_using_stats) {
-    av2_copy(frame_probs->tx_type_probs, default_tx_type_probs);
+    av2_copy(frame_probs->tx_type_probs, av2_default_tx_type_probs);
   }
   if (cpi->sf.inter_sf.prune_warped_prob_thresh > 0 ||
       cpi->sf.inter_sf.prune_warpmv_prob_thresh > 0) {
-    av2_copy(frame_probs->warped_probs, default_warped_probs);
+    av2_copy(frame_probs->warped_probs, av2_default_warped_probs);
   }
 }
 
diff --git a/av2/encoder/ethread.c b/av2/encoder/ethread.c
index 6037264..357df87 100644
--- a/av2/encoder/ethread.c
+++ b/av2/encoder/ethread.c
@@ -418,7 +418,7 @@
     av2_init_above_context(&cm->above_contexts, av2_num_planes(cm), tile_row,
                            &td->mb.e_mbd);
 
-    cfl_init(&td->mb.e_mbd.cfl, &cm->seq_params);
+    av2_cfl_init(&td->mb.e_mbd.cfl, &cm->seq_params);
     av2_crc32c_calculator_init(
         &td->mb.txfm_search_info.mb_rd_record.crc_calculator);
     av2_zero(td->mb.e_mbd.ref_mv_bank);
diff --git a/av2/encoder/intra_mode_search.c b/av2/encoder/intra_mode_search.c
index 3c7f320..1db97ac 100644
--- a/av2/encoder/intra_mode_search.c
+++ b/av2/encoder/intra_mode_search.c
@@ -1361,7 +1361,7 @@
              ++mode_idx) {
           mbmi->y_mode_idx = mode_idx;
           mbmi->joint_y_mode_delta_angle = mbmi->y_intra_mode_list[mode_idx];
-          set_y_mode_and_delta_angle(mbmi->joint_y_mode_delta_angle, mbmi);
+          av2_set_y_mode_and_delta_angle(mbmi->joint_y_mode_delta_angle, mbmi);
           if (mbmi->y_mode_idx >= FIRST_MODE_COUNT &&
               !(mbmi->angle_delta[PLANE_TYPE_Y] ==
                 best_mbmi->angle_delta[PLANE_TYPE_Y])) {
@@ -1610,7 +1610,7 @@
           mbmi->y_mode_idx = mode_idx;
           mbmi->joint_y_mode_delta_angle = mbmi->y_intra_mode_list[mode_idx];
           // the below function changes the mbmi->mode based on the mode_idx
-          set_y_mode_and_delta_angle(mbmi->joint_y_mode_delta_angle, mbmi);
+          av2_set_y_mode_and_delta_angle(mbmi->joint_y_mode_delta_angle, mbmi);
           mode_costs = 0;
           if (dpcm_index > 0 &&
               (mrl_idx > 0 || (mbmi->mode != V_PRED && mbmi->mode != H_PRED) ||
diff --git a/av2/encoder/partition_search.c b/av2/encoder/partition_search.c
index 7501c3d..e1435eb 100644
--- a/av2/encoder/partition_search.c
+++ b/av2/encoder/partition_search.c
@@ -335,8 +335,8 @@
   if (is_inter_block(mbmi, xd->tree_type) && !xd->is_chroma_ref &&
       (is_cfl_allowed(cm->seq_params.enable_cfl_intra, xd) ||
        is_mhccp_allowed(cm, xd))) {
-    cfl_store_block(xd, mbmi->sb_type[xd->tree_type == CHROMA_PART],
-                    mbmi->tx_size, cm->seq_params.cfl_ds_filter_index);
+    av2_cfl_store_block(xd, mbmi->sb_type[xd->tree_type == CHROMA_PART],
+                        mbmi->tx_size, cm->seq_params.cfl_ds_filter_index);
   }
   if (xd->tree_type == LUMA_PART) {
     const CommonModeInfoParams *const mi_params = &cm->mi_params;
diff --git a/av2/encoder/rdopt.c b/av2/encoder/rdopt.c
index cf9749f..9f3051e 100644
--- a/av2/encoder/rdopt.c
+++ b/av2/encoder/rdopt.c
@@ -8863,7 +8863,8 @@
               break;
             mbmi->y_mode_idx = mode_idx;
             mbmi->joint_y_mode_delta_angle = mbmi->y_intra_mode_list[mode_idx];
-            set_y_mode_and_delta_angle(mbmi->joint_y_mode_delta_angle, mbmi);
+            av2_set_y_mode_and_delta_angle(mbmi->joint_y_mode_delta_angle,
+                                           mbmi);
             if ((!cpi->oxcf.intra_mode_cfg.enable_smooth_intra ||
                  cpi->sf.intra_sf.disable_smooth_intra) &&
                 (mbmi->mode == SMOOTH_PRED || mbmi->mode == SMOOTH_H_PRED ||
diff --git a/avm_dsp/avm_dsp_rtcd_defs.pl b/avm_dsp/avm_dsp_rtcd_defs.pl
index 174ddd5..d1e97b5 100644
--- a/avm_dsp/avm_dsp_rtcd_defs.pl
+++ b/avm_dsp/avm_dsp_rtcd_defs.pl
@@ -184,9 +184,9 @@
 #
 # Entropy
 #
-add_proto qw/int od_ec_decode_cdf_q15/, "od_ec_dec *dec, const uint16_t *icdf, int nsyms";
+add_proto qw/int avm_od_ec_decode_cdf_q15/, "od_ec_dec *dec, const uint16_t *icdf, int nsyms";
 if (avm_config("CONFIG_AV2_DECODER") eq "yes") {
-  specialize qw/od_ec_decode_cdf_q15 avx2/;
+  specialize qw/avm_od_ec_decode_cdf_q15 avx2/;
 }
 
 #
diff --git a/avm_dsp/bitreader.c b/avm_dsp/bitreader.c
index f6bd96a..ef46182 100644
--- a/avm_dsp/bitreader.c
+++ b/avm_dsp/bitreader.c
@@ -18,7 +18,7 @@
   }
   r->buffer_end = buffer + size;
   r->buffer = buffer;
-  od_ec_dec_init(&r->ec, buffer, (uint32_t)size);
+  avm_od_ec_dec_init(&r->ec, buffer, (uint32_t)size);
 #if CONFIG_ACCOUNTING
   r->accounting = NULL;
 #endif
@@ -29,10 +29,12 @@
 
 const uint8_t *avm_reader_find_end(avm_reader *r) { return r->buffer_end; }
 
-uint32_t avm_reader_tell(const avm_reader *r) { return od_ec_dec_tell(&r->ec); }
+uint32_t avm_reader_tell(const avm_reader *r) {
+  return avm_od_ec_dec_tell(&r->ec);
+}
 
 uint64_t avm_reader_tell_frac(const avm_reader *r) {
-  return od_ec_dec_tell_frac(&r->ec);
+  return avm_od_ec_dec_tell_frac(&r->ec);
 }
 
 int avm_reader_has_overflowed(const avm_reader *r) {
diff --git a/avm_dsp/bitreader.h b/avm_dsp/bitreader.h
index 1fb8546..810b417 100644
--- a/avm_dsp/bitreader.h
+++ b/avm_dsp/bitreader.h
@@ -146,7 +146,7 @@
 
 static INLINE int avm_read_(avm_reader *r, int prob ACCT_INFO_PARAM) {
   int p = (0x7FFFFF - (prob << 15) + prob) >> 8;
-  int bit = od_ec_decode_bool_q15(&r->ec, p);
+  int bit = avm_od_ec_decode_bool_q15(&r->ec, p);
 
 #if CONFIG_BITSTREAM_DEBUG
   {
@@ -311,7 +311,7 @@
                                 int nsymbs ACCT_INFO_PARAM) {
   int symb;
   assert(cdf != NULL);
-  symb = od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs);
+  symb = avm_od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs);
 
 #if CONFIG_BITSTREAM_DEBUG
   {
@@ -377,7 +377,7 @@
                                         int nsymbs) {
   int symb;
   assert(cdf != NULL);
-  symb = od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs);
+  symb = avm_od_ec_decode_cdf_q15(&r->ec, cdf, nsymbs);
   return symb;
 }
 
diff --git a/avm_dsp/bitwriter.c b/avm_dsp/bitwriter.c
index 57da948..bf8df56 100644
--- a/avm_dsp/bitwriter.c
+++ b/avm_dsp/bitwriter.c
@@ -16,17 +16,17 @@
 void avm_start_encode(avm_writer *w, uint8_t *source) {
   w->buffer = source;
   w->pos = 0;
-  od_ec_enc_init(&w->ec, 62025);
+  avm_od_ec_enc_init(&w->ec, 62025);
 }
 
 int avm_stop_encode(avm_writer *w) {
   int nb_bits;
   uint32_t bytes;
   unsigned char *data;
-  data = od_ec_enc_done(&w->ec, &bytes);
-  nb_bits = od_ec_enc_tell(&w->ec);
+  data = avm_od_ec_enc_done(&w->ec, &bytes);
+  nb_bits = avm_od_ec_enc_tell(&w->ec);
   memcpy(w->buffer, data, bytes);
   w->pos = bytes;
-  od_ec_enc_clear(&w->ec);
+  avm_od_ec_enc_clear(&w->ec);
   return nb_bits;
 }
diff --git a/avm_dsp/bitwriter.h b/avm_dsp/bitwriter.h
index efbe927..d877bc2 100644
--- a/avm_dsp/bitwriter.h
+++ b/avm_dsp/bitwriter.h
@@ -86,7 +86,7 @@
   bitstream_queue_push(bit, cdf, 2);
 #endif  // CONFIG_BITSTREAM_DEBUG
 
-  od_ec_encode_bool_q15(&w->ec, bit, p);
+  avm_od_ec_encode_bool_q15(&w->ec, bit, p);
 }
 
 static INLINE void avm_write_bit(avm_writer *w, int bit) {
@@ -115,7 +115,7 @@
   bitstream_queue_push(symb, cdf, nsymbs);
 #endif  // CONFIG_BITSTREAM_DEBUG
 
-  od_ec_encode_cdf_q15(&w->ec, symb, cdf, nsymbs);
+  avm_od_ec_encode_cdf_q15(&w->ec, symb, cdf, nsymbs);
 }
 
 static INLINE void avm_write_symbol(avm_writer *w, int symb, avm_cdf_prob *cdf,
diff --git a/avm_dsp/entcode.c b/avm_dsp/entcode.c
index 4c2da9d..6810832 100644
--- a/avm_dsp/entcode.c
+++ b/avm_dsp/entcode.c
@@ -32,14 +32,14 @@
 
 /*Given the current total integer number of bits used and the current value of
    rng, computes the fraction number of bits used to OD_BITRES precision.
-  This is used by od_ec_enc_tell_frac() and od_ec_dec_tell_frac().
+  This is used by avm_od_ec_enc_tell_frac() and avm_od_ec_dec_tell_frac().
   nbits_total: The number of whole bits currently used, i.e., the value
-                returned by od_ec_enc_tell() or od_ec_dec_tell().
+                returned by avm_od_ec_enc_tell() or avm_od_ec_dec_tell().
   rng: The current value of rng from either the encoder or decoder state.
   Return: The number of bits scaled by 2**OD_BITRES.
           This will always be slightly larger than the exact value (e.g., all
            rounding error is in the positive direction).*/
-uint64_t od_ec_tell_frac(uint32_t nbits_total, uint32_t rng) {
+uint64_t avm_od_ec_tell_frac(uint32_t nbits_total, uint32_t rng) {
   uint64_t nbits;
   int64_t l;
   int i;
@@ -49,7 +49,7 @@
      subsequent bits.
     The computation here is independent of val itself (the decoder does not
      even track that value), even though the real number of bits used after
-     od_ec_enc_done() may be 1 smaller if rng is a power of two and the
+     avm_od_ec_enc_done() may be 1 smaller if rng is a power of two and the
      corresponding trailing bits of val are all zeros.
     If we did try to track that special case, then coding a value with a
      probability of 1/(1 << n) might sometimes appear to use more than n bits.
diff --git a/avm_dsp/entcode.h b/avm_dsp/entcode.h
index a491b9e..0b2538c 100644
--- a/avm_dsp/entcode.h
+++ b/avm_dsp/entcode.h
@@ -38,8 +38,8 @@
 
 /*See entcode.c for further documentation.*/
 
-OD_WARN_UNUSED_RESULT uint64_t od_ec_tell_frac(uint32_t nbits_total,
-                                               uint32_t rng);
+OD_WARN_UNUSED_RESULT uint64_t avm_od_ec_tell_frac(uint32_t nbits_total,
+                                                   uint32_t rng);
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/avm_dsp/entdec.c b/avm_dsp/entdec.c
index 64f43f8..327b7f2 100644
--- a/avm_dsp/entdec.c
+++ b/avm_dsp/entdec.c
@@ -35,9 +35,9 @@
   End of stream is handled by writing out the smallest number of bits that
    ensures that the stream will be correctly decoded regardless of the value of
    any subsequent bits.
-  od_ec_dec_tell() can be used to determine how many bits were needed to decode
-   all the symbols thus far; other data can be packed in the remaining bits of
-   the input buffer.
+  avm_od_ec_dec_tell() can be used to determine how many bits were needed to
+  decode all the symbols thus far; other data can be packed in the remaining
+  bits of the input buffer.
   @PHDTHESIS{Pas76,
     author="Richard Clark Pasco",
     title="Source coding algorithms for fast data compression",
@@ -72,8 +72,8 @@
 /*Initializes the decoder.
   buf: The input buffer to use.
   storage: The size in bytes of the input buffer.*/
-void od_ec_dec_init(od_ec_dec *dec, const unsigned char *buf,
-                    uint32_t storage) {
+void avm_od_ec_dec_init(od_ec_dec *dec, const unsigned char *buf,
+                        uint32_t storage) {
   dec->buf = buf;
   dec->end = buf + storage;
   dec->bptr = buf;
@@ -87,7 +87,7 @@
 /*Decode a single binary value.
   f: The probability that the bit is one, scaled by 32768.
   Return: The value decoded (0 or 1).*/
-int od_ec_decode_bool_q15(od_ec_dec *dec, unsigned f) {
+int avm_od_ec_decode_bool_q15(od_ec_dec *dec, unsigned f) {
   od_ec_window dif;
   od_ec_window vw;
   unsigned r;
@@ -189,7 +189,8 @@
   nsyms: The number of symbols in the alphabet.
          This should be at most 16.
   Return: The decoded symbol s.*/
-int od_ec_decode_cdf_q15_c(od_ec_dec *dec, const uint16_t *icdf, int nsyms) {
+int avm_od_ec_decode_cdf_q15_c(od_ec_dec *dec, const uint16_t *icdf,
+                               int nsyms) {
   od_ec_window dif;
   unsigned r;
   unsigned c;
@@ -225,7 +226,7 @@
   Return: The number of bits.
           This will always be slightly larger than the exact value (e.g., all
            rounding error is in the positive direction).*/
-int od_ec_dec_tell(const od_ec_dec *dec) {
+int avm_od_ec_dec_tell(const od_ec_dec *dec) {
   /*There is a window of bits stored in dec->dif. The difference
      (dec->bptr - dec->buf) tells us how many bytes have been read into this
      window. The difference (dec->cnt - dec->tell_offs) tells us how many of
@@ -239,6 +240,6 @@
   Return: The number of bits scaled by 2**OD_BITRES.
           This will always be slightly larger than the exact value (e.g., all
            rounding error is in the positive direction).*/
-uint64_t od_ec_dec_tell_frac(const od_ec_dec *dec) {
-  return od_ec_tell_frac(od_ec_dec_tell(dec), dec->rng);
+uint64_t avm_od_ec_dec_tell_frac(const od_ec_dec *dec) {
+  return avm_od_ec_tell_frac(avm_od_ec_dec_tell(dec), dec->rng);
 }
diff --git a/avm_dsp/entdec.h b/avm_dsp/entdec.h
index 479a85b..765abfc 100644
--- a/avm_dsp/entdec.h
+++ b/avm_dsp/entdec.h
@@ -61,8 +61,8 @@
 
 /*See entdec.c for further documentation.*/
 
-void od_ec_dec_init(od_ec_dec *dec, const unsigned char *buf, uint32_t storage)
-    OD_ARG_NONNULL(1) OD_ARG_NONNULL(2);
+void avm_od_ec_dec_init(od_ec_dec *dec, const unsigned char *buf,
+                        uint32_t storage) OD_ARG_NONNULL(1) OD_ARG_NONNULL(2);
 
 OD_WARN_UNUSED_RESULT int od_ec_decode_bool_bypass(od_ec_dec *dec)
     OD_ARG_NONNULL(1);
@@ -72,15 +72,15 @@
 OD_WARN_UNUSED_RESULT int od_ec_decode_unary_bypass(od_ec_dec *dec,
                                                     int max_bits)
     OD_ARG_NONNULL(1);
-OD_WARN_UNUSED_RESULT int od_ec_decode_bool_q15(od_ec_dec *dec, unsigned f)
+OD_WARN_UNUSED_RESULT int avm_od_ec_decode_bool_q15(od_ec_dec *dec, unsigned f)
     OD_ARG_NONNULL(1);
 
 OD_WARN_UNUSED_RESULT uint32_t od_ec_dec_bits_(od_ec_dec *dec, unsigned ftb)
     OD_ARG_NONNULL(1);
 
-OD_WARN_UNUSED_RESULT int od_ec_dec_tell(const od_ec_dec *dec)
+OD_WARN_UNUSED_RESULT int avm_od_ec_dec_tell(const od_ec_dec *dec)
     OD_ARG_NONNULL(1);
-OD_WARN_UNUSED_RESULT uint64_t od_ec_dec_tell_frac(const od_ec_dec *dec)
+OD_WARN_UNUSED_RESULT uint64_t avm_od_ec_dec_tell_frac(const od_ec_dec *dec)
     OD_ARG_NONNULL(1);
 
 /*This is meant to be a large, positive constant that can still be efficiently
@@ -88,8 +88,8 @@
   Even relatively modest values like 100 would work fine.*/
 #define OD_EC_LOTS_OF_BITS (0x4000)
 
-/*The return value of od_ec_dec_tell does not change across an od_ec_dec_refill
-   call.*/
+/*The return value of avm_od_ec_dec_tell does not change across an
+   od_ec_dec_refill call.*/
 static void od_ec_dec_refill(od_ec_dec *dec) {
   int s;
   od_ec_window dif;
@@ -104,7 +104,7 @@
   for (; s >= 0 && bptr < end; s -= 8, bptr++) {
     /*Each time a byte is inserted into the window (dif), bptr advances and cnt
        is incremented by 8, so the total number of consumed bits (the return
-       value of od_ec_dec_tell) does not change.*/
+       value of avm_od_ec_dec_tell) does not change.*/
     assert(s <= OD_EC_WINDOW_SIZE - 8);
     dif ^= (od_ec_window)bptr[0] << s;
     cnt += 8;
diff --git a/avm_dsp/entenc.c b/avm_dsp/entenc.c
index 776c12a..7e615a3 100644
--- a/avm_dsp/entenc.c
+++ b/avm_dsp/entenc.c
@@ -116,8 +116,8 @@
 
 /*Initializes the encoder.
   size: The initial size of the buffer, in bytes.*/
-void od_ec_enc_init(od_ec_enc *enc, uint32_t size) {
-  od_ec_enc_reset(enc);
+void avm_od_ec_enc_init(od_ec_enc *enc, uint32_t size) {
+  avm_od_ec_enc_reset(enc);
   enc->buf = (unsigned char *)malloc(sizeof(*enc->buf) * size);
   enc->storage = size;
   if (size > 0 && enc->buf == NULL) {
@@ -133,7 +133,7 @@
 }
 
 /*Reinitializes the encoder.*/
-void od_ec_enc_reset(od_ec_enc *enc) {
+void avm_od_ec_enc_reset(od_ec_enc *enc) {
   enc->offs = 0;
   enc->low = 0;
   enc->rng = 0x8000;
@@ -148,7 +148,7 @@
 }
 
 /*Frees the buffers used by the encoder.*/
-void od_ec_enc_clear(od_ec_enc *enc) {
+void avm_od_ec_enc_clear(od_ec_enc *enc) {
   free(enc->precarry_buf);
   free(enc->buf);
 }
@@ -192,7 +192,7 @@
 /*Encode a single binary value.
   val: The value to encode (0 or 1).
   f: The probability that the val is one, scaled by 32768.*/
-void od_ec_encode_bool_q15(od_ec_enc *enc, int val, unsigned f) {
+void avm_od_ec_encode_bool_q15(od_ec_enc *enc, int val, unsigned f) {
   od_ec_window l;
   unsigned r;
   unsigned v;
@@ -246,8 +246,8 @@
          be 0.
   nsyms: The number of symbols in the alphabet.
          This should be at most 16.*/
-void od_ec_encode_cdf_q15(od_ec_enc *enc, int s, const uint16_t *icdf,
-                          int nsyms) {
+void avm_od_ec_encode_cdf_q15(od_ec_enc *enc, int s, const uint16_t *icdf,
+                              int nsyms) {
   (void)nsyms;
   assert(s >= 0);
   assert(s < nsyms);
@@ -297,11 +297,11 @@
 
 /*Indicates that there are no more symbols to encode.
   All remaining output bytes are flushed to the output buffer.
-  od_ec_enc_reset() should be called before using the encoder again.
+  avm_od_ec_enc_reset() should be called before using the encoder again.
   bytes: Returns the size of the encoded data in the returned buffer.
   Return: A pointer to the start of the final buffer, or NULL if there was an
            encoding error.*/
-unsigned char *od_ec_enc_done(od_ec_enc *enc, uint32_t *nbytes) {
+unsigned char *avm_od_ec_enc_done(od_ec_enc *enc, uint32_t *nbytes) {
   unsigned char *out;
   uint32_t storage;
   uint16_t *buf;
@@ -316,7 +316,7 @@
   {
     uint32_t tell;
     /* Don't count the 1 bit we lose to raw bits as overhead. */
-    tell = od_ec_enc_tell(enc) - 1;
+    tell = avm_od_ec_enc_tell(enc) - 1;
     fprintf(stderr, "overhead: %f%%\n",
             100 * (tell - enc->entropy) / enc->entropy);
     fprintf(stderr, "efficiency: %f bits/symbol\n",
@@ -399,7 +399,7 @@
   Return: The number of bits.
           This will always be slightly larger than the exact value (e.g., all
            rounding error is in the positive direction).*/
-int od_ec_enc_tell(const od_ec_enc *enc) {
+int avm_od_ec_enc_tell(const od_ec_enc *enc) {
   /*The 10 here counteracts the offset of -9 baked into cnt, and adds 1 extra
      bit, which we reserve for terminating the stream.*/
   return (enc->cnt + 10) + enc->offs * 8;
@@ -414,8 +414,8 @@
   Return: The number of bits scaled by 2**OD_BITRES.
           This will always be slightly larger than the exact value (e.g., all
            rounding error is in the positive direction).*/
-uint64_t od_ec_enc_tell_frac(const od_ec_enc *enc) {
-  return od_ec_tell_frac(od_ec_enc_tell(enc), enc->rng);
+uint64_t avm_od_ec_enc_tell_frac(const od_ec_enc *enc) {
+  return avm_od_ec_tell_frac(avm_od_ec_enc_tell(enc), enc->rng);
 }
 
 /*Saves a entropy coder checkpoint to dst.
diff --git a/avm_dsp/entenc.h b/avm_dsp/entenc.h
index 5cc4ad9..a925117 100644
--- a/avm_dsp/entenc.h
+++ b/avm_dsp/entenc.h
@@ -26,8 +26,9 @@
 /*The entropy encoder context.*/
 struct od_ec_enc {
   /*Buffered output.
-    This contains only the raw bits until the final call to od_ec_enc_done(),
-     where all the arithmetic-coded data gets prepended to it.*/
+    This contains only the raw bits until the final call to
+    avm_od_ec_enc_done(), where all the arithmetic-coded data gets prepended to
+    it.*/
   unsigned char *buf;
   /*The size of the buffer.*/
   uint32_t storage;
@@ -53,30 +54,30 @@
 
 /*See entenc.c for further documentation.*/
 
-void od_ec_enc_init(od_ec_enc *enc, uint32_t size) OD_ARG_NONNULL(1);
-void od_ec_enc_reset(od_ec_enc *enc) OD_ARG_NONNULL(1);
-void od_ec_enc_clear(od_ec_enc *enc) OD_ARG_NONNULL(1);
+void avm_od_ec_enc_init(od_ec_enc *enc, uint32_t size) OD_ARG_NONNULL(1);
+void avm_od_ec_enc_reset(od_ec_enc *enc) OD_ARG_NONNULL(1);
+void avm_od_ec_enc_clear(od_ec_enc *enc) OD_ARG_NONNULL(1);
 
 void od_ec_encode_bool_bypass(od_ec_enc *enc, int val) OD_ARG_NONNULL(1);
 void od_ec_encode_literal_bypass(od_ec_enc *enc, int val, int n_bits)
     OD_ARG_NONNULL(1);
-void od_ec_encode_bool_q15(od_ec_enc *enc, int val, unsigned f_q15)
+void avm_od_ec_encode_bool_q15(od_ec_enc *enc, int val, unsigned f_q15)
     OD_ARG_NONNULL(1);
-void od_ec_encode_cdf_q15(od_ec_enc *enc, int s, const uint16_t *cdf, int nsyms)
-    OD_ARG_NONNULL(1) OD_ARG_NONNULL(3);
+void avm_od_ec_encode_cdf_q15(od_ec_enc *enc, int s, const uint16_t *cdf,
+                              int nsyms) OD_ARG_NONNULL(1) OD_ARG_NONNULL(3);
 
 void od_ec_enc_bits(od_ec_enc *enc, uint32_t fl, unsigned ftb)
     OD_ARG_NONNULL(1);
 
 void od_ec_enc_patch_initial_bits(od_ec_enc *enc, unsigned val, int nbits)
     OD_ARG_NONNULL(1);
-OD_WARN_UNUSED_RESULT unsigned char *od_ec_enc_done(od_ec_enc *enc,
-                                                    uint32_t *nbytes)
+OD_WARN_UNUSED_RESULT unsigned char *avm_od_ec_enc_done(od_ec_enc *enc,
+                                                        uint32_t *nbytes)
     OD_ARG_NONNULL(1) OD_ARG_NONNULL(2);
 
-OD_WARN_UNUSED_RESULT int od_ec_enc_tell(const od_ec_enc *enc)
+OD_WARN_UNUSED_RESULT int avm_od_ec_enc_tell(const od_ec_enc *enc)
     OD_ARG_NONNULL(1);
-OD_WARN_UNUSED_RESULT uint64_t od_ec_enc_tell_frac(const od_ec_enc *enc)
+OD_WARN_UNUSED_RESULT uint64_t avm_od_ec_enc_tell_frac(const od_ec_enc *enc)
     OD_ARG_NONNULL(1);
 
 void od_ec_enc_checkpoint(od_ec_enc *dst, const od_ec_enc *src);
diff --git a/avm_dsp/flow_estimation/flow_estimation.c b/avm_dsp/flow_estimation/flow_estimation.c
index 1016173..1538943 100644
--- a/avm_dsp/flow_estimation/flow_estimation.c
+++ b/avm_dsp/flow_estimation/flow_estimation.c
@@ -18,12 +18,6 @@
 #include "avm_ports/mem.h"
 #include "avm_scale/yv12config.h"
 
-// clang-format off
-const double kIdentityParams[MAX_PARAMDIM] = {
-  0.0, 0.0, 1.0, 0.0, 0.0, 1.0
-};
-// clang-format on
-
 // Compute a global motion model between the given source and ref frames.
 //
 // As is standard for video codecs, the resulting model maps from (x, y)
diff --git a/avm_dsp/flow_estimation/flow_estimation.h b/avm_dsp/flow_estimation/flow_estimation.h
index 798fff5..c82d142 100644
--- a/avm_dsp/flow_estimation/flow_estimation.h
+++ b/avm_dsp/flow_estimation/flow_estimation.h
@@ -67,8 +67,6 @@
 static const GlobalMotionMethod default_global_motion_method =
     GLOBAL_MOTION_METHOD_DISFLOW;
 
-extern const double kIdentityParams[MAX_PARAMDIM];
-
 // Compute a global motion model between the given source and ref frames.
 //
 // As is standard for video codecs, the resulting model maps from (x, y)
diff --git a/avm_dsp/flow_estimation/ransac.c b/avm_dsp/flow_estimation/ransac.c
index 8f261e1..ced98cd 100644
--- a/avm_dsp/flow_estimation/ransac.c
+++ b/avm_dsp/flow_estimation/ransac.c
@@ -455,6 +455,9 @@
   return compare_motions(motion_a, motion_b) < 0;
 }
 
+static const double identity_model_params[MAX_PARAMDIM] = { 0.0, 0.0, 1.0,
+                                                            0.0, 0.0, 1.0 };
+
 // Returns true on success, false on error
 static bool ransac_internal(const Correspondence *matched_points, int npoints,
                             MotionModel *motion_models, int num_desired_motions,
@@ -481,7 +484,7 @@
 
   // Initialize output models, as a fallback in case we can't find a model
   for (i = 0; i < num_desired_motions; i++) {
-    memcpy(motion_models[i].params, kIdentityParams,
+    memcpy(motion_models[i].params, identity_model_params,
            MAX_PARAMDIM * sizeof(*(motion_models[i].params)));
     motion_models[i].num_inliers = 0;
   }
diff --git a/avm_dsp/x86/entdec_avx2.c b/avm_dsp/x86/entdec_avx2.c
index 6aea533..ecf05d2 100644
--- a/avm_dsp/x86/entdec_avx2.c
+++ b/avm_dsp/x86/entdec_avx2.c
@@ -25,7 +25,8 @@
   nsyms: The number of symbols in the alphabet.
          This should be at most 16.
   Return: The decoded symbol s.*/
-int od_ec_decode_cdf_q15_avx2(od_ec_dec *dec, const uint16_t *icdf, int nsyms) {
+int avm_od_ec_decode_cdf_q15_avx2(od_ec_dec *dec, const uint16_t *icdf,
+                                  int nsyms) {
   uint16_t scaled_cdf[16];
 
   __m256i cdf = _mm256_lddqu_si256((__m256i *)icdf);
diff --git a/common/args.c b/common/args.c
index 815bb2d..e39e250 100644
--- a/common/args.c
+++ b/common/args.c
@@ -195,7 +195,7 @@
 
 int arg_match(struct arg *arg_, const struct arg_def *def, char **argv) {
   char err_msg[ARG_ERR_MSG_MAX_LEN];
-  int ret = arg_match_helper(arg_, def, argv, err_msg);
+  int ret = avm_arg_match_helper(arg_, def, argv, err_msg);
   if (err_msg[0] != '\0') {
     die(err_msg);
   }
@@ -256,7 +256,7 @@
 
 unsigned int arg_parse_uint(const struct arg *arg) {
   char err_msg[ARG_ERR_MSG_MAX_LEN];
-  unsigned int ret = arg_parse_uint_helper(arg, err_msg);
+  unsigned int ret = avm_arg_parse_uint_helper(arg, err_msg);
   if (err_msg[0] != '\0') {
     die(err_msg);
   }
@@ -265,7 +265,7 @@
 
 int arg_parse_int(const struct arg *arg) {
   char err_msg[ARG_ERR_MSG_MAX_LEN];
-  int ret = arg_parse_int_helper(arg, err_msg);
+  int ret = avm_arg_parse_int_helper(arg, err_msg);
   if (err_msg[0] != '\0') {
     die(err_msg);
   }
@@ -274,7 +274,7 @@
 
 struct avm_rational arg_parse_rational(const struct arg *arg) {
   char err_msg[ARG_ERR_MSG_MAX_LEN];
-  struct avm_rational ret = arg_parse_rational_helper(arg, err_msg);
+  struct avm_rational ret = avm_arg_parse_rational_helper(arg, err_msg);
   if (err_msg[0] != '\0') {
     die(err_msg);
   }
@@ -283,7 +283,7 @@
 
 int arg_parse_enum(const struct arg *arg) {
   char err_msg[ARG_ERR_MSG_MAX_LEN];
-  int ret = arg_parse_enum_helper(arg, err_msg);
+  int ret = avm_arg_parse_enum_helper(arg, err_msg);
   if (err_msg[0] != '\0') {
     die(err_msg);
   }
@@ -292,7 +292,7 @@
 
 int arg_parse_enum_or_int(const struct arg *arg) {
   char err_msg[ARG_ERR_MSG_MAX_LEN];
-  int ret = arg_parse_enum_or_int_helper(arg, err_msg);
+  int ret = avm_arg_parse_enum_or_int_helper(arg, err_msg);
   if (err_msg[0] != '\0') {
     die(err_msg);
   }
@@ -303,7 +303,7 @@
 // return the number of elements in the list
 int arg_parse_list(const struct arg *arg, int *list, int n) {
   char err_msg[ARG_ERR_MSG_MAX_LEN];
-  int ret = arg_parse_list_helper(arg, list, n, err_msg);
+  int ret = avm_arg_parse_list_helper(arg, list, n, err_msg);
   if (err_msg[0] != '\0') {
     die(err_msg);
   }
diff --git a/common/args_helper.c b/common/args_helper.c
index fc5bfd4..cd7f523 100644
--- a/common/args_helper.c
+++ b/common/args_helper.c
@@ -32,8 +32,8 @@
   return a;
 }
 
-int arg_match_helper(struct arg *arg_, const struct arg_def *def, char **argv,
-                     char *err_msg) {
+int avm_arg_match_helper(struct arg *arg_, const struct arg_def *def,
+                         char **argv, char *err_msg) {
   struct arg arg;
 
   if (err_msg) err_msg[0] = '\0';
@@ -86,7 +86,7 @@
   return 0;
 }
 
-unsigned int arg_parse_uint_helper(const struct arg *arg, char *err_msg) {
+unsigned int avm_arg_parse_uint_helper(const struct arg *arg, char *err_msg) {
   char *endptr;
   const unsigned long rawval = strtoul(arg->val, &endptr, 10);  // NOLINT
 
@@ -102,7 +102,7 @@
   return 0;
 }
 
-int arg_parse_int_helper(const struct arg *arg, char *err_msg) {
+int avm_arg_parse_int_helper(const struct arg *arg, char *err_msg) {
   char *endptr;
   const long rawval = strtol(arg->val, &endptr, 10);  // NOLINT
 
@@ -118,8 +118,8 @@
   return 0;
 }
 
-struct avm_rational arg_parse_rational_helper(const struct arg *arg,
-                                              char *err_msg) {
+struct avm_rational avm_arg_parse_rational_helper(const struct arg *arg,
+                                                  char *err_msg) {
   long rawval;  // NOLINT
   char *endptr;
   struct avm_rational rat = { 0, 1 };
@@ -161,7 +161,7 @@
   return rat;
 }
 
-int arg_parse_enum_helper(const struct arg *arg, char *err_msg) {
+int avm_arg_parse_enum_helper(const struct arg *arg, char *err_msg) {
   const struct arg_enum_list *listptr;
   long rawval;  // NOLINT
   char *endptr;
@@ -184,15 +184,15 @@
   return 0;
 }
 
-int arg_parse_enum_or_int_helper(const struct arg *arg, char *err_msg) {
-  if (arg->def->enums) return arg_parse_enum_helper(arg, err_msg);
-  return arg_parse_int_helper(arg, err_msg);
+int avm_arg_parse_enum_or_int_helper(const struct arg *arg, char *err_msg) {
+  if (arg->def->enums) return avm_arg_parse_enum_helper(arg, err_msg);
+  return avm_arg_parse_int_helper(arg, err_msg);
 }
 
 // parse a comma separated list of at most n integers
 // return the number of elements in the list
-int arg_parse_list_helper(const struct arg *arg, int *list, int n,
-                          char *err_msg) {
+int avm_arg_parse_list_helper(const struct arg *arg, int *list, int n,
+                              char *err_msg) {
   const char *ptr = arg->val;
   char *endptr;
   int i = 0;
diff --git a/common/args_helper.h b/common/args_helper.h
index baa3798..4b53a1e 100644
--- a/common/args_helper.h
+++ b/common/args_helper.h
@@ -58,16 +58,16 @@
  * stored in it if an error occurs. It will be set to an empty string if no
  * error occurs.
  */
-int arg_match_helper(struct arg *arg_, const struct arg_def *def, char **argv,
-                     char *err_msg);
-unsigned int arg_parse_uint_helper(const struct arg *arg, char *err_msg);
-int arg_parse_int_helper(const struct arg *arg, char *err_msg);
-struct avm_rational arg_parse_rational_helper(const struct arg *arg,
-                                              char *err_msg);
-int arg_parse_enum_helper(const struct arg *arg, char *err_msg);
-int arg_parse_enum_or_int_helper(const struct arg *arg, char *err_msg);
-int arg_parse_list_helper(const struct arg *arg, int *list, int n,
-                          char *err_msg);
+int avm_arg_match_helper(struct arg *arg_, const struct arg_def *def,
+                         char **argv, char *err_msg);
+unsigned int avm_arg_parse_uint_helper(const struct arg *arg, char *err_msg);
+int avm_arg_parse_int_helper(const struct arg *arg, char *err_msg);
+struct avm_rational avm_arg_parse_rational_helper(const struct arg *arg,
+                                                  char *err_msg);
+int avm_arg_parse_enum_helper(const struct arg *arg, char *err_msg);
+int avm_arg_parse_enum_or_int_helper(const struct arg *arg, char *err_msg);
+int avm_arg_parse_list_helper(const struct arg *arg, int *list, int n,
+                              char *err_msg);
 
 #ifdef __cplusplus
 }  // extern "C"
diff --git a/test/cdef_test.cc b/test/cdef_test.cc
index d1b87e9..3b41277 100644
--- a/test/cdef_test.cc
+++ b/test/cdef_test.cc
@@ -314,7 +314,7 @@
 typedef CDEFFindDirDualTest CDEFFindDirDualSpeedTest;
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CDEFFindDirDualSpeedTest);
 
-/* Bitmatch test of the SIMD implementations of cdef_find_dir_dual(). */
+/* Bitmatch test of the SIMD implementations of av2_cdef_find_dir_dual(). */
 void test_finddir_dual(
     void (*finddir)(const uint16_t *img1, const uint16_t *img2, int stride,
                     int32_t *var1, int32_t *var2, int coeff_shift, int *out1,
@@ -371,7 +371,7 @@
   }
 }
 
-/* Speed test of the SIMD implementations of cdef_find_dir_dual(). */
+/* Speed test of the SIMD implementations of av2_cdef_find_dir_dual(). */
 void test_finddir_dual_speed(
     void (*finddir)(const uint16_t *img1, const uint16_t *img2, int stride,
                     int32_t *var1, int32_t *var2, int coeff_shift, int *out1,
@@ -432,15 +432,15 @@
 #if defined(_WIN64) || !defined(_MSC_VER) || defined(__clang__)
 #if (HAVE_SSE2 || HAVE_SSSE3 || HAVE_SSE4_1 || HAVE_AVX2 || HAVE_NEON)
 static const CdefFilterBlockFunctions kCdefFilterHighbdFuncC[] = {
-  { &cdef_filter_16_0_c, &cdef_filter_16_1_c, &cdef_filter_16_2_c,
-    &cdef_filter_16_3_c }
+  { &av2_cdef_filter_16_0_c, &av2_cdef_filter_16_1_c, &av2_cdef_filter_16_2_c,
+    &av2_cdef_filter_16_3_c }
 };
 #endif
 
 #if HAVE_SSE2
 static const CdefFilterBlockFunctions kCdefFilterHighbdFuncSse2[] = {
-  { &cdef_filter_16_0_sse2, &cdef_filter_16_1_sse2, &cdef_filter_16_2_sse2,
-    &cdef_filter_16_3_sse2 }
+  { &av2_cdef_filter_16_0_sse2, &av2_cdef_filter_16_1_sse2,
+    &av2_cdef_filter_16_2_sse2, &av2_cdef_filter_16_3_sse2 }
 };
 
 INSTANTIATE_TEST_SUITE_P(
@@ -452,17 +452,18 @@
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 
 INSTANTIATE_TEST_SUITE_P(SSE2, CDEFFindDirTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_sse2,
-                                                      &cdef_find_dir_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_sse2,
+                                                      &av2_cdef_find_dir_c)));
 
-INSTANTIATE_TEST_SUITE_P(SSE2, CDEFFindDirDualTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_dual_sse2,
-                                                      &cdef_find_dir_dual_c)));
+INSTANTIATE_TEST_SUITE_P(
+    SSE2, CDEFFindDirDualTest,
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_sse2,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 #if HAVE_SSSE3
 static const CdefFilterBlockFunctions kCdefFilterHighbdFuncSsse3[] = {
-  { &cdef_filter_16_0_ssse3, &cdef_filter_16_1_ssse3, &cdef_filter_16_2_ssse3,
-    &cdef_filter_16_3_ssse3 }
+  { &av2_cdef_filter_16_0_ssse3, &av2_cdef_filter_16_1_ssse3,
+    &av2_cdef_filter_16_2_ssse3, &av2_cdef_filter_16_3_ssse3 }
 };
 
 INSTANTIATE_TEST_SUITE_P(
@@ -474,18 +475,19 @@
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 
 INSTANTIATE_TEST_SUITE_P(SSSE3, CDEFFindDirTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_ssse3,
-                                                      &cdef_find_dir_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_ssse3,
+                                                      &av2_cdef_find_dir_c)));
 
-INSTANTIATE_TEST_SUITE_P(SSSE3, CDEFFindDirDualTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_dual_ssse3,
-                                                      &cdef_find_dir_dual_c)));
+INSTANTIATE_TEST_SUITE_P(
+    SSSE3, CDEFFindDirDualTest,
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_ssse3,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 #if HAVE_SSE4_1
 static const CdefFilterBlockFunctions kCdefFilterHighbdFuncSse4_1[] = {
-  { &cdef_filter_16_0_sse4_1, &cdef_filter_16_1_sse4_1,
-    &cdef_filter_16_2_sse4_1, &cdef_filter_16_3_sse4_1 }
+  { &av2_cdef_filter_16_0_sse4_1, &av2_cdef_filter_16_1_sse4_1,
+    &av2_cdef_filter_16_2_sse4_1, &av2_cdef_filter_16_3_sse4_1 }
 };
 
 INSTANTIATE_TEST_SUITE_P(
@@ -496,18 +498,18 @@
                                          BLOCK_8X8),
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 INSTANTIATE_TEST_SUITE_P(SSE4_1, CDEFFindDirTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
-                                                      &cdef_find_dir_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_sse4_1,
+                                                      &av2_cdef_find_dir_c)));
 INSTANTIATE_TEST_SUITE_P(
     SSE4_1, CDEFFindDirDualTest,
-    ::testing::Values(make_tuple(&cdef_find_dir_dual_sse4_1,
-                                 &cdef_find_dir_dual_c)));
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_sse4_1,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 #if HAVE_AVX2
 static const CdefFilterBlockFunctions kCdefFilterHighbdFuncAvx2[] = {
-  { &cdef_filter_16_0_avx2, &cdef_filter_16_1_avx2, &cdef_filter_16_2_avx2,
-    &cdef_filter_16_3_avx2 }
+  { &av2_cdef_filter_16_0_avx2, &av2_cdef_filter_16_1_avx2,
+    &av2_cdef_filter_16_2_avx2, &av2_cdef_filter_16_3_avx2 }
 };
 
 INSTANTIATE_TEST_SUITE_P(
@@ -518,17 +520,18 @@
                                          BLOCK_8X8),
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 INSTANTIATE_TEST_SUITE_P(AVX2, CDEFFindDirTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_avx2,
-                                                      &cdef_find_dir_c)));
-INSTANTIATE_TEST_SUITE_P(AVX2, CDEFFindDirDualTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_dual_avx2,
-                                                      &cdef_find_dir_dual_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_avx2,
+                                                      &av2_cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(
+    AVX2, CDEFFindDirDualTest,
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_avx2,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 #if HAVE_NEON
 static const CdefFilterBlockFunctions kCdefFilterHighbdFuncNeon[] = {
-  { &cdef_filter_16_0_neon, &cdef_filter_16_1_neon, &cdef_filter_16_2_neon,
-    &cdef_filter_16_3_neon }
+  { &av2_cdef_filter_16_0_neon, &av2_cdef_filter_16_1_neon,
+    &av2_cdef_filter_16_2_neon, &av2_cdef_filter_16_3_neon }
 };
 
 INSTANTIATE_TEST_SUITE_P(
@@ -539,11 +542,12 @@
                                          BLOCK_8X8),
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 INSTANTIATE_TEST_SUITE_P(NEON, CDEFFindDirTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_neon,
-                                                      &cdef_find_dir_c)));
-INSTANTIATE_TEST_SUITE_P(NEON, CDEFFindDirDualTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_dual_neon,
-                                                      &cdef_find_dir_dual_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_neon,
+                                                      &av2_cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(
+    NEON, CDEFFindDirDualTest,
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_neon,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 // Test speed for all supported architectures
@@ -556,11 +560,12 @@
                                          BLOCK_8X8),
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 INSTANTIATE_TEST_SUITE_P(SSE2, CDEFFindDirSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_sse2,
-                                                      &cdef_find_dir_c)));
-INSTANTIATE_TEST_SUITE_P(SSE2, CDEFFindDirDualSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_dual_sse2,
-                                                      &cdef_find_dir_dual_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_sse2,
+                                                      &av2_cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(
+    SSE2, CDEFFindDirDualSpeedTest,
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_sse2,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 #if HAVE_SSSE3
@@ -572,11 +577,12 @@
                                          BLOCK_8X8),
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 INSTANTIATE_TEST_SUITE_P(SSSE3, CDEFFindDirSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_ssse3,
-                                                      &cdef_find_dir_c)));
-INSTANTIATE_TEST_SUITE_P(SSSE3, CDEFFindDirDualSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_dual_ssse3,
-                                                      &cdef_find_dir_dual_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_ssse3,
+                                                      &av2_cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(
+    SSSE3, CDEFFindDirDualSpeedTest,
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_ssse3,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 #if HAVE_SSE4_1
@@ -588,12 +594,12 @@
                                          BLOCK_8X8),
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 INSTANTIATE_TEST_SUITE_P(SSE4_1, CDEFFindDirSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_sse4_1,
-                                                      &cdef_find_dir_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_sse4_1,
+                                                      &av2_cdef_find_dir_c)));
 INSTANTIATE_TEST_SUITE_P(
     SSE4_1, CDEFFindDirDualSpeedTest,
-    ::testing::Values(make_tuple(&cdef_find_dir_dual_sse4_1,
-                                 &cdef_find_dir_dual_c)));
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_sse4_1,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 #if HAVE_AVX2
@@ -605,11 +611,12 @@
                                          BLOCK_8X8),
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 INSTANTIATE_TEST_SUITE_P(AVX2, CDEFFindDirSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_avx2,
-                                                      &cdef_find_dir_c)));
-INSTANTIATE_TEST_SUITE_P(AVX2, CDEFFindDirDualSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_dual_avx2,
-                                                      &cdef_find_dir_dual_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_avx2,
+                                                      &av2_cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(
+    AVX2, CDEFFindDirDualSpeedTest,
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_avx2,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 #if HAVE_NEON
@@ -621,11 +628,12 @@
                                          BLOCK_8X8),
                        ::testing::Range(0, 16), ::testing::Range(8, 13, 2)));
 INSTANTIATE_TEST_SUITE_P(NEON, CDEFFindDirSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_neon,
-                                                      &cdef_find_dir_c)));
-INSTANTIATE_TEST_SUITE_P(NEON, CDEFFindDirDualSpeedTest,
-                         ::testing::Values(make_tuple(&cdef_find_dir_dual_neon,
-                                                      &cdef_find_dir_dual_c)));
+                         ::testing::Values(make_tuple(&av2_cdef_find_dir_neon,
+                                                      &av2_cdef_find_dir_c)));
+INSTANTIATE_TEST_SUITE_P(
+    NEON, CDEFFindDirDualSpeedTest,
+    ::testing::Values(make_tuple(&av2_cdef_find_dir_dual_neon,
+                                 &av2_cdef_find_dir_dual_c)));
 #endif
 
 #endif  // defined(_WIN64) || !defined(_MSC_VER)
diff --git a/test/cfl_test.cc b/test/cfl_test.cc
index 0ce0291..452291d 100644
--- a/test/cfl_test.cc
+++ b/test/cfl_test.cc
@@ -182,7 +182,7 @@
   }
 };
 
-typedef cfl_subtract_average_fn (*sub_avg_fn)(TX_SIZE tx_size);
+typedef av2_cfl_subtract_average_fn (*sub_avg_fn)(TX_SIZE tx_size);
 typedef std::tuple<TX_SIZE, sub_avg_fn> sub_avg_param;
 class CFLSubAvgTest : public ::testing::TestWithParam<sub_avg_param>,
                       public CFLTestWithData<int16_t> {
@@ -190,13 +190,13 @@
   virtual void SetUp() {
     CFLTest::init(std::get<0>(this->GetParam()));
     sub_avg = std::get<1>(this->GetParam())(tx_size);
-    sub_avg_ref = cfl_get_subtract_average_fn_c(tx_size);
+    sub_avg_ref = av2_cfl_get_subtract_average_fn_c(tx_size);
   }
   virtual ~CFLSubAvgTest() {}
 
  protected:
-  cfl_subtract_average_fn sub_avg;
-  cfl_subtract_average_fn sub_avg_ref;
+  av2_cfl_subtract_average_fn sub_avg;
+  av2_cfl_subtract_average_fn sub_avg_ref;
 };
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CFLSubAvgTest);
 
@@ -286,20 +286,20 @@
   }
 };
 
-typedef cfl_subsample_hbd_fn (*get_subsample_hbd_fn)(TX_SIZE tx_size);
+typedef av2_cfl_subsample_hbd_fn (*get_subsample_hbd_fn)(TX_SIZE tx_size);
 typedef std::tuple<TX_SIZE, get_subsample_hbd_fn, get_subsample_hbd_fn,
                    get_subsample_hbd_fn>
     subsample_hbd_param;
 class CFLSubsampleHBDTest
-    : public CFLSubsampleTest<subsample_hbd_param, cfl_subsample_hbd_fn,
+    : public CFLSubsampleTest<subsample_hbd_param, av2_cfl_subsample_hbd_fn,
                               uint16_t> {
  public:
   virtual ~CFLSubsampleHBDTest() {}
   virtual void SetUp() {
     CFLSubsampleTest::SetUp();
-    fun_420_ref = cfl_get_luma_subsampling_420_hbd_c(tx_size);
-    fun_422_ref = cfl_get_luma_subsampling_422_hbd_c(tx_size);
-    fun_444_ref = cfl_get_luma_subsampling_444_hbd_c(tx_size);
+    fun_420_ref = av2_cfl_get_luma_subsampling_420_hbd_c(tx_size);
+    fun_422_ref = av2_cfl_get_luma_subsampling_422_hbd_c(tx_size);
+    fun_444_ref = av2_cfl_get_luma_subsampling_444_hbd_c(tx_size);
   }
 };
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CFLSubsampleHBDTest);
@@ -329,7 +329,7 @@
   subsampleSpeedTest(fun_444, fun_444_ref, &ACMRandom::Rand12);
 }
 
-typedef cfl_predict_hbd_fn (*get_predict_fn_hbd)(TX_SIZE tx_size);
+typedef av2_cfl_predict_hbd_fn (*get_predict_fn_hbd)(TX_SIZE tx_size);
 typedef std::tuple<TX_SIZE, get_predict_fn_hbd> predict_param_hbd;
 class CFLPredictHBDTest : public ::testing::TestWithParam<predict_param_hbd>,
                           public CFLTestWithAlignedData<uint16_t> {
@@ -337,13 +337,13 @@
   virtual void SetUp() {
     CFLTest::init(std::get<0>(this->GetParam()));
     predict = std::get<1>(this->GetParam())(tx_size);
-    predict_ref = cfl_get_predict_hbd_fn_c(tx_size);
+    predict_ref = av2_cfl_get_predict_hbd_fn_c(tx_size);
   }
   virtual ~CFLPredictHBDTest() {}
 
  protected:
-  cfl_predict_hbd_fn predict;
-  cfl_predict_hbd_fn predict_ref;
+  av2_cfl_predict_hbd_fn predict;
+  av2_cfl_predict_hbd_fn predict_ref;
 };
 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CFLPredictHBDTest);
 
@@ -405,7 +405,7 @@
       make_tuple(static_cast<TX_SIZE>(TX_4X64), &function),  \
       make_tuple(static_cast<TX_SIZE>(TX_64X4), &function)
 
-typedef cfl_subsample_hbd_fn (*get_subsample_hbd_fn)(TX_SIZE tx_size);
+typedef av2_cfl_subsample_hbd_fn (*get_subsample_hbd_fn)(TX_SIZE tx_size);
 typedef std::tuple<TX_SIZE, get_subsample_hbd_fn> CflSubsample121HbdParam;
 
 class CflSubsample121HBDTest
@@ -417,12 +417,12 @@
     CFLTest::init(std::get<0>(GetParam()));
     get_subsample_hbd_fn tgt_getter = std::get<1>(GetParam());
     tgt_fn_ = tgt_getter(tx_size);
-    ref_fn_ = cfl_get_luma_subsampling_420_hbd_121_c(tx_size);
+    ref_fn_ = av2_cfl_get_luma_subsampling_420_hbd_121_c(tx_size);
   }
 
  protected:
-  cfl_subsample_hbd_fn ref_fn_;
-  cfl_subsample_hbd_fn tgt_fn_;
+  av2_cfl_subsample_hbd_fn ref_fn_;
+  av2_cfl_subsample_hbd_fn tgt_fn_;
 };
 
 TEST_P(CflSubsample121HBDTest, Match) {
@@ -463,13 +463,13 @@
 }
 
 #if HAVE_AVX2
-const CflSubsample121HbdParam cfl_subsample_121_hbd_avx2_params[] = {
-  ALL_CFL_TX_SIZES_121(cfl_get_luma_subsampling_420_hbd_121_avx2)
+const CflSubsample121HbdParam av2_cfl_subsample_121_hbd_avx2_params[] = {
+  ALL_CFL_TX_SIZES_121(av2_cfl_get_luma_subsampling_420_hbd_121_avx2)
 };
 
 INSTANTIATE_TEST_SUITE_P(
     AVX2, CflSubsample121HBDTest,
-    ::testing::ValuesIn(cfl_subsample_121_hbd_avx2_params));
+    ::testing::ValuesIn(av2_cfl_subsample_121_hbd_avx2_params));
 #endif
 
 #define ALL_CFL_TX_SIZES_COLOCATED(function)                 \
@@ -499,7 +499,7 @@
       make_tuple(static_cast<TX_SIZE>(TX_4X64), &function),  \
       make_tuple(static_cast<TX_SIZE>(TX_64X4), &function)
 
-typedef cfl_subsample_hbd_fn (*get_subsample_hbd_fn)(TX_SIZE tx_size);
+typedef av2_cfl_subsample_hbd_fn (*get_subsample_hbd_fn)(TX_SIZE tx_size);
 typedef std::tuple<TX_SIZE, get_subsample_hbd_fn> CflSubsampleColocatedHbdParam;
 
 class CflSubsampleColocatedHBDTest
@@ -511,12 +511,12 @@
     CFLTest::init(std::get<0>(GetParam()));
     get_subsample_hbd_fn tgt_getter = std::get<1>(GetParam());
     tgt_fn_ = tgt_getter(tx_size);
-    ref_fn_ = cfl_get_luma_subsampling_420_hbd_colocated_c(tx_size);
+    ref_fn_ = av2_cfl_get_luma_subsampling_420_hbd_colocated_c(tx_size);
   }
 
  protected:
-  cfl_subsample_hbd_fn ref_fn_;
-  cfl_subsample_hbd_fn tgt_fn_;
+  av2_cfl_subsample_hbd_fn ref_fn_;
+  av2_cfl_subsample_hbd_fn tgt_fn_;
 };
 
 TEST_P(CflSubsampleColocatedHBDTest, Match) {
@@ -558,11 +558,13 @@
 
 #if HAVE_AVX2
 const CflSubsampleColocatedHbdParam
-    cfl_subsample_colocated_hbd_avx2_params[] = { ALL_CFL_TX_SIZES_COLOCATED(
-        cfl_get_luma_subsampling_420_hbd_colocated_avx2) };
+    av2_cfl_subsample_colocated_hbd_avx2_params[] = {
+      ALL_CFL_TX_SIZES_COLOCATED(
+          av2_cfl_get_luma_subsampling_420_hbd_colocated_avx2)
+    };
 INSTANTIATE_TEST_SUITE_P(
     AVX2, CflSubsampleColocatedHBDTest,
-    ::testing::ValuesIn(cfl_subsample_colocated_hbd_avx2_params));
+    ::testing::ValuesIn(av2_cfl_subsample_colocated_hbd_avx2_params));
 #endif
 
 typedef void (*mhccp_predict_hv_hbd_fn)(const uint16_t *input, uint16_t *dst,
@@ -809,7 +811,7 @@
 
 #if HAVE_SSE2
 const sub_avg_param sub_avg_sizes_sse2[] = { ALL_CFL_TX_SIZES(
-    cfl_get_subtract_average_fn_sse2) };
+    av2_cfl_get_subtract_average_fn_sse2) };
 
 INSTANTIATE_TEST_SUITE_P(SSE2, CFLSubAvgTest,
                          ::testing::ValuesIn(sub_avg_sizes_sse2));
@@ -818,9 +820,9 @@
 
 #if HAVE_SSSE3
 const subsample_hbd_param subsample_hbd_sizes_ssse3[] = {
-  ALL_CFL_TX_SIZES_SUBSAMPLE(cfl_get_luma_subsampling_420_hbd_ssse3,
-                             cfl_get_luma_subsampling_422_hbd_ssse3,
-                             cfl_get_luma_subsampling_444_hbd_ssse3)
+  ALL_CFL_TX_SIZES_SUBSAMPLE(av2_cfl_get_luma_subsampling_420_hbd_ssse3,
+                             av2_cfl_get_luma_subsampling_422_hbd_ssse3,
+                             av2_cfl_get_luma_subsampling_444_hbd_ssse3)
 };
 
 INSTANTIATE_TEST_SUITE_P(SSSE3, CFLSubsampleHBDTest,
@@ -830,19 +832,19 @@
 
 #if HAVE_AVX2
 const sub_avg_param sub_avg_sizes_avx2[] = { ALL_CFL_TX_SIZES(
-    cfl_get_subtract_average_fn_avx2) };
+    av2_cfl_get_subtract_average_fn_avx2) };
 
 INSTANTIATE_TEST_SUITE_P(AVX2, CFLSubAvgTest,
                          ::testing::ValuesIn(sub_avg_sizes_avx2));
 
 const subsample_hbd_param subsample_hbd_sizes_avx2[] = {
-  ALL_CFL_TX_SIZES_SUBSAMPLE(cfl_get_luma_subsampling_420_hbd_avx2,
-                             cfl_get_luma_subsampling_422_hbd_avx2,
-                             cfl_get_luma_subsampling_444_hbd_avx2)
+  ALL_CFL_TX_SIZES_SUBSAMPLE(av2_cfl_get_luma_subsampling_420_hbd_avx2,
+                             av2_cfl_get_luma_subsampling_422_hbd_avx2,
+                             av2_cfl_get_luma_subsampling_444_hbd_avx2)
 };
 
 const predict_param_hbd predict_sizes_hbd_avx2[] = { ALL_CFL_TX_SIZES(
-    cfl_get_predict_hbd_fn_avx2) };
+    av2_cfl_get_predict_hbd_fn_avx2) };
 
 INSTANTIATE_TEST_SUITE_P(AVX2, CFLSubsampleHBDTest,
                          ::testing::ValuesIn(subsample_hbd_sizes_avx2));
@@ -853,19 +855,19 @@
 
 #if HAVE_NEON
 const sub_avg_param sub_avg_sizes_neon[] = { ALL_CFL_TX_SIZES(
-    cfl_get_subtract_average_fn_neon) };
+    av2_cfl_get_subtract_average_fn_neon) };
 
 INSTANTIATE_TEST_SUITE_P(NEON, CFLSubAvgTest,
                          ::testing::ValuesIn(sub_avg_sizes_neon));
 
 const subsample_hbd_param subsample_hbd_sizes_neon[] = {
-  ALL_CFL_TX_SIZES_SUBSAMPLE(cfl_get_luma_subsampling_420_hbd_neon,
-                             cfl_get_luma_subsampling_422_hbd_neon,
-                             cfl_get_luma_subsampling_444_hbd_neon)
+  ALL_CFL_TX_SIZES_SUBSAMPLE(av2_cfl_get_luma_subsampling_420_hbd_neon,
+                             av2_cfl_get_luma_subsampling_422_hbd_neon,
+                             av2_cfl_get_luma_subsampling_444_hbd_neon)
 };
 
 const predict_param_hbd predict_sizes_hbd_neon[] = { ALL_CFL_TX_SIZES(
-    cfl_get_predict_hbd_fn_neon) };
+    av2_cfl_get_predict_hbd_fn_neon) };
 
 INSTANTIATE_TEST_SUITE_P(NEON, CFLSubsampleHBDTest,
                          ::testing::ValuesIn(subsample_hbd_sizes_neon));
@@ -876,7 +878,7 @@
 
 #if HAVE_VSX
 const sub_avg_param sub_avg_sizes_vsx[] = { ALL_CFL_TX_SIZES(
-    cfl_get_subtract_average_fn_vsx) };
+    av2_cfl_get_subtract_average_fn_vsx) };
 
 INSTANTIATE_TEST_SUITE_P(VSX, CFLSubAvgTest,
                          ::testing::ValuesIn(sub_avg_sizes_vsx));
diff --git a/test/ec_test.cc b/test/ec_test.cc
index 1651153..58fea41 100644
--- a/test/ec_test.cc
+++ b/test/ec_test.cc
@@ -39,7 +39,7 @@
     seed = 0xdaa1a;
   }
   srand(seed);
-  od_ec_enc_init(&enc, 1);
+  avm_od_ec_enc_init(&enc, 1);
   /*Test compatibility between multiple different encode/decode routines.*/
   for (i = 0; i < 409600; i++) {
     unsigned *fz;
@@ -56,8 +56,8 @@
     mode = (unsigned *)malloc(sz * sizeof(*mode));
     tell = (unsigned long *)malloc((sz + 1) * sizeof(*tell));
     enc_method = (unsigned *)malloc(sz * sizeof(*enc_method));
-    od_ec_enc_reset(&enc);
-    tell[0] = od_ec_enc_tell_frac(&enc);
+    avm_od_ec_enc_reset(&enc);
+    tell[0] = avm_od_ec_enc_tell_frac(&enc);
     for (j = 0; j < sz; j++) {
       data[j] = rand();
       mode[j] = rand();
@@ -98,25 +98,26 @@
           uint16_t cdf[16] = {};
           cdf[0] = OD_ICDF(fz[j]);
           cdf[1] = OD_ICDF(1U << fts[j]);
-          od_ec_encode_cdf_q15(&enc, data[j], cdf, 2);
+          avm_od_ec_encode_cdf_q15(&enc, data[j], cdf, 2);
           break;
         }
       }
 
-      tell[j + 1] = od_ec_enc_tell_frac(&enc);
+      tell[j + 1] = avm_od_ec_enc_tell_frac(&enc);
     }
-    ptr = od_ec_enc_done(&enc, &ptr_sz);
-    EXPECT_GE(((od_ec_enc_tell(&enc) + 7U) >> 3), ptr_sz)
-        << "od_ec_enc_tell() lied: "
+    ptr = avm_od_ec_enc_done(&enc, &ptr_sz);
+    EXPECT_GE(((avm_od_ec_enc_tell(&enc) + 7U) >> 3), ptr_sz)
+        << "avm_od_ec_enc_tell() lied: "
            "there's "
-        << ptr_sz << " bytes instead of " << ((od_ec_enc_tell(&enc) + 7) >> 3)
-        << " (Random seed: " << seed << ")\n";
-    od_ec_dec_init(&dec, ptr, ptr_sz);
-    EXPECT_EQ(od_ec_dec_tell_frac(&dec), tell[0])
-        << "od_ec_dec_tell() mismatch between encoder and decoder "
+        << ptr_sz << " bytes instead of "
+        << ((avm_od_ec_enc_tell(&enc) + 7) >> 3) << " (Random seed: " << seed
+        << ")\n";
+    avm_od_ec_dec_init(&dec, ptr, ptr_sz);
+    EXPECT_EQ(avm_od_ec_dec_tell_frac(&dec), tell[0])
+        << "avm_od_ec_dec_tell() mismatch between encoder and decoder "
            "at symbol 0: "
-        << (unsigned long)od_ec_dec_tell_frac(&dec) << " instead of " << tell[0]
-        << " (Random seed: " << seed << ").\n";
+        << (unsigned long)avm_od_ec_dec_tell_frac(&dec) << " instead of "
+        << tell[0] << " (Random seed: " << seed << ").\n";
     for (j = 0; j < sz; j++) {
       int dec_method;
       unsigned int sym = data[j] + 1;  // Initialize sym to an invalid value.
@@ -148,7 +149,7 @@
           uint16_t cdf[16] = {};
           cdf[0] = OD_ICDF(fz[j]);
           cdf[1] = OD_ICDF(1U << fts[j]);
-          sym = od_ec_decode_cdf_q15(&dec, cdf, 2);
+          sym = avm_od_ec_decode_cdf_q15(&dec, cdf, 2);
           break;
         }
       }
@@ -159,10 +160,10 @@
           << j << " of " << sz << " (Random seed: " << seed << ").\n"
           << "Encoding method: " << enc_method[j]
           << " decoding method: " << dec_method << "\n";
-      EXPECT_EQ(od_ec_dec_tell_frac(&dec), tell[j + 1])
-          << "od_ec_dec_tell() mismatch between encoder and "
+      EXPECT_EQ(avm_od_ec_dec_tell_frac(&dec), tell[j + 1])
+          << "avm_od_ec_dec_tell() mismatch between encoder and "
              "decoder at symbol "
-          << j + 1 << ": " << (unsigned long)od_ec_dec_tell_frac(&dec)
+          << j + 1 << ": " << (unsigned long)avm_od_ec_dec_tell_frac(&dec)
           << " instead of " << tell[j + 1] << " (Random seed: " << seed
           << ").\n";
     }
@@ -173,31 +174,31 @@
     free(fts);
     free(fz);
   }
-  od_ec_enc_reset(&enc);
+  avm_od_ec_enc_reset(&enc);
   if (CDF_SHIFT == 0) {
     od_ec_encode_literal_bypass(&enc, 0, 1);
     od_ec_encode_literal_bypass(&enc, 0, 1);
     od_ec_encode_literal_bypass(&enc, 0, 1);
     od_ec_encode_literal_bypass(&enc, 0, 1);
-    od_ec_encode_bool_q15(&enc, 0, OD_ICDF(24576));
+    avm_od_ec_encode_bool_q15(&enc, 0, OD_ICDF(24576));
     od_ec_enc_patch_initial_bits(&enc, 3, 2);
     EXPECT_FALSE(enc.error) << "od_ec_enc_patch_initial_bits() failed.\n";
     od_ec_enc_patch_initial_bits(&enc, 0, 5);
     EXPECT_TRUE(enc.error)
         << "od_ec_enc_patch_initial_bits() didn't fail when it should have.\n";
-    od_ec_enc_reset(&enc);
+    avm_od_ec_enc_reset(&enc);
     od_ec_encode_literal_bypass(&enc, 0, 1);
     od_ec_encode_literal_bypass(&enc, 0, 1);
-    od_ec_encode_bool_q15(&enc, 1, OD_ICDF(32256));
-    od_ec_encode_bool_q15(&enc, 0, OD_ICDF(24576));
+    avm_od_ec_encode_bool_q15(&enc, 1, OD_ICDF(32256));
+    avm_od_ec_encode_bool_q15(&enc, 0, OD_ICDF(24576));
     od_ec_enc_patch_initial_bits(&enc, 0, 2);
     EXPECT_FALSE(enc.error) << "od_ec_enc_patch_initial_bits() failed.\n";
-    ptr = od_ec_enc_done(&enc, &ptr_sz);
+    ptr = avm_od_ec_enc_done(&enc, &ptr_sz);
     EXPECT_EQ(ptr_sz, 2u);
     EXPECT_EQ(ptr[0], 63)
         << "Got " << ptr[0]
         << " when expecting 63 for od_ec_enc_patch_initial_bits().\n";
   }
-  od_ec_enc_clear(&enc);
+  avm_od_ec_enc_clear(&enc);
   EXPECT_EQ(ret, 0);
 }