aom: cdef.c: add missing CONFIG_AV1_HIGHBITDEPTH check

From a24432b07fedd81bf299051229325527ef4e41ad Mon Sep 17 00:00:00 2001
From: James Zern <[EMAIL REDACTED]>
Date: Mon, 19 Aug 2024 15:04:24 -0700
Subject: [PATCH] cdef.c: add missing CONFIG_AV1_HIGHBITDEPTH check

av1_cdef_copy_sb8_16_highbd() is unused w/CONFIG_AV1_HIGHBITDEPTH=0.

Bug: aomedia:3416
Change-Id: I5afe085a7a5b42b37e5049714c2db7c62d1aef46
---
 av1/common/cdef.c          | 12 +++++++++---
 av1/common/thread_common.h |  2 ++
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/av1/common/cdef.c b/av1/common/cdef.c
index 02de17a46..a8d207c36 100644
--- a/av1/common/cdef.c
+++ b/av1/common/cdef.c
@@ -100,6 +100,7 @@ void av1_cdef_copy_sb8_16_lowbd(uint16_t *const dst, int dstride,
   cdef_copy_rect8_8bit_to_16bit(dst, dstride, base, sstride, hsize, vsize);
 }
 
+#if CONFIG_AV1_HIGHBITDEPTH
 void av1_cdef_copy_sb8_16_highbd(uint16_t *const dst, int dstride,
                                  const uint8_t *src, int src_voffset,
                                  int src_hoffset, int sstride, int vsize,
@@ -108,17 +109,22 @@ void av1_cdef_copy_sb8_16_highbd(uint16_t *const dst, int dstride,
       &CONVERT_TO_SHORTPTR(src)[src_voffset * (ptrdiff_t)sstride + src_hoffset];
   cdef_copy_rect8_16bit_to_16bit(dst, dstride, base, sstride, hsize, vsize);
 }
+#endif  // CONFIG_AV1_HIGHBITDEPTH
 
 void av1_cdef_copy_sb8_16(const AV1_COMMON *const cm, uint16_t *const dst,
                           int dstride, const uint8_t *src, int src_voffset,
                           int src_hoffset, int sstride, int vsize, int hsize) {
+#if CONFIG_AV1_HIGHBITDEPTH
   if (cm->seq_params->use_highbitdepth) {
     av1_cdef_copy_sb8_16_highbd(dst, dstride, src, src_voffset, src_hoffset,
                                 sstride, vsize, hsize);
-  } else {
-    av1_cdef_copy_sb8_16_lowbd(dst, dstride, src, src_voffset, src_hoffset,
-                               sstride, vsize, hsize);
+    return;
   }
+#else
+  (void)cm;
+#endif  // CONFIG_AV1_HIGHBITDEPTH
+  av1_cdef_copy_sb8_16_lowbd(dst, dstride, src, src_voffset, src_hoffset,
+                             sstride, vsize, hsize);
 }
 
 static inline void copy_rect(uint16_t *dst, int dstride, const uint16_t *src,
diff --git a/av1/common/thread_common.h b/av1/common/thread_common.h
index 0c27e12f2..90b869b6d 100644
--- a/av1/common/thread_common.h
+++ b/av1/common/thread_common.h
@@ -164,10 +164,12 @@ void av1_cdef_copy_sb8_16_lowbd(uint16_t *const dst, int dstride,
                                 const uint8_t *src, int src_voffset,
                                 int src_hoffset, int sstride, int vsize,
                                 int hsize);
+#if CONFIG_AV1_HIGHBITDEPTH
 void av1_cdef_copy_sb8_16_highbd(uint16_t *const dst, int dstride,
                                  const uint8_t *src, int src_voffset,
                                  int src_hoffset, int sstride, int vsize,
                                  int hsize);
+#endif  // CONFIG_AV1_HIGHBITDEPTH
 void av1_alloc_cdef_sync(AV1_COMMON *const cm, AV1CdefSync *cdef_sync,
                          int num_workers);
 void av1_free_cdef_sync(AV1CdefSync *cdef_sync);