* commit 'e3fcb14347466095839c2a3c47ebecff02da891e': dsputil: Split off IDCT bits into their own context Conflicts: configure libavcodec/aic.c libavcodec/arm/Makefile libavcodec/arm/dsputil_init_arm.c libavcodec/arm/dsputil_init_armv6.c libavcodec/asvdec.c libavcodec/dnxhdenc.c libavcodec/dsputil.c libavcodec/dvdec.c libavcodec/dxva2_mpeg2.c libavcodec/intrax8.c libavcodec/mdec.c libavcodec/mjpegdec.c libavcodec/mjpegenc_common.h libavcodec/mpegvideo.c libavcodec/ppc/dsputil_altivec.h libavcodec/ppc/dsputil_ppc.c libavcodec/ppc/idctdsp.c libavcodec/x86/Makefile libavcodec/x86/dsputil_init.c libavcodec/x86/dsputil_mmx.c libavcodec/x86/dsputil_x86.h
Showing the changes to libavcodec/ppc (4 of 84 files). Show all
Unified · Split
| @@ -9,6 +9,7 @@ OBJS-$(CONFIG_H264DSP) += ppc/h264dsp.o ppc/hpeldsp_altivec.o · 8 unmodified lines | ||
| 9 | 9 | OBJS-$(CONFIG_H264QPEL) += ppc/h264qpel.o |
| 10 | 10 | OBJS-$(CONFIG_HPELDSP) += ppc/hpeldsp_altivec.o |
| 11 | 11 | OBJS-$(CONFIG_HUFFYUVDSP) += ppc/huffyuvdsp_altivec.o |
| 12 | +OBJS-$(CONFIG_IDCTDSP) += ppc/idctdsp.o | |
| 12 | 13 | OBJS-$(CONFIG_MPEGAUDIODSP) += ppc/mpegaudiodsp_altivec.o |
| 13 | 14 | OBJS-$(CONFIG_MPEGVIDEO) += ppc/mpegvideo_altivec.o \ |
| 14 | 15 | ppc/mpegvideodsp.o |
| @@ -24,7 +25,6 @@ OBJS-$(CONFIG_VP8_DECODER) += ppc/vp8dsp_altivec.o · 9 unmodified lines | ||
| 24 | 25 | |
| 25 | 26 | ALTIVEC-OBJS-$(CONFIG_DSPUTIL) += ppc/dsputil_altivec.o \ |
| 26 | 27 | ppc/fdct_altivec.o \ |
| 27 | − ppc/idct_altivec.o \ | |
| 28 | 28 | |
| 29 | 29 | FFT-OBJS-$(HAVE_GNU_AS) += ppc/fft_altivec_s.o |
| 30 | 30 | FFT-OBJS-$(HAVE_VSX) += ppc/fft_vsx.o |
| @@ -29,10 +29,6 @@ · 28 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | void ff_fdct_altivec(int16_t *block); |
| 31 | 31 | |
| 32 | −void ff_idct_altivec(int16_t *block); | |
| 33 | −void ff_idct_put_altivec(uint8_t *dest, int line_size, int16_t *block); | |
| 34 | −void ff_idct_add_altivec(uint8_t *dest, int line_size, int16_t *block); | |
| 35 | − | |
| 36 | 32 | void ff_dsputil_init_altivec(DSPContext *c, AVCodecContext *avctx, |
| 37 | 33 | unsigned high_bit_depth); |
| 38 | 34 | |
| @@ -43,15 +43,6 @@ av_cold void ff_dsputil_init_ppc(DSPContext *c, AVCodecContext *avctx, · 42 unmodified lines | ||
| 43 | 43 | c->fdct = ff_fdct_altivec; |
| 44 | 44 | } |
| 45 | 45 | #endif //CONFIG_ENCODERS |
| 46 | − if (avctx->lowres == 0) { | |
| 47 | − if ((avctx->idct_algo == FF_IDCT_AUTO) || | |
| 48 | − (avctx->idct_algo == FF_IDCT_ALTIVEC)) { | |
| 49 | − c->idct = ff_idct_altivec; | |
| 50 | − c->idct_put = ff_idct_put_altivec; | |
| 51 | − c->idct_add = ff_idct_add_altivec; | |
| 52 | − c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; | |
| 53 | − } | |
| 54 | − } | |
| 55 | 46 | } |
| 56 | 47 | } |
| 57 | 48 | } |
| @@ -37,8 +37,13 @@ · 36 unmodified lines | ||
| 37 | 37 | #include <altivec.h> |
| 38 | 38 | #endif |
| 39 | 39 | |
| 40 | +#include "libavutil/attributes.h" | |
| 41 | +#include "libavutil/cpu.h" | |
| 42 | +#include "libavutil/ppc/cpu.h" | |
| 40 | 43 | #include "libavutil/ppc/types_altivec.h" |
| 41 | −#include "dsputil_altivec.h" | |
| 44 | +#include "libavcodec/idctdsp.h" | |
| 45 | + | |
| 46 | +#if HAVE_ALTIVEC | |
| 42 | 47 | |
| 43 | 48 | #define IDCT_HALF \ |
| 44 | 49 | /* 1st stage */ \ |
| @@ -148,7 +153,7 @@ static const vec_s16 constants[5] = { · 103 unmodified lines | ||
| 148 | 153 | { 19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722 } |
| 149 | 154 | }; |
| 150 | 155 | |
| 151 | −void ff_idct_altivec(int16_t *blk) | |
| 156 | +static void idct_altivec(int16_t *blk) | |
| 152 | 157 | { |
| 153 | 158 | vec_s16 *block = (vec_s16 *) blk; |
| 154 | 159 | |
| @@ -164,7 +169,7 @@ void ff_idct_altivec(int16_t *blk) · 9 unmodified lines | ||
| 164 | 169 | block[7] = vx7; |
| 165 | 170 | } |
| 166 | 171 | |
| 167 | −void ff_idct_put_altivec(uint8_t *dest, int stride, int16_t *blk) | |
| 172 | +static void idct_put_altivec(uint8_t *dest, int stride, int16_t *blk) | |
| 168 | 173 | { |
| 169 | 174 | vec_s16 *block = (vec_s16 *) blk; |
| 170 | 175 | vec_u8 tmp; |
| @@ -193,7 +198,7 @@ void ff_idct_put_altivec(uint8_t *dest, int stride, int16_t *blk) · 22 unmodified lines | ||
| 193 | 198 | COPY(dest, vx7); |
| 194 | 199 | } |
| 195 | 200 | |
| 196 | −void ff_idct_add_altivec(uint8_t *dest, int stride, int16_t *blk) | |
| 201 | +static void idct_add_altivec(uint8_t *dest, int stride, int16_t *blk) | |
| 197 | 202 | { |
| 198 | 203 | vec_s16 *block = (vec_s16 *) blk; |
| 199 | 204 | vec_u8 tmp; |
| @@ -235,3 +240,23 @@ void ff_idct_add_altivec(uint8_t *dest, int stride, int16_t *blk) · 35 unmodified lines | ||
| 235 | 240 | dest += stride; |
| 236 | 241 | ADD(dest, vx7, perm1); |
| 237 | 242 | } |
| 243 | + | |
| 244 | +#endif /* HAVE_ALTIVEC */ | |
| 245 | + | |
| 246 | +av_cold void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, | |
| 247 | + unsigned high_bit_depth) | |
| 248 | +{ | |
| 249 | +#if HAVE_ALTIVEC | |
| 250 | + if (PPC_ALTIVEC(av_get_cpu_flags())) { | |
| 251 | + if (!high_bit_depth && avctx->lowres == 0) { | |
| 252 | + if ((avctx->idct_algo == FF_IDCT_AUTO) || | |
| 253 | + (avctx->idct_algo == FF_IDCT_ALTIVEC)) { | |
| 254 | + c->idct = idct_altivec; | |
| 255 | + c->idct_add = idct_add_altivec; | |
| 256 | + c->idct_put = idct_put_altivec; | |
| 257 | + c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; | |
| 258 | + } | |
| 259 | + } | |
| 260 | + } | |
| 261 | +#endif /* HAVE_ALTIVEC */ | |
| 262 | +} | |