[Ffmpeg-cvslog] r5691 - in trunk: configure libavcodec/Makefile libavcodec/allcodecs.c libavcodec/h261.c libavcodec/h263dec.c libavcodec/h264.c libavcodec/parser.c libavcodec/pnm.c

mru subversion
Sun Jul 9 14:02:16 CEST 2006


Author: mru
Date: Sun Jul  9 14:02:15 2006
New Revision: 5691

Modified:
   trunk/configure
   trunk/libavcodec/Makefile
   trunk/libavcodec/allcodecs.c
   trunk/libavcodec/h261.c
   trunk/libavcodec/h263dec.c
   trunk/libavcodec/h264.c
   trunk/libavcodec/parser.c
   trunk/libavcodec/pnm.c

Log:
--enable/disable parsers. Warning: some combinations are broken.


Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Sun Jul  9 14:02:15 2006
@@ -106,6 +106,9 @@
   echo "  --disable-decoders       disables all decoders"
   echo "  --disable-muxers         disables all muxers"
   echo "  --disable-demuxers       disables all demuxers"
+  echo "  --enable-parser=NAME     enables parser NAME"
+  echo "  --disable-parser=NAME    disables parser NAME"
+  echo "  --disable-parsers        disables all parsers"
   echo ""
   echo "NOTE: Object files are built at the place where configure is launched."
   exit 1
@@ -658,6 +661,7 @@
 done
 
 CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c  | sed 's/.*&\(.*\)).*/\1/'`
+PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' $source_path/libavcodec/allcodecs.c  | sed 's/.*&\(.*\)).*/\1/'`
 
 for opt do
   case "$opt" in
@@ -819,6 +823,12 @@
   ;;
   --disable-demuxers) demuxers="no"
   ;;
+  --enable-parser=*) PARSER_LIST="$PARSER_LIST ${opt#*=}_parser"
+  ;;
+  --disable-parser=*) PARSER_LIST="`echo $PARSER_LIST | sed -e \"s#${opt#*=}_parser##\"`"
+  ;;
+  --disable-parsers) PARSER_LIST=""
+  ;;
   --help) show_help
   ;;
   *)
@@ -2072,7 +2082,7 @@
 fi
 
 
-for codec in $CODEC_LIST ; do
+for codec in $CODEC_LIST $PARSER_LIST; do
     echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
     echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
 done

Modified: trunk/libavcodec/Makefile
==============================================================================
--- trunk/libavcodec/Makefile	(original)
+++ trunk/libavcodec/Makefile	Sun Jul  9 14:02:15 2006
@@ -258,6 +258,20 @@
                                           amrwb_float/enc_util.o  \
                                           amrwb_float/if_rom.o
 
+OBJS-$(CONFIG_AAC_PARSER)              += parser.o
+OBJS-$(CONFIG_AC3_PARSER)              += parser.o
+OBJS-$(CONFIG_CAVS_PARSER)             += parser.o
+OBJS-$(CONFIG_DVBSUB_PARSER)           += dvbsubdec.o
+OBJS-$(CONFIG_DVDSUB_PARSER)           += dvdsub.o
+OBJS-$(CONFIG_H261_PARSER)             += h261.o
+OBJS-$(CONFIG_H263_PARSER)             += h263dec.o
+OBJS-$(CONFIG_H264_PARSER)             += h264.o
+OBJS-$(CONFIG_MJPEG_PARSER)            += mjpeg.o
+OBJS-$(CONFIG_MPEG4VIDEO_PARSER)       += parser.o
+OBJS-$(CONFIG_MPEGAUDIO_PARSER)        += parser.o
+OBJS-$(CONFIG_MPEGVIDEO_PARSER)        += parser.o
+OBJS-$(CONFIG_PNM_PARSER)              += pnm.o
+
 OBJS-$(HAVE_PTHREADS)                  += pthread.o
 OBJS-$(HAVE_W32THREADS)                += w32thread.o
 OBJS-$(HAVE_OS2THREADS)                += os2thread.o

Modified: trunk/libavcodec/allcodecs.c
==============================================================================
--- trunk/libavcodec/allcodecs.c	(original)
+++ trunk/libavcodec/allcodecs.c	Sun Jul  9 14:02:15 2006
@@ -800,31 +800,45 @@
 #endif
 
     /* parsers */
