30 #ifndef AVCODEC_DSPUTIL_H
31 #define AVCODEC_DSPUTIL_H
58 #define H264_IDCT(depth) \
59 void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\
60 void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\
61 void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\
62 void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\
63 void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
64 void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
65 void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
66 void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
67 void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
68 void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(DCTELEM *output, DCTELEM *input, int qmul);\
69 void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul);\
70 void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul);
88 #define MAX_NEG_CROP 1024
94 #define PUTAVG_PIXELS(depth)\
95 void ff_put_pixels8x8_ ## depth ## _c(uint8_t *dst, uint8_t *src, int stride);\
96 void ff_avg_pixels8x8_ ## depth ## _c(uint8_t *dst, uint8_t *src, int stride);\
97 void ff_put_pixels16x16_ ## depth ## _c(uint8_t *dst, uint8_t *src, int stride);\
98 void ff_avg_pixels16x16_ ## depth ## _c(uint8_t *dst, uint8_t *src, int stride);
106 #define ff_put_pixels8x8_c ff_put_pixels8x8_8_c
107 #define ff_avg_pixels8x8_c ff_avg_pixels8x8_8_c
108 #define ff_put_pixels16x16_c ff_put_pixels16x16_8_c
109 #define ff_avg_pixels16x16_c ff_avg_pixels16x16_8_c
156 #define DEF_OLD_QPEL(name)\
157 void ff_put_ ## name (uint8_t *dst, uint8_t *src, int stride);\
158 void ff_put_no_rnd_ ## name (uint8_t *dst, uint8_t *src, int stride);\
159 void ff_avg_ ## name (uint8_t *dst, uint8_t *src, int stride);
174 #define CALL_2X_PIXELS(a, b, n)\
175 static void a(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
176 b(block , pixels , line_size, h);\
177 b(block+n, pixels+n, line_size, h);\
196 int idct_permutation_type);
198 #define EMULATED_EDGE(depth) \
199 void ff_emulated_edge_mc_ ## depth (uint8_t *buf, const uint8_t *src, ptrdiff_t linesize,\
200 int block_w, int block_h,\
201 int src_x, int src_y, int w, int h);
261 int (*ssd_int8_vs_int16)(
const int8_t *pix1,
const int16_t *pix2,
357 void (*add_hfyu_left_prediction_bgr32)(
uint8_t *
dst,
const uint8_t *src,
int w,
int *red,
int *green,
int *blue,
int *alpha);
368 void (*vorbis_inverse_coupling)(
float *mag,
float *ang,
int blocksize);
370 void (*vector_fmul_reverse)(
float *
dst,
const float *src0,
const float *src1,
int len);
372 void (*vector_fmul_add)(
float *
dst,
const float *src0,
const float *src1,
const float *src2,
int len);
374 void (*vector_fmul_window)(
float *
dst,
const float *src0,
const float *src1,
const float *win,
int len);
376 void (*vector_clipf)(
float *dst ,
const float *src ,
float min,
float max,
int len );
383 float (*scalarproduct_float)(
const float *v1,
const float *v2,
int len);
406 void (*butterflies_float_interleave)(
float *
dst,
const float *src0,
407 const float *src1,
int len);
443 #define FF_NO_IDCT_PERM 1
444 #define FF_LIBMPEG2_IDCT_PERM 2
445 #define FF_SIMPLE_IDCT_PERM 3
446 #define FF_TRANSPOSE_IDCT_PERM 4
447 #define FF_PARTTRANS_IDCT_PERM 5
448 #define FF_SSE2_IDCT_PERM 6
451 void (*add_8x8basis)(int16_t rem[64], int16_t basis[64],
int scale);
452 #define BASIS_SHIFT 16
453 #define RECON_SHIFT 6
456 #define EDGE_WIDTH 16
458 #define EDGE_BOTTOM 2
466 int32_t (*scalarproduct_int16)(
const int16_t *v1,
const int16_t *v2,
int len);
473 int32_t (*scalarproduct_and_madd_int16)(int16_t *v1,
const int16_t *v2,
const int16_t *v3,
int len,
int mul);
486 void (*apply_window_int16)(int16_t *output,
const int16_t *input,
487 const int16_t *window,
unsigned int len);
533 #define BYTE_VEC32(c) ((c)*0x01010101UL)
534 #define BYTE_VEC64(c) ((c)*0x0001000100010001UL)
538 return (a | b) - (((a ^
b) & ~
BYTE_VEC32(0x01)) >> 1);
543 return (a & b) + (((a ^
b) & ~
BYTE_VEC32(0x01)) >> 1);
548 return (a | b) - (((a ^
b) & ~
BYTE_VEC64(0x01)) >> 1);
553 return (a & b) + (((a ^
b) & ~
BYTE_VEC64(0x01)) >> 1);
562 return (3*lambda)>>(FF_LAMBDA_SHIFT+1);
591 #if (ARCH_ARM && HAVE_NEON) || ARCH_PPC || HAVE_MMX
592 # define STRIDE_ALIGN 16
594 # define STRIDE_ALIGN 8
601 #define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \
602 uint8_t la_##v[sizeof(t s o) + (a)]; \
603 t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a)
605 #define LOCAL_ALIGNED_D(a, t, v, s, o, ...) \
606 DECLARE_ALIGNED(a, t, la_##v) s o; \
609 #define LOCAL_ALIGNED(a, t, v, ...) E(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))
611 #if HAVE_LOCAL_ALIGNED_8
612 # define LOCAL_ALIGNED_8(t, v, ...) E(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,))
614 # define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__)
617 #if HAVE_LOCAL_ALIGNED_16
618 # define LOCAL_ALIGNED_16(t, v, ...) E(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,))
620 # define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
623 #define WRAPPER8_16_SQ(name8, name16)\
624 static int name16(void *s, uint8_t *dst, uint8_t *src, int stride, int h){\
626 score +=name8(s, dst , src , stride, 8);\
627 score +=name8(s, dst+8 , src+8 , stride, 8);\
631 score +=name8(s, dst , src , stride, 8);\
632 score +=name8(s, dst+8 , src+8 , stride, 8);\