34 #define MK_IDCT_DC_ADD4_C(name) \
35 static void name ## _idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], \
38 name ## _idct_dc_add_c(dst + stride * 0 + 0, block[0], stride); \
39 name ## _idct_dc_add_c(dst + stride * 0 + 4, block[1], stride); \
40 name ## _idct_dc_add_c(dst + stride * 4 + 0, block[2], stride); \
41 name ## _idct_dc_add_c(dst + stride * 4 + 4, block[3], stride); \
44 static void name ## _idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], \
47 name ## _idct_dc_add_c(dst + 0, block[0], stride); \
48 name ## _idct_dc_add_c(dst + 4, block[1], stride); \
49 name ## _idct_dc_add_c(dst + 8, block[2], stride); \
50 name ## _idct_dc_add_c(dst + 12, block[3], stride); \
53 #if CONFIG_VP7_DECODER
54 static void vp7_luma_dc_wht_c(int16_t
block[4][4][16], int16_t
dc[16])
57 unsigned a1, b1,
c1, d1;
60 for (i = 0; i < 4; i++) {
61 a1 = (dc[i * 4 + 0] + dc[i * 4 + 2]) * 23170;
62 b1 = (dc[i * 4 + 0] - dc[i * 4 + 2]) * 23170;
63 c1 = dc[i * 4 + 1] * 12540 - dc[i * 4 + 3] * 30274;
64 d1 = dc[i * 4 + 1] * 30274 + dc[i * 4 + 3] * 12540;
65 tmp[i * 4 + 0] = (
int)(a1 + d1) >> 14;
66 tmp[i * 4 + 3] = (
int)(a1 - d1) >> 14;
67 tmp[i * 4 + 1] = (
int)(b1 + c1) >> 14;
68 tmp[i * 4 + 2] = (
int)(b1 - c1) >> 14;
71 for (i = 0; i < 4; i++) {
72 a1 = (tmp[i + 0] + tmp[i + 8]) * 23170;
73 b1 = (tmp[i + 0] - tmp[i + 8]) * 23170;
74 c1 = tmp[i + 4] * 12540 - tmp[i + 12] * 30274;
75 d1 = tmp[i + 4] * 30274 + tmp[i + 12] * 12540;
77 block[0][i][0] = (
int)(a1 + d1 + 0x20000) >> 18;
78 block[3][i][0] = (
int)(a1 - d1 + 0x20000) >> 18;
79 block[1][i][0] = (
int)(b1 + c1 + 0x20000) >> 18;
80 block[2][i][0] = (
int)(b1 - c1 + 0x20000) >> 18;
84 static void vp7_luma_dc_wht_dc_c(int16_t
block[4][4][16], int16_t
dc[16])
86 int i,
val = (23170 * (23170 * dc[0] >> 14) + 0x20000) >> 18;
89 for (i = 0; i < 4; i++) {
97 static void vp7_idct_add_c(
uint8_t *dst, int16_t block[16], ptrdiff_t
stride)
100 unsigned a1, b1,
c1, d1;
103 for (i = 0; i < 4; i++) {
104 a1 = (block[i * 4 + 0] + block[i * 4 + 2]) * 23170;
105 b1 = (block[i * 4 + 0] - block[i * 4 + 2]) * 23170;
106 c1 = block[i * 4 + 1] * 12540 - block[i * 4 + 3] * 30274;
107 d1 = block[i * 4 + 1] * 30274 + block[i * 4 + 3] * 12540;
109 tmp[i * 4 + 0] = (
int)(a1 + d1) >> 14;
110 tmp[i * 4 + 3] = (
int)(a1 - d1) >> 14;
111 tmp[i * 4 + 1] = (
int)(b1 + c1) >> 14;
112 tmp[i * 4 + 2] = (
int)(b1 - c1) >> 14;
115 for (i = 0; i < 4; i++) {
116 a1 = (tmp[i + 0] + tmp[i + 8]) * 23170;
117 b1 = (tmp[i + 0] - tmp[i + 8]) * 23170;
118 c1 = tmp[i + 4] * 12540 - tmp[i + 12] * 30274;
119 d1 = tmp[i + 4] * 30274 + tmp[i + 12] * 12540;
120 dst[0 * stride + i] = av_clip_uint8(dst[0 * stride + i] +
121 ((
int)(a1 + d1 + 0x20000) >> 18));
122 dst[3 * stride + i] = av_clip_uint8(dst[3 * stride + i] +
123 ((
int)(a1 - d1 + 0x20000) >> 18));
124 dst[1 * stride + i] = av_clip_uint8(dst[1 * stride + i] +
125 ((
int)(b1 + c1 + 0x20000) >> 18));
126 dst[2 * stride + i] = av_clip_uint8(dst[2 * stride + i] +
127 ((
int)(b1 - c1 + 0x20000) >> 18));
131 static void vp7_idct_dc_add_c(
uint8_t *dst, int16_t block[16], ptrdiff_t stride)
133 int i, dc = (23170 * (23170 * block[0] >> 14) + 0x20000) >> 18;
136 for (i = 0; i < 4; i++) {
137 dst[0] = av_clip_uint8(dst[0] + dc);
138 dst[1] = av_clip_uint8(dst[1] + dc);
139 dst[2] = av_clip_uint8(dst[2] + dc);
140 dst[3] = av_clip_uint8(dst[3] + dc);
149 #if CONFIG_VP8_DECODER
150 static void vp8_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16])
154 for (i = 0; i < 4; i++) {
155 t0 = dc[0 * 4 + i] + dc[3 * 4 + i];
156 t1 = dc[1 * 4 + i] + dc[2 * 4 + i];
157 t2 = dc[1 * 4 + i] - dc[2 * 4 + i];
158 t3 = dc[0 * 4 + i] - dc[3 * 4 + i];
160 dc[0 * 4 + i] = t0 +
t1;
161 dc[1 * 4 + i] = t3 +
t2;
162 dc[2 * 4 + i] = t0 -
t1;
163 dc[3 * 4 + i] = t3 -
t2;
166 for (i = 0; i < 4; i++) {
167 t0 = dc[i * 4 + 0] + dc[i * 4 + 3] + 3;
168 t1 = dc[i * 4 + 1] + dc[i * 4 + 2];
169 t2 = dc[i * 4 + 1] - dc[i * 4 + 2];
170 t3 = dc[i * 4 + 0] - dc[i * 4 + 3] + 3;
173 block[i][0][0] = (t0 +
t1) >> 3;
174 block[i][1][0] = (t3 +
t2) >> 3;
175 block[i][2][0] = (t0 -
t1) >> 3;
176 block[i][3][0] = (t3 -
t2) >> 3;
180 static void vp8_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16])
182 int i, val = (dc[0] + 3) >> 3;
185 for (i = 0; i < 4; i++) {
186 block[i][0][0] =
val;
187 block[i][1][0] =
val;
188 block[i][2][0] =
val;
189 block[i][3][0] =
val;
193 #define MUL_20091(a) ((((a) * 20091) >> 16) + (a))
194 #define MUL_35468(a) (((a) * 35468) >> 16)
196 static void vp8_idct_add_c(
uint8_t *dst, int16_t block[16], ptrdiff_t stride)
201 for (i = 0; i < 4; i++) {
202 t0 = block[0 * 4 + i] + block[2 * 4 + i];
203 t1 = block[0 * 4 + i] - block[2 * 4 + i];
204 t2 = MUL_35468(block[1 * 4 + i]) - MUL_20091(block[3 * 4 + i]);
205 t3 = MUL_20091(block[1 * 4 + i]) + MUL_35468(block[3 * 4 + i]);
206 block[0 * 4 + i] = 0;
207 block[1 * 4 + i] = 0;
208 block[2 * 4 + i] = 0;
209 block[3 * 4 + i] = 0;
211 tmp[i * 4 + 0] = t0 +
t3;
212 tmp[i * 4 + 1] = t1 +
t2;
213 tmp[i * 4 + 2] = t1 -
t2;
214 tmp[i * 4 + 3] = t0 -
t3;
217 for (i = 0; i < 4; i++) {
218 t0 = tmp[0 * 4 + i] + tmp[2 * 4 + i];
219 t1 = tmp[0 * 4 + i] - tmp[2 * 4 + i];
220 t2 = MUL_35468(tmp[1 * 4 + i]) - MUL_20091(tmp[3 * 4 + i]);
221 t3 = MUL_20091(tmp[1 * 4 + i]) + MUL_35468(tmp[3 * 4 + i]);
223 dst[0] = av_clip_uint8(dst[0] + ((t0 + t3 + 4) >> 3));
224 dst[1] = av_clip_uint8(dst[1] + ((t1 + t2 + 4) >> 3));
225 dst[2] = av_clip_uint8(dst[2] + ((t1 - t2 + 4) >> 3));
226 dst[3] = av_clip_uint8(dst[3] + ((t0 - t3 + 4) >> 3));
231 static void vp8_idct_dc_add_c(
uint8_t *dst, int16_t block[16], ptrdiff_t stride)
233 int i, dc = (block[0] + 4) >> 3;
236 for (i = 0; i < 4; i++) {
237 dst[0] = av_clip_uint8(dst[0] + dc);
238 dst[1] = av_clip_uint8(dst[1] + dc);
239 dst[2] = av_clip_uint8(dst[2] + dc);
240 dst[3] = av_clip_uint8(dst[3] + dc);
249 #define LOAD_PIXELS \
250 int av_unused p3 = p[-4 * stride]; \
251 int av_unused p2 = p[-3 * stride]; \
252 int av_unused p1 = p[-2 * stride]; \
253 int av_unused p0 = p[-1 * stride]; \
254 int av_unused q0 = p[ 0 * stride]; \
255 int av_unused q1 = p[ 1 * stride]; \
256 int av_unused q2 = p[ 2 * stride]; \
257 int av_unused q3 = p[ 3 * stride];
259 #define clip_int8(n) (cm[(n) + 0x80] - 0x80)
262 int is4tap,
int is_vp7)
277 f1 =
FFMIN(a + 4, 127) >> 3;
280 f2 = f1 - ((a & 7) == 4);
282 f2 =
FFMIN(a + 3, 127) >> 3;
286 p[-1 *
stride] = cm[p0 + f2];
327 #define NORMAL_LIMIT(vpn) \
328 static av_always_inline int vp ## vpn ## _normal_limit(uint8_t *p, \
333 return vp ## vpn ## _simple_limit(p, stride, E) && \
334 FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I && \
335 FFABS(p1 - p0) <= I && FFABS(q3 - q2) <= I && \
336 FFABS(q2 - q1) <= I && FFABS(q1 - q0) <= I; \
359 a0 = (27 * w + 63) >> 7;
360 a1 = (18 * w + 63) >> 7;
361 a2 = (9 * w + 63) >> 7;
371 #define LOOP_FILTER(vpn, dir, size, stridea, strideb, maybe_inline) \
372 static maybe_inline \
373 void vpn ## _ ## dir ## _loop_filter ## size ## _c(uint8_t *dst, \
375 int flim_E, int flim_I, \
379 for (i = 0; i < size; i++) \
380 if (vpn ## _normal_limit(dst + i * stridea, strideb, \
382 if (hev(dst + i * stridea, strideb, hev_thresh)) \
383 vpn ## _filter_common(dst + i * stridea, strideb, 1); \
385 filter_mbedge(dst + i * stridea, strideb); \
389 static maybe_inline \
390 void vpn ## _ ## dir ## _loop_filter ## size ## _inner_c(uint8_t *dst, \
397 for (i = 0; i < size; i++) \
398 if (vpn ## _normal_limit(dst + i * stridea, strideb, \
400 int hv = hev(dst + i * stridea, strideb, hev_thresh); \
402 vpn ## _filter_common(dst + i * stridea, strideb, 1); \
404 vpn ## _filter_common(dst + i * stridea, strideb, 0); \
408 #define UV_LOOP_FILTER(vpn, dir, stridea, strideb) \
409 LOOP_FILTER(vpn, dir, 8, stridea, strideb, av_always_inline) \
410 static void vpn ## _ ## dir ## _loop_filter8uv_c(uint8_t *dstU, \
412 ptrdiff_t stride, int fE, \
413 int fI, int hev_thresh) \
415 vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \
416 vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \
419 static void vpn ## _ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, \
425 vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \
427 vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \
431 #define LOOP_FILTER_SIMPLE(vpn) \
432 static void vpn ## _v_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \
436 for (i = 0; i < 16; i++) \
437 if (vpn ## _simple_limit(dst + i, stride, flim)) \
438 vpn ## _filter_common(dst + i, stride, 1); \
441 static void vpn ## _h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \
445 for (i = 0; i < 16; i++) \
446 if (vpn ## _simple_limit(dst + i * stride, 1, flim)) \
447 vpn ## _filter_common(dst + i * stride, 1, 1); \
450 #define LOOP_FILTERS(vpn) \
451 LOOP_FILTER(vpn, v, 16, 1, stride, ) \
452 LOOP_FILTER(vpn, h, 16, stride, 1, ) \
453 UV_LOOP_FILTER(vpn, v, 1, stride) \
454 UV_LOOP_FILTER(vpn, h, stride, 1) \
455 LOOP_FILTER_SIMPLE(vpn) \
458 { 0, 6, 123, 12, 1, 0 },
459 { 2, 11, 108, 36, 8, 1 },
460 { 0, 9, 93, 50, 6, 0 },
461 { 3, 16, 77, 77, 16, 3 },
462 { 0, 6, 50, 93, 9, 0 },
463 { 1, 8, 36, 108, 11, 2 },
464 { 0, 1, 12, 123, 6, 0 },
467 #define PUT_PIXELS(WIDTH) \
468 static void put_vp8_pixels ## WIDTH ## _c(uint8_t *dst, ptrdiff_t dststride, \
469 uint8_t *src, ptrdiff_t srcstride, \
470 int h, int x, int y) \
473 for (i = 0; i < h; i++, dst += dststride, src += srcstride) \
474 memcpy(dst, src, WIDTH); \
481 #define FILTER_6TAP(src, F, stride) \
482 cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \
483 F[0] * src[x - 2 * stride] + F[3] * src[x + 1 * stride] - \
484 F[4] * src[x + 2 * stride] + F[5] * src[x + 3 * stride] + 64) >> 7]
486 #define FILTER_4TAP(src, F, stride) \
487 cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \
488 F[3] * src[x + 1 * stride] - F[4] * src[x + 2 * stride] + 64) >> 7]
490 #define VP8_EPEL_H(SIZE, TAPS) \
491 static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, \
492 ptrdiff_t dststride, \
494 ptrdiff_t srcstride, \
495 int h, int mx, int my) \
497 const uint8_t *filter = subpel_filters[mx - 1]; \
498 const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
500 for (y = 0; y < h; y++) { \
501 for (x = 0; x < SIZE; x++) \
502 dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \
508 #define VP8_EPEL_V(SIZE, TAPS) \
509 static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, \
510 ptrdiff_t dststride, \
512 ptrdiff_t srcstride, \
513 int h, int mx, int my) \
515 const uint8_t *filter = subpel_filters[my - 1]; \
516 const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
518 for (y = 0; y < h; y++) { \
519 for (x = 0; x < SIZE; x++) \
520 dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \
526 #define VP8_EPEL_HV(SIZE, HTAPS, VTAPS) \
528 put_vp8_epel ## SIZE ## _h ## HTAPS ## v ## VTAPS ## _c(uint8_t *dst, \
529 ptrdiff_t dststride, \
531 ptrdiff_t srcstride, \
535 const uint8_t *filter = subpel_filters[mx - 1]; \
536 const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
538 uint8_t tmp_array[(2 * SIZE + VTAPS - 1) * SIZE]; \
539 uint8_t *tmp = tmp_array; \
540 src -= (2 - (VTAPS == 4)) * srcstride; \
542 for (y = 0; y < h + VTAPS - 1; y++) { \
543 for (x = 0; x < SIZE; x++) \
544 tmp[x] = FILTER_ ## HTAPS ## TAP(src, filter, 1); \
548 tmp = tmp_array + (2 - (VTAPS == 4)) * SIZE; \
549 filter = subpel_filters[my - 1]; \
551 for (y = 0; y < h; y++) { \
552 for (x = 0; x < SIZE; x++) \
553 dst[x] = FILTER_ ## VTAPS ## TAP(tmp, filter, SIZE); \
585 #define VP8_BILINEAR(SIZE) \
586 static void put_vp8_bilinear ## SIZE ## _h_c(uint8_t *dst, ptrdiff_t dstride, \
587 uint8_t *src, ptrdiff_t sstride, \
588 int h, int mx, int my) \
590 int a = 8 - mx, b = mx; \
592 for (y = 0; y < h; y++) { \
593 for (x = 0; x < SIZE; x++) \
594 dst[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \
600 static void put_vp8_bilinear ## SIZE ## _v_c(uint8_t *dst, ptrdiff_t dstride, \
601 uint8_t *src, ptrdiff_t sstride, \
602 int h, int mx, int my) \
604 int c = 8 - my, d = my; \
606 for (y = 0; y < h; y++) { \
607 for (x = 0; x < SIZE; x++) \
608 dst[x] = (c * src[x] + d * src[x + sstride] + 4) >> 3; \
614 static void put_vp8_bilinear ## SIZE ## _hv_c(uint8_t *dst, \
618 int h, int mx, int my) \
620 int a = 8 - mx, b = mx; \
621 int c = 8 - my, d = my; \
623 uint8_t tmp_array[(2 * SIZE + 1) * SIZE]; \
624 uint8_t *tmp = tmp_array; \
625 for (y = 0; y < h + 1; y++) { \
626 for (x = 0; x < SIZE; x++) \
627 tmp[x] = (a * src[x] + b * src[x + 1] + 4) >> 3; \
632 for (y = 0; y < h; y++) { \
633 for (x = 0; x < SIZE; x++) \
634 dst[x] = (c * tmp[x] + d * tmp[x + SIZE] + 4) >> 3; \
644 #define VP78_MC_FUNC(IDX, SIZE) \
645 dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
646 dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \
647 dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \
648 dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \
649 dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \
650 dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \
651 dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \
652 dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \
653 dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c
655 #define VP78_BILINEAR_MC_FUNC(IDX, SIZE) \
656 dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
657 dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \
658 dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \
659 dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \
660 dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
661 dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = put_vp8_bilinear ## SIZE ## _hv_c; \
662 dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = put_vp8_bilinear ## SIZE ## _v_c; \
663 dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
664 dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c
684 #if CONFIG_VP7_DECODER
689 dsp->vp8_luma_dc_wht = vp7_luma_dc_wht_c;
690 dsp->vp8_luma_dc_wht_dc = vp7_luma_dc_wht_dc_c;
691 dsp->vp8_idct_add = vp7_idct_add_c;
692 dsp->vp8_idct_dc_add = vp7_idct_dc_add_c;
693 dsp->vp8_idct_dc_add4y = vp7_idct_dc_add4y_c;
694 dsp->vp8_idct_dc_add4uv = vp7_idct_dc_add4uv_c;
696 dsp->vp8_v_loop_filter16y = vp7_v_loop_filter16_c;
697 dsp->vp8_h_loop_filter16y = vp7_h_loop_filter16_c;
698 dsp->vp8_v_loop_filter8uv = vp7_v_loop_filter8uv_c;
699 dsp->vp8_h_loop_filter8uv = vp7_h_loop_filter8uv_c;
701 dsp->vp8_v_loop_filter16y_inner = vp7_v_loop_filter16_inner_c;
702 dsp->vp8_h_loop_filter16y_inner = vp7_h_loop_filter16_inner_c;
703 dsp->vp8_v_loop_filter8uv_inner = vp7_v_loop_filter8uv_inner_c;
704 dsp->vp8_h_loop_filter8uv_inner = vp7_h_loop_filter8uv_inner_c;
706 dsp->vp8_v_loop_filter_simple = vp7_v_loop_filter_simple_c;
707 dsp->vp8_h_loop_filter_simple = vp7_h_loop_filter_simple_c;
711 #if CONFIG_VP8_DECODER
716 dsp->vp8_luma_dc_wht = vp8_luma_dc_wht_c;
717 dsp->vp8_luma_dc_wht_dc = vp8_luma_dc_wht_dc_c;
718 dsp->vp8_idct_add = vp8_idct_add_c;
719 dsp->vp8_idct_dc_add = vp8_idct_dc_add_c;
720 dsp->vp8_idct_dc_add4y = vp8_idct_dc_add4y_c;
721 dsp->vp8_idct_dc_add4uv = vp8_idct_dc_add4uv_c;
723 dsp->vp8_v_loop_filter16y = vp8_v_loop_filter16_c;
724 dsp->vp8_h_loop_filter16y = vp8_h_loop_filter16_c;
725 dsp->vp8_v_loop_filter8uv = vp8_v_loop_filter8uv_c;
726 dsp->vp8_h_loop_filter8uv = vp8_h_loop_filter8uv_c;
728 dsp->vp8_v_loop_filter16y_inner = vp8_v_loop_filter16_inner_c;
729 dsp->vp8_h_loop_filter16y_inner = vp8_h_loop_filter16_inner_c;
730 dsp->vp8_v_loop_filter8uv_inner = vp8_v_loop_filter8uv_inner_c;
731 dsp->vp8_h_loop_filter8uv_inner = vp8_h_loop_filter8uv_inner_c;
733 dsp->vp8_v_loop_filter_simple = vp8_v_loop_filter_simple_c;
734 dsp->vp8_h_loop_filter_simple = vp8_h_loop_filter_simple_c;
const char const char void * val
#define MK_IDCT_DC_ADD4_C(name)
void ff_vp7dsp_init(VP8DSPContext *c)
static const uint8_t subpel_filters[7][6]
av_cold void ff_vp78dsp_init_ppc(VP8DSPContext *c)
static av_always_inline void vp8_filter_common(uint8_t *p, ptrdiff_t stride, int is4tap)
av_cold void ff_vp78dsp_init(VP8DSPContext *dsp)
av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp)
static const uint8_t q1[256]
av_cold void ff_vp78dsp_init_arm(VP8DSPContext *dsp)
static av_always_inline void filter_mbedge(uint8_t *p, ptrdiff_t stride)
#define VP8_EPEL_H(SIZE, TAPS)
VP8 compatible video decoder.
av_cold void ff_vp8dsp_init_mips(VP8DSPContext *dsp)
static av_always_inline int vp8_simple_limit(uint8_t *p, ptrdiff_t stride, int flim)
#define VP78_BILINEAR_MC_FUNC(IDX, SIZE)
#define NORMAL_LIMIT(vpn)
E - limit at the macroblock edge I - limit for interior difference.
#define VP8_BILINEAR(SIZE)
static const uint8_t q0[256]
#define VP8_EPEL_HV(SIZE, HTAPS, VTAPS)
static av_always_inline int vp7_simple_limit(uint8_t *p, ptrdiff_t stride, int flim)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
void ff_vp78dsp_init_x86(VP8DSPContext *c)
static av_always_inline void filter_common(uint8_t *p, ptrdiff_t stride, int is4tap, int is_vp7)
#define VP8_EPEL_V(SIZE, TAPS)
void ff_vp8dsp_init_x86(VP8DSPContext *c)
static av_always_inline int hev(uint8_t *p, ptrdiff_t stride, int thresh)
GLint GLenum GLboolean GLsizei stride
common internal and external API header
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> dc
#define LOOP_FILTERS(vpn)
void ff_vp8dsp_init(VP8DSPContext *c)
#define VP78_MC_FUNC(IDX, SIZE)
#define PUT_PIXELS(WIDTH)
static av_always_inline void vp7_filter_common(uint8_t *p, ptrdiff_t stride, int is4tap)