*
* Copyright (c) 2001 Michael Niedermayer <michaelni@gmx.at>
*
- * This library is free software; you can redistribute it and/or
+ * based upon some outcommented C code from mpeg2dec (idct_mmx.c
+ * written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
+ *
+ * Alpha optimizations by Måns Rullgård <mans@mansr.com>
+ * and Falk Hueffner <falk@debian.org>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * based upon some outcommented c code from mpeg2dec (idct_mmx.c
- * written by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>)
- *
- * Alpha optimiziations by Måns Rullgård <mru@users.sourceforge.net>
- * and Falk Hueffner <falk@debian.org>
*/
+#include "libavcodec/dsputil.h"
+#include "dsputil_alpha.h"
#include "asm.h"
-#include "../dsputil.h"
-
-extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
- int line_size);
-extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
- int line_size);
// cos(i * M_PI / 16) * sqrt(2) * (1 << 14)
// W4 is actually exactly 16384, but using 16383 works around
// accumulating rounding errors for some encoders
-#define W1 ((int_fast32_t) 22725)
-#define W2 ((int_fast32_t) 21407)
-#define W3 ((int_fast32_t) 19266)
-#define W4 ((int_fast32_t) 16383)
-#define W5 ((int_fast32_t) 12873)
-#define W6 ((int_fast32_t) 8867)
-#define W7 ((int_fast32_t) 4520)
+#define W1 22725
+#define W2 21407
+#define W3 19266
+#define W4 16383
+#define W5 12873
+#define W6 8867
+#define W7 4520
#define ROW_SHIFT 11
#define COL_SHIFT 20
/* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */
static inline int idct_row(DCTELEM *row)
{
- int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3, t;
+ int a0, a1, a2, a3, b0, b1, b2, b3, t;
uint64_t l, r, t2;
l = ldq(row);
r = ldq(row + 4);
static inline void idct_col(DCTELEM *col)
{
- int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3;
+ int a0, a1, a2, a3, b0, b1, b2, b3;
col[0] += (1 << (COL_SHIFT - 1)) / W4;
uint64_t l, r;
for (i = 0; i < 8; ++i) {
- int_fast32_t a0 = col[i] + (1 << (COL_SHIFT - 1)) / W4;
+ int a0 = col[i] + (1 << (COL_SHIFT - 1)) / W4;
a0 *= W4;
col[i] = a0 >> COL_SHIFT;
stq(l, col + 14 * 4); stq(r, col + 15 * 4);
}
-void simple_idct_axp(DCTELEM *block)
+void ff_simple_idct_axp(DCTELEM *block)
{
int i;
}
}
-void simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block)
+void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block)
{
- simple_idct_axp(block);
+ ff_simple_idct_axp(block);
put_pixels_clamped_axp_p(block, dest, line_size);
}
-void simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block)
+void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block)
{
- simple_idct_axp(block);
+ ff_simple_idct_axp(block);
add_pixels_clamped_axp_p(block, dest, line_size);
}