diff options
Diffstat (limited to 'src/libffmpeg/libavcodec/ppc')
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/Makefile.am | 3 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/dsputil_altivec.c | 8 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/dsputil_altivec.h | 10 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/dsputil_ppc.c | 17 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/dsputil_ppc.h | 123 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/gmc_altivec.c | 169 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/idct_altivec.c | 8 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c | 11 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c | 12 |
9 files changed, 334 insertions, 27 deletions
diff --git a/src/libffmpeg/libavcodec/ppc/Makefile.am b/src/libffmpeg/libavcodec/ppc/Makefile.am index a623a96f3..bb4618713 100644 --- a/src/libffmpeg/libavcodec/ppc/Makefile.am +++ b/src/libffmpeg/libavcodec/ppc/Makefile.am @@ -16,6 +16,7 @@ libavcodec_ppc_src = dsputil_altivec.c \ dsputil_ppc.c \ fft_altivec.c \ idct_altivec.c \ + gmc_altivec.c \ mpegvideo_altivec.c \ mpegvideo_ppc.c libavcodec_ppc_dummy = libavcodec_ppc_dummy.c @@ -29,7 +30,7 @@ endif libavcodec_ppc_la_SOURCES = $(ppc_modules) $(libavcodec_ppc_dummy) -noinst_HEADERS = dsputil_altivec.h +noinst_HEADERS = dsputil_altivec.h dsputil_ppc.h .s.lo: $(ASCOMPILE) -o $@ `test -f $< || echo '$(srcdir)/'`$< diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_altivec.c b/src/libffmpeg/libavcodec/ppc/dsputil_altivec.c index dc62e70f4..d48332ba9 100644 --- a/src/libffmpeg/libavcodec/ppc/dsputil_altivec.c +++ b/src/libffmpeg/libavcodec/ppc/dsputil_altivec.c @@ -480,7 +480,7 @@ int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size) return s; } -int pix_sum_altivec(UINT8 * pix, int line_size) +int pix_sum_altivec(uint8_t * pix, int line_size) { const vector unsigned int zero = (const vector unsigned int)vec_splat_u32(0); vector unsigned char perm, *pixv; @@ -513,7 +513,7 @@ int pix_sum_altivec(UINT8 * pix, int line_size) return s; } -void get_pixels_altivec(DCTELEM *restrict block, const UINT8 *pixels, int line_size) +void get_pixels_altivec(DCTELEM *restrict block, const uint8_t *pixels, int line_size) { int i; vector unsigned char perm, bytes, *pixv; @@ -539,8 +539,8 @@ void get_pixels_altivec(DCTELEM *restrict block, const UINT8 *pixels, int line_s } } -void diff_pixels_altivec(DCTELEM *restrict block, const UINT8 *s1, - const UINT8 *s2, int stride) +void diff_pixels_altivec(DCTELEM *restrict block, const uint8_t *s1, + const uint8_t *s2, int stride) { int i; vector unsigned char perm, bytes, *pixv; diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_altivec.h b/src/libffmpeg/libavcodec/ppc/dsputil_altivec.h index 61dbec548..f04496d62 100644 --- a/src/libffmpeg/libavcodec/ppc/dsputil_altivec.h +++ b/src/libffmpeg/libavcodec/ppc/dsputil_altivec.h @@ -34,12 +34,12 @@ extern int sad8x8_altivec(void *s, uint8_t *a, uint8_t *b, int stride); extern int pix_norm1_altivec(uint8_t *pix, int line_size); extern int sse8_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size); extern int sse16_altivec(void *v, uint8_t *pix1, uint8_t *pix2, int line_size); -extern int pix_sum_altivec(UINT8 * pix, int line_size); -extern void diff_pixels_altivec(DCTELEM* block, const UINT8* s1, const UINT8* s2, int stride); -extern void get_pixels_altivec(DCTELEM* block, const UINT8 * pixels, int line_size); +extern int pix_sum_altivec(uint8_t * pix, int line_size); +extern void diff_pixels_altivec(DCTELEM* block, const uint8_t* s1, const uint8_t* s2, int stride); +extern void get_pixels_altivec(DCTELEM* block, const uint8_t * pixels, int line_size); extern void add_bytes_altivec(uint8_t *dst, uint8_t *src, int w); -extern void put_pixels_clamped_altivec(const DCTELEM *block, UINT8 *restrict pixels, int line_size); +extern void put_pixels_clamped_altivec(const DCTELEM *block, uint8_t *restrict pixels, int line_size); extern void put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h); extern void avg_pixels16_altivec(uint8_t *block, const uint8_t *pixels, int line_size, int h); extern void avg_pixels8_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h); @@ -48,7 +48,7 @@ extern void put_no_rnd_pixels8_xy2_altivec(uint8_t *block, const uint8_t *pixels extern void put_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h); extern void put_no_rnd_pixels16_xy2_altivec(uint8_t * block, const uint8_t * pixels, int line_size, int h); -extern void gmc1_altivec(UINT8 *dst, UINT8 *src, int stride, int h, int x16, int y16, int rounder); +extern void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h, int x16, int y16, int rounder); extern int has_altivec(void); diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c b/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c index c502f5819..374309e37 100644 --- a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c +++ b/src/libffmpeg/libavcodec/ppc/dsputil_ppc.c @@ -25,6 +25,9 @@ #include "dsputil_altivec.h" #endif +extern void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block); +extern void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block); + int mm_flags = 0; int mm_support(void) @@ -169,7 +172,7 @@ long check_dcbz_effect(void) return count; } -void dsputil_init_ppc(DSPContext* c, unsigned mask) +void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx) { // Common optimisations whether Altivec or not @@ -215,6 +218,18 @@ void dsputil_init_ppc(DSPContext* c, unsigned mask) c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_altivec; c->gmc1 = gmc1_altivec; + + if ((avctx->idct_algo == FF_IDCT_AUTO) || + (avctx->idct_algo == FF_IDCT_ALTIVEC)) + { + c->idct_put = idct_put_altivec; + c->idct_add = idct_add_altivec; +#ifndef ALTIVEC_USE_REFERENCE_C_CODE + c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM; +#else /* ALTIVEC_USE_REFERENCE_C_CODE */ + c->idct_permutation_type = FF_NO_IDCT_PERM; +#endif /* ALTIVEC_USE_REFERENCE_C_CODE */ + } #ifdef POWERPC_TBL_PERFORMANCE_REPORT { diff --git a/src/libffmpeg/libavcodec/ppc/dsputil_ppc.h b/src/libffmpeg/libavcodec/ppc/dsputil_ppc.h new file mode 100644 index 000000000..ef1481a99 --- /dev/null +++ b/src/libffmpeg/libavcodec/ppc/dsputil_ppc.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _DSPUTIL_PPC_ +#define _DSPUTIL_PPC_ + +#ifdef POWERPC_TBL_PERFORMANCE_REPORT +void powerpc_display_perf_report(void); +/* if you add to the enum below, also add to the perfname array + in dsputil_ppc.c */ +enum powerpc_perf_index { + altivec_fft_num = 0, + altivec_gmc1_num, + altivec_dct_unquantize_h263_num, + altivec_idct_add_num, + altivec_idct_put_num, + altivec_put_pixels16_num, + altivec_avg_pixels16_num, + altivec_avg_pixels8_num, + altivec_put_pixels8_xy2_num, + altivec_put_no_rnd_pixels8_xy2_num, + altivec_put_pixels16_xy2_num, + altivec_put_no_rnd_pixels16_xy2_num, + powerpc_clear_blocks_dcbz32, + powerpc_perf_total +}; +enum powerpc_data_index { + powerpc_data_min = 0, + powerpc_data_max, + powerpc_data_sum, + powerpc_data_num, + powerpc_data_total +}; +extern unsigned long long perfdata[powerpc_perf_total][powerpc_data_total]; +#ifdef POWERPC_PERF_USE_PMC +extern unsigned long long perfdata_miss[powerpc_perf_total][powerpc_data_total]; +#endif + +#ifndef POWERPC_PERF_USE_PMC +#define POWERPC_GET_CYCLES(a) asm volatile("mftb %0" : "=r" (a)) +#define POWERPC_TBL_DECLARE(a, cond) register unsigned long tbl_start, tbl_stop +#define POWERPC_TBL_START_COUNT(a, cond) do { POWERPC_GET_CYCLES(tbl_start); } while (0) +#define POWERPC_TBL_STOP_COUNT(a, cond) do { \ + POWERPC_GET_CYCLES(tbl_stop); \ + if (tbl_stop > tbl_start) \ + { \ + unsigned long diff = tbl_stop - tbl_start; \ + if (cond) \ + { \ + if (diff < perfdata[a][powerpc_data_min]) \ + perfdata[a][powerpc_data_min] = diff; \ + if (diff > perfdata[a][powerpc_data_max]) \ + perfdata[a][powerpc_data_max] = diff; \ + perfdata[a][powerpc_data_sum] += diff; \ + perfdata[a][powerpc_data_num] ++; \ + } \ + } \ +} while (0) + +#else /* POWERPC_PERF_USE_PMC */ +#define POWERPC_GET_CYCLES(a) asm volatile("mfspr %0, 937" : "=r" (a)) +#define POWERPC_GET_MISS(a) asm volatile("mfspr %0, 938" : "=r" (a)) +#define POWERPC_TBL_DECLARE(a, cond) register unsigned long cycles_start, cycles_stop, miss_start, miss_stop +#define POWERPC_TBL_START_COUNT(a, cond) do { POWERPC_GET_MISS(miss_start); POWERPC_GET_CYCLES(cycles_start); } while (0) +#define POWERPC_TBL_STOP_COUNT(a, cond) do { \ + POWERPC_GET_CYCLES(cycles_stop); \ + POWERPC_GET_MISS(miss_stop); \ + if (cycles_stop >= cycles_start) \ + { \ + unsigned long diff = \ + cycles_stop - cycles_start; \ + if (cond) \ + { \ + if (diff < perfdata[a][powerpc_data_min]) \ + perfdata[a][powerpc_data_min] = diff; \ + if (diff > perfdata[a][powerpc_data_max]) \ + perfdata[a][powerpc_data_max] = diff; \ + perfdata[a][powerpc_data_sum] += diff; \ + perfdata[a][powerpc_data_num] ++; \ + } \ + } \ + if (miss_stop >= miss_start) \ + { \ + unsigned long diff = \ + miss_stop - miss_start; \ + if (cond) \ + { \ + if (diff < perfdata_miss[a][powerpc_data_min]) \ + perfdata_miss[a][powerpc_data_min] = diff; \ + if (diff > perfdata_miss[a][powerpc_data_max]) \ + perfdata_miss[a][powerpc_data_max] = diff; \ + perfdata_miss[a][powerpc_data_sum] += diff; \ + perfdata_miss[a][powerpc_data_num] ++; \ + } \ + } \ +} while (0) + +#endif /* POWERPC_PERF_USE_PMC */ + + +#else /* POWERPC_TBL_PERFORMANCE_REPORT */ +// those are needed to avoid empty statements. +#define POWERPC_TBL_DECLARE(a, cond) int altivec_placeholder __attribute__ ((unused)) +#define POWERPC_TBL_START_COUNT(a, cond) do {} while (0) +#define POWERPC_TBL_STOP_COUNT(a, cond) do {} while (0) +#endif /* POWERPC_TBL_PERFORMANCE_REPORT */ + +#endif /* _DSPUTIL_PPC_ */ diff --git a/src/libffmpeg/libavcodec/ppc/gmc_altivec.c b/src/libffmpeg/libavcodec/ppc/gmc_altivec.c new file mode 100644 index 000000000..515a766d7 --- /dev/null +++ b/src/libffmpeg/libavcodec/ppc/gmc_altivec.c @@ -0,0 +1,169 @@ +/* + * GMC (Global Motion Compensation) + * AltiVec-enabled + * Copyright (c) 2003 Romain Dolbeau <romain@dolbeau.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "../dsputil.h" + +#include "dsputil_altivec.h" + +/* + altivec-enhanced gmc1. ATM this code assume stride is a multiple of 8, + to preserve proper dst alignement. +*/ +void gmc1_altivec(uint8_t *dst /* align 8 */, uint8_t *src /* align1 */, int stride, int h, int x16, int y16, int rounder) +{ +POWERPC_TBL_DECLARE(altivec_gmc1_num, h == 8); +#ifdef ALTIVEC_USE_REFERENCE_C_CODE + const int A=(16-x16)*(16-y16); + const int B=( x16)*(16-y16); + const int C=(16-x16)*( y16); + const int D=( x16)*( y16); + int i; + +POWERPC_TBL_START_COUNT(altivec_gmc1_num, h == 8); + + for(i=0; i<h; i++) + { + dst[0]= (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1] + rounder)>>8; + dst[1]= (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2] + rounder)>>8; + dst[2]= (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3] + rounder)>>8; + dst[3]= (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4] + rounder)>>8; + dst[4]= (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5] + rounder)>>8; + dst[5]= (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6] + rounder)>>8; + dst[6]= (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7] + rounder)>>8; + dst[7]= (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8] + rounder)>>8; + dst+= stride; + src+= stride; + } + +POWERPC_TBL_STOP_COUNT(altivec_gmc1_num, h == 8); + +#else /* ALTIVEC_USE_REFERENCE_C_CODE */ + const unsigned short __attribute__ ((aligned(16))) rounder_a[8] = + {rounder, rounder, rounder, rounder, + rounder, rounder, rounder, rounder}; + const unsigned short __attribute__ ((aligned(16))) ABCD[8] = + { + (16-x16)*(16-y16), /* A */ + ( x16)*(16-y16), /* B */ + (16-x16)*( y16), /* C */ + ( x16)*( y16), /* D */ + 0, 0, 0, 0 /* padding */ + }; + register const vector unsigned char vczero = (const vector unsigned char)vec_splat_u8(0); + register const vector unsigned short vcsr8 = (const vector unsigned short)vec_splat_u16(8); + register vector unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC, srcvD; + register vector unsigned short Av, Bv, Cv, Dv, rounderV, tempA, tempB, tempC, tempD; + int i; + unsigned long dst_odd = (unsigned long)dst & 0x0000000F; + unsigned long src_really_odd = (unsigned long)src & 0x0000000F; + + +POWERPC_TBL_START_COUNT(altivec_gmc1_num, h == 8); + + tempA = vec_ld(0, (unsigned short*)ABCD); + Av = vec_splat(tempA, 0); + Bv = vec_splat(tempA, 1); + Cv = vec_splat(tempA, 2); + Dv = vec_splat(tempA, 3); + + rounderV = vec_ld(0, (unsigned short*)rounder_a); + + // we'll be able to pick-up our 9 char elements + // at src from those 32 bytes + // we load the first batch here, as inside the loop + // we can re-use 'src+stride' from one iteration + // as the 'src' of the next. + src_0 = vec_ld(0, src); + src_1 = vec_ld(16, src); + srcvA = vec_perm(src_0, src_1, vec_lvsl(0, src)); + + if (src_really_odd != 0x0000000F) + { // if src & 0xF == 0xF, then (src+1) is properly aligned on the second vector. + srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src)); + } + else + { + srcvB = src_1; + } + srcvA = vec_mergeh(vczero, srcvA); + srcvB = vec_mergeh(vczero, srcvB); + + for(i=0; i<h; i++) + { + dst_odd = (unsigned long)dst & 0x0000000F; + src_really_odd = (((unsigned long)src) + stride) & 0x0000000F; + + dstv = vec_ld(0, dst); + + // we we'll be able to pick-up our 9 char elements + // at src + stride from those 32 bytes + // then reuse the resulting 2 vectors srvcC and srcvD + // as the next srcvA and srcvB + src_0 = vec_ld(stride + 0, src); + src_1 = vec_ld(stride + 16, src); + srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src)); + + if (src_really_odd != 0x0000000F) + { // if src & 0xF == 0xF, then (src+1) is properly aligned on the second vector. + srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src)); + } + else + { + srcvD = src_1; + } + + srcvC = vec_mergeh(vczero, srcvC); + srcvD = vec_mergeh(vczero, srcvD); + + + // OK, now we (finally) do the math :-) + // those four instructions replaces 32 int muls & 32 int adds. + // isn't AltiVec nice ? + tempA = vec_mladd((vector unsigned short)srcvA, Av, rounderV); + tempB = vec_mladd((vector unsigned short)srcvB, Bv, tempA); + tempC = vec_mladd((vector unsigned short)srcvC, Cv, tempB); + tempD = vec_mladd((vector unsigned short)srcvD, Dv, tempC); + + srcvA = srcvC; + srcvB = srcvD; + + tempD = vec_sr(tempD, vcsr8); + + dstv2 = vec_pack(tempD, (vector unsigned short)vczero); + + if (dst_odd) + { + dstv2 = vec_perm(dstv, dstv2, vcprm(0,1,s0,s1)); + } + else + { + dstv2 = vec_perm(dstv, dstv2, vcprm(s0,s1,2,3)); + } + + vec_st(dstv2, 0, dst); + + dst += stride; + src += stride; + } + +POWERPC_TBL_STOP_COUNT(altivec_gmc1_num, h == 8); + +#endif /* ALTIVEC_USE_REFERENCE_C_CODE */ +} diff --git a/src/libffmpeg/libavcodec/ppc/idct_altivec.c b/src/libffmpeg/libavcodec/ppc/idct_altivec.c index 1619f1731..13df78f32 100644 --- a/src/libffmpeg/libavcodec/ppc/idct_altivec.c +++ b/src/libffmpeg/libavcodec/ppc/idct_altivec.c @@ -176,8 +176,8 @@ void idct_put_altivec(uint8_t* dest, int stride, vector_s16_t* block) POWERPC_TBL_DECLARE(altivec_idct_put_num, 1); #ifdef ALTIVEC_USE_REFERENCE_C_CODE POWERPC_TBL_START_COUNT(altivec_idct_put_num, 1); - void simple_idct_put(UINT8 *dest, int line_size, INT16 *block); - simple_idct_put(dest, stride, (INT16*)block); + void simple_idct_put(uint8_t *dest, int line_size, int16_t *block); + simple_idct_put(dest, stride, (int16_t*)block); POWERPC_TBL_STOP_COUNT(altivec_idct_put_num, 1); #else /* ALTIVEC_USE_REFERENCE_C_CODE */ vector_u8_t tmp; @@ -209,8 +209,8 @@ void idct_add_altivec(uint8_t* dest, int stride, vector_s16_t* block) POWERPC_TBL_DECLARE(altivec_idct_add_num, 1); #ifdef ALTIVEC_USE_REFERENCE_C_CODE POWERPC_TBL_START_COUNT(altivec_idct_add_num, 1); - void simple_idct_add(UINT8 *dest, int line_size, INT16 *block); - simple_idct_add(dest, stride, (INT16*)block); + void simple_idct_add(uint8_t *dest, int line_size, int16_t *block); + simple_idct_add(dest, stride, (int16_t*)block); POWERPC_TBL_STOP_COUNT(altivec_idct_add_num, 1); #else /* ALTIVEC_USE_REFERENCE_C_CODE */ vector_u8_t tmp; diff --git a/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c b/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c index 6c3be0e77..95558a6be 100644 --- a/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c +++ b/src/libffmpeg/libavcodec/ppc/mpegvideo_altivec.c @@ -21,7 +21,6 @@ #include "../dsputil.h" #include "../mpegvideo.h" #include "dsputil_altivec.h" -#include "xineutils.h" // Swaps two variables (used for altivec registers) #define SWAP(a,b) \ @@ -469,7 +468,7 @@ int dct_quantize_altivec(MpegEncContext* s, // and handle it using the vector unit if we can. This is the permute used // by the altivec idct, so it is common when using the altivec dct. - if ((lastNonZero > 0) && (s->idct_permutation_type == FF_TRANSPOSE_IDCT_PERM)) + if ((lastNonZero > 0) && (s->dsp.idct_permutation_type == FF_TRANSPOSE_IDCT_PERM)) { TRANSPOSE8(data0, data1, data2, data3, data4, data5, data6, data7); } @@ -502,10 +501,10 @@ int dct_quantize_altivec(MpegEncContext* s, // We handled the tranpose permutation above and we don't // need to permute the "no" permutation case. if ((lastNonZero > 0) && - (s->idct_permutation_type != FF_TRANSPOSE_IDCT_PERM) && - (s->idct_permutation_type != FF_NO_IDCT_PERM)) + (s->dsp.idct_permutation_type != FF_TRANSPOSE_IDCT_PERM) && + (s->dsp.idct_permutation_type != FF_NO_IDCT_PERM)) { - ff_block_permute(data, s->idct_permutation, + ff_block_permute(data, s->dsp.idct_permutation, s->intra_scantable.scantable, lastNonZero); } @@ -524,7 +523,7 @@ POWERPC_TBL_DECLARE(altivec_dct_unquantize_h263_num, 1); int i, level, qmul, qadd; int nCoeffs; - XINE_ASSERT(s->block_last_index[n]>=0, "s->block_last_index[%d] < 0", n); + assert(s->block_last_index[n]>=0); POWERPC_TBL_START_COUNT(altivec_dct_unquantize_h263_num, 1); diff --git a/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c b/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c index 9757f5f39..c290dde16 100644 --- a/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c +++ b/src/libffmpeg/libavcodec/ppc/mpegvideo_ppc.c @@ -30,8 +30,8 @@ extern int dct_quantize_altivec(MpegEncContext *s, extern void dct_unquantize_h263_altivec(MpegEncContext *s, DCTELEM *block, int n, int qscale); -extern void idct_put_altivec(UINT8 *dest, int line_size, INT16 *block);
-extern void idct_add_altivec(UINT8 *dest, int line_size, INT16 *block);
+extern void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
+extern void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
void MPV_common_init_ppc(MpegEncContext *s)
@@ -42,12 +42,12 @@ void MPV_common_init_ppc(MpegEncContext *s) if ((s->avctx->idct_algo == FF_IDCT_AUTO) ||
(s->avctx->idct_algo == FF_IDCT_ALTIVEC))
{
- s->idct_put = idct_put_altivec;
- s->idct_add = idct_add_altivec;
+ s->dsp.idct_put = idct_put_altivec;
+ s->dsp.idct_add = idct_add_altivec;
#ifndef ALTIVEC_USE_REFERENCE_C_CODE - s->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
+ s->dsp.idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
#else /* ALTIVEC_USE_REFERENCE_C_CODE */ - s->idct_permutation_type = FF_NO_IDCT_PERM; + s->dsp.idct_permutation_type = FF_NO_IDCT_PERM; #endif /* ALTIVEC_USE_REFERENCE_C_CODE */ }
|