2004-04-24 02:38:54 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2003 David S. Miller <davem@redhat.com>
|
|
|
|
*
|
2006-10-07 18:30:46 +03:00
|
|
|
* This file is part of FFmpeg.
|
2004-04-24 02:38:54 +03:00
|
|
|
*
|
2006-10-11 10:47:59 +03: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 02:38:54 +03:00
|
|
|
*
|
2006-10-07 18:30:46 +03:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2004-04-24 02:38:54 +03:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2006-10-11 10:47:59 +03:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2004-04-24 02:38:54 +03:00
|
|
|
*
|
2006-10-11 10:47:59 +03: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-13 00:43:26 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-04-24 02:38:54 +03:00
|
|
|
*/
|
|
|
|
|
2013-02-01 12:31:59 +03:00
|
|
|
#include "libavutil/attributes.h"
|
2008-05-09 14:56:36 +03:00
|
|
|
#include "libavcodec/dsputil.h"
|
2010-03-11 00:24:42 +02:00
|
|
|
#include "dsputil_vis.h"
|
2004-04-24 02:38:54 +03:00
|
|
|
#include "vis.h"
|
|
|
|
|
2013-02-01 12:31:59 +03:00
|
|
|
av_cold void ff_dsputil_init_vis(DSPContext *c, AVCodecContext *avctx)
|
2004-04-24 02:38:54 +03:00
|
|
|
{
|
2007-12-02 17:43:08 +02:00
|
|
|
/* VIS-specific optimizations */
|
2004-04-24 18:23:50 +03:00
|
|
|
int accel = vis_level ();
|
2013-03-14 14:21:43 +03:00
|
|
|
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
2004-04-24 18:23:50 +03:00
|
|
|
|
2013-02-15 04:13:42 +03:00
|
|
|
if (accel & ACCEL_SPARC_VIS && !high_bit_depth) {
|
|
|
|
if (avctx->idct_algo == FF_IDCT_SIMPLEVIS) {
|
2007-08-30 22:18:23 +03: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 18:23:50 +03:00
|
|
|
}
|
2004-04-24 02:38:54 +03:00
|
|
|
}
|