External partition: Correctly call the model and delete
(1). Properly delete the model after the encoder is destroyed.
(2). Correctly call the model by reference.
Change-Id: If53ef5dcf085a25e0233cee552ef9d35cc1e88b4
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 18622f6..23f725c 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -1575,6 +1575,8 @@
dealloc_compressor_data(cpi);
+ av1_ext_part_delete(&cpi->ext_part_controller);
+
av1_remove_common(cm);
aom_free(cpi);
diff --git a/av1/encoder/external_partition.c b/av1/encoder/external_partition.c
index b8bde66..6328f5c 100644
--- a/av1/encoder/external_partition.c
+++ b/av1/encoder/external_partition.c
@@ -44,7 +44,7 @@
}
if (ext_part_controller->ready) {
const aom_ext_part_status_t status =
- ext_part_controller->funcs.delete_model(&ext_part_controller->model);
+ ext_part_controller->funcs.delete_model(ext_part_controller->model);
if (status != AOM_EXT_PART_OK) {
return AOM_CODEC_ERROR;
}
@@ -59,7 +59,7 @@
assert(decision != NULL);
const aom_ext_part_status_t status =
ext_part_controller->funcs.get_partition_decision(
- &ext_part_controller->model, decision);
+ ext_part_controller->model, decision);
if (status != AOM_EXT_PART_OK) return false;
return true;
}
@@ -71,7 +71,7 @@
assert(stats != NULL);
const aom_ext_part_status_t status =
ext_part_controller->funcs.send_partition_stats(
- &ext_part_controller->model, stats);
+ ext_part_controller->model, stats);
if (status != AOM_EXT_PART_OK) return false;
return true;
}
@@ -82,7 +82,7 @@
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);
+ ext_part_controller->model, features);
if (status != AOM_EXT_PART_OK) return false;
return true;
}