]> git.sesse.net Git - vlc/commitdiff
Factorize avcodec chroma table - another 2kb
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 19 Oct 2008 20:01:29 +0000 (23:01 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 19 Oct 2008 20:01:29 +0000 (23:01 +0300)
modules/codec/avcodec/Modules.am
modules/codec/avcodec/avcodec.h
modules/codec/avcodec/chroma.c [moved from modules/codec/avcodec/chroma.h with 90% similarity]
modules/codec/avcodec/deinterlace.c
modules/codec/avcodec/encoder.c
modules/codec/avcodec/video.c

index f68022933dd9d2a42524effdd9753592068b50b6..af45ff8028882d19d6af53e71323ccdf3384e092 100644 (file)
@@ -6,7 +6,7 @@ SOURCES_avcodec = \
        deinterlace.c \
        avutil.h \
        fourcc.c \
-       chroma.h \
+       chroma.c \
        $(NULL)
 
 if ENABLE_SOUT
index 6d8e08277d644ed99a425078f773a3cb2d7c1de4..053249944d0d233ab724f3deafceb9653978a7ba 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+/* VLC <-> avcodec tables */
 int GetFfmpegCodec( vlc_fourcc_t i_fourcc, int *pi_cat,
                     int *pi_ffmpeg_codec, const char **ppsz_name );
 int GetVlcFourcc( int i_ffmpeg_codec, int *pi_cat,
                   vlc_fourcc_t *pi_fourcc, const char **ppsz_name );
+int TestFfmpegChroma( const int i_ffmpeg_id, const vlc_fourcc_t i_vlc_fourcc );
+int GetFfmpegChroma( int *i_ffmpeg_chroma, const video_format_t fmt );
+int GetVlcChroma( video_format_t *fmt, const int i_ffmpeg_chroma );
+
 
 picture_t * DecodeVideo    ( decoder_t *, block_t ** );
 aout_buffer_t * DecodeAudio( decoder_t *, block_t ** );
similarity index 90%
rename from modules/codec/avcodec/chroma.h
rename to modules/codec/avcodec/chroma.c
index 542bcf99e1e2c98c01a22acb57f683d11799c2b7..6913a427a67b6bfc34b4030d4e7f271c653398e4 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * chroma.h: libavutil <-> libvlc conversion routines
+ * chroma.c: libavutil <-> libvlc conversion routines
  *****************************************************************************
  * Copyright (C) 1999-2008 the VideoLAN team
  * $Id$
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 021100301, USA.
  *****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <vlc_common.h>
+#include <vlc_codec.h>
+
+#ifdef HAVE_LIBAVCODEC_AVCODEC_H
+#   include <libavcodec/avcodec.h>
+#elif defined(HAVE_FFMPEG_AVCODEC_H)
+#   include <ffmpeg/avcodec.h>
+#else
+#   include <avcodec.h>
+#endif
+#include "avcodec.h"
+
 /*****************************************************************************
  * Chroma fourcc -> ffmpeg_id mapping
  *****************************************************************************/
@@ -101,7 +117,7 @@ static const struct
     { 0, 0, 0, 0, 0 }
 };
 
-static inline int TestFfmpegChroma( const int i_ffmpeg_id, const vlc_fourcc_t i_vlc_fourcc )
+int TestFfmpegChroma( const int i_ffmpeg_id, const vlc_fourcc_t i_vlc_fourcc )
 {
     for( int i = 0; chroma_table[i].i_chroma != 0; i++ )
     {
@@ -112,7 +128,7 @@ static inline int TestFfmpegChroma( const int i_ffmpeg_id, const vlc_fourcc_t i_
 }
 
 /* FIXME special case the RGB formats */
-static inline int GetFfmpegChroma( int *i_ffmpeg_chroma, const video_format_t fmt )
+int GetFfmpegChroma( int *i_ffmpeg_chroma, const video_format_t fmt )
 {
     for( int i = 0; chroma_table[i].i_chroma != 0; i++ )
     {
@@ -130,7 +146,7 @@ static inline int GetFfmpegChroma( int *i_ffmpeg_chroma, const video_format_t fm
     return VLC_EGENERIC;
 }
 
-static inline int GetVlcChroma( video_format_t *fmt, const int i_ffmpeg_chroma )
+int GetVlcChroma( video_format_t *fmt, const int i_ffmpeg_chroma )
 {
     /* TODO FIXME for rgb format we HAVE to set rgb mask/shift */
     for( int i = 0; chroma_table[i].i_chroma != 0; i++ )
index fbc553d7016433a6d8eb597b13cccfd0e357b91f..4b97455b15fb98b4642b0293860e377b00956e88 100644 (file)
@@ -44,7 +44,6 @@
 #endif
 
 #include "avcodec.h"
-#include "chroma.h"
 
 static picture_t *Deinterlace( filter_t *p_filter, picture_t *p_pic );
 
index 675c811c028fbdc04a080d15f784c5ef42a813bf..0dc7dc083a13e13211175e3e56dddddf351286d6 100644 (file)
@@ -50,7 +50,6 @@
 #endif
 
 #include "avcodec.h"
-#include "chroma.h"
 
 #define HURRY_UP_GUARD1 (450000)
 #define HURRY_UP_GUARD2 (300000)
index 0d6d01ff0ee55ec867732b41cb2f1c8e7f6aa5ab..bd018e7043d860ab20c5b01a36937f16407b9eb6 100644 (file)
@@ -44,7 +44,6 @@
 #endif
 
 #include "avcodec.h"
-#include "chroma.h"
 
 /*****************************************************************************
  * decoder_sys_t : decoder descriptor