-static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, int w, int h){
+/* HACK Duplicated from swscale_internal.h.
+ * Should be removed when a cleaner pixel format system exists. */
+const char *sws_format_name(enum PixelFormat format);
+#define isGray(x) ( \
+ (x)==PIX_FMT_GRAY8 \
+ || (x)==PIX_FMT_GRAY16BE \
+ || (x)==PIX_FMT_GRAY16LE \
+ )
+#define hasChroma(x) (!( \
+ isGray(x) \
+ || (x)==PIX_FMT_MONOBLACK \
+ || (x)==PIX_FMT_MONOWHITE \
+ ))
+#define isALPHA(x) ( \
+ (x)==PIX_FMT_BGR32 \
+ || (x)==PIX_FMT_BGR32_1 \
+ || (x)==PIX_FMT_RGB32 \
+ || (x)==PIX_FMT_RGB32_1 \
+ || (x)==PIX_FMT_YUVA420P \
+ )
+
+static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, int w, int h)
+{