+#ifdef CONFIG_MPEGVIDEO_PARSER
     av_register_codec_parser(&mpegvideo_parser);
+#endif
+#ifdef CONFIG_MPEG4VIDEO_PARSER
     av_register_codec_parser(&mpeg4video_parser);
-#ifdef CONFIG_CAVS_DECODER
+#endif
+#ifdef CONFIG_CAVSVIDEO_PARSER
     av_register_codec_parser(&cavsvideo_parser);
 #endif
-#if defined(CONFIG_H261_DECODER) || defined(CONFIG_H261_ENCODER)
+#ifdef CONFIG_H261_PARSER
     av_register_codec_parser(&h261_parser);
 #endif
+#ifdef CONFIG_H263_PARSER
     av_register_codec_parser(&h263_parser);
-#ifdef CONFIG_H264_DECODER
+#endif
+#ifdef CONFIG_H264_PARSER
     av_register_codec_parser(&h264_parser);
 #endif
+#ifdef CONFIG_MJPEG_PARSER
     av_register_codec_parser(&mjpeg_parser);
+#endif
+#ifdef CONFIG_PNM_PARSER
     av_register_codec_parser(&pnm_parser);
-
+#endif
+#ifdef CONFIG_MPEGAUDIO_PARSER
     av_register_codec_parser(&mpegaudio_parser);
+#endif
+#ifdef CONFIG_AC3_PARSER
     av_register_codec_parser(&ac3_parser);
-
-#ifdef CONFIG_DVDSUB_DECODER
+#endif
+#ifdef CONFIG_DVDSUB_PARSER
     av_register_codec_parser(&dvdsub_parser);
 #endif
-#ifdef CONFIG_DVBSUB_DECODER
+#ifdef CONFIG_DVBSUB_PARSER
     av_register_codec_parser(&dvbsub_parser);
 #endif
+#ifdef CONFIG_AAC_PARSER
     av_register_codec_parser(&aac_parser);
+#endif
 
     av_register_bitstream_filter(&dump_extradata_bsf);
     av_register_bitstream_filter(&remove_extradata_bsf);

Modified: trunk/libavcodec/h261.c
==============================================================================
--- trunk/libavcodec/h261.c	(original)
+++ trunk/libavcodec/h261.c	Sun Jul  9 14:02:15 2006
@@ -847,6 +847,7 @@
     return -1;
 }
 
+#ifdef CONFIG_H261_PARSER
 static int h261_find_frame_end(ParseContext *pc, AVCodecContext* avctx, const uint8_t *buf, int buf_size){
     int vop_found, i, j;
     uint32_t state;
@@ -900,6 +901,7 @@
     *poutbuf_size = buf_size;
     return next;
 }
+#endif
 
 /**
  * returns the number of bytes consumed for building the current frame
@@ -1039,6 +1041,7 @@
     CODEC_CAP_DR1,
 };
 
+#ifdef CONFIG_H261_PARSER
 AVCodecParser h261_parser = {
     { CODEC_ID_H261 },
     sizeof(ParseContext),
@@ -1046,3 +1049,4 @@
     h261_parse,
     ff_parse_close,
 };
+#endif

Modified: trunk/libavcodec/h263dec.c
==============================================================================
--- trunk/libavcodec/h263dec.c	(original)
+++ trunk/libavcodec/h263dec.c	Sun Jul  9 14:02:15 2006
@@ -391,6 +391,7 @@
     return END_NOT_FOUND;
 }
 
+#ifdef CONFIG_H263_PARSER
 static int h263_parse(AVCodecParserContext *s,
                            AVCodecContext *avctx,
                            uint8_t **poutbuf, int *poutbuf_size,
@@ -411,6 +412,7 @@
     *poutbuf_size = buf_size;
     return next;
 }
+#endif
 
 int ff_h263_decode_frame(AVCodecContext *avctx,
                              void *data, int *data_size,
@@ -887,6 +889,7 @@
     CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1
 };
 
+#ifdef CONFIG_H263_PARSER
 AVCodecParser h263_parser = {
     { CODEC_ID_H263 },
     sizeof(ParseContext),
@@ -894,3 +897,4 @@
     h263_parse,
     ff_parse_close,
 };
+#endif

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Sun Jul  9 14:02:15 2006
@@ -7872,6 +7872,7 @@
     return END_NOT_FOUND;
 }
 
+#ifdef CONFIG_H264_PARSER
 static int h264_parse(AVCodecParserContext *s,
                       AVCodecContext *avctx,
                       uint8_t **poutbuf, int *poutbuf_size,
@@ -7917,7 +7918,7 @@
     }
     return 0;
 }
-
+#endif /* CONFIG_H264_PARSER */
 
 static int decode_nal_units(H264Context *h, uint8_t *buf, int buf_size){
     MpegEncContext * const s = &h->s;
@@ -8488,6 +8489,7 @@
     .flush= flush_dpb,
 };
 
