| OLD | NEW |
| 1 /** | 1 /** |
| 2 * VP8 compatible video decoder | 2 * VP8 compatible video decoder |
| 3 * | 3 * |
| 4 * Copyright (C) 2010 David Conrad | 4 * Copyright (C) 2010 David Conrad |
| 5 * | 5 * |
| 6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
| 7 * | 7 * |
| 8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| 11 * version 2.1 of the License, or (at your option) any later version. | 11 * version 2.1 of the License, or (at your option) any later version. |
| 12 * | 12 * |
| 13 * FFmpeg is distributed in the hope that it will be useful, | 13 * FFmpeg is distributed in the hope that it will be useful, |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 * Lesser General Public License for more details. | 16 * Lesser General Public License for more details. |
| 17 * | 17 * |
| 18 * You should have received a copy of the GNU Lesser General Public | 18 * You should have received a copy of the GNU Lesser General Public |
| 19 * License along with FFmpeg; if not, write to the Free Software | 19 * License along with FFmpeg; if not, write to the Free Software |
| 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 */ | 21 */ |
| 22 | 22 |
| 23 #include "libavutil/cpu.h" |
| 23 #include "libavcodec/vp8dsp.h" | 24 #include "libavcodec/vp8dsp.h" |
| 24 #include "dsputil_altivec.h" | 25 #include "dsputil_altivec.h" |
| 25 #include "types_altivec.h" | 26 #include "types_altivec.h" |
| 26 #include "util_altivec.h" | 27 #include "util_altivec.h" |
| 27 | 28 |
| 28 #define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ } | 29 #define REPT4(...) { __VA_ARGS__, __VA_ARGS__, __VA_ARGS__, __VA_ARGS__ } |
| 29 | 30 |
| 30 // h subpel filter uses msum to multiply+add 4 pixel taps at once | 31 // h subpel filter uses msum to multiply+add 4 pixel taps at once |
| 31 static const vec_s8 h_subpel_filters_inner[7] = | 32 static const vec_s8 h_subpel_filters_inner[7] = |
| 32 { | 33 { |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 EPEL_HV(4, 6,4) | 259 EPEL_HV(4, 6,4) |
| 259 EPEL_HV(4, 4,4) | 260 EPEL_HV(4, 4,4) |
| 260 | 261 |
| 261 static void put_vp8_pixels16_altivec(uint8_t *dst, int stride, uint8_t *src, int
s, int h, int mx, int my) | 262 static void put_vp8_pixels16_altivec(uint8_t *dst, int stride, uint8_t *src, int
s, int h, int mx, int my) |
| 262 { | 263 { |
| 263 put_pixels16_altivec(dst, src, stride, h); | 264 put_pixels16_altivec(dst, src, stride, h); |
| 264 } | 265 } |
| 265 | 266 |
| 266 av_cold void ff_vp8dsp_init_altivec(VP8DSPContext *c) | 267 av_cold void ff_vp8dsp_init_altivec(VP8DSPContext *c) |
| 267 { | 268 { |
| 268 if (!has_altivec()) | 269 if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) |
| 269 return; | 270 return; |
| 270 | 271 |
| 271 c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec; | 272 c->put_vp8_epel_pixels_tab[0][0][0] = put_vp8_pixels16_altivec; |
| 272 c->put_vp8_epel_pixels_tab[0][0][2] = put_vp8_epel16_h6_altivec; | 273 c->put_vp8_epel_pixels_tab[0][0][2] = put_vp8_epel16_h6_altivec; |
| 273 c->put_vp8_epel_pixels_tab[0][2][0] = put_vp8_epel16_v6_altivec; | 274 c->put_vp8_epel_pixels_tab[0][2][0] = put_vp8_epel16_v6_altivec; |
| 274 c->put_vp8_epel_pixels_tab[0][2][2] = put_vp8_epel16_h6v6_altivec; | 275 c->put_vp8_epel_pixels_tab[0][2][2] = put_vp8_epel16_h6v6_altivec; |
| 275 | 276 |
| 276 c->put_vp8_epel_pixels_tab[1][0][2] = put_vp8_epel8_h6_altivec; | 277 c->put_vp8_epel_pixels_tab[1][0][2] = put_vp8_epel8_h6_altivec; |
| 277 c->put_vp8_epel_pixels_tab[1][2][0] = put_vp8_epel8_v6_altivec; | 278 c->put_vp8_epel_pixels_tab[1][2][0] = put_vp8_epel8_v6_altivec; |
| 278 c->put_vp8_epel_pixels_tab[1][0][1] = put_vp8_epel8_h4_altivec; | 279 c->put_vp8_epel_pixels_tab[1][0][1] = put_vp8_epel8_h4_altivec; |
| 279 c->put_vp8_epel_pixels_tab[1][1][0] = put_vp8_epel8_v4_altivec; | 280 c->put_vp8_epel_pixels_tab[1][1][0] = put_vp8_epel8_v4_altivec; |
| 280 | 281 |
| 281 c->put_vp8_epel_pixels_tab[1][2][2] = put_vp8_epel8_h6v6_altivec; | 282 c->put_vp8_epel_pixels_tab[1][2][2] = put_vp8_epel8_h6v6_altivec; |
| 282 c->put_vp8_epel_pixels_tab[1][1][1] = put_vp8_epel8_h4v4_altivec; | 283 c->put_vp8_epel_pixels_tab[1][1][1] = put_vp8_epel8_h4v4_altivec; |
| 283 c->put_vp8_epel_pixels_tab[1][1][2] = put_vp8_epel8_h6v4_altivec; | 284 c->put_vp8_epel_pixels_tab[1][1][2] = put_vp8_epel8_h6v4_altivec; |
| 284 c->put_vp8_epel_pixels_tab[1][2][1] = put_vp8_epel8_h4v6_altivec; | 285 c->put_vp8_epel_pixels_tab[1][2][1] = put_vp8_epel8_h4v6_altivec; |
| 285 | 286 |
| 286 c->put_vp8_epel_pixels_tab[2][0][2] = put_vp8_epel4_h6_altivec; | 287 c->put_vp8_epel_pixels_tab[2][0][2] = put_vp8_epel4_h6_altivec; |
| 287 c->put_vp8_epel_pixels_tab[2][2][0] = put_vp8_epel4_v6_altivec; | 288 c->put_vp8_epel_pixels_tab[2][2][0] = put_vp8_epel4_v6_altivec; |
| 288 c->put_vp8_epel_pixels_tab[2][0][1] = put_vp8_epel4_h4_altivec; | 289 c->put_vp8_epel_pixels_tab[2][0][1] = put_vp8_epel4_h4_altivec; |
| 289 c->put_vp8_epel_pixels_tab[2][1][0] = put_vp8_epel4_v4_altivec; | 290 c->put_vp8_epel_pixels_tab[2][1][0] = put_vp8_epel4_v4_altivec; |
| 290 | 291 |
| 291 c->put_vp8_epel_pixels_tab[2][2][2] = put_vp8_epel4_h6v6_altivec; | 292 c->put_vp8_epel_pixels_tab[2][2][2] = put_vp8_epel4_h6v6_altivec; |
| 292 c->put_vp8_epel_pixels_tab[2][1][1] = put_vp8_epel4_h4v4_altivec; | 293 c->put_vp8_epel_pixels_tab[2][1][1] = put_vp8_epel4_h4v4_altivec; |
| 293 c->put_vp8_epel_pixels_tab[2][1][2] = put_vp8_epel4_h6v4_altivec; | 294 c->put_vp8_epel_pixels_tab[2][1][2] = put_vp8_epel4_h6v4_altivec; |
| 294 c->put_vp8_epel_pixels_tab[2][2][1] = put_vp8_epel4_h4v6_altivec; | 295 c->put_vp8_epel_pixels_tab[2][2][1] = put_vp8_epel4_h4v6_altivec; |
| 295 } | 296 } |
| OLD | NEW |