Revision b482e2d1 libavcodec/cavsdsp.c

View differences:

libavcodec/cavsdsp.c
22 22

  
23 23
#include <stdio.h>
24 24
#include "dsputil.h"
25
#include "cavsdsp.h"
26 25

  
27 26
/*****************************************************************************
28 27
 *
......
110 109
#undef Q1
111 110
#undef Q2
112 111

  
113
void cavs_filter_lv_c(uint8_t *d, int stride, int alpha, int beta, int tc,
112
static void cavs_filter_lv_c(uint8_t *d, int stride, int alpha, int beta, int tc,
114 113
                           int bs1, int bs2) {
115 114
    int i;
116 115
    if(bs1==2)
......
126 125
    }
127 126
}
128 127

  
129
void cavs_filter_lh_c(uint8_t *d, int stride, int alpha, int beta, int tc,
128
static void cavs_filter_lh_c(uint8_t *d, int stride, int alpha, int beta, int tc,
130 129
                           int bs1, int bs2) {
131 130
    int i;
132 131
    if(bs1==2)
......
142 141
    }
143 142
}
144 143

  
145
void cavs_filter_cv_c(uint8_t *d, int stride, int alpha, int beta, int tc,
144
static void cavs_filter_cv_c(uint8_t *d, int stride, int alpha, int beta, int tc,
146 145
                           int bs1, int bs2) {
147 146
    int i;
148 147
    if(bs1==2)
......
158 157
    }
159 158
}
160 159

  
161
void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc,
160
static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc,
162 161
                           int bs1, int bs2) {
163 162
    int i;
164 163
    if(bs1==2)
......
180 179
 *
181 180
 ****************************************************************************/
182 181

  
183
void cavs_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride) {
182
static void cavs_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride) {
184 183
    int i;
185 184
    DCTELEM (*src)[8] = (DCTELEM(*)[8])block;
186 185
    uint8_t *cm = cropTbl + MAX_NEG_CROP;
......
416 415
}\
417 416

  
418 417
#define CAVS_MC(OPNAME, SIZE) \
419
void OPNAME ## cavs_qpel ## SIZE ## _mc00_c (uint8_t *dst, uint8_t *src, int stride){\
420
    OPNAME ## pixels ## SIZE ## _c(dst, src, stride, SIZE);\
421
}\
422
void OPNAME ## cavs_qpel ## SIZE ## _mc10_c(uint8_t *dst, uint8_t *src, int stride){\
418
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc10_c(uint8_t *dst, uint8_t *src, int stride){\
423 419
    OPNAME ## cavs_filt ## SIZE ## _h_qpel_l(dst, src, stride, stride);\
424 420
}\
425 421
\
426
void OPNAME ## cavs_qpel ## SIZE ## _mc20_c(uint8_t *dst, uint8_t *src, int stride){\
422
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc20_c(uint8_t *dst, uint8_t *src, int stride){\
427 423
    OPNAME ## cavs_filt ## SIZE ## _h_hpel(dst, src, stride, stride);\
428 424
}\
429 425
\
430
void OPNAME ## cavs_qpel ## SIZE ## _mc30_c(uint8_t *dst, uint8_t *src, int stride){\
426
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc30_c(uint8_t *dst, uint8_t *src, int stride){\
431 427
    OPNAME ## cavs_filt ## SIZE ## _h_qpel_r(dst, src, stride, stride);\
432 428
}\
433 429
\
434
void OPNAME ## cavs_qpel ## SIZE ## _mc01_c(uint8_t *dst, uint8_t *src, int stride){\
430
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc01_c(uint8_t *dst, uint8_t *src, int stride){\
435 431
    OPNAME ## cavs_filt ## SIZE ## _v_qpel_l(dst, src, stride, stride);\
436 432
}\
437 433
\
438
void OPNAME ## cavs_qpel ## SIZE ## _mc02_c(uint8_t *dst, uint8_t *src, int stride){\
434
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc02_c(uint8_t *dst, uint8_t *src, int stride){\
439 435
    OPNAME ## cavs_filt ## SIZE ## _v_hpel(dst, src, stride, stride);\
440 436
}\
441 437
\
442
void OPNAME ## cavs_qpel ## SIZE ## _mc03_c(uint8_t *dst, uint8_t *src, int stride){\
438
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc03_c(uint8_t *dst, uint8_t *src, int stride){\
443 439
    OPNAME ## cavs_filt ## SIZE ## _v_qpel_r(dst, src, stride, stride);\
444 440
}\
445 441
\
446
void OPNAME ## cavs_qpel ## SIZE ## _mc22_c(uint8_t *dst, uint8_t *src, int stride){\
442
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc22_c(uint8_t *dst, uint8_t *src, int stride){\
447 443
  OPNAME ## cavs_filt ## SIZE ## _hv_jj(dst, src, NULL, stride, stride); \
448 444
}\
449 445
\
450
void OPNAME ## cavs_qpel ## SIZE ## _mc11_c(uint8_t *dst, uint8_t *src, int stride){\
446
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc11_c(uint8_t *dst, uint8_t *src, int stride){\
451 447
  OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src, stride, stride); \
