x264-dsp
mc.h
1 /*****************************************************************************
2  * mc.h: motion compensation
3  *****************************************************************************/
4 
5 #ifndef X264_MC_H
6 #define X264_MC_H
7 
8 struct x264_weight_t;
9 typedef void (*weight_fn_t)(pixel *, intptr_t, pixel *, intptr_t, const struct x264_weight_t *, int);
10 typedef struct x264_weight_t {
11  /* aligning the first member is a gcc hack to force the struct to be
12  * 16 byte aligned, as well as force sizeof(struct) to be a multiple of 16 */
13  ALIGNED_16(int16_t cachea[8]);
14  int16_t cacheb[8];
15  int32_t i_denom; /* exp2 as denominator */
16  int32_t i_scale; /* scale as numerator */
17  int32_t i_offset;
18  weight_fn_t *weightfn;
20 
21 extern const x264_weight_t x264_weight_none[3];
22 
23 /* Do the MC
24  * XXX: Only width = 4, 8 or 16 are valid
25  * width == 4 -> height == 4 or 8
26  * width == 8 -> height == 4 or 8 or 16
27  * width == 16-> height == 8 or 16
28  * */
29 
30 typedef struct
31 {
32  void (*mc_luma)(pixel *dst, intptr_t i_dst, pixel **src, intptr_t i_src,
33  int mvx, int mvy, int i_width, int i_height, const x264_weight_t *weight);
34 
35  /* may round up the dimensions if they're not a power of 2 */
36  pixel *(*get_ref)(pixel *dst, intptr_t *i_dst, pixel **src, intptr_t i_src,
37  int mvx, int mvy, int i_width, int i_height, const x264_weight_t *weight);
38 
39  /* mc_chroma may write up to 2 bytes of garbage to the right of dst,
40  * so it must be run from left to right. */
41  void (*mc_chroma)(pixel *dstu, pixel *dstv, intptr_t i_dst, pixel *src, intptr_t i_src,
42  int mvx, int mvy, int i_width, int i_height);
43 
44  /* only 16x16, 8x8, and 4x4 defined */
45  void (*copy[7])(pixel *dst, intptr_t dst_stride, pixel *src, intptr_t src_stride, int i_height);
46 
47  void (*store_interleave_chroma)(pixel *dst, intptr_t i_dst, pixel *srcu, pixel *srcv, int height);
48  void (*load_deinterleave_chroma_fenc)(pixel *dst, pixel *src, intptr_t i_src, int height);
49  void (*load_deinterleave_chroma_fdec)(pixel *dst, pixel *src, intptr_t i_src, int height);
50 
51  void (*plane_copy)(pixel *dst, intptr_t i_dst, pixel *src, intptr_t i_src, int w, int h);
52  void (*plane_copy_interleave)(pixel *dst, intptr_t i_dst, pixel *srcu, intptr_t i_srcu,
53  pixel *srcv, intptr_t i_srcv, int w, int h);
54  /* may write up to 15 pixels off the end of each plane */
55  void (*plane_copy_deinterleave)(pixel *dstu, intptr_t i_dstu, pixel *dstv, intptr_t i_dstv,
56  pixel *src, intptr_t i_src, int w, int h);
57  void (*plane_copy_deinterlace)(
58  pixel *srcy, intptr_t i_srcy, pixel *dsty, intptr_t i_dsty,
59  pixel *srcc, intptr_t i_srcc, pixel *dstc, intptr_t i_dstc,
60  int i_width, int i_height);
61  void (*plane_deinterlace)(pixel *pixy, intptr_t i_pixy, pixel *pixc, intptr_t i_pixc, int i_width, int i_height);
62 
63  void (*hpel_filter)(pixel *dsth, pixel *dstv, pixel *dstc, pixel *src,
64  intptr_t i_stride, int i_width, int i_height, int16_t *buf);
65 
66  /* prefetch the next few macroblocks of fenc or fdec */
67  void (*prefetch_fenc)(pixel *pix_y, intptr_t stride_y, pixel *pix_uv, intptr_t stride_uv, int mb_x);
68  void (*prefetch_fenc_420)(pixel *pix_y, intptr_t stride_y, pixel *pix_uv, intptr_t stride_uv, int mb_x);
69  /* prefetch the next few macroblocks of a hpel reference frame */
70  void (*prefetch_ref)(pixel *pix, intptr_t stride, int parity);
71 
72  void *(*memcpy_aligned)(void *dst, const void *src, size_t n);
73  void (*memzero_aligned)(void *dst, size_t n);
74 
75  void (*frame_init_lowres_core)(pixel *src0, pixel *dst0, pixel *dsth, pixel *dstv, pixel *dstc,
76  intptr_t src_stride, intptr_t dst_stride, int width, int height);
77 
79 
80 void x264_mc_init(int cpu, x264_mc_functions_t *pf);
81 
82 #endif
Definition: me.h:11
Definition: mc.h:31
Definition: mc.h:10