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