Skip to content

Commit 9df5331

Browse files
committed
avfilter/vf_cuda_yadif: Avoid new syntax for vector initialisation
This requires a newer version of CUDA than we want to require.
1 parent 1b41115 commit 9df5331

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

libavfilter/vf_yadif_cuda.cu

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ __inline__ __device__ int min3(int a, int b, int c)
6060
return min(x, c);
6161
}
6262

63+
__inline__ __device__ uchar2 make_vector(unsigned char x, unsigned char y)
64+
{
65+
return make_uchar2(x, y);
66+
}
67+
68+
__inline__ __device__ ushort2 make_vector(unsigned short x, unsigned short y)
69+
{
70+
return make_ushort2(x, y);
71+
}
72+
6373
template<typename T>
6474
__inline__ __device__ T temporal_predictor(T A, T B, T C, T D, T E, T F,
6575
T G, T H, T I, T J, T K, T L,
@@ -201,9 +211,9 @@ __inline__ __device__ void yadif_double(T *dst,
201211
T m = tex2D<T>(cur, xo + 2, yo + 1);
202212
T n = tex2D<T>(cur, xo + 3, yo + 1);
203213

204-
T spatial_pred = {
214+
T spatial_pred = make_vector(
205215
spatial_predictor(a.x, b.x, c.x, d.x, e.x, f.x, g.x, h.x, i.x, j.x, k.x, l.x, m.x, n.x),
206-
spatial_predictor(a.y, b.y, c.y, d.y, e.y, f.y, g.y, h.y, i.y, j.y, k.y, l.y, m.y, n.y) };
216+
spatial_predictor(a.y, b.y, c.y, d.y, e.y, f.y, g.y, h.y, i.y, j.y, k.y, l.y, m.y, n.y));
207217

208218
// Calculate temporal prediction
209219
int is_second_field = !(parity ^ tff);
@@ -226,11 +236,11 @@ __inline__ __device__ void yadif_double(T *dst,
226236
T K = tex2D<T>(next2, xo, yo - 1);
227237
T L = tex2D<T>(next2, xo, yo + 1);
228238

229-
spatial_pred = {
239+
spatial_pred = make_vector(
230240
temporal_predictor(A.x, B.x, C.x, D.x, E.x, F.x, G.x, H.x, I.x, J.x, K.x, L.x,
231241
spatial_pred.x, skip_spatial_check),
232242
temporal_predictor(A.y, B.y, C.y, D.y, E.y, F.y, G.y, H.y, I.y, J.y, K.y, L.y,
233-
spatial_pred.y, skip_spatial_check) };
243+
spatial_pred.y, skip_spatial_check));
234244

235245
dst[yo*dst_pitch+xo] = spatial_pred;
236246
}

0 commit comments

Comments
 (0)