Revision 6a786b15 libavcodec/vc1dsp.c

View differences:

libavcodec/vc1dsp.c
199 199
    }
200 200
}
201 201

  
202
static void vc1_inv_trans_8x8_c(DCTELEM block[64])
202
static av_always_inline void vc1_inv_trans_8x8_c(DCTELEM block[64], int shl, int sub)
203 203
{
204 204
    int i;
205 205
    register int t1,t2,t3,t4,t5,t6,t7,t8;
......
254 254
        t3 =  9 * src[ 8] - 16 * src[24] +  4 * src[40] + 15 * src[56];
255 255
        t4 =  4 * src[ 8] -  9 * src[24] + 15 * src[40] - 16 * src[56];
256 256

  
257
        dst[ 0] = (t5 + t1) >> 7;
258
        dst[ 8] = (t6 + t2) >> 7;
259
        dst[16] = (t7 + t3) >> 7;
260
        dst[24] = (t8 + t4) >> 7;
261
        dst[32] = (t8 - t4 + 1) >> 7;
262
        dst[40] = (t7 - t3 + 1) >> 7;
263
        dst[48] = (t6 - t2 + 1) >> 7;
264
        dst[56] = (t5 - t1 + 1) >> 7;
257
        dst[ 0] = (((t5 + t1    ) >> 7) - sub) << shl;
258
        dst[ 8] = (((t6 + t2    ) >> 7) - sub) << shl;
259
        dst[16] = (((t7 + t3    ) >> 7) - sub) << shl;
260
        dst[24] = (((t8 + t4    ) >> 7) - sub) << shl;
261
        dst[32] = (((t8 - t4 + 1) >> 7) - sub) << shl;
262
        dst[40] = (((t7 - t3 + 1) >> 7) - sub) << shl;
263
        dst[48] = (((t6 - t2 + 1) >> 7) - sub) << shl;
264
        dst[56] = (((t5 - t1 + 1) >> 7) - sub) << shl;
265 265

  
266 266
        src++;
267 267
        dst++;
268 268
    }
269 269
}
270 270

  
271
static void vc1_inv_trans_8x8_add_c(uint8_t *dest, int linesize, DCTELEM *block)
272
{
273
    vc1_inv_trans_8x8_c(block, 0, 0);
274
    ff_add_pixels_clamped_c(block, dest, linesize);
275
}
276

  
277
static void vc1_inv_trans_8x8_put_signed_c(uint8_t *dest, int linesize, DCTELEM *block)
278
{
279
    vc1_inv_trans_8x8_c(block, 0, 0);
280
    ff_put_signed_pixels_clamped_c(block, dest, linesize);
281
}
282

  
283
static void vc1_inv_trans_8x8_put_signed_rangered_c(uint8_t *dest, int linesize, DCTELEM *block)
284
{
285
    vc1_inv_trans_8x8_c(block, 1, 0);
286
    ff_put_signed_pixels_clamped_c(block, dest, linesize);
287
}
288

  
289
static void vc1_inv_trans_8x8_put_c(uint8_t *dest, int linesize, DCTELEM *block)
290
{
291
    vc1_inv_trans_8x8_c(block, 0, 0);
292
    ff_put_pixels_clamped_c(block, dest, linesize);
293
}
294

  
295
static void vc1_inv_trans_8x8_put_rangered_c(uint8_t *dest, int linesize, DCTELEM *block)
296
{
297
    vc1_inv_trans_8x8_c(block, 1, 64);
298
    ff_put_pixels_clamped_c(block, dest, linesize);
299
}
300

  
271 301
/** Do inverse transform on 8x4 part of block
272 302
*/
273 303
static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block)
......
662 692
}
663 693

  
664 694
av_cold void ff_vc1dsp_init(VC1DSPContext* dsp) {
665
    dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
695
    dsp->vc1_inv_trans_8x8_add = vc1_inv_trans_8x8_add_c;
696
    dsp->vc1_inv_trans_8x8_put_signed[0] = vc1_inv_trans_8x8_put_signed_c;
697
    dsp->vc1_inv_trans_8x8_put_signed[1] = vc1_inv_trans_8x8_put_signed_rangered_c;
698
    dsp->vc1_inv_trans_8x8_put[0] = vc1_inv_trans_8x8_put_c;
699
    dsp->vc1_inv_trans_8x8_put[1] = vc1_inv_trans_8x8_put_rangered_c;
666 700
    dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
667 701
    dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
668 702
    dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;

Also available in: Unified diff