+#ifdef CONFIG_H264_PARSER
 AVCodecParser h264_parser = {
     { CODEC_ID_H264 },
     sizeof(H264Context),
@@ -8496,5 +8498,6 @@
     ff_parse_close,
     h264_split,
 };
+#endif
 
 #include "svq3.c"

Modified: trunk/libavcodec/parser.c
==============================================================================
--- trunk/libavcodec/parser.c	(original)
+++ trunk/libavcodec/parser.c	Sun Jul  9 14:02:15 2006
@@ -298,6 +298,7 @@
     25025,
 };
 
+#ifdef CONFIG_MPEGVIDEO_PARSER
 //FIXME move into mpeg12.c
 static void mpegvideo_extract_headers(AVCodecParserContext *s,
                                       AVCodecContext *avctx,
@@ -450,6 +451,7 @@
     }
     return 0;
 }
+#endif /* CONFIG_MPEGVIDEO_PARSER */
 
 void ff_parse_close(AVCodecParserContext *s)
 {
@@ -468,6 +470,7 @@
 
 /*************************/
 
+#ifdef CONFIG_MPEG4VIDEO_PARSER
 /* used by parser */
 /* XXX: make it use less memory */
 static int av_mpeg4_decode_header(AVCodecParserContext *s1,
@@ -533,8 +536,9 @@
     *poutbuf_size = buf_size;
     return next;
 }
+#endif
 
-#ifdef CONFIG_CAVS_DECODER
+#ifdef CONFIG_CAVSVIDEO_PARSER
 static int cavsvideo_parse(AVCodecParserContext *s,
                            AVCodecContext *avctx,
                            uint8_t **poutbuf, int *poutbuf_size,
@@ -558,7 +562,7 @@
     *poutbuf_size = buf_size;
     return next;
 }
-#endif /* CONFIG_CAVS_DECODER */
+#endif /* CONFIG_CAVSVIDEO_PARSER */
 
 static int mpeg4video_split(AVCodecContext *avctx,
                            const uint8_t *buf, int buf_size)
@@ -576,6 +580,7 @@
 
 /*************************/
 
+#ifdef CONFIG_MPEGAUDIO_PARSER
 typedef struct MpegAudioParseContext {
     uint8_t inbuf[MPA_MAX_CODED_FRAME_SIZE];    /* input buffer */
     uint8_t *inbuf_ptr;
@@ -753,7 +758,9 @@
     }
     return buf_ptr - buf;
 }
+#endif /* CONFIG_MPEGAUDIO_PARSER */
 
