-void
-_mesa_upscale_teximage2d (unsigned int inWidth, unsigned int inHeight,
- unsigned int outWidth, unsigned int outHeight,
- unsigned int comps,
- const byte *src, int srcRowStride,
- unsigned char *dest);
+/** Copy a 4-element vector */
+#define COPY_4V( DST, SRC ) \
+do { \
+ (DST)[0] = (SRC)[0]; \
+ (DST)[1] = (SRC)[1]; \
+ (DST)[2] = (SRC)[2]; \
+ (DST)[3] = (SRC)[3]; \
+} while (0)
+
+/** Copy a 4-element unsigned byte vector */
+static inline void
+COPY_4UBV(uint8_t dst[4], const uint8_t src[4])
+{
+#if defined(__i386__)
+ *((uint32_t *) dst) = *((uint32_t *) src);
+#else
+ /* The uint32_t cast might fail if DST or SRC are not dword-aligned (RISC) */
+ COPY_4V(dst, src);
+#endif
+}
+
+void reorder_source_3(byte *tex, dword width, dword height, int srcRowStride);
+void *reorder_source_3_alloc(const byte *source, dword width, dword height, int srcRowStride);
+void reorder_source_4(byte *tex, dword width, dword height, int srcRowStride);
+void *reorder_source_4_alloc(const byte *source, dword width, dword height, int srcRowStride);