From 78bb8e1c0a9b386b983c4e7cadf2ffb7b3b52bd5 Mon Sep 17 00:00:00 2001 From: Jerome Jiang Date: Wed, 22 Mar 2023 20:18:39 +0000 Subject: [PATCH] Revert "Add codec control to get tpl stats" This reverts commit 9c15fb62b3dfe1c698dc28f9efedb022b0ef8eb8. Reason for revert: vpxenc should only use public interface Original change's description: > Add codec control to get tpl stats > > Add command line flag to vpxenc to export tpl stats > > Bug: b/273736974 > Change-Id: I6980096531b0c12fbf7a307fdef4c562d0c29e32 Bug: b/273736974 Change-Id: Ifa8951bb34e5936bbfc33086b22e9fc36d379bc9 --- vp9/vp9_cx_iface.c | 23 ----------------------- vpx/vp8cx.h | 9 --------- vpxenc.c | 20 ++------------------ vpxenc.h | 1 - 4 files changed, 2 insertions(+), 51 deletions(-) diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c index ec2105b..4c7eaed 100644 --- a/vp9/vp9_cx_iface.c +++ b/vp9/vp9_cx_iface.c @@ -1788,28 +1788,6 @@ static vpx_codec_err_t ctrl_get_svc_ref_frame_config(vpx_codec_alg_priv_t *ctx, return VPX_CODEC_OK; } -static vpx_codec_err_t ctrl_get_tpl_stats(vpx_codec_alg_priv_t *ctx, - va_list args) { - VP9_COMP *const cpi = ctx->cpi; - VP9_COMMON *const cm = &cpi->common; - TplDepFrame **data = va_arg(args, TplDepFrame **); - int i; - *data = vpx_calloc(MAX_ARF_GOP_SIZE, sizeof(TplDepFrame)); - for (i = 0; i < MAX_ARF_GOP_SIZE; i++) { - const int mi_cols = mi_cols_aligned_to_sb(cm->mi_cols); - const int mi_rows = mi_cols_aligned_to_sb(cm->mi_rows); - const int copy_size = mi_cols * mi_rows * sizeof(*(*data)[i].tpl_stats_ptr); - (*data)[i] = cpi->tpl_stats[i]; - (*data)[i].tpl_stats_ptr = NULL; - (*data)[i].tpl_stats_ptr = - vpx_calloc(mi_rows * mi_cols, sizeof(*(*data)[i].tpl_stats_ptr)); - memcpy((*data)[i].tpl_stats_ptr, cpi->tpl_stats[i].tpl_stats_ptr, - copy_size); - } - - return VPX_CODEC_OK; -} - static vpx_codec_err_t ctrl_set_svc_ref_frame_config(vpx_codec_alg_priv_t *ctx, va_list args) { VP9_COMP *const cpi = ctx->cpi; @@ -2057,7 +2035,6 @@ static vpx_codec_ctrl_fn_map_t encoder_ctrl_maps[] = { { VP9E_GET_ACTIVEMAP, ctrl_get_active_map }, { VP9E_GET_LEVEL, ctrl_get_level }, { VP9E_GET_SVC_REF_FRAME_CONFIG, ctrl_get_svc_ref_frame_config }, - { VP9E_GET_TPL_STATS, ctrl_get_tpl_stats }, { -1, NULL }, }; diff --git a/vpx/vp8cx.h b/vpx/vp8cx.h index 01c0558..e0b679f 100644 --- a/vpx/vp8cx.h +++ b/vpx/vp8cx.h @@ -767,13 +767,6 @@ enum vp8e_enc_control_id { * */ VP9E_SET_QUANTIZER_ONE_PASS, - - /*!\brief Codec control to get TPL stats for the current frame. - * - * Supported in codecs: VP9 - * - */ - VP9E_GET_TPL_STATS, }; /*!\brief vpx 1-D scaling mode @@ -1104,8 +1097,6 @@ VPX_CTRL_USE_TYPE(VP8E_SET_RTC_EXTERNAL_RATECTRL, int) #define VPX_CTRL_VP8E_SET_RTC_EXTERNAL_RATECTRL VPX_CTRL_USE_TYPE(VP9E_SET_QUANTIZER_ONE_PASS, int) #define VPX_CTRL_VP9E_SET_QUANTIZER_ONE_PASS -VPX_CTRL_USE_TYPE(VP9E_GET_TPL_STATS, void *) -#define VPX_CTRL_VP9E_GET_TPL_STATS /*!\endcond */ /*! @} - end defgroup vp8_encoder */ diff --git a/vpxenc.c b/vpxenc.c index 9d57708..61672ac 100644 --- a/vpxenc.c +++ b/vpxenc.c @@ -39,10 +39,6 @@ #include "vpx/vp8dx.h" #endif -#if CONFIG_VP9_ENCODER -#include "vp9/encoder/vp9_encoder.h" -#endif - #include "vpx/vpx_integer.h" #include "vpx_ports/mem_ops.h" #include "vpx_ports/vpx_timer.h" @@ -165,8 +161,6 @@ static const arg_def_t disable_warnings = static const arg_def_t disable_warning_prompt = ARG_DEF("y", "disable-warning-prompt", 0, "Display warnings, but do not prompt user to continue."); -static const arg_def_t export_tpl_stats = - ARG_DEF(NULL, "export-tpl-stats", 0, "Export TPL stats of vp9 encoder"); #if CONFIG_VP9_HIGHBITDEPTH static const arg_def_t test16bitinternalarg = ARG_DEF( @@ -197,7 +191,6 @@ static const arg_def_t *main_args[] = { &help, &disable_warnings, &disable_warning_prompt, &recontest, - &export_tpl_stats, NULL }; static const arg_def_t usage = @@ -538,7 +531,9 @@ static const arg_def_t disable_loopfilter = "1: Loopfilter off for non reference frames\n" " " "2: Loopfilter off for all frames"); +#endif +#if CONFIG_VP9_ENCODER static const arg_def_t *vp9_args[] = { &cpu_used_vp9, &auto_altref_vp9, &sharpness, @@ -809,8 +804,6 @@ static void parse_global_config(struct VpxEncoderConfig *global, char **argv) { global->disable_warnings = 1; else if (arg_match(&arg, &disable_warning_prompt, argi)) global->disable_warning_prompt = 1; - else if (arg_match(&arg, &export_tpl_stats, argi)) - global->export_tpl_stats = 1; else argj++; } @@ -1989,15 +1982,6 @@ int main(int argc, const char **argv_) { if (got_data && global.test_decode != TEST_DECODE_OFF) FOREACH_STREAM(test_decode(stream, global.test_decode, global.codec)); - -#if CONFIG_VP9_ENCODER - if (got_data && global.export_tpl_stats) { - TplDepFrame *tpl_stats = NULL; - FOREACH_STREAM(vpx_codec_control(&stream->encoder, VP9E_GET_TPL_STATS, - &tpl_stats)); - vpx_free(tpl_stats); - } -#endif } fflush(stdout); diff --git a/vpxenc.h b/vpxenc.h index f065f08..be54840 100644 --- a/vpxenc.h +++ b/vpxenc.h @@ -56,7 +56,6 @@ struct VpxEncoderConfig { int disable_warnings; int disable_warning_prompt; int experimental_bitstream; - int export_tpl_stats; }; #ifdef __cplusplus -- 2.7.4