2002-10-06 17:27:01 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2002 Michael Niedermayer
|
|
|
|
*
|
|
|
|
* This library 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 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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 this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../dsputil.h"
|
|
|
|
#include "../mpegvideo.h"
|
|
|
|
#include "../avcodec.h"
|
|
|
|
|
|
|
|
extern void j_rev_dct_ARM(DCTELEM *data);
|
2002-11-19 08:33:36 +01:00
|
|
|
/* XXX: local hack */
|
2003-02-11 17:35:48 +01:00
|
|
|
static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
|
|
|
|
static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
|
2002-10-06 17:27:01 +02:00
|
|
|
|
|
|
|
/* XXX: those functions should be suppressed ASAP when all IDCTs are
|
|
|
|
converted */
|
2003-02-11 17:35:48 +01:00
|
|
|
static void arm_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
|
2002-10-06 17:27:01 +02:00
|
|
|
{
|
|
|
|
j_rev_dct_ARM (block);
|
2002-11-19 08:33:36 +01:00
|
|
|
ff_put_pixels_clamped(block, dest, line_size);
|
2002-10-06 17:27:01 +02:00
|
|
|
}
|
2003-02-11 17:35:48 +01:00
|
|
|
static void arm_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
|
2002-10-06 17:27:01 +02:00
|
|
|
{
|
|
|
|
j_rev_dct_ARM (block);
|
2002-11-19 08:33:36 +01:00
|
|
|
ff_add_pixels_clamped(block, dest, line_size);
|
2002-10-06 17:27:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void MPV_common_init_armv4l(MpegEncContext *s)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
const int idct_algo= s->avctx->idct_algo;
|
|
|
|
|
2002-11-19 11:08:31 +01:00
|
|
|
ff_put_pixels_clamped = s->dsp.put_pixels_clamped;
|
2002-11-20 08:32:18 +01:00
|
|
|
ff_add_pixels_clamped = s->dsp.add_pixels_clamped;
|
2002-11-19 08:33:36 +01:00
|
|
|
|
2002-10-06 17:27:01 +02:00
|
|
|
if(idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_ARM){
|
|
|
|
s->idct_put= arm_idct_put;
|
|
|
|
s->idct_add= arm_idct_add;
|
2002-11-19 11:08:31 +01:00
|
|
|
s->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;/* FF_NO_IDCT_PERM */
|
2002-10-06 17:27:01 +02:00
|
|
|
}
|
|
|
|
}
|