~ubuntu-branches/ubuntu/utopic/libav/utopic-proposed

« back to all changes in this revision

Viewing changes to libavcodec/ppc/h264qpel.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler, Reinhard Tartler, Rico Tzschichholz
  • Date: 2014-08-30 11:02:45 UTC
  • mfrom: (1.3.47 sid)
  • Revision ID: package-import@ubuntu.com-20140830110245-io3dg7q85wfr7125
Tags: 6:11~beta1-2
[ Reinhard Tartler ]
* Make libavcodec-dev depend on libavresample-dev

[ Rico Tzschichholz ]
* Some fixes and leftovers from soname bumps

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include "libavutil/attributes.h"
23
23
#include "libavutil/cpu.h"
24
24
#include "libavutil/intreadwrite.h"
 
25
#include "libavutil/ppc/cpu.h"
25
26
#include "libavutil/ppc/types_altivec.h"
26
27
#include "libavutil/ppc/util_altivec.h"
27
28
#include "libavcodec/h264qpel.h"
28
 
#include "dsputil_altivec.h"
 
29
#include "hpeldsp_altivec.h"
29
30
 
30
31
#if HAVE_ALTIVEC
31
32
 
65
66
#undef PREFIX_h264_qpel16_hv_lowpass_num
66
67
 
67
68
#define H264_MC(OPNAME, SIZE, CODETYPE) \
68
 
static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
69
static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
69
70
{\
70
71
    ff_ ## OPNAME ## pixels ## SIZE ## _ ## CODETYPE(dst, src, stride, SIZE);\
71
72
}\
72
73
\
73
 
static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
74
static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
74
75
{ \
75
76
    DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
76
77
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
77
78
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
78
79
}\
79
80
\
80
 
static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
81
static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
81
82
{\
82
83
    OPNAME ## h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(dst, src, stride, stride);\
83
84
}\
84
85
\
85
 
static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
86
static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
86
87
{\
87
88
    DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
88
89
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
89
90
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\
90
91
}\
91
92
\
92
 
static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
93
static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
93
94
{\
94
95
    DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
95
96
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
96
97
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\
97
98
}\
98
99
\
99
 
static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
100
static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
100
101
{\
101
102
    OPNAME ## h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(dst, src, stride, stride);\
102
103
}\
103
104
\
104
 
static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
105
static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
105
106
{\
106
107
    DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\
107
108
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\
108
109
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\
109
110
}\
110
111
\
111
 
static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
112
 
{\
113
 
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
114
 
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
115
 
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
116
 
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
117
 
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
118
 
}\
119
 
\
120
 
static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
121
 
{\
122
 
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
123
 
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
124
 
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
125
 
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
126
 
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
127
 
}\
128
 
\
129
 
static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
130
 
{\
131
 
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
132
 
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
133
 
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
134
 
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
135
 
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
136
 
}\
137
 
\
138
 
static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
139
 
{\
140
 
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
141
 
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
142
 
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
143
 
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
144
 
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
145
 
}\
146
 
\
147
 
static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
112
static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
 
113
{\
 
114
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
 
115
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
 
116
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
 
117
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
 
118
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
 
119
}\
 
120
\
 
121
static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
 
122
{\
 
123
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
 
124
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
 
125
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src, SIZE, stride);\
 
126
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
 
127
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
 
128
}\
 
129
\
 
130
static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
 
131
{\
 
132
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
 
133
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
 
134
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
 
135
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src, SIZE, stride);\
 
136
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
 
137
}\
 
138
\
 
139
static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
 
140
{\
 
141
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
 
142
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
 
143
    put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(halfH, src + stride, SIZE, stride);\
 
144
    put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(halfV, src+1, SIZE, stride);\
 
145
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfV, stride, SIZE, SIZE);\
 
146
}\
 
147
\
 
148
static void OPNAME ## h264_qpel ## SIZE ## _mc22_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
148
149
{\
149
150
    DECLARE_ALIGNED(16, int16_t, tmp)[SIZE*(SIZE+8)];\
150
151
    OPNAME ## h264_qpel ## SIZE ## _hv_lowpass_ ## CODETYPE(dst, tmp, src, stride, SIZE, stride);\
151
152
}\
152
153
\
153
 
static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
154
static void OPNAME ## h264_qpel ## SIZE ## _mc21_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
154
155
{\
155
156
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
156
157
    DECLARE_ALIGNED(16, uint8_t, halfHV)[SIZE*SIZE];\
160
161
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
161
162
}\
162
163
\
163
 
static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
164
static void OPNAME ## h264_qpel ## SIZE ## _mc23_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
164
165
{\
165
166
    DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\
166
167
    DECLARE_ALIGNED(16, uint8_t, halfHV)[SIZE*SIZE];\
170
171
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfH, halfHV, stride, SIZE, SIZE);\
171
172
}\
172
173
\
173
 
static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
174
static void OPNAME ## h264_qpel ## SIZE ## _mc12_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
174
175
{\
175
176
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
176
177
    DECLARE_ALIGNED(16, uint8_t, halfHV)[SIZE*SIZE];\
180
181
    OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, halfV, halfHV, stride, SIZE, SIZE);\
181
182
}\
182
183
\
183
 
static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, uint8_t *src, ptrdiff_t stride)\
 
184
static void OPNAME ## h264_qpel ## SIZE ## _mc32_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\
184
185
{\
185
186
    DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\
186
187
    DECLARE_ALIGNED(16, uint8_t, halfHV)[SIZE*SIZE];\
288
289
#if HAVE_ALTIVEC
289
290
    const int high_bit_depth = bit_depth > 8;
290
291
 
291
 
    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
 
292
    if (!PPC_ALTIVEC(av_get_cpu_flags()))
292
293
        return;
293
294
 
294
295
    if (!high_bit_depth) {