~ubuntu-branches/ubuntu/utopic/ffmpeg-debian/utopic

« back to all changes in this revision

Viewing changes to libavcodec/ppc/dsputil_ppc.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-01-20 09:20:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120092053-izz63p40hc98qfgp
Tags: 3:0.svn20090119-1ubuntu1
* merge from debian. LP: #318501
* new version fixes CVE-2008-3230, LP: #253767

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
#include "dsputil_ppc.h"
26
26
 
27
 
#ifdef HAVE_ALTIVEC
 
27
#if HAVE_ALTIVEC
28
28
#include "dsputil_altivec.h"
29
29
 
30
 
extern void fdct_altivec(int16_t *block);
31
 
extern void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
32
 
                         int x16, int y16, int rounder);
33
 
extern void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
34
 
extern void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
 
30
void fdct_altivec(int16_t *block);
 
31
void gmc1_altivec(uint8_t *dst, uint8_t *src, int stride, int h,
 
32
                  int x16, int y16, int rounder);
 
33
void idct_put_altivec(uint8_t *dest, int line_size, int16_t *block);
 
34
void idct_add_altivec(uint8_t *dest, int line_size, int16_t *block);
35
35
 
36
36
void dsputil_h264_init_ppc(DSPContext* c, AVCodecContext *avctx);
37
37
 
48
48
int mm_support(void)
49
49
{
50
50
    int result = 0;
51
 
#ifdef HAVE_ALTIVEC
 
51
#if HAVE_ALTIVEC
52
52
    if (has_altivec()) {
53
53
        result |= FF_MM_ALTIVEC;
54
54
    }
56
56
    return result;
57
57
}
58
58
 
59
 
#ifdef CONFIG_POWERPC_PERF
 
59
#if CONFIG_POWERPC_PERF
60
60
unsigned long long perfdata[POWERPC_NUM_PMC_ENABLED][powerpc_perf_total][powerpc_data_total];
61
61
/* list below must match enum in dsputil_ppc.h */
62
62
static unsigned char* perfname[] = {
91
91
#include <stdio.h>
92
92
#endif
93
93
 
94
 
#ifdef CONFIG_POWERPC_PERF
 
94
#if CONFIG_POWERPC_PERF
95
95
void powerpc_display_perf_report(void)
96
96
{
97
97
    int i, j;
165
165
 
166
166
/* same as above, when dcbzl clear a whole 128B cache line
167
167
   i.e. the PPC970 aka G5 */
168
 
#ifdef HAVE_DCBZL
 
168
#if HAVE_DCBZL
169
169
void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
170
170
{
171
171
POWERPC_PERF_DECLARE(powerpc_clear_blocks_dcbz128, 1);
195
195
}
196
196
#endif
197
197
 
198
 
#ifdef HAVE_DCBZL
 
198
#if HAVE_DCBZL
199
199
/* check dcbz report how many bytes are set to 0 by dcbz */
200
200
/* update 24/06/2003 : replace dcbz by dcbzl to get
201
201
   the intended effect (Apple "fixed" dcbz)
261
261
            break;
262
262
    }
263
263
 
264
 
#ifdef HAVE_ALTIVEC
265
 
    if(ENABLE_H264_DECODER) dsputil_h264_init_ppc(c, avctx);
 
264
#if HAVE_ALTIVEC
 
265
    if(CONFIG_H264_DECODER) dsputil_h264_init_ppc(c, avctx);
266
266
 
267
267
    if (has_altivec()) {
268
268
        mm_flags |= FF_MM_ALTIVEC;
269
269
 
270
270
        dsputil_init_altivec(c, avctx);
271
 
        if(ENABLE_SNOW_DECODER) snow_init_altivec(c, avctx);
272
 
        if(ENABLE_VC1_DECODER || ENABLE_WMV3_DECODER)
 
271
        if(CONFIG_SNOW_DECODER) snow_init_altivec(c, avctx);
 
272
        if(CONFIG_VC1_DECODER || CONFIG_WMV3_DECODER)
273
273
            vc1dsp_init_altivec(c, avctx);
274
274
        float_init_altivec(c, avctx);
275
275
        int_init_altivec(c, avctx);
276
276
        c->gmc1 = gmc1_altivec;
277
277
 
278
 
#ifdef CONFIG_ENCODERS
 
278
#if CONFIG_ENCODERS
279
279
        if (avctx->dct_algo == FF_DCT_AUTO ||
280
280
            avctx->dct_algo == FF_DCT_ALTIVEC) {
281
281
            c->fdct = fdct_altivec;
291
291
            }
292
292
        }
293
293
 
294
 
#ifdef CONFIG_POWERPC_PERF
 
294
#if CONFIG_POWERPC_PERF
295
295
        {
296
296
            int i, j;
297
297
            for (i = 0 ; i < powerpc_perf_total ; i++) {