[FFmpeg-cvslog] r20163 - in trunk/libavcodec: Makefile arm/dsputil_arm.c arm/dsputil_arm.h arm/dsputil_init_armv5te.c arm/dsputil_init_armv6.c arm/dsputil_neon.c arm/float_arm_vfp.c
mru
subversion
Sun Oct 4 15:12:55 CEST 2009
Author: mru
Date: Sun Oct 4 15:12:55 2009
New Revision: 20163
Log:
ARM: clean up dsputil initialisation
- Move v5 and v6 initialisation to separate files.
- Move NEON IDCT selection to ff_dsputil_init_neon()
Added:
trunk/libavcodec/arm/dsputil_arm.h
- copied, changed from r20162, trunk/libavcodec/arm/float_arm_vfp.c
trunk/libavcodec/arm/dsputil_init_armv5te.c
- copied, changed from r20162, trunk/libavcodec/arm/float_arm_vfp.c
trunk/libavcodec/arm/dsputil_init_armv6.c
- copied, changed from r20162, trunk/libavcodec/arm/float_arm_vfp.c
Modified:
trunk/libavcodec/Makefile
trunk/libavcodec/arm/dsputil_arm.c
trunk/libavcodec/arm/dsputil_neon.c
trunk/libavcodec/arm/float_arm_vfp.c
Modified: trunk/libavcodec/Makefile
==============================================================================
--- trunk/libavcodec/Makefile Sun Oct 4 10:42:23 2009 (r20162)
+++ trunk/libavcodec/Makefile Sun Oct 4 15:12:55 2009 (r20163)
@@ -487,11 +487,13 @@ OBJS-$(ARCH_ARM) +
arm/mpegvideo_arm.o \
arm/simple_idct_arm.o \
-OBJS-$(HAVE_ARMV5TE) += arm/mpegvideo_armv5te.o \
+OBJS-$(HAVE_ARMV5TE) += arm/dsputil_init_armv5te.o \
+ arm/mpegvideo_armv5te.o \
arm/mpegvideo_armv5te_s.o \
arm/simple_idct_armv5te.o \
-OBJS-$(HAVE_ARMV6) += arm/simple_idct_armv6.o \
+OBJS-$(HAVE_ARMV6) += arm/dsputil_init_armv6.o \
+ arm/simple_idct_armv6.o \
OBJS-$(HAVE_ARMVFP) += arm/dsputil_vfp.o \
arm/float_arm_vfp.o \
Modified: trunk/libavcodec/arm/dsputil_arm.c
==============================================================================
--- trunk/libavcodec/arm/dsputil_arm.c Sun Oct 4 10:42:23 2009 (r20162)
+++ trunk/libavcodec/arm/dsputil_arm.c Sun Oct 4 15:12:55 2009 (r20163)
@@ -20,30 +20,11 @@
*/
#include "libavcodec/dsputil.h"
-
-void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx);
-void ff_float_init_arm_vfp(DSPContext* c, AVCodecContext *avctx);
-void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx);
+#include "dsputil_arm.h"
void j_rev_dct_ARM(DCTELEM *data);
void simple_idct_ARM(DCTELEM *data);
-void simple_idct_armv5te(DCTELEM *data);
-void simple_idct_put_armv5te(uint8_t *dest, int line_size, DCTELEM *data);
-void simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data);
-
-void ff_simple_idct_armv6(DCTELEM *data);
-void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data);
-void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data);
-
-void ff_simple_idct_neon(DCTELEM *data);
-void ff_simple_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
-void ff_simple_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
-
-void ff_vp3_idct_neon(DCTELEM *data);
-void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
-void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
-
/* XXX: local hack */
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);
@@ -59,8 +40,6 @@ void put_no_rnd_pixels8_xy2_arm(uint8_t
void put_pixels16_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
-void ff_prefetch_arm(void *mem, int stride, int h);
-
CALL_2X_PIXELS(put_pixels16_x2_arm , put_pixels8_x2_arm , 8)
CALL_2X_PIXELS(put_pixels16_y2_arm , put_pixels8_y2_arm , 8)
CALL_2X_PIXELS(put_pixels16_xy2_arm, put_pixels8_xy2_arm, 8)
@@ -101,61 +80,21 @@ int mm_support(void)
void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
{
- int idct_algo= avctx->idct_algo;
-
ff_put_pixels_clamped = c->put_pixels_clamped;
ff_add_pixels_clamped = c->add_pixels_clamped;
if (avctx->lowres == 0) {
- if(idct_algo == FF_IDCT_AUTO){
-#if HAVE_NEON
- idct_algo = FF_IDCT_SIMPLENEON;
-#elif HAVE_ARMV6
- idct_algo = FF_IDCT_SIMPLEARMV6;
-#elif HAVE_ARMV5TE
- idct_algo = FF_IDCT_SIMPLEARMV5TE;
-#else
- idct_algo = FF_IDCT_ARM;
-#endif
- }
-
- if(idct_algo==FF_IDCT_ARM){
+ if(avctx->idct_algo == FF_IDCT_AUTO ||
+ avctx->idct_algo == FF_IDCT_ARM){
c->idct_put= j_rev_dct_ARM_put;
c->idct_add= j_rev_dct_ARM_add;
c->idct = j_rev_dct_ARM;
c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
- } else if (idct_algo==FF_IDCT_SIMPLEARM){
+ } else if (avctx->idct_algo==FF_IDCT_SIMPLEARM){
c->idct_put= simple_idct_ARM_put;
c->idct_add= simple_idct_ARM_add;
c->idct = simple_idct_ARM;
c->idct_permutation_type= FF_NO_IDCT_PERM;
-#if HAVE_ARMV6
- } else if (idct_algo==FF_IDCT_SIMPLEARMV6){
- c->idct_put= ff_simple_idct_put_armv6;
- c->idct_add= ff_simple_idct_add_armv6;
- c->idct = ff_simple_idct_armv6;
- c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
-#endif
-#if HAVE_ARMV5TE
- } else if (idct_algo==FF_IDCT_SIMPLEARMV5TE){
- c->idct_put= simple_idct_put_armv5te;
- c->idct_add= simple_idct_add_armv5te;
- c->idct = simple_idct_armv5te;
- c->idct_permutation_type = FF_NO_IDCT_PERM;
-#endif
-#if HAVE_NEON
- } else if (idct_algo==FF_IDCT_SIMPLENEON){
- c->idct_put= ff_simple_idct_put_neon;
- c->idct_add= ff_simple_idct_add_neon;
- c->idct = ff_simple_idct_neon;
- c->idct_permutation_type = FF_PARTTRANS_IDCT_PERM;
- } else if ((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER || CONFIG_VP6_DECODER) &&
- idct_algo==FF_IDCT_VP3){
- c->idct_put= ff_vp3_idct_put_neon;
- c->idct_add= ff_vp3_idct_add_neon;
- c->idct = ff_vp3_idct_neon;
- c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
-#endif
}
}
@@ -176,9 +115,8 @@ void dsputil_init_arm(DSPContext* c, AVC
c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm;
c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;
-#if HAVE_ARMV5TE
- c->prefetch = ff_prefetch_arm;
-#endif
+ if (HAVE_ARMV5TE) ff_dsputil_init_armv5te(c, avctx);
+ if (HAVE_ARMV6) ff_dsputil_init_armv6(c, avctx);
#if HAVE_IWMMXT
dsputil_init_iwmmxt(c, avctx);
Copied and modified: trunk/libavcodec/arm/dsputil_arm.h (from r20162, trunk/libavcodec/arm/float_arm_vfp.c)
==============================================================================
--- trunk/libavcodec/arm/float_arm_vfp.c Sun Oct 4 10:42:23 2009 (r20162, copy source)
+++ trunk/libavcodec/arm/dsputil_arm.h Sun Oct 4 15:12:55 2009 (r20163)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008 Siarhei Siamashka <ssvb at users.sourceforge.net>
+ * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
*
* This file is part of FFmpeg.
*
@@ -18,18 +18,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavcodec/dsputil.h"
+#ifndef AVCODEC_ARM_DSPUTIL_H
+#define AVCODEC_ARM_DSPUTIL_H
-void ff_vector_fmul_vfp(float *dst, const float *src, int len);
-void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
- const float *src1, int len);
-void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len);
+void ff_dsputil_init_armv5te(DSPContext* c, AVCodecContext *avctx);
+void ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx);
+void ff_float_init_arm_vfp(DSPContext* c, AVCodecContext *avctx);
+void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx);
+void dsputil_init_iwmmxt(DSPContext* c, AVCodecContext *avctx);
-void ff_float_init_arm_vfp(DSPContext* c, AVCodecContext *avctx)
-{
- c->vector_fmul = ff_vector_fmul_vfp;
- c->vector_fmul_reverse = ff_vector_fmul_reverse_vfp;
-#if HAVE_ARMV6
- c->float_to_int16 = ff_float_to_int16_vfp;
#endif
-}
Copied and modified: trunk/libavcodec/arm/dsputil_init_armv5te.c (from r20162, trunk/libavcodec/arm/float_arm_vfp.c)
==============================================================================
--- trunk/libavcodec/arm/float_arm_vfp.c Sun Oct 4 10:42:23 2009 (r20162, copy source)
+++ trunk/libavcodec/arm/dsputil_init_armv5te.c Sun Oct 4 15:12:55 2009 (r20163)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008 Siarhei Siamashka <ssvb at users.sourceforge.net>
+ * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
*
* This file is part of FFmpeg.
*
@@ -19,17 +19,23 @@
*/
#include "libavcodec/dsputil.h"
+#include "dsputil_arm.h"
-void ff_vector_fmul_vfp(float *dst, const float *src, int len);
-void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
- const float *src1, int len);
-void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len);
+void simple_idct_armv5te(DCTELEM *data);
+void simple_idct_put_armv5te(uint8_t *dest, int line_size, DCTELEM *data);
+void simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data);
-void ff_float_init_arm_vfp(DSPContext* c, AVCodecContext *avctx)
+void ff_prefetch_arm(void *mem, int stride, int h);
+
+void av_cold ff_dsputil_init_armv5te(DSPContext* c, AVCodecContext *avctx)
{
- c->vector_fmul = ff_vector_fmul_vfp;
- c->vector_fmul_reverse = ff_vector_fmul_reverse_vfp;
-#if HAVE_ARMV6
- c->float_to_int16 = ff_float_to_int16_vfp;
-#endif
+ if (!avctx->lowres && (avctx->idct_algo == FF_IDCT_AUTO ||
+ avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
+ c->idct_put= simple_idct_put_armv5te;
+ c->idct_add= simple_idct_add_armv5te;
+ c->idct = simple_idct_armv5te;
+ c->idct_permutation_type = FF_NO_IDCT_PERM;
+ }
+
+ c->prefetch = ff_prefetch_arm;
}
Copied and modified: trunk/libavcodec/arm/dsputil_init_armv6.c (from r20162, trunk/libavcodec/arm/float_arm_vfp.c)
==============================================================================
--- trunk/libavcodec/arm/float_arm_vfp.c Sun Oct 4 10:42:23 2009 (r20162, copy source)
+++ trunk/libavcodec/arm/dsputil_init_armv6.c Sun Oct 4 15:12:55 2009 (r20163)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008 Siarhei Siamashka <ssvb at users.sourceforge.net>
+ * Copyright (c) 2009 Mans Rullgard <mans at mansr.com>
*
* This file is part of FFmpeg.
*
@@ -19,17 +19,19 @@
*/
#include "libavcodec/dsputil.h"
+#include "dsputil_arm.h"
-void ff_vector_fmul_vfp(float *dst, const float *src, int len);
-void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
- const float *src1, int len);
-void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len);
+void ff_simple_idct_armv6(DCTELEM *data);
+void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data);
+void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data);
-void ff_float_init_arm_vfp(DSPContext* c, AVCodecContext *avctx)
+void av_cold ff_dsputil_init_armv6(DSPContext* c, AVCodecContext *avctx)
{
- c->vector_fmul = ff_vector_fmul_vfp;
- c->vector_fmul_reverse = ff_vector_fmul_reverse_vfp;
-#if HAVE_ARMV6
- c->float_to_int16 = ff_float_to_int16_vfp;
-#endif
+ if (!avctx->lowres && (avctx->idct_algo == FF_IDCT_AUTO ||
+ avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
+ c->idct_put= ff_simple_idct_put_armv6;
+ c->idct_add= ff_simple_idct_add_armv6;
+ c->idct = ff_simple_idct_armv6;
+ c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
+ }
}
Modified: trunk/libavcodec/arm/dsputil_neon.c
==============================================================================
--- trunk/libavcodec/arm/dsputil_neon.c Sun Oct 4 10:42:23 2009 (r20162)
+++ trunk/libavcodec/arm/dsputil_neon.c Sun Oct 4 15:12:55 2009 (r20163)
@@ -23,6 +23,15 @@
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
+#include "dsputil_arm.h"
+
+void ff_simple_idct_neon(DCTELEM *data);
+void ff_simple_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
+void ff_simple_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
+
+void ff_vp3_idct_neon(DCTELEM *data);
+void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
+void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int);
void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int);
@@ -185,6 +194,23 @@ void ff_vorbis_inverse_coupling_neon(flo
void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
{
+ if (!avctx->lowres) {
+ if (avctx->idct_algo == FF_IDCT_AUTO ||
+ avctx->idct_algo == FF_IDCT_SIMPLENEON) {
+ c->idct_put= ff_simple_idct_put_neon;
+ c->idct_add= ff_simple_idct_add_neon;
+ c->idct = ff_simple_idct_neon;
+ c->idct_permutation_type = FF_PARTTRANS_IDCT_PERM;
+ } else if ((CONFIG_VP3_DECODER || CONFIG_VP5_DECODER ||
+ CONFIG_VP6_DECODER) &&
+ avctx->idct_algo == FF_IDCT_VP3) {
+ c->idct_put= ff_vp3_idct_put_neon;
+ c->idct_add= ff_vp3_idct_add_neon;
+ c->idct = ff_vp3_idct_neon;
+ c->idct_permutation_type = FF_TRANSPOSE_IDCT_PERM;
+ }
+ }
+
c->put_pixels_tab[0][0] = ff_put_pixels16_neon;
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_neon;
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_neon;
Modified: trunk/libavcodec/arm/float_arm_vfp.c
==============================================================================
--- trunk/libavcodec/arm/float_arm_vfp.c Sun Oct 4 10:42:23 2009 (r20162)
+++ trunk/libavcodec/arm/float_arm_vfp.c Sun Oct 4 15:12:55 2009 (r20163)
@@ -19,6 +19,7 @@
*/
#include "libavcodec/dsputil.h"
+#include "dsputil_arm.h"
void ff_vector_fmul_vfp(float *dst, const float *src, int len);
void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
More information about the ffmpeg-cvslog
mailing list