2007-10-04 20:47:12 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
|
|
|
|
*
|
2007-10-04 22:41:21 +00:00
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
2007-10-04 20:47:12 +00: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.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2013-01-28 19:19:07 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2013-02-01 09:31:59 +00:00
|
|
|
#include "libavutil/attributes.h"
|
2008-05-09 11:56:36 +00:00
|
|
|
#include "libavcodec/avcodec.h"
|
2013-01-28 19:22:54 +00:00
|
|
|
#include "libavcodec/vp3dsp.h"
|
2013-01-29 13:34:30 +00:00
|
|
|
#include "libavcodec/dsputil.h"
|
2007-10-04 20:47:12 +00:00
|
|
|
#include "dsputil_bfin.h"
|
2013-01-28 19:22:54 +00:00
|
|
|
#include "vp3_bfin.h"
|
2007-10-04 20:47:12 +00:00
|
|
|
|
|
|
|
/* Intra iDCT offset 128 */
|
2013-04-03 11:26:14 +00:00
|
|
|
static void bfin_vp3_idct_put(uint8_t *dest, int line_size, int16_t *block)
|
2007-10-04 20:47:12 +00:00
|
|
|
{
|
2013-04-03 12:28:45 +00:00
|
|
|
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + 128;
|
2007-10-04 20:47:12 +00:00
|
|
|
int i,j;
|
|
|
|
|
|
|
|
ff_bfin_vp3_idct (block);
|
|
|
|
|
|
|
|
for (i=0;i<8;i++)
|
|
|
|
for (j=0;j<8;j++)
|
2010-06-22 23:12:48 +00:00
|
|
|
dest[line_size*i+j]=cm[block[i*8+j]];
|
2013-01-28 19:19:07 +00:00
|
|
|
|
|
|
|
memset(block, 0, 128);
|
2007-10-04 20:47:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Inter iDCT */
|
2013-04-03 11:26:14 +00:00
|
|
|
static void bfin_vp3_idct_add(uint8_t *dest, int line_size, int16_t *block)
|
2007-10-04 20:47:12 +00:00
|
|
|
{
|
|
|
|
ff_bfin_vp3_idct (block);
|
|
|
|
ff_bfin_add_pixels_clamped (block, dest, line_size);
|
2013-01-28 19:19:07 +00:00
|
|
|
|
|
|
|
memset(block, 0, 128);
|
2007-10-04 20:47:12 +00:00
|
|
|
}
|
2013-01-28 19:22:54 +00:00
|
|
|
|
2013-02-01 09:31:59 +00:00
|
|
|
av_cold void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags)
|
2013-01-28 19:22:54 +00:00
|
|
|
{
|
2013-03-12 14:28:12 +00:00
|
|
|
// FIXME: these functions are disabled because they expect unpermutated
|
|
|
|
// IDCT coefficients as input, but the coefficients are transposed
|
2013-04-08 10:18:29 +00:00
|
|
|
// if (!(flags & CODEC_FLAG_BITEXACT)) {
|
2013-04-08 10:40:26 +00:00
|
|
|
// c->idct_add = bfin_vp3_idct_add;
|
|
|
|
// c->idct_put = bfin_vp3_idct_put;
|
2013-04-08 10:18:29 +00:00
|
|
|
// }
|
2013-01-28 19:22:54 +00:00
|
|
|
}
|