~ubuntu-branches/ubuntu/trusty/libav/trusty-proposed

« back to all changes in this revision

Viewing changes to libavcodec/ppc/vp8dsp_altivec.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2013-10-22 23:24:08 UTC
  • mfrom: (1.3.36 sid)
  • Revision ID: package-import@ubuntu.com-20131022232408-b8tvvn4pyzri9mi3
Tags: 6:9.10-1ubuntu1
* Build all -extra flavors from this source package, as libav got demoted
  from main to universe, cf LP: #1243235
* Simplify debian/rules to follow exactly the code that debian executes
* New upstream (LP: #1180288) fixes lots of security issues (LP: #1242802)
* Merge from unstable, remaining changes:
  - build-depend on libtiff5-dev rather than libtiff4-dev,
    avoids FTBFS caused by imlib
  - follow the regular debian codepaths

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
 
1
/*
2
2
 * VP8 compatible video decoder
3
3
 *
4
4
 * Copyright (C) 2010 David Conrad
21
21
 */
22
22
 
23
23
#include "libavutil/cpu.h"
 
24
#include "libavutil/mem.h"
 
25
#include "libavutil/ppc/types_altivec.h"
 
26
#include "libavutil/ppc/util_altivec.h"
24
27
#include "libavcodec/vp8dsp.h"
25
28
#include "dsputil_altivec.h"
26
 
#include "types_altivec.h"
27
 
#include "util_altivec.h"
28
29
 
29
30
#define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ }
30
31
 
75
76
    dstv = vec_sra(dstv, c7)
76
77
 
77
78
static av_always_inline
78
 
void put_vp8_epel_h_altivec_core(uint8_t *dst, int dst_stride,
79
 
                                 uint8_t *src, int src_stride,
 
79
void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
 
80
                                 uint8_t *src, ptrdiff_t src_stride,
80
81
                                 int h, int mx, int w, int is6tap)
81
82
{
82
83
    LOAD_H_SUBPEL_FILTER(mx-1);
161
162
    dstv = vec_sra(dstv, c7)
162
163
 
163
164
static av_always_inline
164
 
void put_vp8_epel_v_altivec_core(uint8_t *dst, int dst_stride,
165
 
                                 uint8_t *src, int src_stride,
 
165
void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
 
166
                                 uint8_t *src, ptrdiff_t src_stride,
166
167
                                 int h, int my, int w, int is6tap)
167
168
{
168
169
    LOAD_V_SUBPEL_FILTER(my-1);
226
227
 
227
228
#define EPEL_FUNCS(WIDTH, TAPS) \
228
229
static av_noinline \
229
 
void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, int dst_stride, uint8_t *src, int src_stride, int h, int mx, int my) \
 
230
void put_vp8_epel ## WIDTH ## _h ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
230
231
{ \
231
232
    put_vp8_epel_h_altivec_core(dst, dst_stride, src, src_stride, h, mx, WIDTH, TAPS == 6); \
232
233
} \
233
234
\
234
235
static av_noinline \
235
 
void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, int dst_stride, uint8_t *src, int src_stride, int h, int mx, int my) \
 
236
void put_vp8_epel ## WIDTH ## _v ## TAPS ## _altivec(uint8_t *dst, ptrdiff_t dst_stride, uint8_t *src, ptrdiff_t src_stride, int h, int mx, int my) \
236
237
{ \
237
238
    put_vp8_epel_v_altivec_core(dst, dst_stride, src, src_stride, h, my, WIDTH, TAPS == 6); \
238
239
}
239
240
 
240
241
#define EPEL_HV(WIDTH, HTAPS, VTAPS) \
241
 
static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, int stride, uint8_t *src, int s, int h, int mx, int my) \
 
242
static void put_vp8_epel ## WIDTH ## _h ## HTAPS ## v ## VTAPS ## _altivec(uint8_t *dst, ptrdiff_t stride, uint8_t *src, ptrdiff_t s, int h, int mx, int my) \
242
243
{ \
243
244
    DECLARE_ALIGNED(16, uint8_t, tmp)[(2*WIDTH+5)*16]; \
244
245
    if (VTAPS == 6) { \
266
267
EPEL_HV(4,  6,4)
267
268
EPEL_HV(4,  4,4)
268
269
 
269
 
static void put_vp8_pixels16_altivec(uint8_t *dst, int stride, uint8_t *src, int s, int h, int mx, int my)
 
270
static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t stride, uint8_t *src, ptrdiff_t s, int h, int mx, int my)
270
271
{
271
 
    put_pixels16_altivec(dst, src, stride, h);
 
272
    ff_put_pixels16_altivec(dst, src, stride, h);
272
273
}
273
274
 
274
275
av_cold void ff_vp8dsp_init_altivec(VP8DSPContext *c)