Add missing headers to make template files compile (more) standalone
[ffmpeg.git] / libavcodec / hpel_template.c
index 0d90445..81d3892 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/intreadwrite.h"
+
+#include "pixels.h"
+
+#include "bit_depth_template.c"
+
 #define DEF_HPEL(OPNAME, OP)                                            \
-static inline void FUNCC(OPNAME ## _pixels2)(uint8_t *block,            \
-                                             const uint8_t *pixels,     \
-                                             ptrdiff_t line_size,       \
-                                             int h)                     \
-{                                                                       \
-    int i;                                                              \
-    for (i = 0; i < h; i++) {                                           \
-        OP(*((pixel2 *) block), AV_RN2P(pixels));                       \
-        pixels += line_size;                                            \
-        block  += line_size;                                            \
-    }                                                                   \
-}                                                                       \
-                                                                        \
-static inline void FUNCC(OPNAME ## _pixels4)(uint8_t *block,            \
-                                             const uint8_t *pixels,     \
-                                             ptrdiff_t line_size,       \
-                                             int h)                     \
-{                                                                       \
-    int i;                                                              \
-    for (i = 0; i < h; i++) {                                           \
-        OP(*((pixel4 *) block), AV_RN4P(pixels));                       \
-        pixels += line_size;                                            \
-        block  += line_size;                                            \
-    }                                                                   \
-}                                                                       \
-                                                                        \
-static inline void FUNCC(OPNAME ## _pixels8)(uint8_t *block,            \
-                                             const uint8_t *pixels,     \
-                                             ptrdiff_t line_size,       \
-                                             int h)                     \
-{                                                                       \
-    int i;                                                              \
-    for (i = 0; i < h; i++) {                                           \
-        OP(*((pixel4 *) block), AV_RN4P(pixels));                       \
-        OP(*((pixel4 *) (block + 4 * sizeof(pixel))),                   \
-           AV_RN4P(pixels + 4 * sizeof(pixel)));                        \
-        pixels += line_size;                                            \
-        block  += line_size;                                            \
-    }                                                                   \
-}                                                                       \
-                                                                        \
 static inline void FUNC(OPNAME ## _pixels8_l2)(uint8_t *dst,            \
                                                const uint8_t *src1,     \
                                                const uint8_t *src2,     \
@@ -132,10 +97,6 @@ static inline void FUNC(OPNAME ## _pixels16_l2)(uint8_t *dst,           \
                                 dst_stride, src_stride1,                \
                                 src_stride2, h);                        \
 }                                                                       \
-                                                                        \
-CALL_2X_PIXELS(FUNCC(OPNAME ## _pixels16),                              \
-               FUNCC(OPNAME ## _pixels8),                               \
-               8 * sizeof(pixel))
 
 #define op_avg(a, b) a = rnd_avg_pixel4(a, b)
 #define op_put(a, b) a = b