452 448
}\
453 449
\
454
void OPNAME ## cavs_qpel ## SIZE ## _mc13_c(uint8_t *dst, uint8_t *src, int stride){\
450
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc13_c(uint8_t *dst, uint8_t *src, int stride){\
455 451
  OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+stride, stride, stride); \
456 452
}\
457 453
\
458
void OPNAME ## cavs_qpel ## SIZE ## _mc31_c(uint8_t *dst, uint8_t *src, int stride){\
454
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc31_c(uint8_t *dst, uint8_t *src, int stride){\
459 455
  OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+1, stride, stride); \
460 456
}\
461 457
\
462
void OPNAME ## cavs_qpel ## SIZE ## _mc33_c(uint8_t *dst, uint8_t *src, int stride){\
458
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc33_c(uint8_t *dst, uint8_t *src, int stride){\
463 459
  OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+stride+1,stride, stride); \
464 460
}\
465 461
\
466
void OPNAME ## cavs_qpel ## SIZE ## _mc21_c(uint8_t *dst, uint8_t *src, int stride){\
462
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc21_c(uint8_t *dst, uint8_t *src, int stride){\
467 463
  OPNAME ## cavs_filt ## SIZE ## _hv_ff(dst, src, src+stride+1,stride, stride); \
468 464
}\
469 465
\
470
void OPNAME ## cavs_qpel ## SIZE ## _mc12_c(uint8_t *dst, uint8_t *src, int stride){\
466
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc12_c(uint8_t *dst, uint8_t *src, int stride){\
471 467
  OPNAME ## cavs_filt ## SIZE ## _hv_ii(dst, src, src+stride+1,stride, stride); \
472 468
}\
473 469
\
474
void OPNAME ## cavs_qpel ## SIZE ## _mc32_c(uint8_t *dst, uint8_t *src, int stride){\
470
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc32_c(uint8_t *dst, uint8_t *src, int stride){\
475 471
  OPNAME ## cavs_filt ## SIZE ## _hv_kk(dst, src, src+stride+1,stride, stride); \
476 472
}\
477 473
\
478
void OPNAME ## cavs_qpel ## SIZE ## _mc23_c(uint8_t *dst, uint8_t *src, int stride){\
474
static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc23_c(uint8_t *dst, uint8_t *src, int stride){\
479 475
  OPNAME ## cavs_filt ## SIZE ## _hv_qq(dst, src, src+stride+1,stride, stride); \
480 476
}\
481 477

  
......
509 505
CAVS_MC(put_, 16)
510 506
CAVS_MC(avg_, 8)
511 507
CAVS_MC(avg_, 16)
508

  
509
void ff_put_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride);
510
void ff_avg_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride);
511
void ff_put_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride);
512
void ff_avg_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride);
513

  
514
void ff_cavsdsp_init(DSPContext* c, AVCodecContext *avctx) {
515
#define dspfunc(PFX, IDX, NUM) \
516
    c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_c; \
517
    c->PFX ## _pixels_tab[IDX][ 1] = ff_ ## PFX ## NUM ## _mc10_c; \
518
    c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_c; \
519
    c->PFX ## _pixels_tab[IDX][ 3] = ff_ ## PFX ## NUM ## _mc30_c; \
520
    c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_c; \
521
    c->PFX ## _pixels_tab[IDX][ 5] = ff_ ## PFX ## NUM ## _mc11_c; \
522
    c->PFX ## _pixels_tab[IDX][ 6] = ff_ ## PFX ## NUM ## _mc21_c; \
523
    c->PFX ## _pixels_tab[IDX][ 7] = ff_ ## PFX ## NUM ## _mc31_c; \
524
    c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_c; \
525
    c->PFX ## _pixels_tab[IDX][ 9] = ff_ ## PFX ## NUM ## _mc12_c; \
526
    c->PFX ## _pixels_tab[IDX][10] = ff_ ## PFX ## NUM ## _mc22_c; \
527
    c->PFX ## _pixels_tab[IDX][11] = ff_ ## PFX ## NUM ## _mc32_c; \
528
    c->PFX ## _pixels_tab[IDX][12] = ff_ ## PFX ## NUM ## _mc03_c; \
529
    c->PFX ## _pixels_tab[IDX][13] = ff_ ## PFX ## NUM ## _mc13_c; \
530
    c->PFX ## _pixels_tab[IDX][14] = ff_ ## PFX ## NUM ## _mc23_c; \
531
    c->PFX ## _pixels_tab[IDX][15] = ff_ ## PFX ## NUM ## _mc33_c
532
    dspfunc(put_cavs_qpel, 0, 16);
533
    dspfunc(put_cavs_qpel, 1, 8);
534
    dspfunc(avg_cavs_qpel, 0, 16);
535
    dspfunc(avg_cavs_qpel, 1, 8);
536
    c->cavs_filter_lv = cavs_filter_lv_c;
537
    c->cavs_filter_lh = cavs_filter_lh_c;
538
    c->cavs_filter_cv = cavs_filter_cv_c;
539
    c->cavs_filter_ch = cavs_filter_ch_c;
540
    c->cavs_idct8_add = cavs_idct8_add_c;
541
}

Also available in: Unified diff