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
|
|
|
*/
|
|
|
|
|
2013-02-01 10:31:59 +01:00
|
|
|
#include "libavutil/attributes.h"
|
2008-05-09 13:56:36 +02:00
|
|
|
#include "libavcodec/dsputil.h"
|
2010-03-10 23:24:42 +01:00
|
|
|
#include "dsputil_vis.h"
|
2004-04-24 01:38:54 +02:00
|
|
|
#include "vis.h"
|
|
|
|
|
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-03-14 12:21:43 +01:00
|
|
|
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
2004-04-24 17:23:50 +02:00
|
|
|
|
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
|
|
|
}
|