~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/ppc/dsputil_ppc.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
{
49
49
    register int misal = ((unsigned long)blocks & 0x00000010);
50
50
    register int i = 0;
51
 
#if 1
52
51
    if (misal) {
53
52
        ((unsigned long*)blocks)[0] = 0L;
54
53
        ((unsigned long*)blocks)[1] = 0L;
66
65
        ((unsigned long*)blocks)[191] = 0L;
67
66
        i += 16;
68
67
    }
69
 
#else
70
 
    memset(blocks, 0, sizeof(DCTELEM)*6*64);
71
 
#endif
72
68
}
73
69
 
74
70
/* same as above, when dcbzl clear a whole 128B cache line
78
74
{
79
75
    register int misal = ((unsigned long)blocks & 0x0000007f);
80
76
    register int i = 0;
81
 
#if 1
82
77
    if (misal) {
83
78
        // we could probably also optimize this case,
84
79
        // but there's not much point as the machines
89
84
        for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) {
90
85
            __asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory");
91
86
        }
92
 
#else
93
 
    memset(blocks, 0, sizeof(DCTELEM)*6*64);
94
 
#endif
95
87
}
96
88
#else
97
89
static void clear_blocks_dcbz128_ppc(DCTELEM *blocks)
153
145
 
154
146
void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx)
155
147
{
156
 
    const int high_bit_depth = avctx->codec_id == CODEC_ID_H264 && avctx->bits_per_raw_sample > 8;
 
148
    const int high_bit_depth = avctx->bits_per_raw_sample > 8;
157
149
 
158
150
    // Common optimizations whether AltiVec is available or not
159
151
    c->prefetch = prefetch_ppc;
180
172
        c->gmc1 = gmc1_altivec;
181
173
 
182
174
#if CONFIG_ENCODERS
183
 
        if (avctx->dct_algo == FF_DCT_AUTO ||
184
 
            avctx->dct_algo == FF_DCT_ALTIVEC) {
 
175
        if (avctx->bits_per_raw_sample <= 8 &&
 
176
            (avctx->dct_algo == FF_DCT_AUTO ||
 
177
             avctx->dct_algo == FF_DCT_ALTIVEC)) {
185
178
            c->fdct = fdct_altivec;
186
179
        }
187
180
#endif //CONFIG_ENCODERS
188
181
 
189
 
        if (avctx->lowres==0) {
 
182
        if (avctx->lowres == 0 && avctx->bits_per_raw_sample <= 8) {
190
183
            if ((avctx->idct_algo == FF_IDCT_AUTO) ||
191
184
                (avctx->idct_algo == FF_IDCT_ALTIVEC)) {
192
185
                c->idct_put = idct_put_altivec;