[FFmpeg-devel] [PATCH 2/2] libavcodec: provide hardcoded tables for float also.

Konstantin Pavlov thresh
Thu May 13 12:02:32 CEST 2010


From: Konstantin Pavlov <thresh at altlinux.org>

This fixes compilation when using hardcoded tables with CONFIG_FLOAT.
---
 libavcodec/mpegaudio_tablegen.c |    8 ++++++++
 libavcodec/tableprint.c         |    1 +
 libavcodec/tableprint.h         |    1 +
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libavcodec/mpegaudio_tablegen.c b/libavcodec/mpegaudio_tablegen.c
index 70d145b..768bc55 100644
--- a/libavcodec/mpegaudio_tablegen.c
+++ b/libavcodec/mpegaudio_tablegen.c
@@ -47,5 +47,13 @@ int main(void)
     write_uint32_2d_array(expval_table, 512, 16);
     printf("};\n");
 
+    printf("static const float exp_table_float[512] ={\n");
+    write_float_array(exp_table_float, 512);
+    printf("};\n");
+
+    printf("static const float expval_table_float[512][16] ={\n");
+    write_float_2d_array(exp_table_float, 512, 16);
+    printf("};\n");
+
     return 0;
 }
diff --git a/libavcodec/tableprint.c b/libavcodec/tableprint.c
index e39606b..6349cf5 100644
--- a/libavcodec/tableprint.c
+++ b/libavcodec/tableprint.c
@@ -33,6 +33,7 @@ WRITE_1D_FUNC(float,  float,    "%.18e", 3)
 WRITE_2D_FUNC(int8,   int8_t)
 WRITE_2D_FUNC(uint8,  uint8_t)
 WRITE_2D_FUNC(uint32, uint32_t)
+WRITE_2D_FUNC(float,	float)
 
 void write_fileheader(void) {
     printf("/* This file was generated by libavcodec/tableprint */\n");
diff --git a/libavcodec/tableprint.h b/libavcodec/tableprint.h
index d81af97..76ab802 100644
--- a/libavcodec/tableprint.h
+++ b/libavcodec/tableprint.h
@@ -66,6 +66,7 @@ void write_float_array    (const float    *, int);
 void write_int8_2d_array  (const void *, int, int);
 void write_uint8_2d_array (const void *, int, int);
 void write_uint32_2d_array(const void *, int, int);
+void write_float_2d_array (const void *, int, int);
 /** \} */ // end of printfuncs group
 
 /** Write a standard file header */
-- 
1.7.0.4




More information about the ffmpeg-devel mailing list