2007-10-04 23:47:12 +03:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
|
|
|
|
*
|
2007-10-05 01:41:21 +03:00
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
2007-10-04 23:47:12 +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.
|
|
|
|
*
|
|
|
|
* 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 22:19:07 +03:00
|
|
|
#include <string.h>
|
|
|
|
|
2013-02-01 12:31:59 +03:00
|
|
|
#include "libavutil/attributes.h"
|
2008-05-09 14:56:36 +03:00
|
|
|
#include "libavcodec/avcodec.h"
|
2013-01-28 22:22:54 +03:00
|
|
|
#include "libavcodec/vp3dsp.h"
|
2013-01-29 16:34:30 +03:00
|
|
|
#include "libavcodec/dsputil.h"
|
2007-10-04 23:47:12 +03:00
|
|
|
#include "dsputil_bfin.h"
|
2013-01-28 22:22:54 +03:00
|
|
|
#include "vp3_bfin.h"
|
2007-10-04 23:47:12 +03:00
|
|
|
|
|
|
|
/* Intra iDCT offset 128 */
|
2013-04-03 14:26:14 +03:00
|
|
|
static void bfin_vp3_idct_put(uint8_t *dest, int line_size, int16_t *block)
|
2007-10-04 23:47:12 +03:00
|
|
|
{
|
2013-04-03 15:28:45 +03:00
|
|
|
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + 128;
|
2007-10-04 23:47:12 +03:00
|
|
|
int i,j;
|
|
|
|
|
|
|
|
ff_bfin_vp3_idct (block);
|
|
|
|
|
|
|
|
for (i=0;i<8;i++)
|
|
|
|
for (j=0;j<8;j++)
|
2013-04-03 15:03:17 +03:00
|
|
|
dest[line_size*i + j] = cm[block[j*8 + i]];
|
2013-01-28 22:19:07 +03:00
|
|
|
|
|
|
|
memset(block, 0, 128);
|
2007-10-04 23:47:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Inter iDCT */
|
2013-04-03 14:26:14 +03:00
|
|
|
static void bfin_vp3_idct_add(uint8_t *dest, int line_size, int16_t *block)
|
2007-10-04 23:47:12 +03:00
|
|
|
{
|
2013-04-03 15:03:17 +03:00
|
|
|
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
|
|
|
|
int i, j;
|
|
|
|
|
2007-10-04 23:47:12 +03:00
|
|
|
ff_bfin_vp3_idct (block);
|
2013-04-03 15:03:17 +03:00
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
for (j = 0; j < 8; j++)
|
|
|
|
dest[line_size*i + j] = cm[dest[line_size*i + j] + block[j*8 + i]];
|
2013-01-28 22:19:07 +03:00
|
|
|
|
|
|
|
memset(block, 0, 128);
|
2007-10-04 23:47:12 +03:00
|
|
|
}
|
2013-01-28 22:22:54 +03:00
|
|
|
|
2013-02-01 12:31:59 +03:00
|
|
|
av_cold void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags)
|
2013-01-28 22:22:54 +03:00
|
|
|
{
|
2013-04-03 13:56:33 +03:00
|
|
|
if (!(flags & CODEC_FLAG_BITEXACT)) {
|
2013-04-03 14:26:14 +03:00
|
|
|
c->idct_add = bfin_vp3_idct_add;
|
|
|
|
c->idct_put = bfin_vp3_idct_put;
|
2013-04-03 13:56:33 +03:00
|
|
|
}
|
2013-01-28 22:22:54 +03:00
|
|
|
}
|