Revision 22893e10 libavcodec/vp8dsp.c

View differences:

libavcodec/vp8dsp.c
331 331
    cm[(F[2]*src[x+0*stride] - F[1]*src[x-1*stride] + \
332 332
        F[3]*src[x+1*stride] - F[4]*src[x+2*stride] + 64) >> 7]
333 333

  
334
#define VP8_EPEL_H(SIZE, FILTER, FILTERNAME) \
335
static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
334
#define VP8_EPEL_H(SIZE, TAPS) \
335
static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
336 336
{ \
337 337
    const uint8_t *filter = subpel_filters[mx-1]; \
338 338
    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
......
340 340
\
341 341
    for (y = 0; y < h; y++) { \
342 342
        for (x = 0; x < SIZE; x++) \
343
            dst[x] = FILTER(src, filter, 1); \
343
            dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \
344 344
        dst += dststride; \
345 345
        src += srcstride; \
346 346
    } \
347 347
}
348
#define VP8_EPEL_V(SIZE, FILTER, FILTERNAME) \
349
static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
348
#define VP8_EPEL_V(SIZE, TAPS) \
349
static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
350 350
{ \
351 351
    const uint8_t *filter = subpel_filters[my-1]; \
352 352
    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
......
354 354
\
355 355
    for (y = 0; y < h; y++) { \
356 356
        for (x = 0; x < SIZE; x++) \
357
            dst[x] = FILTER(src, filter, srcstride); \
357
            dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \
358 358
        dst += dststride; \
359 359
        src += srcstride; \
360 360
    } \
361 361
}
362
#define VP8_EPEL_HV(SIZE, FILTERX, FILTERY, FILTERNAME) \
363
static void put_vp8_epel ## SIZE ## _ ## FILTERNAME ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
362
#define VP8_EPEL_HV(SIZE, HTAPS, VTAPS) \
363
static void put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, int dststride, uint8_t *src, int srcstride, int h, int mx, int my) \
364 364
{ \
365 365
    const uint8_t *filter = subpel_filters[mx-1]; \
366 366
    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; \
367 367
    int x, y; \
368
    uint8_t tmp_array[(2*SIZE+5)*SIZE]; \
368
    uint8_t tmp_array[(2*SIZE+VTAPS-1)*SIZE]; \
369 369
    uint8_t *tmp = tmp_array; \
370
    src -= 2*srcstride; \
370
    src -= (2-(VTAPS==4))*srcstride; \
371 371
\
372
    for (y = 0; y < h+5; y++) { \
372
    for (y = 0; y < h+VTAPS-1; y++) { \
373 373
        for (x = 0; x < SIZE; x++) \
374
            tmp[x] = FILTERX(src, filter, 1); \
374
            tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \
375 375
        tmp += SIZE; \
376 376
        src += srcstride; \
377 377
    } \
378 378
\
379
    tmp = tmp_array + 2*SIZE; \
379
    tmp = tmp_array + (2-(VTAPS==4))*SIZE; \
380 380
    filter = subpel_filters[my-1]; \
381 381
\
382 382
    for (y = 0; y < h; y++) { \
383 383
        for (x = 0; x < SIZE; x++) \
384
            dst[x] = FILTERY(tmp, filter, SIZE); \
384
            dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \
385 385
        dst += dststride; \
386 386
        tmp += SIZE; \
387 387
    } \
388 388
}
389 389

  
390
VP8_EPEL_H(16, FILTER_4TAP, h4)
391
VP8_EPEL_H(8,  FILTER_4TAP, h4)
392
VP8_EPEL_H(4,  FILTER_4TAP, h4)
393
VP8_EPEL_H(16, FILTER_6TAP, h6)
394
VP8_EPEL_H(8,  FILTER_6TAP, h6)
395
VP8_EPEL_H(4,  FILTER_6TAP, h6)
396
VP8_EPEL_V(16, FILTER_4TAP, v4)
397
VP8_EPEL_V(8,  FILTER_4TAP, v4)
398
VP8_EPEL_V(4,  FILTER_4TAP, v4)
399
VP8_EPEL_V(16, FILTER_6TAP, v6)
400
VP8_EPEL_V(8,  FILTER_6TAP, v6)
401
VP8_EPEL_V(4,  FILTER_6TAP, v6)
402
VP8_EPEL_HV(16, FILTER_4TAP, FILTER_4TAP, h4v4)
403
VP8_EPEL_HV(8,  FILTER_4TAP, FILTER_4TAP, h4v4)
404
VP8_EPEL_HV(4,  FILTER_4TAP, FILTER_4TAP, h4v4)
405
VP8_EPEL_HV(16, FILTER_4TAP, FILTER_6TAP, h4v6)
406
VP8_EPEL_HV(8,  FILTER_4TAP, FILTER_6TAP, h4v6)
407
VP8_EPEL_HV(4,  FILTER_4TAP, FILTER_6TAP, h4v6)
408
VP8_EPEL_HV(16, FILTER_6TAP, FILTER_4TAP, h6v4)
409
VP8_EPEL_HV(8,  FILTER_6TAP, FILTER_4TAP, h6v4)
410
VP8_EPEL_HV(4,  FILTER_6TAP, FILTER_4TAP, h6v4)
411
VP8_EPEL_HV(16, FILTER_6TAP, FILTER_6TAP, h6v6)
412
VP8_EPEL_HV(8,  FILTER_6TAP, FILTER_6TAP, h6v6)
413
VP8_EPEL_HV(4,  FILTER_6TAP, FILTER_6TAP, h6v6)
390
VP8_EPEL_H(16, 4)
391
VP8_EPEL_H(8,  4)
392
VP8_EPEL_H(4,  4)
393
VP8_EPEL_H(16, 6)
394
VP8_EPEL_H(8,  6)
395
VP8_EPEL_H(4,  6)
396
VP8_EPEL_V(16, 4)
397
VP8_EPEL_V(8,  4)
398
VP8_EPEL_V(4,  4)
399
VP8_EPEL_V(16, 6)
400
VP8_EPEL_V(8,  6)
401
VP8_EPEL_V(4,  6)
402
VP8_EPEL_HV(16, 4, 4)
403
VP8_EPEL_HV(8,  4, 4)
404
VP8_EPEL_HV(4,  4, 4)
405
VP8_EPEL_HV(16, 4, 6)
406
VP8_EPEL_HV(8,  4, 6)
407
VP8_EPEL_HV(4,  4, 6)
408
VP8_EPEL_HV(16, 6, 4)
409
VP8_EPEL_HV(8,  6, 4)
410
VP8_EPEL_HV(4,  6, 4)
411
VP8_EPEL_HV(16, 6, 6)
412
VP8_EPEL_HV(8,  6, 6)
413
VP8_EPEL_HV(4,  6, 6)
414 414

  
415 415
#define VP8_BILINEAR(SIZE) \
416 416
static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, int stride, uint8_t *src, int s2, int h, int mx, int my) \

Also available in: Unified diff