From 658900ead4508d9760974abc5d272d409ece1940 Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Tue, 13 Aug 2024 17:19:50 -0700
Subject: [PATCH] external_partition.c: make av1_ext_part_init() static
This function is unused outside of this file.
+ make av1_ext_part_send_partition_stats() and
av1_get_ext_part_decision_mode() conditional on
CONFIG_PARTITION_SEARCH_ORDER.
Bug: aomedia:3416
Change-Id: I6702860cb9b46c7c964c93b2ffee610852cfbc40
---
av1/encoder/external_partition.c | 29 ++++++++++++++++-------------
av1/encoder/external_partition.h | 11 ++++++-----
2 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/av1/encoder/external_partition.c b/av1/encoder/external_partition.c
index d72eab0883..45bd433eb1 100644
--- a/av1/encoder/external_partition.c
+++ b/av1/encoder/external_partition.c
@@ -11,6 +11,7 @@
#include "av1/common/common.h"
#include "av1/encoder/external_partition.h"
+#include "config/aom_config.h"
aom_codec_err_t av1_ext_part_create(aom_ext_part_funcs_t funcs,
aom_ext_part_config_t config,
@@ -35,7 +36,7 @@ aom_codec_err_t av1_ext_part_create(aom_ext_part_funcs_t funcs,
return AOM_CODEC_OK;
}
-aom_codec_err_t av1_ext_part_init(ExtPartController *ext_part_controller) {
+static aom_codec_err_t ext_part_init(ExtPartController *ext_part_controller) {
if (ext_part_controller == NULL) {
return AOM_CODEC_INVALID_PARAM;
}
@@ -54,7 +55,7 @@ aom_codec_err_t av1_ext_part_delete(ExtPartController *ext_part_controller) {
return AOM_CODEC_ERROR;
}
}
- return av1_ext_part_init(ext_part_controller);
+ return ext_part_init(ext_part_controller);
}
bool av1_ext_part_get_partition_decision(ExtPartController *ext_part_controller,
@@ -69,25 +70,26 @@ bool av1_ext_part_get_partition_decision(ExtPartController *ext_part_controller,
return true;
}
-bool av1_ext_part_send_partition_stats(ExtPartController *ext_part_controller,
- const aom_partition_stats_t *stats) {
+bool av1_ext_part_send_features(ExtPartController *ext_part_controller,
+ const aom_partition_features_t *features) {
assert(ext_part_controller != NULL);
assert(ext_part_controller->ready);
- assert(stats != NULL);
- const aom_ext_part_status_t status =
- ext_part_controller->funcs.send_partition_stats(
- ext_part_controller->model, stats);
+ assert(features != NULL);
+ const aom_ext_part_status_t status = ext_part_controller->funcs.send_features(
+ ext_part_controller->model, features);
if (status != AOM_EXT_PART_OK) return false;
return true;
}
-bool av1_ext_part_send_features(ExtPartController *ext_part_controller,
- const aom_partition_features_t *features) {
+#if CONFIG_PARTITION_SEARCH_ORDER
+bool av1_ext_part_send_partition_stats(ExtPartController *ext_part_controller,
+ const aom_partition_stats_t *stats) {
assert(ext_part_controller != NULL);
assert(ext_part_controller->ready);
- assert(features != NULL);
- const aom_ext_part_status_t status = ext_part_controller->funcs.send_features(
- ext_part_controller->model, features);
+ assert(stats != NULL);
+ const aom_ext_part_status_t status =
+ ext_part_controller->funcs.send_partition_stats(
+ ext_part_controller->model, stats);
if (status != AOM_EXT_PART_OK) return false;
return true;
}
@@ -96,3 +98,4 @@ aom_ext_part_decision_mode_t av1_get_ext_part_decision_mode(
const ExtPartController *ext_part_controller) {
return ext_part_controller->funcs.decision_mode;
}
+#endif // CONFIG_PARTITION_SEARCH_ORDER
diff --git a/av1/encoder/external_partition.h b/av1/encoder/external_partition.h
index bd299fc5f3..e1ed2dd139 100644
--- a/av1/encoder/external_partition.h
+++ b/av1/encoder/external_partition.h
@@ -16,6 +16,7 @@
#include "aom/aom_codec.h"
#include "aom/aom_external_partition.h"
+#include "config/aom_config.h"
#ifdef __cplusplus
extern "C" {
@@ -34,21 +35,21 @@ aom_codec_err_t av1_ext_part_create(aom_ext_part_funcs_t funcs,
aom_ext_part_config_t config,
ExtPartController *ext_part_controller);
-aom_codec_err_t av1_ext_part_init(ExtPartController *ext_part_controller);
-
aom_codec_err_t av1_ext_part_delete(ExtPartController *ext_part_controller);
bool av1_ext_part_get_partition_decision(ExtPartController *ext_part_controller,
aom_partition_decision_t *decision);
-bool av1_ext_part_send_partition_stats(ExtPartController *ext_part_controller,
- const aom_partition_stats_t *stats);
-
bool av1_ext_part_send_features(ExtPartController *ext_part_controller,
const aom_partition_features_t *features);
+#if CONFIG_PARTITION_SEARCH_ORDER
+bool av1_ext_part_send_partition_stats(ExtPartController *ext_part_controller,
+ const aom_partition_stats_t *stats);
+
aom_ext_part_decision_mode_t av1_get_ext_part_decision_mode(
const ExtPartController *ext_part_controller);
+#endif // CONFIG_PARTITION_SEARCH_ORDER
/*!\endcond */
#ifdef __cplusplus