Correct data size estimation for odd size video

Given the largest transform size is 32x32, this commmit changes size
estiiation based on the size rounding up to 32 multiples to avoid
insufficient buffer allocations.

BUG=https://bugs.chromium.org/p/aomedia/issues/detail?id=36

Change-Id: I6eab09dc6acdc0f5a6bcadb918d62c4852aae21f
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 63f7618..bacb23c 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -953,11 +953,13 @@
     // failure condition, encoder setup is done fully in init() currently.
     if (res == AOM_CODEC_OK) {
 #if CONFIG_EXT_REFS
-      data_sz = ctx->cfg.g_w * ctx->cfg.g_h * get_image_bps(img);
+      data_sz = ALIGN_POWER_OF_TWO(ctx->cfg.g_w, 5) *
+                ALIGN_POWER_OF_TWO(ctx->cfg.g_h, 5) * get_image_bps(img);
 #else
       // There's no codec control for multiple alt-refs so check the encoder
       // instance for its status to determine the compressed data size.
-      data_sz = ctx->cfg.g_w * ctx->cfg.g_h * get_image_bps(img) / 8 *
+      data_sz = ALIGN_POWER_OF_TWO(ctx->cfg.g_w, 5) *
+                ALIGN_POWER_OF_TWO(ctx->cfg.g_h, 5) * get_image_bps(img) / 8 *
                 (cpi->multi_arf_allowed ? 8 : 2);
 #endif  // CONFIG_EXT_REFS
       if (data_sz < kMinCompressedSize) data_sz = kMinCompressedSize;