[xiph-commits] r11430 - in trunk/theora: . lib lib/x86_32 lib/x86_64
giles at svn.xiph.org
giles at svn.xiph.org
Fri May 26 13:02:42 PDT 2006
Author: giles
Date: 2006-05-26 13:02:40 -0700 (Fri, 26 May 2006)
New Revision: 11430
Modified:
trunk/theora/configure.ac
trunk/theora/lib/codec_internal.h
trunk/theora/lib/cpu.c
trunk/theora/lib/dsp.c
trunk/theora/lib/x86_32/dsp_mmx.c
trunk/theora/lib/x86_32/dsp_mmxext.c
trunk/theora/lib/x86_32/fdct_mmx.c
trunk/theora/lib/x86_32/recon_mmx.c
trunk/theora/lib/x86_64/dsp_mmx.c
trunk/theora/lib/x86_64/dsp_mmxext.c
trunk/theora/lib/x86_64/fdct_mmx.c
trunk/theora/lib/x86_64/recon_mmx.c
Log:
Use a TH_DEBUG() macro instead of fprintf() for asm enable messages, and
make this a nop outside the debug and profile builds, since a library
shouldn't spew.
We need a more general solution than this, with level filtering and
varargs.
Modified: trunk/theora/configure.ac
===================================================================
--- trunk/theora/configure.ac 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/configure.ac 2006-05-26 20:02:40 UTC (rev 11430)
@@ -87,17 +87,17 @@
if test -z "$GCC"; then
case $host in
*)
- DEBUG="-g"
+ DEBUG="-g -DDEBUG"
CFLAGS="-O"
- PROFILE="-g -p" ;;
+ PROFILE="-g -p -DDEBUG" ;;
esac
else
case $host in
*)
- DEBUG="-g -Wall -D__NO_MATH_INLINES"
+ DEBUG="-g -Wall -DDEBUG -D__NO_MATH_INLINES"
CFLAGS="-Wall -O3 -fforce-addr -fomit-frame-pointer -finline-functions -funroll-loops"
- PROFILE="-Wall -pg -g -O3 -fno-inline-functions";;
+ PROFILE="-Wall -pg -g -O3 -fno-inline-functions -DDEBGU";;
esac
fi
CFLAGS="$CFLAGS $cflags_save"
Modified: trunk/theora/lib/codec_internal.h
===================================================================
--- trunk/theora/lib/codec_internal.h 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/codec_internal.h 2006-05-26 20:02:40 UTC (rev 11430)
@@ -32,6 +32,13 @@
#define theora_read(x,y,z) ( oggpackB_read(x,y,z) )
#endif
+#ifdef DEBUG
+#include <stdio.h>
+#define TH_DEBUG(x) fprintf(stderr, x)
+#else
+#define TH_DEBUG(x)
+#endif
+
#define CURRENT_ENCODE_VERSION 1
#define HUGE_ERROR (1<<28) /* Out of range test value */
Modified: trunk/theora/lib/cpu.c
===================================================================
--- trunk/theora/lib/cpu.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/cpu.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -15,7 +15,6 @@
********************************************************************/
-#include <stdio.h>
#include "cpu.h"
void
@@ -114,18 +113,16 @@
{
ogg_uint32_t cpu_flags = cpu_get_flags();
- /*
if (cpu_flags) {
- fprintf(stderr, "vectorized instruction sets supported:");
- if (cpu_flags & CPU_X86_MMX) fprintf(stderr, " mmx");
- if (cpu_flags & CPU_X86_MMXEXT) fprintf(stderr, " mmxext");
- if (cpu_flags & CPU_X86_SSE) fprintf(stderr, " sse");
- if (cpu_flags & CPU_X86_SSE2) fprintf(stderr, " sse2");
- if (cpu_flags & CPU_X86_3DNOW) fprintf(stderr, " 3dnow");
- if (cpu_flags & CPU_X86_3DNOWEXT) fprintf(stderr, " 3dnowext");
- fprintf(stderr, "\n");
+ TH_DEBUG("vectorized instruction sets supported:");
+ if (cpu_flags & CPU_X86_MMX) TH_DEBUG(" mmx");
+ if (cpu_flags & CPU_X86_MMXEXT) TH_DEBUG(" mmxext");
+ if (cpu_flags & CPU_X86_SSE) TH_DEBUG(" sse");
+ if (cpu_flags & CPU_X86_SSE2) TH_DEBUG(" sse2");
+ if (cpu_flags & CPU_X86_3DNOW) TH_DEBUG(" 3dnow");
+ if (cpu_flags & CPU_X86_3DNOWEXT) TH_DEBUG(" 3dnowext");
+ TH_DEBUG("\n");
}
- */
return cpu_flags;
}
Modified: trunk/theora/lib/dsp.c
===================================================================
--- trunk/theora/lib/dsp.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/dsp.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -15,7 +15,6 @@
********************************************************************/
-#include <stdio.h>
#include <stdlib.h>
#include "cpu.h"
#include "dsp.h"
@@ -385,7 +384,7 @@
void dsp_init(DspFunctions *funcs)
{
- /*fprintf(stderr, "setting dsp functions to C defaults.\n"); */
+ /* TH_DEBUG("setting dsp functions to C defaults.\n"); */
funcs->save_fpu = nop;
funcs->restore_fpu = nop;
funcs->sub8x8 = sub8x8__c;
Modified: trunk/theora/lib/x86_32/dsp_mmx.c
===================================================================
--- trunk/theora/lib/x86_32/dsp_mmx.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/x86_32/dsp_mmx.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -15,8 +15,9 @@
********************************************************************/
-#include <stdio.h>
#include <stdlib.h>
+
+#include "codec_internal.h"
#include "dsp.h"
static const __attribute__ ((aligned(8),used)) ogg_int64_t V128 = 0x0080008000800080LL;
@@ -627,7 +628,7 @@
void dsp_mmx_init(DspFunctions *funcs)
{
- fprintf(stderr, "enabling accelerated x86_32 mmx dsp functions.\n");
+ TH_DEBUG("enabling accelerated x86_32 mmx dsp functions.\n");
funcs->restore_fpu = restore_fpu;
funcs->sub8x8 = sub8x8__mmx;
funcs->sub8x8_128 = sub8x8_128__mmx;
Modified: trunk/theora/lib/x86_32/dsp_mmxext.c
===================================================================
--- trunk/theora/lib/x86_32/dsp_mmxext.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/x86_32/dsp_mmxext.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -15,8 +15,9 @@
********************************************************************/
-#include <stdio.h>
#include <stdlib.h>
+
+#include "codec_internal.h"
#include "dsp.h"
static ogg_uint32_t sad8x8__mmxext (unsigned char *ptr1, ogg_uint32_t stride1,
@@ -307,7 +308,7 @@
void dsp_mmxext_init(DspFunctions *funcs)
{
- fprintf(stderr, "enabling accelerated x86_32 mmxext dsp functions.\n");
+ TH_DEBUG("enabling accelerated x86_32 mmxext dsp functions.\n");
funcs->row_sad8 = row_sad8__mmxext;
funcs->col_sad8x8 = col_sad8x8__mmxext;
funcs->sad8x8 = sad8x8__mmxext;
Modified: trunk/theora/lib/x86_32/fdct_mmx.c
===================================================================
--- trunk/theora/lib/x86_32/fdct_mmx.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/x86_32/fdct_mmx.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -9,8 +9,8 @@
;//
;//--------------------------------------------------------------------------
-#include <stdio.h>
-#include <theora/theora.h>
+#include "theora/theora.h"
+#include "codec_internal.h"
#include "dsp.h"
static const __attribute__ ((aligned(8),used)) ogg_int64_t xC1S7 = 0x0fb15fb15fb15fb15LL;
@@ -337,6 +337,6 @@
void dsp_mmx_fdct_init(DspFunctions *funcs)
{
- fprintf(stderr, "enabling accelerated x86_32 mmx fdct function.\n");
+ TH_DEBUG("enabling accelerated x86_32 mmx fdct function.\n");
funcs->fdct_short = fdct_short__mmx;
}
Modified: trunk/theora/lib/x86_32/recon_mmx.c
===================================================================
--- trunk/theora/lib/x86_32/recon_mmx.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/x86_32/recon_mmx.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -15,7 +15,6 @@
********************************************************************/
-#include <stdio.h>
#include "codec_internal.h"
static const __attribute__ ((aligned(8),used)) ogg_int64_t V128 = 0x8080808080808080LL;
@@ -178,7 +177,7 @@
void dsp_mmx_recon_init(DspFunctions *funcs)
{
- fprintf(stderr, "enabling accelerated x86_32 mmx recon functions.\n");
+ TH_DEBUG("enabling accelerated x86_32 mmx recon functions.\n");
funcs->copy8x8 = copy8x8__mmx;
funcs->recon_intra8x8 = recon_intra8x8__mmx;
funcs->recon_inter8x8 = recon_inter8x8__mmx;
Modified: trunk/theora/lib/x86_64/dsp_mmx.c
===================================================================
--- trunk/theora/lib/x86_64/dsp_mmx.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/x86_64/dsp_mmx.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -15,8 +15,9 @@
********************************************************************/
-#include <stdio.h>
#include <stdlib.h>
+
+#include "codec_internal.h"
#include "dsp.h"
static const __attribute__ ((aligned(8),used)) ogg_int64_t V128 = 0x0080008000800080LL;
@@ -287,7 +288,7 @@
void dsp_mmx_init(DspFunctions *funcs)
{
- fprintf(stderr, "setting accelerated x86_64 mmx dsp functions.\n");
+ TH_DEBUG("setting accelerated x86_64 mmx dsp functions.\n");
funcs->restore_fpu = restore_fpu;
funcs->sub8x8 = sub8x8__mmx;
funcs->sub8x8_128 = sub8x8_128__mmx;
Modified: trunk/theora/lib/x86_64/dsp_mmxext.c
===================================================================
--- trunk/theora/lib/x86_64/dsp_mmxext.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/x86_64/dsp_mmxext.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -15,8 +15,9 @@
********************************************************************/
-#include <stdio.h>
#include <stdlib.h>
+
+#include "codec_internal.h"
#include "dsp.h"
static ogg_uint32_t sad8x8__mmxext (unsigned char *ptr1, ogg_uint32_t stride1,
@@ -307,7 +308,7 @@
void dsp_mmxext_init(DspFunctions *funcs)
{
- fprintf(stderr, "enabling accerated x86_64 mmxext dsp functions.\n");
+ TH_DEBUG("enabling accerated x86_64 mmxext dsp functions.\n");
funcs->row_sad8 = row_sad8__mmxext;
funcs->col_sad8x8 = col_sad8x8__mmxext;
funcs->sad8x8 = sad8x8__mmxext;
Modified: trunk/theora/lib/x86_64/fdct_mmx.c
===================================================================
--- trunk/theora/lib/x86_64/fdct_mmx.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/x86_64/fdct_mmx.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -9,8 +9,8 @@
;//
;//--------------------------------------------------------------------------
-#include <stdio.h>
-#include <theora/theora.h>
+#include "theora/theora.h"
+#include "codec_internal.h"
#include "dsp.h"
static const __attribute__ ((aligned(8),used)) ogg_int64_t xC1S7 = 0x0fb15fb15fb15fb15LL;
@@ -344,6 +344,6 @@
void dsp_mmx_fdct_init(DspFunctions *funcs)
{
- fprintf(stderr, "enabling accelerated x86_64 mmx fdct function.\n");
+ TH_DEBUG("enabling accelerated x86_64 mmx fdct function.\n");
funcs->fdct_short = fdct_short__mmx;
}
Modified: trunk/theora/lib/x86_64/recon_mmx.c
===================================================================
--- trunk/theora/lib/x86_64/recon_mmx.c 2006-05-26 18:57:50 UTC (rev 11429)
+++ trunk/theora/lib/x86_64/recon_mmx.c 2006-05-26 20:02:40 UTC (rev 11430)
@@ -15,7 +15,6 @@
********************************************************************/
-#include <stdio.h>
#include "codec_internal.h"
static const __attribute__ ((aligned(8),used)) ogg_int64_t V128 = 0x8080808080808080LL;
@@ -172,7 +171,7 @@
void dsp_mmx_recon_init(DspFunctions *funcs)
{
- fprintf(stderr, "enabling accelerated x86_64 mmx recon functions.\n");
+ TH_DEBUG("enabling accelerated x86_64 mmx recon functions.\n");
funcs->copy8x8 = copy8x8__mmx;
funcs->recon_intra8x8 = recon_intra8x8__mmx;
funcs->recon_inter8x8 = recon_inter8x8__mmx;
More information about the commits
mailing list