+#if defined(CONFIG_AC3_PARSER) || defined(CONFIG_AAC_PARSER)
 /* also used for ADTS AAC */
 typedef struct AC3ParseContext {
     uint8_t *inbuf_ptr;
@@ -767,6 +774,7 @@
 #define AC3_HEADER_SIZE 7
 #define AAC_HEADER_SIZE 7
 
+#ifdef CONFIG_AC3_PARSER
 static const int ac3_sample_rates[4] = {
     48000, 44100, 32000, 0
 };
@@ -821,7 +829,9 @@
 static const int ac3_channels[8] = {
     2, 1, 2, 3, 3, 4, 4, 5
 };
+#endif /* CONFIG_AC3_PARSER */
 
+#ifdef CONFIG_AAC_PARSER
 static int aac_sample_rates[16] = {
     96000, 88200, 64000, 48000, 44100, 32000,
     24000, 22050, 16000, 12000, 11025, 8000, 7350
@@ -830,7 +840,9 @@
 static int aac_channels[8] = {
     0, 1, 2, 3, 4, 5, 6, 8
 };
+#endif
 
+#ifdef CONFIG_AC3_PARSER
 static int ac3_sync(const uint8_t *buf, int *channels, int *sample_rate,
                     int *bit_rate, int *samples)
 {
@@ -869,7 +881,9 @@
 
     return ac3_frame_sizes[frmsizecod][fscod] * 2;
 }
+#endif /* CONFIG_AC3_PARSER */
 
+#ifdef CONFIG_AAC_PARSER
 static int aac_sync(const uint8_t *buf, int *channels, int *sample_rate,
                     int *bit_rate, int *samples)
 {
@@ -909,7 +923,9 @@
 
     return size;
 }
+#endif /* CONFIG_AAC_PARSER */
 
+#ifdef CONFIG_AC3_PARSER
 static int ac3_parse_init(AVCodecParserContext *s1)
 {
     AC3ParseContext *s = s1->priv_data;
@@ -918,7 +934,9 @@
     s->sync = ac3_sync;
     return 0;
 }
+#endif
 
+#ifdef CONFIG_AAC_PARSER
 static int aac_parse_init(AVCodecParserContext *s1)
 {
     AC3ParseContext *s = s1->priv_data;
@@ -927,6 +945,7 @@
     s->sync = aac_sync;
     return 0;
 }
+#endif
 
 /* also used for ADTS AAC */
 static int ac3_parse(AVCodecParserContext *s1,
@@ -995,7 +1014,9 @@
     }
     return buf_ptr - buf;
 }
+#endif /* CONFIG_AC3_PARSER || CONFIG_AAC_PARSER */
 
+#ifdef CONFIG_MPEGVIDEO_PARSER
 AVCodecParser mpegvideo_parser = {
     { CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO },
     sizeof(ParseContext1),
@@ -1004,7 +1025,8 @@
     parse1_close,
     mpegvideo_split,
 };
-
+#endif
+#ifdef CONFIG_MPEG4VIDEO_PARSER
 AVCodecParser mpeg4video_parser = {
     { CODEC_ID_MPEG4 },
     sizeof(ParseContext1),
@@ -1013,8 +1035,8 @@
     parse1_close,
     mpeg4video_split,
 };
-
-#ifdef CONFIG_CAVS_DECODER
+#endif
+#ifdef CONFIG_CAVSVIDEO_PARSER
 AVCodecParser cavsvideo_parser = {
     { CODEC_ID_CAVS },
     sizeof(ParseContext1),
@@ -1024,7 +1046,7 @@
     mpeg4video_split,
 };
 #endif
-
+#ifdef CONFIG_MPEGAUDIO_PARSER
 AVCodecParser mpegaudio_parser = {
     { CODEC_ID_MP2, CODEC_ID_MP3 },
     sizeof(MpegAudioParseContext),
@@ -1032,7 +1054,8 @@
     mpegaudio_parse,
     NULL,
 };
-
+#endif
+#ifdef CONFIG_AC3_PARSER
 AVCodecParser ac3_parser = {
     { CODEC_ID_AC3 },
     sizeof(AC3ParseContext),
@@ -1040,7 +1063,8 @@
     ac3_parse,
     NULL,
 };
-
+#endif
+#ifdef CONFIG_AAC_PARSER
 AVCodecParser aac_parser = {
     { CODEC_ID_AAC },
     sizeof(AC3ParseContext),
@@ -1048,3 +1072,4 @@
     ac3_parse,
     NULL,
 };
+#endif

Modified: trunk/libavcodec/pnm.c
==============================================================================
--- trunk/libavcodec/pnm.c	(original)
+++ trunk/libavcodec/pnm.c	Sun Jul  9 14:02:15 2006
@@ -454,6 +454,7 @@
 }
 #endif
 
+#ifdef CONFIG_PNM_PARSER
 static int pnm_parse(AVCodecParserContext *s,
                            AVCodecContext *avctx,
                            uint8_t **poutbuf, int *poutbuf_size,
@@ -522,6 +523,7 @@
     pnm_parse,
     ff_parse_close,
 };
+#endif /* CONFIG_PNM_PARSER */
 
 #ifdef CONFIG_PGM_ENCODER
 AVCodec pgm_encoder = {




More information about the ffmpeg-cvslog mailing list