Remove obsolete MAX_NUM_ENHANCEMENT_LAYERS.
MAX_NUM_ENHANCEMENT_LAYERS has been replaced by MAX_NUM_SPATIAL_LAYERS.
Fix an off-by-one error in the validity check of spatial_layer_id in
ctrl_set_spatial_layer_id(). The range of spatial_layer_id is from 0 up
to and including MAX_NUM_SPATIAL_LAYERS - 1.
Add parentheses around the value of the MAX_NUM_OPERATING_POINTS macro.
Change-Id: I62ba308188339d95a58fb9509855d59fad73ff1e
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 15242494..5ca8256 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -27,7 +27,6 @@
#include "av1/encoder/firstpass.h"
#define MAG_SIZE (4)
-#define MAX_NUM_ENHANCEMENT_LAYERS 3
struct av1_extracfg {
int cpu_used;
@@ -2460,7 +2459,7 @@
static aom_codec_err_t ctrl_set_spatial_layer_id(aom_codec_alg_priv_t *ctx,
va_list args) {
const int spatial_layer_id = va_arg(args, int);
- if (spatial_layer_id > MAX_NUM_ENHANCEMENT_LAYERS)
+ if (spatial_layer_id >= MAX_NUM_SPATIAL_LAYERS)
return AOM_CODEC_INVALID_PARAM;
ctx->cpi->common.spatial_layer_id = spatial_layer_id;
return AOM_CODEC_OK;
@@ -2469,7 +2468,7 @@
static aom_codec_err_t ctrl_set_number_spatial_layers(aom_codec_alg_priv_t *ctx,
va_list args) {
const int number_spatial_layers = va_arg(args, int);
- if (number_spatial_layers > MAX_NUM_ENHANCEMENT_LAYERS)
+ if (number_spatial_layers > MAX_NUM_SPATIAL_LAYERS)
return AOM_CODEC_INVALID_PARAM;
ctx->cpi->common.number_spatial_layers = number_spatial_layers;
return AOM_CODEC_OK;
diff --git a/av1/common/av1_common_int.h b/av1/common/av1_common_int.h
index 07b0720..3872be8 100644
--- a/av1/common/av1_common_int.h
+++ b/av1/common/av1_common_int.h
@@ -71,7 +71,7 @@
// clang-format seems to think this is a pointer dereference and not a
// multiplication.
#define MAX_NUM_OPERATING_POINTS \
- MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS
+ (MAX_NUM_TEMPORAL_LAYERS * MAX_NUM_SPATIAL_LAYERS)
/* clang-format on */
// TODO(jingning): Turning this on to set up transform coefficient