AOM_QM: use SIMD for flat matrices and re-enable tests.

When AOM_QM is enabled, by default quantization matrices are
flat unless enabled with --enable-qm=1. Re-use existing SIMD
functions when a flat matrix is used, so that there is no
speed deficit when AOM_QM is enabled.

SIMD for the non-flat case is TBC.

Change-Id: I1bb8da70d3dd5858dac15099610ddf61662e3d0d
diff --git a/av1/encoder/av1_quantize.c b/av1/encoder/av1_quantize.c
index b44e06f..0265f1f 100644
--- a/av1/encoder/av1_quantize.c
+++ b/av1/encoder/av1_quantize.c
@@ -577,7 +577,7 @@
 #if CONFIG_AOM_QM
   const qm_val_t *qm_ptr = qparam->qmatrix;
   const qm_val_t *iqm_ptr = qparam->iqmatrix;
-  if (1 /*qm_ptr != NULL || iqm_ptr != NULL*/) {
+  if (qm_ptr != NULL && iqm_ptr != NULL) {
     quantize_fp_helper_c(coeff_ptr, n_coeffs, skip_block, p->zbin, p->round_fp,
                          p->quant_fp, p->quant_shift, qcoeff_ptr, dqcoeff_ptr,
                          pd->dequant, eob_ptr, sc->scan, sc->iscan, qm_ptr,
@@ -630,7 +630,7 @@
 #if CONFIG_AOM_QM
   const qm_val_t *qm_ptr = qparam->qmatrix;
   const qm_val_t *iqm_ptr = qparam->iqmatrix;
-  if (1 /*qm_ptr != NULL && iqm_ptr != NULL*/) {
+  if (qm_ptr != NULL && iqm_ptr != NULL) {
     quantize_b_helper_c(coeff_ptr, n_coeffs, skip_block, p->zbin, p->round,
                         p->quant, p->quant_shift, qcoeff_ptr, dqcoeff_ptr,
                         pd->dequant, eob_ptr, sc->scan, sc->iscan, qm_ptr,
@@ -845,7 +845,7 @@
 #if CONFIG_AOM_QM
   const qm_val_t *qm_ptr = qparam->qmatrix;
   const qm_val_t *iqm_ptr = qparam->iqmatrix;
-  if (1 /*qm_ptr != NULL && iqm_ptr != NULL*/) {
+  if (qm_ptr != NULL && iqm_ptr != NULL) {
     highbd_quantize_fp_helper_c(
         coeff_ptr, n_coeffs, skip_block, p->zbin, p->round_fp, p->quant_fp,
         p->quant_shift, qcoeff_ptr, dqcoeff_ptr, pd->dequant, eob_ptr, sc->scan,
@@ -884,7 +884,7 @@
 #if CONFIG_AOM_QM
   const qm_val_t *qm_ptr = qparam->qmatrix;
   const qm_val_t *iqm_ptr = qparam->iqmatrix;
-  if (1 /*qm_ptr != NULL && iqm_ptr != NULL*/) {
+  if (qm_ptr != NULL && iqm_ptr != NULL) {
     highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, skip_block, p->zbin,
                                p->round, p->quant, p->quant_shift, qcoeff_ptr,
                                dqcoeff_ptr, pd->dequant, eob_ptr, sc->scan,