Commit 3fc2362a authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'b4dd424d'

* commit 'b4dd424d':
  Remove all SPARC architecture optimizations

Conflicts:
	Makefile
	configure
	libavcodec/sparc/dsputil_vis.c
	libavcodec/sparc/dsputil_vis.h
	libavcodec/sparc/hpeldsp_vis.c
	libavcodec/sparc/simple_idct_vis.c
	libavcodec/sparc/vis.h
	libswscale/sparc/yuv2rgb_vis.c
	libswscale/swscale_internal.h

If someone wants to maintain these (or other) SPARC optimizations, please
contact me or ffmpeg-devel.
I am happy to revert this removial if theres someone considering to
maintain this code.
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents fb1b70c1 b4dd424d
......@@ -73,8 +73,7 @@ config.h: .config
SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
ARMV5TE-OBJS ARMV6-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS VIS-OBJS \
MMX-OBJS YASM-OBJS \
ALTIVEC-OBJS MMX-OBJS YASM-OBJS \
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \
OBJS SLIBOBJS HOSTOBJS TESTOBJS
......
......@@ -10,7 +10,5 @@ OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS) $(MIPSDSPR2-OBJS-yes)
OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
OBJS-$(HAVE_VIS) += $(VIS-OBJS) $(VIS-OBJS-yes)
OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
OBJS-$(HAVE_YASM) += $(YASM-OBJS) $(YASM-OBJS-yes)
......@@ -337,7 +337,6 @@ Optimization options (experts only):
--disable-armv6t2 disable armv6t2 optimizations
--disable-vfp disable VFP optimizations
--disable-neon disable NEON optimizations
--disable-vis disable VIS optimizations
--disable-inline-asm disable use of inline assembler
--disable-yasm disable use of yasm assembler
--disable-mips32r2 disable MIPS32R2 optimizations
......@@ -1498,7 +1497,6 @@ ARCH_EXT_LIST="
$ARCH_EXT_LIST_X86
altivec
ppc4xx
vis
mipsfpu
mips32r2
mipsdspr1
......@@ -1837,8 +1835,6 @@ mipsdspr2_deps="mips"
altivec_deps="ppc"
ppc4xx_deps="ppc"
vis_deps="sparc"
cpunop_deps="i686"
x86_64_select="i686"
x86_64_suggest="fast_cmov"
......@@ -3599,7 +3595,6 @@ elif enabled sparc; then
case $cpu in
cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
cpuflags="-mcpu=$cpu"
disable vis
;;
ultrasparc*|niagara[234])
cpuflags="-mcpu=$cpu"
......@@ -4239,10 +4234,6 @@ EOF
enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
fi
elif enabled sparc; then
enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"'
elif enabled x86; then
check_builtin rdtsc intrin.h "__rdtsc()"
......@@ -5013,9 +5004,6 @@ if enabled ppc; then
echo "PPC 4xx optimizations ${ppc4xx-no}"
echo "dcbzl available ${dcbzl-no}"
fi
if enabled sparc; then
echo "VIS enabled ${vis-no}"
fi
echo "debug symbols ${debug-no}"
echo "strip symbols ${stripping-no}"
echo "optimize for size ${small-no}"
......
......@@ -268,17 +268,6 @@ CELL/SPU:
http://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/30B3520C93F437AB87257060006FFE5E/$file/Language_Extensions_for_CBEA_2.4.pdf
http://www-01.ibm.com/chips/techlib/techlib.nsf/techdocs/9F820A5FFA3ECE8C8725716A0062585F/$file/CBE_Handbook_v1.1_24APR2007_pub.pdf
SPARC-specific:
---------------
SPARC Joint Programming Specification (JPS1): Commonality
http://www.fujitsu.com/downloads/PRMPWR/JPS1-R1.0.4-Common-pub.pdf
UltraSPARC III Processor User's Manual (contains instruction timings)
http://www.sun.com/processors/manuals/USIIIv2.pdf
VIS Whitepaper (contains optimization guidelines)
http://www.sun.com/processors/vis/download/vis/vis_whitepaper.pdf
GCC asm links:
--------------
official doc but quite ugly
......
......@@ -2629,7 +2629,9 @@ typedef struct AVCodecContext {
#define FF_IDCT_XVIDMMX 14
#define FF_IDCT_SIMPLEARMV5TE 16
#define FF_IDCT_SIMPLEARMV6 17
#if FF_API_ARCH_SPARC
#define FF_IDCT_SIMPLEVIS 18
#endif
#define FF_IDCT_FAAN 20
#define FF_IDCT_SIMPLENEON 22
#if FF_API_ARCH_ALPHA
......
......@@ -2830,8 +2830,6 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx)
ff_dsputil_init_bfin(c, avctx);
if (ARCH_PPC)
ff_dsputil_init_ppc(c, avctx);
if (HAVE_VIS)
ff_dsputil_init_vis(c, avctx);
if (ARCH_X86)
ff_dsputil_init_x86(c, avctx);
......
......@@ -306,7 +306,6 @@ void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_x86(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_dwt(DSPContext *c);
......
......@@ -64,8 +64,6 @@ av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
ff_hpeldsp_init_bfin(c, flags);
if (ARCH_PPC)
ff_hpeldsp_init_ppc(c, flags);
if (HAVE_VIS)
ff_hpeldsp_init_vis(c, flags);
if (ARCH_X86)
ff_hpeldsp_init_x86(c, flags);
}
......@@ -99,7 +99,6 @@ void ff_hpeldsp_init_alpha(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_bfin(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_vis(HpelDSPContext *c, int flags);
void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags);
#endif /* AVCODEC_HPELDSP_H */
VIS-OBJS += sparc/dsputil_vis.o \
sparc/simple_idct_vis.o \
VIS-OBJS-$(CONFIG_HPELDSP) += sparc/hpeldsp_vis.o
/*
* Copyright (C) 2003 David S. Miller <davem@redhat.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 "libavutil/attributes.h"
#include "libavcodec/dsputil.h"
#include "dsputil_vis.h"
#include "vis.h"
av_cold void ff_dsputil_init_vis(DSPContext *c, AVCodecContext *avctx)
{
/* VIS-specific optimizations */
int accel = vis_level ();
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
if (accel & ACCEL_SPARC_VIS && !high_bit_depth) {
if (avctx->idct_algo == FF_IDCT_SIMPLEVIS) {
c->idct_put = ff_simple_idct_put_vis;
c->idct_add = ff_simple_idct_add_vis;
c->idct = ff_simple_idct_vis;
c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
}
}
}
/*
* 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_SPARC_DSPUTIL_VIS_H
#define AVCODEC_SPARC_DSPUTIL_VIS_H
#include <stdint.h>
void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data);
void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data);
void ff_simple_idct_vis(int16_t *data);
#endif /* AVCODEC_SPARC_DSPUTIL_VIS_H */
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
......@@ -144,5 +144,8 @@
#ifndef FF_API_ARCH_SH4
#define FF_API_ARCH_SH4 (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#ifndef FF_API_ARCH_SPARC
#define FF_API_ARCH_SPARC (LIBAVCODEC_VERSION_MAJOR < 56)
#endif
#endif /* AVCODEC_VERSION_H */
VIS-OBJS += sparc/yuv2rgb_vis.o \
/*
* VIS optimized software YUV to RGB converter
* Copyright (c) 2007 Denes Balatoni <dbalatoni@programozo.hu>
*
* 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 <inttypes.h>
#include <stdlib.h>
#include "libavutil/attributes.h"
#include "libswscale/swscale.h"
#include "libswscale/swscale_internal.h"
#define YUV2RGB_INIT \
"wr %%g0, 0x10, %%gsr \n\t" \
"ldd [%5], %%f32 \n\t" \
"ldd [%5 + 8], %%f34 \n\t" \
"ldd [%5 + 16], %%f36 \n\t" \
"ldd [%5 + 24], %%f38 \n\t" \
"ldd [%5 + 32], %%f40 \n\t" \
"ldd [%5 + 40], %%f42 \n\t" \
"ldd [%5 + 48], %%f44 \n\t" \
"ldd [%5 + 56], %%f46 \n\t" \
"ldd [%5 + 64], %%f48 \n\t" \
"ldd [%5 + 72], %%f50 \n\t"
#define YUV2RGB_KERNEL \
/* ^^^^ f0=Y f3=u f5=v */ \
"fmul8x16 %%f3, %%f48, %%f6 \n\t" \
"fmul8x16 %%f19, %%f48, %%f22 \n\t" \
"fmul8x16 %%f5, %%f44, %%f8 \n\t" \
"fmul8x16 %%f21, %%f44, %%f24 \n\t" \
"fmul8x16 %%f0, %%f42, %%f0 \n\t" \
"fmul8x16 %%f16, %%f42, %%f16 \n\t" \
"fmul8x16 %%f3, %%f50, %%f2 \n\t" \
"fmul8x16 %%f19, %%f50, %%f18 \n\t" \
"fmul8x16 %%f5, %%f46, %%f4 \n\t" \
"fmul8x16 %%f21, %%f46, %%f20 \n\t" \
\
"fpsub16 %%f6, %%f34, %%f6 \n\t" /* 1 */ \
"fpsub16 %%f22, %%f34, %%f22 \n\t" /* 1 */ \
"fpsub16 %%f8, %%f38, %%f8 \n\t" /* 3 */ \
"fpsub16 %%f24, %%f38, %%f24 \n\t" /* 3 */ \
"fpsub16 %%f0, %%f32, %%f0 \n\t" /* 0 */ \
"fpsub16 %%f16, %%f32, %%f16 \n\t" /* 0 */ \
"fpsub16 %%f2, %%f36, %%f2 \n\t" /* 2 */ \
"fpsub16 %%f18, %%f36, %%f18 \n\t" /* 2 */ \
"fpsub16 %%f4, %%f40, %%f4 \n\t" /* 4 */ \
"fpsub16 %%f20, %%f40, %%f20 \n\t" /* 4 */ \
\
"fpadd16 %%f0, %%f8, %%f8 \n\t" /* Gt */ \
"fpadd16 %%f16, %%f24, %%f24 \n\t" /* Gt */ \
"fpadd16 %%f0, %%f4, %%f4 \n\t" /* R */ \
"fpadd16 %%f16, %%f20, %%f20 \n\t" /* R */ \
"fpadd16 %%f0, %%f6, %%f6 \n\t" /* B */ \
"fpadd16 %%f16, %%f22, %%f22 \n\t" /* B */ \
"fpadd16 %%f8, %%f2, %%f2 \n\t" /* G */ \
"fpadd16 %%f24, %%f18, %%f18 \n\t" /* G */ \
\
"fpack16 %%f4, %%f4 \n\t" \
"fpack16 %%f20, %%f20 \n\t" \
"fpack16 %%f6, %%f6 \n\t" \
"fpack16 %%f22, %%f22 \n\t" \
"fpack16 %%f2, %%f2 \n\t" \
"fpack16 %%f18, %%f18 \n\t"
// FIXME: must be changed to set alpha to 255 instead of 0
static int vis_420P_ARGB32(SwsContext *c, uint8_t *src[], int srcStride[],
int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[])
{
int y, out1, out2, out3, out4, out5, out6;
for (y = 0; y < srcSliceH; ++y)
__asm__ volatile (
YUV2RGB_INIT
"wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
"1: \n\t"
"ldda [%1] %%asi, %%f2 \n\t"
"ldda [%1 + 2] %%asi, %%f18 \n\t"
"ldda [%2] %%asi, %%f4 \n\t"
"ldda [%2 + 2] %%asi, %%f20 \n\t"
"ld [%0], %%f0 \n\t"
"ld [%0+4], %%f16 \n\t"
"fpmerge %%f3, %%f3, %%f2 \n\t"
"fpmerge %%f19, %%f19, %%f18 \n\t"
"fpmerge %%f5, %%f5, %%f4 \n\t"
"fpmerge %%f21, %%f21, %%f20 \n\t"
YUV2RGB_KERNEL
"fzero %%f0 \n\t"
"fpmerge %%f4, %%f6, %%f8 \n\t" // r, b, t1
"fpmerge %%f20, %%f22, %%f24 \n\t" // r, b, t1
"fpmerge %%f0, %%f2, %%f10 \n\t" // 0, g, t2
"fpmerge %%f0, %%f18, %%f26 \n\t" // 0, g, t2
"fpmerge %%f10, %%f8, %%f4 \n\t" // t2, t1, msb
"fpmerge %%f26, %%f24, %%f20 \n\t" // t2, t1, msb
"fpmerge %%f11, %%f9, %%f6 \n\t" // t2, t1, lsb
"fpmerge %%f27, %%f25, %%f22 \n\t" // t2, t1, lsb
"std %%f4, [%3] \n\t"
"std %%f20, [%3 + 16] \n\t"
"std %%f6, [%3 + 8] \n\t"
"std %%f22, [%3 + 24] \n\t"
"add %0, 8, %0 \n\t"
"add %1, 4, %1 \n\t"
"add %2, 4, %2 \n\t"
"subcc %4, 8, %4 \n\t"
"bne 1b \n\t"
"add %3, 32, %3 \n\t" // delay slot
: "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6)
: "0" (src[0] + (y + srcSliceY) * srcStride[0]), "1" (src[1] + ((y + srcSliceY) >> 1) * srcStride[1]),
"2" (src[2] + ((y + srcSliceY) >> 1) * srcStride[2]), "3" (dst[0] + (y + srcSliceY) * dstStride[0]),
"4" (c->dstW),
"5" (c->sparc_coeffs)
);
return srcSliceH;
}
// FIXME: must be changed to set alpha to 255 instead of 0
static int vis_422P_ARGB32(SwsContext *c, uint8_t *src[], int srcStride[],
int srcSliceY, int srcSliceH,
uint8_t *dst[], int dstStride[])
{
int y, out1, out2, out3, out4, out5, out6;
for (y = 0; y < srcSliceH; ++y)
__asm__ volatile (
YUV2RGB_INIT
"wr %%g0, 0xd2, %%asi \n\t" /* ASI_FL16_P */
"1: \n\t"
"ldda [%1] %%asi, %%f2 \n\t"
"ldda [%1 + 2] %%asi, %%f18 \n\t"
"ldda [%2] %%asi, %%f4 \n\t"
"ldda [%2 + 2] %%asi, %%f20 \n\t"
"ld [%0], %%f0 \n\t"
"ld [%0 + 4], %%f16 \n\t"
"fpmerge %%f3, %%f3, %%f2 \n\t"
"fpmerge %%f19, %%f19, %%f18 \n\t"
"fpmerge %%f5, %%f5, %%f4 \n\t"
"fpmerge %%f21, %%f21, %%f20 \n\t"
YUV2RGB_KERNEL
"fzero %%f0 \n\t"
"fpmerge %%f4, %%f6, %%f8 \n\t" // r,b,t1
"fpmerge %%f20, %%f22, %%f24 \n\t" // r,b,t1
"fpmerge %%f0, %%f2, %%f10 \n\t" // 0,g,t2
"fpmerge %%f0, %%f18, %%f26 \n\t" // 0,g,t2
"fpmerge %%f10, %%f8, %%f4 \n\t" // t2,t1,msb
"fpmerge %%f26, %%f24, %%f20 \n\t" // t2,t1,msb
"fpmerge %%f11, %%f9, %%f6 \n\t" // t2,t1,lsb
"fpmerge %%f27, %%f25, %%f22 \n\t" // t2,t1,lsb
"std %%f4, [%3] \n\t"
"std %%f20, [%3 + 16] \n\t"
"std %%f6, [%3 + 8] \n\t"
"std %%f22, [%3 + 24] \n\t"
"add %0, 8, %0 \n\t"
"add %1, 4, %1 \n\t"
"add %2, 4, %2 \n\t"
"subcc %4, 8, %4 \n\t"
"bne 1b \n\t"
"add %3, 32, %3 \n\t" //delay slot
: "=r" (out1), "=r" (out2), "=r" (out3), "=r" (out4), "=r" (out5), "=r" (out6)
: "0" (src[0] + (y + srcSliceY) * srcStride[0]), "1" (src[1] + (y + srcSliceY) * srcStride[1]),
"2" (src[2] + (y + srcSliceY) * srcStride[2]), "3" (dst[0] + (y + srcSliceY) * dstStride[0]),
"4" (c->dstW),
"5" (c->sparc_coeffs)
);
return srcSliceH;
}
av_cold SwsFunc ff_yuv2rgb_init_vis(SwsContext *c)
{
c->sparc_coeffs[5] = c->yCoeff;
c->sparc_coeffs[6] = c->vgCoeff;
c->sparc_coeffs[7] = c->vrCoeff;
c->sparc_coeffs[8] = c->ubCoeff;
c->sparc_coeffs[9] = c->ugCoeff;
c->sparc_coeffs[0] = (((int16_t)c->yOffset * (int16_t)c->yCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
c->sparc_coeffs[1] = (((int16_t)c->uOffset * (int16_t)c->ubCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
c->sparc_coeffs[2] = (((int16_t)c->uOffset * (int16_t)c->ugCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
c->sparc_coeffs[3] = (((int16_t)c->vOffset * (int16_t)c->vgCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
c->sparc_coeffs[4] = (((int16_t)c->vOffset * (int16_t)c->vrCoeff >> 11) & 0xffff) * 0x0001000100010001ULL;
if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV422P && (c->dstW & 7) == 0) {
av_log(c, AV_LOG_INFO,
"SPARC VIS accelerated YUV422P -> RGB32 (WARNING: alpha value is wrong)\n");
return vis_422P_ARGB32;
} else if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV420P && (c->dstW & 7) == 0) {
av_log(c, AV_LOG_INFO,
"SPARC VIS accelerated YUV420P -> RGB32 (WARNING: alpha value is wrong)\n");
return vis_420P_ARGB32;
}
return NULL;
}
......@@ -484,9 +484,6 @@ typedef struct SwsContext {
DECLARE_ALIGNED(4, uint32_t, gmask);
#endif
#if HAVE_VIS
DECLARE_ALIGNED(8, uint64_t, sparc_coeffs)[10];
#endif
int use_mmx_vfilter;
/* pre defined color-spaces gamma */
......@@ -619,7 +616,6 @@ void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufI
int lastInLumBuf, int lastInChrBuf);
SwsFunc ff_yuv2rgb_init_x86(SwsContext *c);
SwsFunc ff_yuv2rgb_init_vis(SwsContext *c);
SwsFunc ff_yuv2rgb_init_ppc(SwsContext *c);
SwsFunc ff_yuv2rgb_init_bfin(SwsContext *c);
......
......@@ -605,8 +605,6 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
t = ff_yuv2rgb_init_bfin(c);
if (ARCH_PPC)
t = ff_yuv2rgb_init_ppc(c);
if (HAVE_VIS)
t = ff_yuv2rgb_init_vis(c);
if (ARCH_X86)
t = ff_yuv2rgb_init_x86(c);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment