2001-09-17 00:54:00 +03:00
|
|
|
/*
|
|
|
|
* Sun mediaLib optimized DSP utils
|
2002-05-26 01:45:33 +03:00
|
|
|
* Copyright (c) 2001 Fabrice Bellard.
|
2001-09-17 00:54:00 +03:00
|
|
|
*
|
2002-05-26 01:45:33 +03:00
|
|
|
* This library 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.
|
2001-09-17 00:54:00 +03:00
|
|
|
*
|
2002-05-26 01:45:33 +03:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2001-09-17 00:54:00 +03:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2002-05-26 01:45:33 +03:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2001-09-17 00:54:00 +03:00
|
|
|
*
|
2002-05-26 01:45:33 +03:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-01-13 00:43:26 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2001-09-17 00:54:00 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../dsputil.h"
|
2002-08-30 21:17:20 +03:00
|
|
|
#include "../mpegvideo.h"
|
2001-09-17 00:54:00 +03:00
|
|
|
|
|
|
|
#include <mlib_types.h>
|
|
|
|
#include <mlib_status.h>
|
|
|
|
#include <mlib_sys.h>
|
2003-10-11 19:43:51 +03:00
|
|
|
#include <mlib_algebra.h>
|
2001-09-17 00:54:00 +03:00
|
|
|
#include <mlib_video.h>
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
/* misc */
|
2001-09-17 00:54:00 +03:00
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
static void get_pixels_mlib(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i=0;i<8;i++) {
|
|
|
|
mlib_VectorConvert_S16_U8_Mod((mlib_s16 *)block, (mlib_u8 *)pixels, 8);
|
|
|
|
|
|
|
|
pixels += line_size;
|
|
|
|
block += 8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void diff_pixels_mlib(DCTELEM *restrict block, const uint8_t *s1, const uint8_t *s2, int line_size)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i=0;i<8;i++) {
|
|
|
|
mlib_VectorSub_S16_U8_Mod((mlib_s16 *)block, (mlib_u8 *)s1, (mlib_u8 *)s2, 8);
|
|
|
|
|
|
|
|
s1 += line_size;
|
|
|
|
s2 += line_size;
|
|
|
|
block += 8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void add_pixels_clamped_mlib(const DCTELEM *block, uint8_t *pixels, int line_size)
|
|
|
|
{
|
|
|
|
mlib_VideoAddBlock_U8_S16(pixels, (mlib_s16 *)block, line_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* put block, width 16 pixel, height 8/16 */
|
2002-10-08 15:09:23 +03:00
|
|
|
|
|
|
|
static void put_pixels16_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2002-10-08 15:09:23 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 8:
|
|
|
|
mlib_VideoCopyRef_U8_U8_16x8(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoCopyRef_U8_U8_16x16(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void put_pixels16_x2_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2002-10-08 15:09:23 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpX_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpX_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void put_pixels16_y2_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2002-10-08 15:09:23 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void put_pixels16_xy2_mlib(uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2002-10-08 15:09:23 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpXY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpXY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
}
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
/* put block, width 8 pixel, height 4/8/16 */
|
2002-10-08 15:09:23 +03:00
|
|
|
|
|
|
|
static void put_pixels8_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 4:
|
|
|
|
mlib_VideoCopyRef_U8_U8_8x4(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
mlib_VideoCopyRef_U8_U8_8x8(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoCopyRef_U8_U8_8x16(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2002-10-08 15:09:23 +03:00
|
|
|
static void put_pixels8_x2_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 4:
|
|
|
|
mlib_VideoInterpX_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpX_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpX_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2002-10-08 15:09:23 +03:00
|
|
|
static void put_pixels8_y2_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 4:
|
|
|
|
mlib_VideoInterpY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2002-10-08 15:09:23 +03:00
|
|
|
static void put_pixels8_xy2_mlib(uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 4:
|
|
|
|
mlib_VideoInterpXY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpXY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpXY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
/* average block, width 16 pixel, height 8/16 */
|
2002-10-08 15:09:23 +03:00
|
|
|
|
|
|
|
static void avg_pixels16_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2002-10-08 15:09:23 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 8:
|
|
|
|
mlib_VideoCopyRefAve_U8_U8_16x8(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoCopyRefAve_U8_U8_16x16(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void avg_pixels16_x2_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2002-10-08 15:09:23 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpAveX_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpAveX_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static void avg_pixels16_y2_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2002-10-08 15:09:23 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpAveY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpAveY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
}
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
static void avg_pixels16_xy2_mlib(uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2002-10-08 15:09:23 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpAveXY_U8_U8_16x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpAveXY_U8_U8_16x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
}
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
/* average block, width 8 pixel, height 4/8/16 */
|
2002-10-08 15:09:23 +03:00
|
|
|
|
|
|
|
static void avg_pixels8_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 4:
|
|
|
|
mlib_VideoCopyRefAve_U8_U8_8x4(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
mlib_VideoCopyRefAve_U8_U8_8x8(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoCopyRefAve_U8_U8_8x16(dest, (uint8_t *)ref, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2002-10-08 15:09:23 +03:00
|
|
|
static void avg_pixels8_x2_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 4:
|
|
|
|
mlib_VideoInterpAveX_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpAveX_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpAveX_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2002-10-08 15:09:23 +03:00
|
|
|
static void avg_pixels8_y2_mlib (uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 4:
|
|
|
|
mlib_VideoInterpAveY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpAveY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpAveY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
static void avg_pixels8_xy2_mlib(uint8_t * dest, const uint8_t * ref,
|
2005-12-22 03:10:11 +02:00
|
|
|
int stride, int height)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
switch (height) {
|
|
|
|
case 4:
|
|
|
|
mlib_VideoInterpAveXY_U8_U8_8x4(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 8:
|
|
|
|
mlib_VideoInterpAveXY_U8_U8_8x8(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 16:
|
|
|
|
mlib_VideoInterpAveXY_U8_U8_8x16(dest, (uint8_t *)ref, stride, stride);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
assert(0);
|
|
|
|
}
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
/* swap byte order of a buffer */
|
2001-09-17 00:54:00 +03:00
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
static void bswap_buf_mlib(uint32_t *dst, uint32_t *src, int w)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
mlib_VectorReverseByteOrder_U32_U32(dst, src, w);
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
/* transformations */
|
2002-10-08 15:09:23 +03:00
|
|
|
|
2003-02-11 18:35:48 +02:00
|
|
|
static void ff_idct_put_mlib(uint8_t *dest, int line_size, DCTELEM *data)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
int i;
|
|
|
|
uint8_t *cm = cropTbl + MAX_NEG_CROP;
|
|
|
|
|
2001-09-17 00:54:00 +03:00
|
|
|
mlib_VideoIDCT8x8_S16_S16 (data, data);
|
2005-12-17 20:14:38 +02:00
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
for(i=0;i<8;i++) {
|
|
|
|
dest[0] = cm[data[0]];
|
|
|
|
dest[1] = cm[data[1]];
|
|
|
|
dest[2] = cm[data[2]];
|
|
|
|
dest[3] = cm[data[3]];
|
|
|
|
dest[4] = cm[data[4]];
|
|
|
|
dest[5] = cm[data[5]];
|
|
|
|
dest[6] = cm[data[6]];
|
|
|
|
dest[7] = cm[data[7]];
|
|
|
|
|
|
|
|
dest += line_size;
|
|
|
|
data += 8;
|
|
|
|
}
|
2002-10-06 18:27:01 +03:00
|
|
|
}
|
2002-10-08 15:09:23 +03:00
|
|
|
|
2003-02-11 18:35:48 +02:00
|
|
|
static void ff_idct_add_mlib(uint8_t *dest, int line_size, DCTELEM *data)
|
2002-10-06 18:27:01 +03:00
|
|
|
{
|
|
|
|
mlib_VideoIDCT8x8_S16_S16 (data, data);
|
2002-12-16 00:42:59 +02:00
|
|
|
mlib_VideoAddBlock_U8_S16(dest, (mlib_s16 *)data, line_size);
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
|
|
|
|
2004-03-15 03:21:01 +02:00
|
|
|
static void ff_idct_mlib(DCTELEM *data)
|
2003-06-21 04:11:31 +03:00
|
|
|
{
|
|
|
|
mlib_VideoIDCT8x8_S16_S16 (data, data);
|
|
|
|
}
|
|
|
|
|
2002-10-08 15:09:23 +03:00
|
|
|
static void ff_fdct_mlib(DCTELEM *data)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
|
|
|
mlib_VideoDCT8x8_S16_S16 (data, data);
|
|
|
|
}
|
|
|
|
|
2003-05-20 20:36:49 +03:00
|
|
|
void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx)
|
2001-09-17 00:54:00 +03:00
|
|
|
{
|
2003-10-11 19:43:51 +03:00
|
|
|
c->get_pixels = get_pixels_mlib;
|
|
|
|
c->diff_pixels = diff_pixels_mlib;
|
|
|
|
c->add_pixels_clamped = add_pixels_clamped_mlib;
|
|
|
|
|
2002-11-11 12:04:45 +02:00
|
|
|
c->put_pixels_tab[0][0] = put_pixels16_mlib;
|
|
|
|
c->put_pixels_tab[0][1] = put_pixels16_x2_mlib;
|
|
|
|
c->put_pixels_tab[0][2] = put_pixels16_y2_mlib;
|
|
|
|
c->put_pixels_tab[0][3] = put_pixels16_xy2_mlib;
|
|
|
|
c->put_pixels_tab[1][0] = put_pixels8_mlib;
|
|
|
|
c->put_pixels_tab[1][1] = put_pixels8_x2_mlib;
|
|
|
|
c->put_pixels_tab[1][2] = put_pixels8_y2_mlib;
|
|
|
|
c->put_pixels_tab[1][3] = put_pixels8_xy2_mlib;
|
|
|
|
|
|
|
|
c->avg_pixels_tab[0][0] = avg_pixels16_mlib;
|
|
|
|
c->avg_pixels_tab[0][1] = avg_pixels16_x2_mlib;
|
|
|
|
c->avg_pixels_tab[0][2] = avg_pixels16_y2_mlib;
|
|
|
|
c->avg_pixels_tab[0][3] = avg_pixels16_xy2_mlib;
|
|
|
|
c->avg_pixels_tab[1][0] = avg_pixels8_mlib;
|
|
|
|
c->avg_pixels_tab[1][1] = avg_pixels8_x2_mlib;
|
|
|
|
c->avg_pixels_tab[1][2] = avg_pixels8_y2_mlib;
|
|
|
|
c->avg_pixels_tab[1][3] = avg_pixels8_xy2_mlib;
|
|
|
|
|
|
|
|
c->put_no_rnd_pixels_tab[0][0] = put_pixels16_mlib;
|
|
|
|
c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib;
|
|
|
|
|
2003-10-11 19:43:51 +03:00
|
|
|
c->bswap_buf = bswap_buf_mlib;
|
2001-09-17 00:54:00 +03:00
|
|
|
}
|
2002-08-30 21:17:20 +03:00
|
|
|
|
|
|
|
void MPV_common_init_mlib(MpegEncContext *s)
|
|
|
|
{
|
|
|
|
if(s->avctx->dct_algo==FF_DCT_AUTO || s->avctx->dct_algo==FF_DCT_MLIB){
|
2005-12-22 03:10:11 +02:00
|
|
|
s->dsp.fdct = ff_fdct_mlib;
|
2002-08-30 21:17:20 +03:00
|
|
|
}
|
2002-10-06 18:27:01 +03:00
|
|
|
|
2002-10-08 15:09:23 +03:00
|
|
|
if(s->avctx->idct_algo==FF_IDCT_AUTO || s->avctx->idct_algo==FF_IDCT_MLIB){
|
2003-05-20 20:36:49 +03:00
|
|
|
s->dsp.idct_put= ff_idct_put_mlib;
|
|
|
|
s->dsp.idct_add= ff_idct_add_mlib;
|
2003-06-21 04:11:31 +03:00
|
|
|
s->dsp.idct = ff_idct_mlib;
|
2003-05-20 20:36:49 +03:00
|
|
|
s->dsp.idct_permutation_type= FF_NO_IDCT_PERM;
|
2002-10-06 18:27:01 +03:00
|
|
|
}
|
2002-08-30 21:17:20 +03:00
|
|
|
}
|