mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 10:04:37 +08:00
avcodec/fmtconvert: Remove now unused subsystem
Unused since 2312ae4d10.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
1 parent
d9ed77cb52
commit
b6e90cc92c
27 files changed
-830
No files matched your search
@@ -2747,7 +2747,6 @@ CONFIG_EXTRA="
|
||||
faandct
|
||||
faanidct
|
||||
fdctdsp
|
||||
fmtconvert
|
||||
frame_thread_encoder
|
||||
g722dsp
|
||||
golomb
|
||||
|
||||
@@ -59,6 +59,5 @@ Files that have MIPS copyright notice in them:
|
||||
compute_antialias_fixed.h
|
||||
compute_antialias_float.h
|
||||
lsp_mips.h
|
||||
fmtconvert_mips.c
|
||||
mpegaudiodsp_mips_fixed.c
|
||||
mpegaudiodsp_mips_float.c
|
||||
@@ -108,7 +108,6 @@ OBJS-$(CONFIG_EVCPARSE) += evc_parse.o evc_ps.o
|
||||
OBJS-$(CONFIG_FAANDCT) += faandct.o
|
||||
OBJS-$(CONFIG_FAANIDCT) += faanidct.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += fdctdsp.o jfdctfst.o jfdctint.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o
|
||||
OBJS-$(CONFIG_GOLOMB) += golomb.o
|
||||
OBJS-$(CONFIG_H263DSP) += h263dsp.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += h264chroma.o
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# subsystems
|
||||
OBJS-$(CONFIG_AC3DSP) += aarch64/ac3dsp_init_aarch64.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += aarch64/fdctdsp_init_aarch64.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_init.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += aarch64/h264chroma_init_aarch64.o
|
||||
OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_init_aarch64.o
|
||||
OBJS-$(CONFIG_HUFFYUVDSP) += aarch64/huffyuvdsp_init_aarch64.o
|
||||
@@ -45,7 +44,6 @@ NEON-OBJS-$(CONFIG_AAC_DECODER) += aarch64/sbrdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_AAC_ENCODER) += aarch64/aacencdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_AC3DSP) += aarch64/ac3dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_FDCTDSP) += aarch64/fdctdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_FMTCONVERT) += aarch64/fmtconvert_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264CHROMA) += aarch64/h264cmc_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264DSP) += aarch64/h264dsp_neon.o \
|
||||
aarch64/h264idct_neon.o
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* ARM optimized Format Conversion Utils
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/aarch64/cpu.h"
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
|
||||
void ff_int32_to_float_fmul_scalar_neon(float *dst, const int32_t *src,
|
||||
float mul, int len);
|
||||
|
||||
av_cold void ff_fmt_convert_init_aarch64(FmtConvertContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon;
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* ARM NEON optimised Format Conversion Utils
|
||||
* Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
|
||||
* Copyright (c) 2015 Janne Grunau <janne-libav@jannau.net>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/aarch64/asm.S"
|
||||
|
||||
function ff_int32_to_float_fmul_scalar_neon, export=1
|
||||
ld1 {v1.4s,v2.4s}, [x1], #32
|
||||
scvtf v1.4s, v1.4s
|
||||
scvtf v2.4s, v2.4s
|
||||
1:
|
||||
subs w2, w2, #8
|
||||
fmul v3.4s, v1.4s, v0.s[0]
|
||||
fmul v4.4s, v2.4s, v0.s[0]
|
||||
b.le 2f
|
||||
ld1 {v1.4s,v2.4s}, [x1], #32
|
||||
st1 {v3.4s,v4.4s}, [x0], #32
|
||||
scvtf v1.4s, v1.4s
|
||||
scvtf v2.4s, v2.4s
|
||||
b 1b
|
||||
2:
|
||||
st1 {v3.4s,v4.4s}, [x0]
|
||||
ret
|
||||
endfunc
|
||||
@@ -5,7 +5,6 @@ OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
|
||||
arm/ac3dsp_arm.o
|
||||
OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o
|
||||
OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_init_arm.o
|
||||
OBJS-$(CONFIG_G722DSP) += arm/g722dsp_init_arm.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o
|
||||
OBJS-$(CONFIG_H264DSP) += arm/h264dsp_init_arm.o
|
||||
@@ -86,9 +85,6 @@ ARMV6-OBJS-$(CONFIG_TRUEHD_DECODER) += arm/mlpdsp_armv6.o
|
||||
|
||||
# VFP optimizations
|
||||
|
||||
# subsystems
|
||||
VFP-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_vfp.o
|
||||
|
||||
# decoders/encoders
|
||||
VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_vfp.o
|
||||
|
||||
@@ -102,7 +98,6 @@ NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \
|
||||
arm/int_neon.o
|
||||
NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \
|
||||
arm/blockdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_neon.o
|
||||
NEON-OBJS-$(CONFIG_G722DSP) += arm/g722dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_neon.o \
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* ARM optimized Format Conversion Utils
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
|
||||
void ff_int32_to_float_fmul_scalar_neon(float *dst, const int32_t *src,
|
||||
float mul, int len);
|
||||
|
||||
void ff_int32_to_float_fmul_scalar_vfp(float *dst, const int32_t *src,
|
||||
float mul, int len);
|
||||
|
||||
av_cold void ff_fmt_convert_init_arm(FmtConvertContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_vfp_vm(cpu_flags)) {
|
||||
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_vfp;
|
||||
}
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon;
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* ARM NEON optimised Format Conversion Utils
|
||||
* Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
|
||||
* Copyright (c) 2015 Janne Grunau <janne-libav@jannau.net>b
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
function ff_int32_to_float_fmul_scalar_neon, export=1
|
||||
VFP vdup.32 q0, d0[0]
|
||||
VFP len .req r2
|
||||
NOVFP vdup.32 q0, r2
|
||||
NOVFP len .req r3
|
||||
|
||||
vld1.32 {q1},[r1,:128]!
|
||||
vcvt.f32.s32 q3, q1
|
||||
vld1.32 {q2},[r1,:128]!
|
||||
vcvt.f32.s32 q8, q2
|
||||
1: subs len, len, #8
|
||||
pld [r1, #16]
|
||||
vmul.f32 q9, q3, q0
|
||||
vmul.f32 q10, q8, q0
|
||||
beq 2f
|
||||
vld1.32 {q1},[r1,:128]!
|
||||
vcvt.f32.s32 q3, q1
|
||||
vld1.32 {q2},[r1,:128]!
|
||||
vcvt.f32.s32 q8, q2
|
||||
vst1.32 {q9}, [r0,:128]!
|
||||
vst1.32 {q10},[r0,:128]!
|
||||
b 1b
|
||||
2: vst1.32 {q9}, [r0,:128]!
|
||||
vst1.32 {q10},[r0,:128]!
|
||||
bx lr
|
||||
.unreq len
|
||||
endfunc
|
||||
@@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2013 RISC OS Open Ltd <bavison@riscosopen.org>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/arm/asm.S"
|
||||
|
||||
/**
|
||||
* ARM VFP optimised int32 to float conversion.
|
||||
* Assume len is a multiple of 8, destination buffer is at least 4 bytes aligned
|
||||
* (16 bytes alignment is best for BCM2835), little-endian.
|
||||
* TODO: could be further optimised by unrolling and interleaving, as above
|
||||
*/
|
||||
@ void ff_int32_to_float_fmul_scalar_vfp(float *dst, const int32_t *src, float mul, int len)
|
||||
function ff_int32_to_float_fmul_scalar_vfp, export=1
|
||||
VFP tmp .req a4
|
||||
VFP len .req a3
|
||||
NOVFP tmp .req a3
|
||||
NOVFP len .req a4
|
||||
NOVFP vmov s0, a3
|
||||
ldr tmp, =0x03070000 @ RunFast mode, short vectors of length 8, stride 1
|
||||
fmrx ip, FPSCR
|
||||
fmxr FPSCR, tmp
|
||||
1:
|
||||
vldmia a2!, {s8-s15}
|
||||
vcvt.f32.s32 s8, s8
|
||||
vcvt.f32.s32 s9, s9
|
||||
vcvt.f32.s32 s10, s10
|
||||
vcvt.f32.s32 s11, s11
|
||||
vcvt.f32.s32 s12, s12
|
||||
vcvt.f32.s32 s13, s13
|
||||
vcvt.f32.s32 s14, s14
|
||||
vcvt.f32.s32 s15, s15
|
||||
vmul.f32 s8, s8, s0
|
||||
subs len, len, #8
|
||||
vstmia a1!, {s8-s11}
|
||||
vstmia a1!, {s12-s15}
|
||||
bne 1b
|
||||
|
||||
fmxr FPSCR, ip
|
||||
bx lr
|
||||
endfunc
|
||||
.unreq tmp
|
||||
.unreq len
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Format Conversion Utils
|
||||
* Copyright (c) 2000, 2001 Fabrice Bellard
|
||||
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "fmtconvert.h"
|
||||
|
||||
static void int32_to_float_fmul_scalar_c(float *dst, const int32_t *src,
|
||||
float mul, int len)
|
||||
{
|
||||
int i;
|
||||
for(i=0; i<len; i++)
|
||||
dst[i] = src[i] * mul;
|
||||
}
|
||||
|
||||
av_cold void ff_fmt_convert_init(FmtConvertContext *c)
|
||||
{
|
||||
c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_c;
|
||||
|
||||
#if ARCH_AARCH64
|
||||
ff_fmt_convert_init_aarch64(c);
|
||||
#elif ARCH_ARM
|
||||
ff_fmt_convert_init_arm(c);
|
||||
#elif ARCH_PPC
|
||||
ff_fmt_convert_init_ppc(c);
|
||||
#elif ARCH_RISCV
|
||||
ff_fmt_convert_init_riscv(c);
|
||||
#elif ARCH_X86 && HAVE_X86ASM
|
||||
ff_fmt_convert_init_x86(c);
|
||||
#endif
|
||||
#if HAVE_MIPSFPU
|
||||
ff_fmt_convert_init_mips(c);
|
||||
#endif
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Format Conversion Utils
|
||||
* Copyright (c) 2000, 2001 Fabrice Bellard
|
||||
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_FMTCONVERT_H
|
||||
#define AVCODEC_FMTCONVERT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct FmtConvertContext {
|
||||
/**
|
||||
* Convert an array of int32_t to float and multiply by a float value.
|
||||
* @param dst destination array of float.
|
||||
* constraints: 16-byte aligned
|
||||
* @param src source array of int32_t.
|
||||
* constraints: 16-byte aligned
|
||||
* @param len number of elements to convert.
|
||||
* constraints: multiple of 8
|
||||
*/
|
||||
void (*int32_to_float_fmul_scalar)(float *dst, const int32_t *src,
|
||||
float mul, int len);
|
||||
} FmtConvertContext;
|
||||
|
||||
void ff_fmt_convert_init(FmtConvertContext *c);
|
||||
|
||||
void ff_fmt_convert_init_aarch64(FmtConvertContext *c);
|
||||
void ff_fmt_convert_init_arm(FmtConvertContext *c);
|
||||
void ff_fmt_convert_init_ppc(FmtConvertContext *c);
|
||||
void ff_fmt_convert_init_riscv(FmtConvertContext *c);
|
||||
void ff_fmt_convert_init_x86(FmtConvertContext *c);
|
||||
void ff_fmt_convert_init_mips(FmtConvertContext *c);
|
||||
|
||||
#endif /* AVCODEC_FMTCONVERT_H */
|
||||
@@ -36,7 +36,6 @@ MIPSFPU-OBJS-$(CONFIG_WMAVOICE_DECODER) += mips/acelp_filters_mips.o \
|
||||
MIPSFPU-OBJS-$(CONFIG_CELP_MATH) += mips/celp_math_mips.o
|
||||
MIPSFPU-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_float.o
|
||||
MIPSDSP-OBJS-$(CONFIG_MPEGAUDIODSP) += mips/mpegaudiodsp_mips_fixed.o
|
||||
MIPSFPU-OBJS-$(CONFIG_FMTCONVERT) += mips/fmtconvert_mips.o
|
||||
OBJS-$(CONFIG_AC3DSP) += mips/ac3dsp_mips.o
|
||||
OBJS-$(CONFIG_HEVC_DECODER) += mips/hevcdsp_init_mips.o \
|
||||
mips/hevcpred_init_mips.o
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
/*
|
||||
* Format Conversion Utils for MIPS
|
||||
*
|
||||
* Copyright (c) 2012
|
||||
* MIPS Technologies, Inc., California.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the MIPS Technologies, Inc., nor the names of is
|
||||
* contributors may be used to endorse or promote products derived from
|
||||
* this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* Author: Zoran Lukic (zoranl@mips.com)
|
||||
* Author: Nedeljko Babic (nbabic@mips.com)
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
static void int32_to_float_fmul_scalar_mips(float *dst, const int *src,
|
||||
float mul, int len)
|
||||
{
|
||||
/*
|
||||
* variables used in inline assembler
|
||||
*/
|
||||
float temp1, temp3, temp5, temp7, temp9, temp11, temp13, temp15;
|
||||
|
||||
int rpom1, rpom2, rpom11, rpom21, rpom12, rpom22, rpom13, rpom23;
|
||||
const int *src_end = src + len;
|
||||
/*
|
||||
* loop is 8 times unrolled in assembler in order to achieve better performance
|
||||
*/
|
||||
__asm__ volatile (
|
||||
"i32tf_lp%=: \n\t"
|
||||
"lw %[rpom11], 0(%[src]) \n\t"
|
||||
"lw %[rpom21], 4(%[src]) \n\t"
|
||||
"lw %[rpom1], 8(%[src]) \n\t"
|
||||
"lw %[rpom2], 12(%[src]) \n\t"
|
||||
"mtc1 %[rpom11], %[temp1] \n\t"
|
||||
"mtc1 %[rpom21], %[temp3] \n\t"
|
||||
"mtc1 %[rpom1], %[temp5] \n\t"
|
||||
"mtc1 %[rpom2], %[temp7] \n\t"
|
||||
|
||||
"lw %[rpom13], 16(%[src]) \n\t"
|
||||
"lw %[rpom23], 20(%[src]) \n\t"
|
||||
"lw %[rpom12], 24(%[src]) \n\t"
|
||||
"lw %[rpom22], 28(%[src]) \n\t"
|
||||
"mtc1 %[rpom13], %[temp9] \n\t"
|
||||
"mtc1 %[rpom23], %[temp11] \n\t"
|
||||
"mtc1 %[rpom12], %[temp13] \n\t"
|
||||
"mtc1 %[rpom22], %[temp15] \n\t"
|
||||
|
||||
PTR_ADDIU "%[src], 32 \n\t"
|
||||
"cvt.s.w %[temp1], %[temp1] \n\t"
|
||||
"cvt.s.w %[temp3], %[temp3] \n\t"
|
||||
"cvt.s.w %[temp5], %[temp5] \n\t"
|
||||
"cvt.s.w %[temp7], %[temp7] \n\t"
|
||||
|
||||
"cvt.s.w %[temp9], %[temp9] \n\t"
|
||||
"cvt.s.w %[temp11], %[temp11] \n\t"
|
||||
"cvt.s.w %[temp13], %[temp13] \n\t"
|
||||
"cvt.s.w %[temp15], %[temp15] \n\t"
|
||||
|
||||
"mul.s %[temp1], %[temp1], %[mul] \n\t"
|
||||
"mul.s %[temp3], %[temp3], %[mul] \n\t"
|
||||
"mul.s %[temp5], %[temp5], %[mul] \n\t"
|
||||
"mul.s %[temp7], %[temp7], %[mul] \n\t"
|
||||
|
||||
"mul.s %[temp9], %[temp9], %[mul] \n\t"
|
||||
"mul.s %[temp11], %[temp11], %[mul] \n\t"
|
||||
"mul.s %[temp13], %[temp13], %[mul] \n\t"
|
||||
"mul.s %[temp15], %[temp15], %[mul] \n\t"
|
||||
|
||||
"swc1 %[temp1], 0(%[dst]) \n\t" /*dst[i] = src[i] * mul; */
|
||||
"swc1 %[temp3], 4(%[dst]) \n\t" /*dst[i+1] = src[i+1] * mul;*/
|
||||
"swc1 %[temp5], 8(%[dst]) \n\t" /*dst[i+2] = src[i+2] * mul;*/
|
||||
"swc1 %[temp7], 12(%[dst]) \n\t" /*dst[i+3] = src[i+3] * mul;*/
|
||||
|
||||
"swc1 %[temp9], 16(%[dst]) \n\t" /*dst[i+4] = src[i+4] * mul;*/
|
||||
"swc1 %[temp11], 20(%[dst]) \n\t" /*dst[i+5] = src[i+5] * mul;*/
|
||||
"swc1 %[temp13], 24(%[dst]) \n\t" /*dst[i+6] = src[i+6] * mul;*/
|
||||
"swc1 %[temp15], 28(%[dst]) \n\t" /*dst[i+7] = src[i+7] * mul;*/
|
||||
PTR_ADDIU "%[dst], 32 \n\t"
|
||||
"bne %[src], %[src_end], i32tf_lp%= \n\t"
|
||||
: [temp1]"=&f"(temp1), [temp11]"=&f"(temp11),
|
||||
[temp13]"=&f"(temp13), [temp15]"=&f"(temp15),
|
||||
[temp3]"=&f"(temp3), [temp5]"=&f"(temp5),
|
||||
[temp7]"=&f"(temp7), [temp9]"=&f"(temp9),
|
||||
[rpom1]"=&r"(rpom1), [rpom2]"=&r"(rpom2),
|
||||
[rpom11]"=&r"(rpom11), [rpom21]"=&r"(rpom21),
|
||||
[rpom12]"=&r"(rpom12), [rpom22]"=&r"(rpom22),
|
||||
[rpom13]"=&r"(rpom13), [rpom23]"=&r"(rpom23),
|
||||
[dst]"+r"(dst), [src]"+r"(src)
|
||||
: [mul]"f"(mul), [src_end]"r"(src_end)
|
||||
: "memory"
|
||||
);
|
||||
}
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
av_cold void ff_fmt_convert_init_mips(FmtConvertContext *c)
|
||||
{
|
||||
#if HAVE_INLINE_ASM
|
||||
c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_mips;
|
||||
#endif
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
OBJS-$(CONFIG_AUDIODSP) += ppc/audiodsp.o
|
||||
OBJS-$(CONFIG_BLOCKDSP) += ppc/blockdsp.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += ppc/fdctdsp.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += ppc/fmtconvert_altivec.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += ppc/h264chroma_init.o
|
||||
OBJS-$(CONFIG_H264DSP) += ppc/h264dsp.o ppc/hpeldsp_altivec.o
|
||||
OBJS-$(CONFIG_H264QPEL) += ppc/h264qpel.o
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2006 Luca Barbato <lu_zero@gentoo.org>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/mem.h"
|
||||
#include "libavutil/ppc/cpu.h"
|
||||
#include "libavutil/ppc/util_altivec.h"
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
|
||||
#if HAVE_ALTIVEC
|
||||
|
||||
static void int32_to_float_fmul_scalar_altivec(float *dst, const int32_t *src,
|
||||
float mul, int len)
|
||||
{
|
||||
union {
|
||||
vector float v;
|
||||
float s[4];
|
||||
} mul_u;
|
||||
int i;
|
||||
vector float src1, src2, dst1, dst2, mul_v, zero;
|
||||
|
||||
zero = (vector float)vec_splat_u32(0);
|
||||
mul_u.s[0] = mul;
|
||||
mul_v = vec_splat(mul_u.v, 0);
|
||||
|
||||
for (i = 0; i < len; i += 8) {
|
||||
src1 = vec_ctf(vec_ld(0, src+i), 0);
|
||||
src2 = vec_ctf(vec_ld(16, src+i), 0);
|
||||
dst1 = vec_madd(src1, mul_v, zero);
|
||||
dst2 = vec_madd(src2, mul_v, zero);
|
||||
vec_st(dst1, 0, dst+i);
|
||||
vec_st(dst2, 16, dst+i);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_ALTIVEC */
|
||||
|
||||
av_cold void ff_fmt_convert_init_ppc(FmtConvertContext *c)
|
||||
{
|
||||
#if HAVE_ALTIVEC
|
||||
if (!PPC_ALTIVEC(av_get_cpu_flags()))
|
||||
return;
|
||||
|
||||
c->int32_to_float_fmul_scalar = int32_to_float_fmul_scalar_altivec;
|
||||
#endif /* HAVE_ALTIVEC */
|
||||
}
|
||||
@@ -20,8 +20,6 @@ OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_init.o
|
||||
RVV-OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_rvv.o
|
||||
OBJS-$(CONFIG_FLAC_DECODER) += riscv/flacdsp_init.o
|
||||
RVV-OBJS-$(CONFIG_FLAC_DECODER) += riscv/flacdsp_rvv.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_init.o
|
||||
RVV-OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_rvv.o
|
||||
OBJS-$(CONFIG_G722DSP) += riscv/g722dsp_init.o
|
||||
RVV-OBJS-$(CONFIG_G722DSP) += riscv/g722dsp_rvv.o
|
||||
OBJS-$(CONFIG_JPEG2000_DECODER) += riscv/jpeg2000dsp_init.o
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2022 Rémi Denis-Courmont.
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
|
||||
void ff_int32_to_float_fmul_scalar_rvv(float *dst, const int32_t *src,
|
||||
float mul, int len);
|
||||
|
||||
av_cold void ff_fmt_convert_init_riscv(FmtConvertContext *c)
|
||||
{
|
||||
#if HAVE_RVV
|
||||
int flags = av_get_cpu_flags();
|
||||
|
||||
if ((flags & AV_CPU_FLAG_RVV_F32) && (flags & AV_CPU_FLAG_RVB)) {
|
||||
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_rvv;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright © 2022 Rémi Denis-Courmont.
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "libavutil/riscv/asm.S"
|
||||
|
||||
func ff_int32_to_float_fmul_scalar_rvv, zve32f, zba
|
||||
lpad 0
|
||||
NOHWF fmv.w.x fa0, a2
|
||||
NOHWF mv a2, a3
|
||||
1:
|
||||
vsetvli t0, a2, e32, m8, ta, ma
|
||||
vle32.v v24, (a1)
|
||||
sub a2, a2, t0
|
||||
vfcvt.f.x.v v24, v24
|
||||
sh2add a1, t0, a1
|
||||
vfmul.vf v24, v24, fa0
|
||||
vse32.v v24, (a0)
|
||||
sh2add a0, t0, a0
|
||||
bnez a2, 1b
|
||||
|
||||
ret
|
||||
endfunc
|
||||
@@ -12,7 +12,6 @@ X86ASM-OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp_init.o
|
||||
X86ASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_init.o \
|
||||
x86/dirac_dwt_init.o
|
||||
OBJS-$(CONFIG_FDCTDSP) += x86/fdctdsp_init.o x86/fdct.o
|
||||
X86ASM-OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert_init.o
|
||||
X86ASM-OBJS-$(CONFIG_H263DSP) += x86/h263dsp_init.o
|
||||
X86ASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o
|
||||
X86ASM-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_init.o
|
||||
@@ -95,7 +94,6 @@ X86ASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o \
|
||||
X86ASM-OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp.o
|
||||
X86ASM-OBJS-$(CONFIG_BLOCKDSP) += x86/blockdsp.o
|
||||
X86ASM-OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp.o
|
||||
X86ASM-OBJS-$(CONFIG_FMTCONVERT) += x86/fmtconvert.o
|
||||
X86ASM-OBJS-$(CONFIG_H263DSP) += x86/h263_loopfilter.o
|
||||
X86ASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \
|
||||
x86/h264_chromamc_10bit.o
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
;******************************************************************************
|
||||
;* x86 optimized Format Conversion Utils
|
||||
;* Copyright (c) 2008 Loren Merritt
|
||||
;*
|
||||
;* This file is part of FFmpeg.
|
||||
;*
|
||||
;* 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
|
||||
;******************************************************************************
|
||||
|
||||
%include "libavutil/x86/x86util.asm"
|
||||
|
||||
SECTION .text
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; void ff_int32_to_float_fmul_scalar(float *dst, const int32_t *src, float mul,
|
||||
; int len);
|
||||
;------------------------------------------------------------------------------
|
||||
%macro INT32_TO_FLOAT_FMUL_SCALAR 1
|
||||
%if UNIX64
|
||||
cglobal int32_to_float_fmul_scalar, 3, 3, %1, dst, src, len
|
||||
%else
|
||||
cglobal int32_to_float_fmul_scalar, 4, 4, %1, dst, src, mul, len
|
||||
%endif
|
||||
%if WIN64
|
||||
SWAP 0, 2
|
||||
%elif ARCH_X86_32
|
||||
movss m0, mulm
|
||||
%endif
|
||||
SPLATD m0
|
||||
shl lend, 2
|
||||
add srcq, lenq
|
||||
add dstq, lenq
|
||||
neg lenq
|
||||
.loop:
|
||||
cvtdq2ps m1, [srcq+lenq ]
|
||||
cvtdq2ps m2, [srcq+lenq+16]
|
||||
mulps m1, m0
|
||||
mulps m2, m0
|
||||
mova [dstq+lenq ], m1
|
||||
mova [dstq+lenq+16], m2
|
||||
add lenq, 32
|
||||
jl .loop
|
||||
RET
|
||||
%endmacro
|
||||
|
||||
INIT_XMM sse2
|
||||
INT32_TO_FLOAT_FMUL_SCALAR 3
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Format Conversion Utils
|
||||
* Copyright (c) 2000, 2001 Fabrice Bellard
|
||||
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* MMX optimization by Nick Kurshev <nickols_k@mail.ru>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/x86/cpu.h"
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
|
||||
void ff_int32_to_float_fmul_scalar_sse2(float *dst, const int32_t *src, float mul, int len);
|
||||
|
||||
av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (EXTERNAL_SSE2(cpu_flags)) {
|
||||
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ AVCODECOBJS-$(CONFIG_AUDIODSP) += audiodsp.o
|
||||
AVCODECOBJS-$(CONFIG_BLOCKDSP) += blockdsp.o
|
||||
AVCODECOBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
|
||||
AVCODECOBJS-$(CONFIG_FDCTDSP) += fdctdsp.o
|
||||
AVCODECOBJS-$(CONFIG_FMTCONVERT) += fmtconvert.o
|
||||
AVCODECOBJS-$(CONFIG_G722DSP) += g722dsp.o
|
||||
AVCODECOBJS-$(CONFIG_H263DSP) += h263dsp.o
|
||||
AVCODECOBJS-$(CONFIG_H264CHROMA) += h264chroma.o
|
||||
|
||||
@@ -103,9 +103,6 @@ static const CheckasmTest tests[] = {
|
||||
#if CONFIG_FLAC_DECODER
|
||||
{ "flacdsp", checkasm_check_flacdsp },
|
||||
#endif
|
||||
#if CONFIG_FMTCONVERT
|
||||
{ "fmtconvert", checkasm_check_fmtconvert },
|
||||
#endif
|
||||
#if CONFIG_G722DSP
|
||||
{ "g722dsp", checkasm_check_g722dsp },
|
||||
#endif
|
||||
|
||||
@@ -54,7 +54,6 @@ void checkasm_check_fdctdsp(void);
|
||||
void checkasm_check_fixed_dsp(void);
|
||||
void checkasm_check_flacdsp(void);
|
||||
void checkasm_check_float_dsp(void);
|
||||
void checkasm_check_fmtconvert(void);
|
||||
void checkasm_check_g722dsp(void);
|
||||
void checkasm_check_h263dsp(void);
|
||||
void checkasm_check_h264chroma(void);
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Janne Grunau
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU 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.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavutil/common.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
|
||||
#include "checkasm.h"
|
||||
|
||||
#define BUF_SIZE 1024
|
||||
|
||||
#define randomize_input(len) \
|
||||
do { \
|
||||
int k; \
|
||||
for (k = 0; k < len; k++) { \
|
||||
in[k] = rnd() - INT32_MAX; \
|
||||
} \
|
||||
for ( ; k < BUF_SIZE; k++) { \
|
||||
in[k] = INT32_MAX; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void checkasm_check_fmtconvert(void)
|
||||
{
|
||||
FmtConvertContext c;
|
||||
LOCAL_ALIGNED(32, float, dst0, [BUF_SIZE]);
|
||||
LOCAL_ALIGNED(32, float, dst1, [BUF_SIZE]);
|
||||
LOCAL_ALIGNED(32, int32_t, in, [BUF_SIZE]);
|
||||
float scale_arr[128];
|
||||
int length[] = {8, 16, 24, 56, 72, 128, 512, 520, 656, 768, 992};
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(scale_arr); i++)
|
||||
scale_arr[i] = (FF_ARRAY_ELEMS(scale_arr) - FF_ARRAY_ELEMS(scale_arr) / 2) / 13;
|
||||
|
||||
ff_fmt_convert_init(&c);
|
||||
|
||||
memset(dst0, 0, sizeof(*dst0) * BUF_SIZE);
|
||||
memset(dst1, 0, sizeof(*dst1) * BUF_SIZE);
|
||||
|
||||
if (check_func(c.int32_to_float_fmul_scalar, "int32_to_float_fmul_scalar")) {
|
||||
declare_func(void, float *, const int32_t *, float, int);
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(scale_arr); i++) {
|
||||
for (j = 0; j < FF_ARRAY_ELEMS(length); j++) {
|
||||
|
||||
randomize_input(length[j]);
|
||||
|
||||
call_ref(dst0, in, scale_arr[i], length[j]);
|
||||
call_new(dst1, in, scale_arr[i], length[j]);
|
||||
|
||||
if (!float_near_ulp_array(dst0, dst1, 3, length[j])) {
|
||||
fail();
|
||||
break;
|
||||
}
|
||||
|
||||
bench_new(dst1, in, scale_arr[i], length[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
report("fmtconvert");
|
||||
}
|
||||
@@ -19,7 +19,6 @@ FATE_CHECKASM = fate-checkasm-aacencdsp \
|
||||
fate-checkasm-fixed_dsp \
|
||||
fate-checkasm-flacdsp \
|
||||
fate-checkasm-float_dsp \
|
||||
fate-checkasm-fmtconvert \
|
||||
fate-checkasm-g722dsp \
|
||||
fate-checkasm-h263dsp \
|
||||
fate-checkasm-h264chroma \
|
||||
|
||||
Reference in new issue
Block a user