| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Alpha optimized DSP utils | 2 * Alpha optimized DSP utils |
| 3 * Copyright (c) 2002 Falk Hueffner <falk@debian.org> | 3 * Copyright (c) 2002 Falk Hueffner <falk@debian.org> |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| 11 * | 11 * |
| 12 * FFmpeg is distributed in the hope that it will be useful, | 12 * FFmpeg is distributed in the hope that it will be useful, |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 * Lesser General Public License for more details. | 15 * Lesser General Public License for more details. |
| 16 * | 16 * |
| 17 * You should have received a copy of the GNU Lesser General Public | 17 * You should have received a copy of the GNU Lesser General Public |
| 18 * License along with FFmpeg; if not, write to the Free Software | 18 * License along with FFmpeg; if not, write to the Free Software |
| 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #include "libavcodec/dsputil.h" | 22 #include "libavcodec/dsputil.h" |
| 23 #include "dsputil_alpha.h" |
| 23 #include "asm.h" | 24 #include "asm.h" |
| 24 | 25 |
| 25 void ff_simple_idct_axp(DCTELEM *block); | |
| 26 void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block); | |
| 27 void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block); | |
| 28 | |
| 29 void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels, | |
| 30 int line_size, int h); | |
| 31 void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, | |
| 32 int line_size); | |
| 33 void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, | |
| 34 int line_size); | |
| 35 void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, | 26 void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, |
| 36 int line_size); | 27 int line_size); |
| 37 void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, | 28 void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, |
| 38 int line_size); | 29 int line_size); |
| 39 | 30 |
| 40 void get_pixels_mvi(DCTELEM *restrict block, | |
| 41 const uint8_t *restrict pixels, int line_size); | |
| 42 void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, | |
| 43 int stride); | |
| 44 int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); | |
| 45 int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, i
nt h); | |
| 46 int pix_abs16x16_x2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, in
t h); | |
| 47 int pix_abs16x16_y2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, in
t h); | |
| 48 int pix_abs16x16_xy2_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, i
nt h); | |
| 49 | |
| 50 #if 0 | 31 #if 0 |
| 51 /* These functions were the base for the optimized assembler routines, | 32 /* These functions were the base for the optimized assembler routines, |
| 52 and remain here for documentation purposes. */ | 33 and remain here for documentation purposes. */ |
| 53 static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, | 34 static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, |
| 54 int line_size) | 35 int line_size) |
| 55 { | 36 { |
| 56 int i = 8; | 37 int i = 8; |
| 57 uint64_t clampmask = zap(-1, 0xaa); /* 0x00ff00ff00ff00ff */ | 38 uint64_t clampmask = zap(-1, 0xaa); /* 0x00ff00ff00ff00ff */ |
| 58 | 39 |
| 59 do { | 40 do { |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 #define AVG2 avg2_no_rnd | 254 #define AVG2 avg2_no_rnd |
| 274 #define AVG4 avg4_no_rnd | 255 #define AVG4 avg4_no_rnd |
| 275 #define AVG4_ROUNDER BYTE_VEC(0x01) | 256 #define AVG4_ROUNDER BYTE_VEC(0x01) |
| 276 #define STORE(l, b) stq(l, b) | 257 #define STORE(l, b) stq(l, b) |
| 277 PIXOP(put_no_rnd, STORE); | 258 PIXOP(put_no_rnd, STORE); |
| 278 | 259 |
| 279 #undef STORE | 260 #undef STORE |
| 280 #define STORE(l, b) stq(AVG2(l, ldq(b)), b); | 261 #define STORE(l, b) stq(AVG2(l, ldq(b)), b); |
| 281 PIXOP(avg_no_rnd, STORE); | 262 PIXOP(avg_no_rnd, STORE); |
| 282 | 263 |
| 283 void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels, | 264 static void put_pixels16_axp_asm(uint8_t *block, const uint8_t *pixels, |
| 284 int line_size, int h) | 265 int line_size, int h) |
| 285 { | 266 { |
| 286 put_pixels_axp_asm(block, pixels, line_size, h); | 267 put_pixels_axp_asm(block, pixels, line_size, h); |
| 287 put_pixels_axp_asm(block + 8, pixels + 8, line_size, h); | 268 put_pixels_axp_asm(block + 8, pixels + 8, line_size, h); |
| 288 } | 269 } |
| 289 | 270 |
| 290 void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx) | 271 void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx) |
| 291 { | 272 { |
| 292 c->put_pixels_tab[0][0] = put_pixels16_axp_asm; | 273 c->put_pixels_tab[0][0] = put_pixels16_axp_asm; |
| 293 c->put_pixels_tab[0][1] = put_pixels16_x2_axp; | 274 c->put_pixels_tab[0][1] = put_pixels16_x2_axp; |
| 294 c->put_pixels_tab[0][2] = put_pixels16_y2_axp; | 275 c->put_pixels_tab[0][2] = put_pixels16_y2_axp; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 add_pixels_clamped_axp_p = c->add_pixels_clamped; | 332 add_pixels_clamped_axp_p = c->add_pixels_clamped; |
| 352 | 333 |
| 353 if (!avctx->lowres && | 334 if (!avctx->lowres && |
| 354 (avctx->idct_algo == FF_IDCT_AUTO || | 335 (avctx->idct_algo == FF_IDCT_AUTO || |
| 355 avctx->idct_algo == FF_IDCT_SIMPLEALPHA)) { | 336 avctx->idct_algo == FF_IDCT_SIMPLEALPHA)) { |
| 356 c->idct_put = ff_simple_idct_put_axp; | 337 c->idct_put = ff_simple_idct_put_axp; |
| 357 c->idct_add = ff_simple_idct_add_axp; | 338 c->idct_add = ff_simple_idct_add_axp; |
| 358 c->idct = ff_simple_idct_axp; | 339 c->idct = ff_simple_idct_axp; |
| 359 } | 340 } |
| 360 } | 341 } |
| OLD | NEW |