Add Vpx* prefix to Tpl{Block,Frame}Stats
authorJerome Jiang <jianj@google.com>
Thu, 4 May 2023 14:32:03 +0000 (10:32 -0400)
committerJerome Jiang <jianj@google.com>
Thu, 4 May 2023 14:33:07 +0000 (10:33 -0400)
This is to avoid symbols redifinition when integrating with other
libraries.

Bug: b/273736974
Change-Id: I891af78b1907504d5bb9f735164aea18c2aba944

test/encode_api_test.cc
test/encode_test_driver.h
vp9/encoder/vp9_encoder.h
vp9/encoder/vp9_tpl_model.c
vp9/vp9_cx_iface.c
vpx/vp8cx.h
vpx/vpx_encoder.h

index eac9626..0514cd8 100644 (file)
@@ -384,10 +384,11 @@ class EncodeApiGetTplStatsTest
     }
   }
 
-  vpx_codec_err_t AllocateTplList(TplFrameStats **data) {
-    // Allocate MAX_ARF_GOP_SIZE * sizeof(TplFrameStats) that will be filled
+  vpx_codec_err_t AllocateTplList(VpxTplFrameStats **data) {
+    // Allocate MAX_ARF_GOP_SIZE * sizeof(VpxTplFrameStats) that will be filled
     // by VP9E_GET_TPL_STATS
-    *data = static_cast<TplFrameStats *>(calloc(50, sizeof(TplFrameStats)));
+    *data =
+        static_cast<VpxTplFrameStats *>(calloc(50, sizeof(VpxTplFrameStats)));
     if (*data == nullptr) return VPX_CODEC_MEM_ERROR;
     return VPX_CODEC_OK;
   }
@@ -397,7 +398,7 @@ class EncodeApiGetTplStatsTest
     while (const vpx_codec_cx_pkt_t *pkt = iter.Next()) {
       switch (pkt->kind) {
         case VPX_CODEC_CX_FRAME_PKT: {
-          TplFrameStats *tpl_stats = NULL;
+          VpxTplFrameStats *tpl_stats = NULL;
           EXPECT_EQ(AllocateTplList(&tpl_stats), VPX_CODEC_OK);
           encoder->Control(VP9E_GET_TPL_STATS, tpl_stats);
           bool stats_not_all_zero = false;
index 27a78e6..a5cd830 100644 (file)
@@ -154,7 +154,7 @@ class Encoder {
     ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
   }
 
-  void Control(int ctrl_id, TplFrameStats *arg) {
+  void Control(int ctrl_id, VpxTplFrameStats *arg) {
     const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
     ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
   }
index 742cf0b..cca1617 100644 (file)
@@ -745,7 +745,7 @@ typedef struct VP9_COMP {
   BLOCK_SIZE tpl_bsize;
   TplDepFrame tpl_stats[MAX_ARF_GOP_SIZE];
   // Used to store TPL stats before propagation
-  TplFrameStats tpl_frame_stats[MAX_ARF_GOP_SIZE];
+  VpxTplFrameStats tpl_frame_stats[MAX_ARF_GOP_SIZE];
   YV12_BUFFER_CONFIG *tpl_recon_frames[REF_FRAMES];
   EncFrameBuf enc_frame_buf[REF_FRAMES];
 #if CONFIG_MULTITHREAD
index b62c66b..ea5d61e 100644 (file)
@@ -154,7 +154,7 @@ static void init_tpl_stats(VP9_COMP *cpi) {
   int frame_idx;
   for (frame_idx = 0; frame_idx < MAX_ARF_GOP_SIZE; ++frame_idx) {
     TplDepFrame *tpl_frame = &cpi->tpl_stats[frame_idx];
-    TplFrameStats *tpl_frame_stats = &cpi->tpl_frame_stats[frame_idx];
+    VpxTplFrameStats *tpl_frame_stats = &cpi->tpl_frame_stats[frame_idx];
     memset(tpl_frame->tpl_stats_ptr, 0,
            tpl_frame->height * tpl_frame->width *
                sizeof(*tpl_frame->tpl_stats_ptr));
@@ -356,7 +356,7 @@ static void tpl_model_store(TplDepStats *tpl_stats, int mi_row, int mi_col,
   }
 }
 
-static void tpl_store_before_propagation(TplBlockStats *tpl_block_stats,
+static void tpl_store_before_propagation(VpxTplBlockStats *tpl_block_stats,
                                          TplDepStats *tpl_stats, int mi_row,
                                          int mi_col, BLOCK_SIZE bsize,
                                          int stride, int64_t recon_error,
@@ -368,7 +368,7 @@ static void tpl_store_before_propagation(TplBlockStats *tpl_block_stats,
 
   for (idy = 0; idy < mi_height; ++idy) {
     for (idx = 0; idx < mi_width; ++idx) {
-      TplBlockStats *tpl_block_stats_ptr =
+      VpxTplBlockStats *tpl_block_stats_ptr =
           &tpl_block_stats[(mi_row + idy) * stride + mi_col + idx];
       tpl_block_stats_ptr->inter_cost = src_stats->inter_cost;
       tpl_block_stats_ptr->intra_cost = src_stats->intra_cost;
@@ -1105,7 +1105,7 @@ static void build_motion_field(
 static void mc_flow_dispenser(VP9_COMP *cpi, GF_PICTURE *gf_picture,
                               int frame_idx, BLOCK_SIZE bsize) {
   TplDepFrame *tpl_frame = &cpi->tpl_stats[frame_idx];
-  TplFrameStats *tpl_frame_stats_before_propagation =
+  VpxTplFrameStats *tpl_frame_stats_before_propagation =
       &cpi->tpl_frame_stats[frame_idx];
   YV12_BUFFER_CONFIG *this_frame = gf_picture[frame_idx].frame;
   YV12_BUFFER_CONFIG *ref_frame[MAX_INTER_REF_FRAMES] = { NULL, NULL, NULL };
index 8bd880c..66efba1 100644 (file)
@@ -1791,7 +1791,7 @@ static vpx_codec_err_t ctrl_get_svc_ref_frame_config(vpx_codec_alg_priv_t *ctx,
 static vpx_codec_err_t ctrl_get_tpl_stats(vpx_codec_alg_priv_t *ctx,
                                           va_list args) {
   VP9_COMP *const cpi = ctx->cpi;
-  TplFrameStats *data = va_arg(args, TplFrameStats *);
+  VpxTplFrameStats *data = va_arg(args, VpxTplFrameStats *);
   int i;
   if (data == NULL) {
     return VPX_CODEC_INVALID_PARAM;
index 123a645..c4e0408 100644 (file)
@@ -771,7 +771,7 @@ enum vp8e_enc_control_id {
   /*!\brief Codec control to get TPL stats for the current GOP.
    *
    * Allocation and free of memory of size MAX_ARF_GOP_SIZE (50) *
-   * sizeof(TplFrameStats) should be done by applications.
+   * sizeof(VpxTplFrameStats) should be done by applications.
    *
    * VPX_CODEC_INVALID_PARAM will be returned if the pointer passed in is NULL.
    *
index 1910a19..66c5a68 100644 (file)
@@ -253,7 +253,7 @@ enum vpx_kf_mode {
 };
 
 /*!\brief Temporal dependency model stats for each block before propagation */
-typedef struct TplBlockStats {
+typedef struct VpxTplBlockStats {
   int64_t intra_cost;  /**< Intra cost */
   int64_t inter_cost;  /**< Inter cost */
   int16_t mv_r;        /**< Motion vector row */
@@ -261,15 +261,15 @@ typedef struct TplBlockStats {
   int64_t recrf_rate;  /**< Rate from reconstructed ref frame */
   int64_t recrf_dist;  /**< Distortion from reconstructed ref frame */
   int ref_frame_index; /**< Ref frame index */
-} TplBlockStats;
+} VpxTplBlockStats;
 
 /*!\brief Temporal dependency model stats for each frame before propagation */
-typedef struct TplFrameStats {
+typedef struct VpxTplFrameStats {
   int frame_width;  /**< Frame width */
   int frame_height; /**< Frame height */
   // Size of the list can be calculated from frame_width and frame_height.
-  TplBlockStats *block_stats_list; /**< List of tpl stats for each block */
-} TplFrameStats;
+  VpxTplBlockStats *block_stats_list; /**< List of tpl stats for each block */
+} VpxTplFrameStats;
 
 /*!\brief Encoded Frame Flags
  *