2004-04-24 01:38:54 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2003 David S. Miller <davem@redhat.com>
|
|
|
|
*
|
2011-03-18 18:35:10 +01:00
|
|
|
* This file is part of Libav.
|
2004-04-24 01:38:54 +02:00
|
|
|
*
|
2011-03-18 18:35:10 +01:00
|
|
|
* Libav is free software; you can redistribute it and/or
|
2006-10-11 09:47:59 +02:00
|
|
|
* 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
|
|
|
*
|
2011-03-18 18:35:10 +01:00
|
|
|
* Libav 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
|
2011-03-18 18:35:10 +01:00
|
|
|
* License along with Libav; 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-03-11 00:51:25 +01:00
|
|
|
#include "libavutil/attributes.h"
|
|
|
|
#include "libavcodec/dsputil.h"
|
|
|
|
#include "dsputil_vis.h"
|
|
|
|
#include "vis.h"
|
2004-04-24 17:23:50 +02:00
|
|
|
|
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 ();
|
2011-07-21 11:05:15 +02: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
|
|
|
}
|