@@ -21,11 +21,44 @@
#include <stdint.h>
+/**
+ * @file
+ * Optimized buffer byte swapping routines.
+ */
+
typedef struct BswapDSPContext {
+ /**
+ * Byte swap 32 bit elements in a buffer.
+
+ * @param dst Destination buffer.
+ * @param src Source buffer, may be the same as dst.
+ * @param len The number of elements in the buffer.
+ *
+ */
+ /** @{ */
void (*bswap32_buf)(uint32_t *dst, const uint32_t *src, int len);
+ /** @} */
+
+ /**
+ * Byte swap 16 bit elements in a buffer.
+ *
+ * @param dst Destination buffer.
+ * @param src Source buffer, may be the same as dst.
+ * @param len The number of elements in the buffer.
+ *
+ */
+ /** @{ */
void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len);
+ /** @} */
} BswapDSPContext;
+
+/**
+ * Initialize BswapDSPContext function pointers.
+ *
+ * @param c pointer to BswapDSPContext
+ *
+ */
void ff_bswapdsp_init(BswapDSPContext *c);
void ff_bswapdsp_init_riscv(BswapDSPContext *c);
void ff_bswapdsp_init_x86(BswapDSPContext *c);
From: Mark Reid <mindmark@gmail.com> --- libavcodec/bswapdsp.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+)