]> granicus.if.org Git - libvpx/commitdiff
Revert "Add VPX_TUNE_SSIM and VPX_TUNE_PSNR enums"
authorSai Deng <sdeng@google.com>
Tue, 23 Apr 2019 22:59:34 +0000 (22:59 +0000)
committerSai Deng <sdeng@google.com>
Tue, 23 Apr 2019 23:02:55 +0000 (23:02 +0000)
This reverts commit 1d8d8f562bf382e47071bb38d13b7ded366820af.

Reason for revert: change the api names will break existing code.

Original change's description:
> Add VPX_TUNE_SSIM and VPX_TUNE_PSNR enums
>
> Change-Id: I3df5af2c60b774e6d395062077542c52db868236

TBR=jingning@google.com,builds@webmproject.org,sdeng@google.com

Change-Id: Ic94c19739f595f4544e8b68892ab9d9c1bbccd79
No-Presubmit: true
No-Tree-Checks: true
No-Try: true

vp8/common/onyx.h
vp8/encoder/encodeframe.c
vp8/encoder/ethreading.c
vp8/vp8_cx_iface.c
vp9/encoder/vp9_encodeframe.c
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vp9/vp9_cx_iface.c
vpx/vp8cx.h
vpxenc.c

index adc8326644df15a9b17e064215fcbe93894d205e..05c72df3faa446da47331ebda3ec0a5c638c7d59 100644 (file)
@@ -217,7 +217,7 @@ typedef struct {
   vpx_fixed_buf_t two_pass_stats_in;
   struct vpx_codec_pkt_list *output_pkt_list;
 
-  vpx_tuning tuning;
+  vp8e_tuning tuning;
 
   /* Temporal scaling parameters */
   unsigned int number_of_layers;
index 624d60c95747df7d6b89372097e27fd4aadebed5..2b3d9564ce20ab2ce20940550bcc94ec91f01cb7 100644 (file)
@@ -426,7 +426,7 @@ static void encode_mb_row(VP8_COMP *cpi, VP8_COMMON *cm, int mb_row,
     }
 #endif
 
-    if (cpi->oxcf.tuning == VPX_TUNE_SSIM) vp8_activity_masking(cpi, x);
+    if (cpi->oxcf.tuning == VP8_TUNE_SSIM) vp8_activity_masking(cpi, x);
 
     /* Is segmentation enabled */
     /* MB level adjustment to quantizer */
@@ -720,7 +720,7 @@ void vp8_encode_frame(VP8_COMP *cpi) {
 
   vp8cx_initialize_me_consts(cpi, cm->base_qindex);
 
-  if (cpi->oxcf.tuning == VPX_TUNE_SSIM) {
+  if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
     /* Initialize encode frame context. */
     init_encode_frame_mb_context(cpi);
 
@@ -1086,7 +1086,7 @@ int vp8cx_encode_intra_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
     vp8_pick_intra_mode(x, &rate);
   }
 
-  if (cpi->oxcf.tuning == VPX_TUNE_SSIM) {
+  if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
     adjust_act_zbin(cpi, x);
     vp8_update_zbin_extra(cpi, x);
   }
@@ -1172,7 +1172,7 @@ int vp8cx_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x, TOKENEXTRA **t,
   x->prediction_error += distortion;
   x->intra_error += intra_error;
 
-  if (cpi->oxcf.tuning == VPX_TUNE_SSIM) {
+  if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
     /* Adjust the zbin based on this MB rate. */
     adjust_act_zbin(cpi, x);
   }
index 7714d9d7640273341d4e684774aae9ce30686e28..55a1528b14a34872099c412b623f24854b355cb4 100644 (file)
@@ -149,7 +149,7 @@ static THREAD_FUNCTION thread_encoding_proc(void *p_data) {
           /* Copy current mb to a buffer */
           vp8_copy_mem16x16(x->src.y_buffer, x->src.y_stride, x->thismb, 16);
 
-          if (cpi->oxcf.tuning == VPX_TUNE_SSIM) vp8_activity_masking(cpi, x);
+          if (cpi->oxcf.tuning == VP8_TUNE_SSIM) vp8_activity_masking(cpi, x);
 
           /* Is segmentation enabled */
           /* MB level adjustment to quantizer */
index bd291201f1a273ffbd153a49c633faa5e5161576..d65bf9652e41acd231e6f0499b057547c473552a 100644 (file)
@@ -38,7 +38,7 @@ struct vp8_extracfg {
   unsigned int arnr_max_frames; /* alt_ref Noise Reduction Max Frame Count */
   unsigned int arnr_strength;   /* alt_ref Noise Reduction Strength */
   unsigned int arnr_type;       /* alt_ref filter type */
-  vpx_tuning tuning;
+  vp8e_tuning tuning;
   unsigned int cq_level; /* constrained quality level */
   unsigned int rc_max_intra_bitrate_pct;
   unsigned int gf_cbr_boost_pct;
index f41dfa020e7f18d1c71e5a1073bd289283aa128b..a5d59b69ba2d3cd1ac7cc70a5ae14fd55fc79b8f 100644 (file)
@@ -269,7 +269,7 @@ static double get_ssim_rdmult_scaling_factor(VP9_COMP *const cpi, int mi_row,
   const int col = mi_col / num_8x8_w;
   const int index = row * num_cols + col;
 
-  assert(cpi->oxcf.tuning == VPX_TUNE_SSIM);
+  assert(cpi->oxcf.tuning == VP8_TUNE_SSIM);
   vpx_clear_system_state();
   return cpi->mi_ssim_rdmult_scaling_factors[index];
 }
@@ -309,7 +309,7 @@ static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
   // R/D setup.
   x->rddiv = cpi->rd.RDDIV;
   x->rdmult = cpi->rd.RDMULT;
-  if (oxcf->tuning == VPX_TUNE_SSIM) {
+  if (oxcf->tuning == VP8_TUNE_SSIM) {
     const double ssim_factor =
         get_ssim_rdmult_scaling_factor(cpi, mi_row, mi_col);
     x->rdmult = (int)(ssim_factor * x->rdmult);
@@ -1961,7 +1961,7 @@ static void set_segment_rdmult(VP9_COMP *const cpi, MACROBLOCK *const x,
     }
   }
 
-  if (oxcf->tuning == VPX_TUNE_SSIM) {
+  if (oxcf->tuning == VP8_TUNE_SSIM) {
     const double ssim_factor =
         get_ssim_rdmult_scaling_factor(cpi, mi_row, mi_col);
     x->rdmult = (int)(ssim_factor * x->rdmult);
@@ -2207,7 +2207,7 @@ static void encode_b(VP9_COMP *cpi, const TileInfo *const tile, ThreadData *td,
       cpi->oxcf.aq_mode == NO_AQ) {
     const VP9EncoderConfig *const oxcf = &cpi->oxcf;
     x->rdmult = x->cb_rdmult;
-    if (oxcf->tuning == VPX_TUNE_SSIM) {
+    if (oxcf->tuning == VP8_TUNE_SSIM) {
       const double ssim_factor =
           get_ssim_rdmult_scaling_factor(cpi, mi_row, mi_col);
       x->rdmult = (int)(ssim_factor * x->rdmult);
@@ -3823,7 +3823,7 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td,
   uint8_t ref_frames_used[4] = { 0, 0, 0, 0 };
 
   int partition_mul = x->cb_rdmult;
-  if (oxcf->tuning == VPX_TUNE_SSIM) {
+  if (oxcf->tuning == VP8_TUNE_SSIM) {
     const double ssim_factor =
         get_ssim_rdmult_scaling_factor(cpi, mi_row, mi_col);
     partition_mul = (int)(ssim_factor * partition_mul);
index 353b026b025f71a710398e52439fcedb7bc17270..f7e3237dc0205ea405cb94be5773f11a16045042 100644 (file)
@@ -5022,7 +5022,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, size_t *size,
     }
   }
 
-  if (oxcf->tuning == VPX_TUNE_SSIM) set_mb_ssim_rdmult_scaling(cpi);
+  if (oxcf->tuning == VP8_TUNE_SSIM) set_mb_ssim_rdmult_scaling(cpi);
 
   set_mb_wiener_variance(cpi);
 
index 73592fdfe08046cc7c63bdcb41ee0f7b2ac9b360..5eec17d59c3fd8e1b9f6b6db19b8cf68a1a9a12d 100644 (file)
@@ -262,7 +262,7 @@ typedef struct VP9EncoderConfig {
   vpx_fixed_buf_t firstpass_mb_stats_in;
 #endif
 
-  vpx_tuning tuning;
+  vp8e_tuning tuning;
   vp9e_tune_content content;
 #if CONFIG_VP9_HIGHBITDEPTH
   int use_highbitdepth;
index 1911011139c124937fe0c48551b31b0934d6b0a3..56588285670a9c05e069f6e42bccd4f5b4108189 100644 (file)
@@ -35,7 +35,7 @@ struct vp9_extracfg {
   unsigned int arnr_strength;
   unsigned int min_gf_interval;
   unsigned int max_gf_interval;
-  vpx_tuning tuning;
+  vp8e_tuning tuning;
   unsigned int cq_level;  // constrained quality level
   unsigned int rc_max_intra_bitrate_pct;
   unsigned int rc_max_inter_bitrate_pct;
@@ -69,7 +69,7 @@ static struct vp9_extracfg default_extra_cfg = {
   5,                     // arnr_strength
   0,                     // min_gf_interval; 0 -> default decision
   0,                     // max_gf_interval; 0 -> default decision
-  VPX_TUNE_PSNR,         // tuning
+  VP8_TUNE_PSNR,         // tuning
   10,                    // cq_level
   0,                     // rc_max_intra_bitrate_pct
   0,                     // rc_max_inter_bitrate_pct
index ff85a096c2c638e53f0b6088ae6f0ee21df3a514..0aef1ff32299d70b81e1e064a7f0a98a7c964e03 100644 (file)
@@ -782,12 +782,12 @@ typedef enum {
   VP9E_CONTENT_INVALID
 } vp9e_tune_content;
 
-/*!\brief VPX model tuning parameters
+/*!\brief VP8 model tuning parameters
  *
  * Changes the encoder to tune for certain types of input material.
  *
  */
-typedef enum { VPX_TUNE_PSNR, VPX_TUNE_SSIM } vpx_tuning;
+typedef enum { VP8_TUNE_PSNR, VP8_TUNE_SSIM } vp8e_tuning;
 
 /*!\brief  vp9 svc layer parameters
  *
@@ -911,7 +911,7 @@ VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int)
 #define VPX_CTRL_VP8E_SET_ARNR_STRENGTH
 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int)
 #define VPX_CTRL_VP8E_SET_ARNR_TYPE
-VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vpx_tuning */
+VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
 #define VPX_CTRL_VP8E_SET_TUNING
 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
 #define VPX_CTRL_VP8E_SET_CQ_LEVEL
index c6cb03c4f5a35e4d0d47ec1b852ff49f8c6b3073..fc640f6444aa3c4c92762347c15825bd567b52b1 100644 (file)
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -320,8 +320,8 @@ static const arg_def_t arnr_strength =
     ARG_DEF(NULL, "arnr-strength", 1, "AltRef filter strength (0..6)");
 static const arg_def_t arnr_type =
     ARG_DEF(NULL, "arnr-type", 1, "AltRef filter type (1..3)");
-static const struct arg_enum_list tuning_enum[] = { { "psnr", VPX_TUNE_PSNR },
-                                                    { "ssim", VPX_TUNE_SSIM },
+static const struct arg_enum_list tuning_enum[] = { { "psnr", VP8_TUNE_PSNR },
+                                                    { "ssim", VP8_TUNE_SSIM },
                                                     { NULL, 0 } };
 static const arg_def_t tune_ssim =
     ARG_DEF_ENUM(NULL, "tune", 1, "Material to favor", tuning_enum);