Commit bb1a2365 authored by JackyChen's avatar JackyChen

Change the control function of VP9 denoiser.

Change from VP8E_SET_NOISE_SENSITIVITY to VP9E_SET_NOISE_SENSITIVITY

Change-Id: Ia210a7029b26924e30973f0f9798a338e0412407
parent 3e7b04af
...@@ -586,7 +586,7 @@ int main(int argc, char **argv) { ...@@ -586,7 +586,7 @@ int main(int argc, char **argv) {
vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed); vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3); vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
vpx_codec_control(&codec, VP9E_SET_FRAME_PERIODIC_BOOST, 0); vpx_codec_control(&codec, VP9E_SET_FRAME_PERIODIC_BOOST, 0);
vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, 0); vpx_codec_control(&codec, VP9E_SET_NOISE_SENSITIVITY, 0);
if (vpx_codec_control(&codec, VP9E_SET_SVC, 1)) { if (vpx_codec_control(&codec, VP9E_SET_SVC, 1)) {
die_codec(&codec, "Failed to set SVC"); die_codec(&codec, "Failed to set SVC");
} }
......
...@@ -555,7 +555,7 @@ static vpx_codec_err_t ctrl_set_enable_auto_alt_ref(vpx_codec_alg_priv_t *ctx, ...@@ -555,7 +555,7 @@ static vpx_codec_err_t ctrl_set_enable_auto_alt_ref(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t ctrl_set_noise_sensitivity(vpx_codec_alg_priv_t *ctx, static vpx_codec_err_t ctrl_set_noise_sensitivity(vpx_codec_alg_priv_t *ctx,
va_list args) { va_list args) {
struct vp9_extracfg extra_cfg = ctx->extra_cfg; struct vp9_extracfg extra_cfg = ctx->extra_cfg;
extra_cfg.noise_sensitivity = CAST(VP8E_SET_NOISE_SENSITIVITY, args); extra_cfg.noise_sensitivity = CAST(VP9E_SET_NOISE_SENSITIVITY, args);
return update_extra_cfg(ctx, &extra_cfg); return update_extra_cfg(ctx, &extra_cfg);
} }
...@@ -1240,7 +1240,6 @@ static vpx_codec_ctrl_fn_map_t encoder_ctrl_maps[] = { ...@@ -1240,7 +1240,6 @@ static vpx_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
{VP8E_SET_ACTIVEMAP, ctrl_set_active_map}, {VP8E_SET_ACTIVEMAP, ctrl_set_active_map},
{VP8E_SET_SCALEMODE, ctrl_set_scale_mode}, {VP8E_SET_SCALEMODE, ctrl_set_scale_mode},
{VP8E_SET_CPUUSED, ctrl_set_cpuused}, {VP8E_SET_CPUUSED, ctrl_set_cpuused},
{VP8E_SET_NOISE_SENSITIVITY, ctrl_set_noise_sensitivity},
{VP8E_SET_ENABLEAUTOALTREF, ctrl_set_enable_auto_alt_ref}, {VP8E_SET_ENABLEAUTOALTREF, ctrl_set_enable_auto_alt_ref},
{VP8E_SET_SHARPNESS, ctrl_set_sharpness}, {VP8E_SET_SHARPNESS, ctrl_set_sharpness},
{VP8E_SET_STATIC_THRESHOLD, ctrl_set_static_thresh}, {VP8E_SET_STATIC_THRESHOLD, ctrl_set_static_thresh},
...@@ -1260,6 +1259,7 @@ static vpx_codec_ctrl_fn_map_t encoder_ctrl_maps[] = { ...@@ -1260,6 +1259,7 @@ static vpx_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
{VP9E_SET_SVC_PARAMETERS, ctrl_set_svc_parameters}, {VP9E_SET_SVC_PARAMETERS, ctrl_set_svc_parameters},
{VP9E_SET_SVC_LAYER_ID, ctrl_set_svc_layer_id}, {VP9E_SET_SVC_LAYER_ID, ctrl_set_svc_layer_id},
{VP9E_SET_TUNE_CONTENT, ctrl_set_tune_content}, {VP9E_SET_TUNE_CONTENT, ctrl_set_tune_content},
{VP9E_SET_NOISE_SENSITIVITY, ctrl_set_noise_sensitivity},
// Getters // Getters
{VP8E_GET_LAST_QUANTIZER, ctrl_get_quantizer}, {VP8E_GET_LAST_QUANTIZER, ctrl_get_quantizer},
......
...@@ -148,7 +148,12 @@ enum vp8e_enc_control_id { ...@@ -148,7 +148,12 @@ enum vp8e_enc_control_id {
*/ */
VP8E_SET_CPUUSED = 13, VP8E_SET_CPUUSED = 13,
VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */ VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */
VP8E_SET_NOISE_SENSITIVITY, /**< control function to set noise sensitivity */ /*!\brief control function to set noise sensitivity
*
* 0: off, 1: OnYOnly, 2: OnYUV,
* 3: OnYUVAggressive, 4: Adaptive
*/
VP8E_SET_NOISE_SENSITIVITY,
VP8E_SET_SHARPNESS, /**< control function to set sharpness */ VP8E_SET_SHARPNESS, /**< control function to set sharpness */
VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */ VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */
VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */ VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */
...@@ -197,6 +202,11 @@ enum vp8e_enc_control_id { ...@@ -197,6 +202,11 @@ enum vp8e_enc_control_id {
VP9E_SET_FRAME_PARALLEL_DECODING, VP9E_SET_FRAME_PARALLEL_DECODING,
VP9E_SET_AQ_MODE, VP9E_SET_AQ_MODE,
VP9E_SET_FRAME_PERIODIC_BOOST, VP9E_SET_FRAME_PERIODIC_BOOST,
/*!\brief control function to set noise sensitivity
*
* 0: off, 1: OnYOnly
*/
VP9E_SET_NOISE_SENSITIVITY,
VP9E_SET_SVC, VP9E_SET_SVC,
VP9E_SET_SVC_PARAMETERS, VP9E_SET_SVC_PARAMETERS,
...@@ -377,6 +387,8 @@ VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int) ...@@ -377,6 +387,8 @@ VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int) VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int)
VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int)
VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */ VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
/*! @} - end defgroup vp8_encoder */ /*! @} - end defgroup vp8_encoder */
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -415,10 +415,11 @@ static const arg_def_t tune_content = ARG_DEF_ENUM( ...@@ -415,10 +415,11 @@ static const arg_def_t tune_content = ARG_DEF_ENUM(
NULL, "tune-content", 1, "Tune content type", tune_content_enum); NULL, "tune-content", 1, "Tune content type", tune_content_enum);
static const arg_def_t *vp9_args[] = { static const arg_def_t *vp9_args[] = {
&cpu_used, &auto_altref, &noise_sens, &sharpness, &static_thresh, &cpu_used, &auto_altref, &sharpness, &static_thresh,
&tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type, &tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type,
&tune_ssim, &cq_level, &max_intra_rate_pct, &lossless, &tune_ssim, &cq_level, &max_intra_rate_pct, &lossless,
&frame_parallel_decoding, &aq_mode, &frame_periodic_boost, &tune_content, &frame_parallel_decoding, &aq_mode, &frame_periodic_boost,
&noise_sens, &tune_content,
#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH
&bitdeptharg, &inbitdeptharg, &bitdeptharg, &inbitdeptharg,
#endif #endif
...@@ -426,12 +427,13 @@ static const arg_def_t *vp9_args[] = { ...@@ -426,12 +427,13 @@ static const arg_def_t *vp9_args[] = {
}; };
static const int vp9_arg_ctrl_map[] = { static const int vp9_arg_ctrl_map[] = {
VP8E_SET_CPUUSED, VP8E_SET_ENABLEAUTOALTREF, VP8E_SET_CPUUSED, VP8E_SET_ENABLEAUTOALTREF,
VP8E_SET_NOISE_SENSITIVITY, VP8E_SET_SHARPNESS, VP8E_SET_STATIC_THRESHOLD, VP8E_SET_SHARPNESS, VP8E_SET_STATIC_THRESHOLD,
VP9E_SET_TILE_COLUMNS, VP9E_SET_TILE_ROWS, VP9E_SET_TILE_COLUMNS, VP9E_SET_TILE_ROWS,
VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE, VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE,
VP8E_SET_TUNING, VP8E_SET_CQ_LEVEL, VP8E_SET_MAX_INTRA_BITRATE_PCT, VP8E_SET_TUNING, VP8E_SET_CQ_LEVEL, VP8E_SET_MAX_INTRA_BITRATE_PCT,
VP9E_SET_LOSSLESS, VP9E_SET_FRAME_PARALLEL_DECODING, VP9E_SET_AQ_MODE, VP9E_SET_LOSSLESS, VP9E_SET_FRAME_PARALLEL_DECODING, VP9E_SET_AQ_MODE,
VP9E_SET_FRAME_PERIODIC_BOOST, VP9E_SET_TUNE_CONTENT, VP9E_SET_FRAME_PERIODIC_BOOST, VP9E_SET_NOISE_SENSITIVITY,
VP9E_SET_TUNE_CONTENT,
0 0
}; };
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment