Add MAX_NUM_THREADS macro

A new macro has been added. It will be used for allocating memory in
row based multi-threading of encoder.

Change-Id: Iaade345ea975232bbeb2bf12a7556616fc583bba
diff --git a/aom_util/aom_thread.h b/aom_util/aom_thread.h
index 5660a5d..bda8b75 100644
--- a/aom_util/aom_thread.h
+++ b/aom_util/aom_thread.h
@@ -26,6 +26,7 @@
 // Set maximum decode threads to be 8 due to the limit of frame buffers
 // and not enough semaphores in the emulation layer on windows.
 #define MAX_DECODE_THREADS 8
+#define MAX_NUM_THREADS 64
 
 #if CONFIG_MULTITHREAD
 
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 3ea1ca3..9b36733 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -247,7 +247,7 @@
   RANGE_CHECK_HI(extra_cfg, aq_mode, AQ_MODE_COUNT - 1);
   RANGE_CHECK_HI(extra_cfg, deltaq_mode, DELTAQ_MODE_COUNT - 1);
   RANGE_CHECK_HI(extra_cfg, frame_periodic_boost, 1);
-  RANGE_CHECK_HI(cfg, g_threads, 64);
+  RANGE_CHECK_HI(cfg, g_threads, MAX_NUM_THREADS);
   RANGE_CHECK_HI(cfg, g_lag_in_frames, MAX_LAG_BUFFERS);
   RANGE_CHECK(cfg, rc_end_usage, AOM_VBR, AOM_Q);
   RANGE_CHECK_HI(cfg, rc_undershoot_pct, 100);