2002-10-06 18:27:01 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2002 Michael Niedermayer
|
|
|
|
*
|
2006-10-07 18:30:46 +03:00
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2002-10-06 18:27:01 +03:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2006-10-07 18:30:46 +03:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2002-10-06 18:27:01 +03:00
|
|
|
*
|
2006-10-07 18:30:46 +03:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2002-10-06 18:27:01 +03:00
|
|
|
* 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
|
2006-10-07 18:30:46 +03:00
|
|
|
* 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
|
2002-10-06 18:27:01 +03:00
|
|
|
*/
|
|
|
|
|
2024-03-28 20:58:47 +02:00
|
|
|
#include <assert.h>
|
|
|
|
|
2021-04-14 15:11:43 +02:00
|
|
|
#include "libavutil/attributes.h"
|
2012-04-21 17:31:10 +03:00
|
|
|
#include "libavutil/arm/cpu.h"
|
2008-05-09 14:56:36 +03:00
|
|
|
#include "libavcodec/avcodec.h"
|
|
|
|
#include "libavcodec/mpegvideo.h"
|
2010-03-08 04:36:07 +02:00
|
|
|
#include "mpegvideo_arm.h"
|
2010-06-02 21:49:53 +03:00
|
|
|
#include "asm-offsets.h"
|
|
|
|
|
2010-06-03 01:05:25 +03:00
|
|
|
#if HAVE_NEON
|
2024-03-28 20:58:47 +02:00
|
|
|
#define CHECK_OFFSET(s, m, o) \
|
|
|
|
static_assert(offsetof(s, m) == o, \
|
|
|
|
"Hardcoded ASM offset of " #s " field " #o " needs to be updated.");
|
|
|
|
CHECK_OFFSET(MpegEncContext, y_dc_scale, Y_DC_SCALE);
|
|
|
|
CHECK_OFFSET(MpegEncContext, c_dc_scale, C_DC_SCALE);
|
|
|
|
CHECK_OFFSET(MpegEncContext, ac_pred, AC_PRED);
|
|
|
|
CHECK_OFFSET(MpegEncContext, block_last_index, BLOCK_LAST_INDEX);
|
|
|
|
CHECK_OFFSET(MpegEncContext, inter_scantable.raster_end,
|
|
|
|
INTER_SCANTAB_RASTER_END);
|
|
|
|
CHECK_OFFSET(MpegEncContext, h263_aic, H263_AIC);
|
2010-06-03 01:05:25 +03:00
|
|
|
#endif
|
2005-05-26 17:32:46 +03:00
|
|
|
|
2013-01-20 03:02:29 +03:00
|
|
|
void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block,
|
2010-05-29 18:29:40 +03:00
|
|
|
int n, int qscale);
|
2013-01-20 03:02:29 +03:00
|
|
|
void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, int16_t *block,
|
2010-05-29 18:29:40 +03:00
|
|
|
int n, int qscale);
|
|
|
|
|
2014-08-10 18:25:12 +03:00
|
|
|
av_cold void ff_mpv_common_init_arm(MpegEncContext *s)
|
2002-10-06 18:27:01 +03:00
|
|
|
{
|
2012-04-21 17:31:10 +03:00
|
|
|
int cpu_flags = av_get_cpu_flags();
|
|
|
|
|
|
|
|
if (have_armv5te(cpu_flags))
|
2014-08-10 18:25:12 +03:00
|
|
|
ff_mpv_common_init_armv5te(s);
|
2010-05-29 18:29:40 +03:00
|
|
|
|
2012-04-21 17:31:10 +03:00
|
|
|
if (have_neon(cpu_flags)) {
|
2010-05-29 18:29:40 +03:00
|
|
|
s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_neon;
|
|
|
|
s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_neon;
|
|
|
|
}
|
2002-10-06 18:27:01 +03:00
|
|
|
}
|