]> git.sesse.net Git - vlc/commitdiff
* modules/codec/Modules.am, configure.ac.in, modules/codec/vorbis.c: added
authorGildas Bazin <gbazin@videolan.org>
Thu, 21 Nov 2002 21:37:46 +0000 (21:37 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 21 Nov 2002 21:37:46 +0000 (21:37 +0000)
   a tremor decoder module using libvorbisidec (aka tremor) from xiph.org.
   This module allows decoding vorbis audio on hardware without a fpu
   (--enable-tremor).

* modules/LIST: added entries for tremor and theora.

configure.ac.in
modules/LIST
modules/codec/Modules.am
modules/codec/vorbis.c

index b51bb3607f3fddf76a66d06c54213c93a4c36f56..2c4dccdeaba5b4514ce9fb8ee96965b2ae3fc664 100644 (file)
@@ -1505,6 +1505,19 @@ then
    ],[])
 fi
 
+dnl
+dnl  Tremor plugin
+dnl
+AC_ARG_ENABLE(tremor,
+  [  --enable-tremor         Tremor decoder support (default disabled)])
+if test "x${enable_tremor}" = "xyes"
+then
+  AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
+    PLUGINS="${PLUGINS} tremor"
+    LDFLAGS_tremor="${LDFLAGS_tremor} -lvorbisidec -logg"
+   ],[])
+fi
+
 dnl
 dnl  tarkin decoder plugin
 dnl
index 03252459cea5d8d709ebd45ee60908626a32d7c4..a9fe90d1fbd91410f6316db13b84e18c72c82671 100644 (file)
@@ -1,5 +1,5 @@
 List of vlc plugins
-$Id: LIST,v 1.4 2002/11/18 13:02:16 gbazin Exp $
+$Id: LIST,v 1.5 2002/11/21 21:37:46 gbazin Exp $
 
  * a52_system: input module for A52 decapsulation.
 
@@ -137,6 +137,10 @@ $Id: LIST,v 1.4 2002/11/18 13:02:16 gbazin Exp $
 
  * spudec: DVD subtitles decoder.
 
+ * theora: a theora video decoder using the libtheora library.
+
+ * tremor: a vorbis audio decoder using the libvorbisidec (aka tremor) library.
+
  * vcd: input module for accessing Video CDs.
 
  * vorbis: a vorbis audio decoder using the libvorbis library.
index e07e946e4e05f7e28e4c4046c64cb556c747341f..602bb1b6bd16b9b0314f2aa265a3473bb3a1b108 100644 (file)
@@ -4,5 +4,6 @@ SOURCES_araw = modules/codec/araw.c
 SOURCES_vorbis = modules/codec/vorbis.c
 SOURCES_tarkin = modules/codec/tarkin.c
 SOURCES_theora = modules/codec/theora.c
+SOURCES_tremor = modules/codec/vorbis.c
 SOURCES_dv = modules/codec/dv.c
 SOURCES_xvid = modules/codec/xvid.c
index e2a6d29208aecea862bffe22ac4576b69588bd72..8759a1b3cb2d849f44bed9ce73fb661a5cae1159 100644 (file)
@@ -2,7 +2,7 @@
  * vorbis.c: vorbis decoder module making use of libvorbis.
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vorbis.c,v 1.6 2002/11/15 00:41:00 gbazin Exp $
+ * $Id: vorbis.c,v 1.7 2002/11/21 21:37:46 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
 #include <vlc/input.h>
 
 #include <ogg/ogg.h>
+#ifdef MODULE_NAME_IS_tremor
+#include <tremor/ivorbiscodec.h>
+#else
 #include <vorbis/codec.h>
+#endif
 
 /*****************************************************************************
  * dec_thread_t : vorbis decoder thread descriptor
@@ -95,7 +99,11 @@ static void CloseDecoder ( dec_thread_t * );
 static void DecodePacket ( dec_thread_t * );
 static int  GetOggPacket ( dec_thread_t *, ogg_packet *, mtime_t * );
 
+#ifdef MODULE_NAME_IS_tremor
+static void Interleave   ( int32_t *, const int32_t **, int, int );
+#else
 static void Interleave   ( float *, const float **, int, int );
+#endif
 
 /*****************************************************************************
  * Module descriptor
@@ -184,7 +192,11 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
     vorbis_synthesis_init( &p_dec->vd, &p_dec->vi );
     vorbis_block_init( &p_dec->vd, &p_dec->vb );
 
+#ifdef MODULE_NAME_IS_tremor
+    p_dec->output_format.i_format = VLC_FOURCC('f','i','3','2');
+#else
     p_dec->output_format.i_format = VLC_FOURCC('f','l','3','2');
+#endif
     p_dec->output_format.i_physical_channels =
         p_dec->output_format.i_original_channels =
             pi_channels_maps[p_dec->vi.channels];
@@ -241,7 +253,11 @@ static void DecodePacket( dec_thread_t *p_dec )
 {
     aout_buffer_t *p_aout_buffer;
     ogg_packet    oggpacket;
+#ifdef MODULE_NAME_IS_tremor
+    int32_t       **pp_pcm;
+#else
     float         **pp_pcm;
+#endif
     int           i_samples;
     mtime_t       i_pts;
 
@@ -278,8 +294,13 @@ static void DecodePacket( dec_thread_t *p_dec )
         }
 
         /* Interleave the samples */
-        Interleave( (float *)p_aout_buffer->p_buffer, (const float **)pp_pcm,
-                    p_dec->vi.channels, i_samples );
+#ifdef MODULE_NAME_IS_tremor
+        Interleave( (int32_t *)p_aout_buffer->p_buffer,
+                    (const int32_t **)pp_pcm, p_dec->vi.channels, i_samples );
+#else
+        Interleave( (float *)p_aout_buffer->p_buffer,
+                    (const float **)pp_pcm, p_dec->vi.channels, i_samples );
+#endif
 
         /* Tell libvorbis how many samples we actually consumed */
         vorbis_synthesis_read( &p_dec->vd, i_samples );
@@ -324,8 +345,12 @@ static int GetOggPacket( dec_thread_t *p_dec, ogg_packet *p_oggpacket,
 /*****************************************************************************
  * Interleave: helper function to interleave channels
  *****************************************************************************/
-static void Interleave( float *p_out, const float **pp_in, int i_nb_channels,
-                        int i_samples )
+#ifdef MODULE_NAME_IS_tremor
+static void Interleave( int32_t *p_out, const int32_t **pp_in,
+#else
+static void Interleave( float *p_out, const float **pp_in,
+#endif
+                        int i_nb_channels, int i_samples )
 {
     int i, j;