Revision 18b6a69c libavcodec/ppc/vc1dsp_altivec.c

View differences:

libavcodec/ppc/vc1dsp_altivec.c
130 130

  
131 131
/** Do inverse transform on 8x8 block
132 132
*/
133
static void vc1_inv_trans_8x8_altivec(DCTELEM block[64],
134
                                      int sign, int rangered)
133
static void vc1_inv_trans_8x8_altivec(DCTELEM block[64])
135 134
{
136 135
    vector signed short src0, src1, src2, src3, src4, src5, src6, src7;
137 136
    vector signed int s0, s1, s2, s3, s4, s5, s6, s7;
......
145 144
    const vector unsigned int vec_2 = vec_splat_u32(2);
146 145
    const vector  signed int vec_1s = vec_splat_s32(1);
147 146
    const vector unsigned int vec_1 = vec_splat_u32(1);
148
    const vector unsigned short rangered_shift = vec_splat_u16(1);
149
    const vector   signed short signed_bias = vec_sl(vec_splat_s16(4),
150
                                                     vec_splat_u16(4));
151 147

  
152 148
    src0 = vec_ld(  0, block);
153 149
    src1 = vec_ld( 16, block);
......
217 213
    src6 = vec_pack(sE, s6);
218 214
    src7 = vec_pack(sF, s7);
219 215

  
220
    if (rangered) {
221
        if (!sign) {
222
            src0 = vec_sub(src0, signed_bias);
223
            src1 = vec_sub(src1, signed_bias);
224
            src2 = vec_sub(src2, signed_bias);
225
            src3 = vec_sub(src3, signed_bias);
226
            src4 = vec_sub(src4, signed_bias);
227
            src5 = vec_sub(src5, signed_bias);
228
            src6 = vec_sub(src6, signed_bias);
229
            src7 = vec_sub(src7, signed_bias);
230
        }
231
        src0 = vec_sl(src0, rangered_shift);
232
        src1 = vec_sl(src1, rangered_shift);
233
        src2 = vec_sl(src2, rangered_shift);
234
        src3 = vec_sl(src3, rangered_shift);
235
        src4 = vec_sl(src4, rangered_shift);
236
        src5 = vec_sl(src5, rangered_shift);
237
        src6 = vec_sl(src6, rangered_shift);
238
        src7 = vec_sl(src7, rangered_shift);
239
    }
240

  
241 216
    vec_st(src0,  0, block);
242 217
    vec_st(src1, 16, block);
243 218
    vec_st(src2, 32, block);
......
248 223
    vec_st(src7,112, block);
249 224
}
250 225

  
251
static void vc1_inv_trans_8x8_add_altivec(uint8_t *dest, int stride, DCTELEM *b)
252
{
253
    vc1_inv_trans_8x8_altivec(b, 0, 0);
254
    ff_add_pixels_clamped_c(b, dest, stride);
255
}
256

  
257
static void vc1_inv_trans_8x8_put_signed_altivec(uint8_t *dest, int stride, DCTELEM *b)
258
{
259
    vc1_inv_trans_8x8_altivec(b, 1, 0);
260
    ff_put_signed_pixels_clamped_c(b, dest, stride);
261
}
262

  
263
static void vc1_inv_trans_8x8_put_signed_rangered_altivec(uint8_t *dest, int stride, DCTELEM *b)
264
{
265
    vc1_inv_trans_8x8_altivec(b, 1, 1);
266
    ff_put_signed_pixels_clamped_c(b, dest, stride);
267
}
268

  
269
static void vc1_inv_trans_8x8_put_altivec(uint8_t *dest, int stride, DCTELEM *b)
270
{
271
    vc1_inv_trans_8x8_altivec(b, 0, 0);
272
    ff_put_pixels_clamped_c(b, dest, stride);
273
}
274

  
275
static void vc1_inv_trans_8x8_put_rangered_altivec(uint8_t *dest, int stride, DCTELEM *b)
276
{
277
    vc1_inv_trans_8x8_altivec(b, 0, 1);
278
    ff_put_pixels_clamped_c(b, dest, stride);
279
}
280

  
281 226
/** Do inverse transform on 8x4 part of block
282 227
*/
283 228
static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, DCTELEM *block)
......
396 341
    if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
397 342
        return;
398 343

  
399
    dsp->vc1_inv_trans_8x8_add = vc1_inv_trans_8x8_add_altivec;
400
    dsp->vc1_inv_trans_8x8_put_signed[0] = vc1_inv_trans_8x8_put_signed_altivec;
401
    dsp->vc1_inv_trans_8x8_put_signed[1] = vc1_inv_trans_8x8_put_signed_rangered_altivec;
402
    dsp->vc1_inv_trans_8x8_put[0] = vc1_inv_trans_8x8_put_altivec;
403
    dsp->vc1_inv_trans_8x8_put[1] = vc1_inv_trans_8x8_put_rangered_altivec;
344
    dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_altivec;
404 345
    dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_altivec;
405 346
    dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = put_no_rnd_vc1_chroma_mc8_altivec;
406 347
    dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = avg_no_rnd_vc1_chroma_mc8_altivec;

Also available in: Unified diff