2004-04-24 01:38:54 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2003 David S. Miller <davem@redhat.com>
|
|
|
|
*
|
2006-10-07 17:30:46 +02:00
|
|
|
* This file is part of FFmpeg.
|
2004-04-24 01:38:54 +02:00
|
|
|
*
|
2006-10-11 09:47:59 +02:00
|
|
|
* FFmpeg 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.1 of the License, or (at your option) any later version.
|
2004-04-24 01:38:54 +02:00
|
|
|
*
|
2006-10-07 17:30:46 +02:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2004-04-24 01:38:54 +02:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2006-10-11 09:47:59 +02:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2004-04-24 01:38:54 +02:00
|
|
|
*
|
2006-10-11 09:47:59 +02:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2006-01-12 23:43:26 +01:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-04-24 01:38:54 +02:00
|
|
|
*/
|
|
|
|
|
2004-04-24 17:23:50 +02:00
|
|
|
/* The *no_round* functions have been added by James A. Morrison, 2003,2004.
|
2011-10-30 18:02:42 +01:00
|
|
|
The vis code from libmpeg2 was adapted for libavcodec by James A. Morrison.
|
2004-04-24 01:38:54 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
|
|
|
|
2013-02-01 10:31:59 +01:00
|
|
|
#include "libavutil/attributes.h"
|
2008-05-09 13:56:36 +02:00
|
|
|
#include "libavcodec/dsputil.h"
|
2012-08-16 09:22:31 +02:00
|
|
|
#include "libavutil/mem.h"
|
2010-03-10 23:24:42 +01:00
|
|
|
#include "dsputil_vis.h"
|
2004-04-24 01:38:54 +02:00
|
|
|
|
|
|
|
#include "vis.h"
|
|
|
|
|
2004-04-24 17:23:50 +02:00
|
|
|
#define ACCEL_SPARC_VIS 1
|
|
|
|
#define ACCEL_SPARC_VIS2 2
|
|
|
|
|
2009-01-30 19:38:25 +01:00
|
|
|
static int vis_level(void)
|
2004-04-24 17:23:50 +02:00
|
|
|
{
|
2007-10-02 21:51:18 +02:00
|
|
|
int accel = 0;
|
2004-04-24 17:23:50 +02:00
|
|
|
accel |= ACCEL_SPARC_VIS;
|
|
|
|
accel |= ACCEL_SPARC_VIS2;
|
|
|
|
return accel;
|
|
|
|
}
|
|
|
|
|
2004-04-24 01:38:54 +02:00
|
|
|
/* libavcodec initialization code */
|
2013-02-01 10:31:59 +01:00
|
|
|
av_cold void ff_dsputil_init_vis(DSPContext *c, AVCodecContext *avctx)
|
2004-04-24 01:38:54 +02:00
|
|
|
{
|
2007-12-02 16:43:08 +01:00
|
|
|
/* VIS-specific optimizations */
|
2004-04-24 17:23:50 +02:00
|
|
|
int accel = vis_level ();
|
|
|
|
|
2013-02-15 02:13:42 +01:00
|
|
|
if (accel & ACCEL_SPARC_VIS && !high_bit_depth) {
|
|
|
|
if (avctx->idct_algo == FF_IDCT_SIMPLEVIS) {
|
2007-08-30 21:18:23 +02:00
|
|
|
c->idct_put = ff_simple_idct_put_vis;
|
|
|
|
c->idct_add = ff_simple_idct_add_vis;
|
|
|
|
c->idct = ff_simple_idct_vis;
|
|
|
|
c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
|
|
|
|
}
|
2004-04-24 17:23:50 +02:00
|
|
|
}
|
2004-04-24 01:38:54 +02:00
|
|
|
}
|