changeset 7782:6efb15a24e91 libavcodec

Replace generic CONFIG_ENCODERS preprocessor conditionals by more specific CONFIG_FOO_ENCODER conditionals where appropriate.
author diego
date Wed, 03 Sep 2008 12:33:21 +0000
parents 0d62fafc69ae
children 12a25666f1e4
files asv1.c cljr.c ffv1.c g726.c huffyuv.c rv10.c sonic.c vcr1.c
diffstat 8 files changed, 44 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/asv1.c	Wed Sep 03 04:45:01 2008 +0000
+++ b/asv1.c	Wed Sep 03 12:33:21 2008 +0000
@@ -465,7 +465,7 @@
     return (get_bits_count(&a->gb)+31)/32*4;
 }
 
-#ifdef CONFIG_ENCODERS
+#if defined(CONFIG_ASV1_ENCODER) || defined(CONFIG_ASV2_ENCODER)
 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
     ASV1Context * const a = avctx->priv_data;
     AVFrame *pict = data;
@@ -519,7 +519,7 @@
 
     return size*4;
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* defined(CONFIG_ASV1_ENCODER) || defined(CONFIG_ASV2_ENCODER) */
 
 static av_cold void common_init(AVCodecContext *avctx){
     ASV1Context * const a = avctx->priv_data;
@@ -569,7 +569,7 @@
     return 0;
 }
 
-#ifdef CONFIG_ENCODERS
+#if defined(CONFIG_ASV1_ENCODER) || defined(CONFIG_ASV2_ENCODER)
 static av_cold int encode_init(AVCodecContext *avctx){
     ASV1Context * const a = avctx->priv_data;
     int i;
@@ -593,7 +593,7 @@
 
     return 0;
 }
-#endif
+#endif /* defined(CONFIG_ASV1_ENCODER) || defined(CONFIG_ASV2_ENCODER) */
 
 static av_cold int decode_end(AVCodecContext *avctx){
     ASV1Context * const a = avctx->priv_data;
@@ -631,8 +631,7 @@
     .long_name= NULL_IF_CONFIG_SMALL("ASUS V2"),
 };
 
-#ifdef CONFIG_ENCODERS
-
+#ifdef CONFIG_ASV1_ENCODER
 AVCodec asv1_encoder = {
     "asv1",
     CODEC_TYPE_VIDEO,
@@ -644,7 +643,9 @@
     .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
     .long_name= NULL_IF_CONFIG_SMALL("ASUS V1"),
 };
+#endif
 
+#ifdef CONFIG_ASV2_ENCODER
 AVCodec asv2_encoder = {
     "asv2",
     CODEC_TYPE_VIDEO,
@@ -656,5 +657,4 @@
     .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
     .long_name= NULL_IF_CONFIG_SMALL("ASUS V2"),
 };
-
-#endif //CONFIG_ENCODERS
+#endif
--- a/cljr.c	Wed Sep 03 04:45:01 2008 +0000
+++ b/cljr.c	Wed Sep 03 12:33:21 2008 +0000
@@ -143,8 +143,7 @@
     .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
 };
 #if 0
-#ifdef CONFIG_ENCODERS
-
+#ifdef CONFIG_CLJR_ENCODER
 AVCodec cljr_encoder = {
     "cljr",
     CODEC_TYPE_VIDEO,
@@ -155,6 +154,5 @@
     //encode_end,
     .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
 };
-
-#endif //CONFIG_ENCODERS
 #endif
+#endif
--- a/ffv1.c	Wed Sep 03 04:45:01 2008 +0000
+++ b/ffv1.c	Wed Sep 03 12:33:21 2008 +0000
@@ -350,7 +350,7 @@
     return ret;
 }
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_FFV1_ENCODER
 static inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
     PlaneContext * const p= &s->plane[plane_index];
     RangeCoder * const c= &s->c;
@@ -524,7 +524,7 @@
     for(i=0; i<5; i++)
         write_quant_table(c, f->quant_table[i]);
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* CONFIG_FFV1_ENCODER */
 
 static av_cold int common_init(AVCodecContext *avctx){
     FFV1Context *s = avctx->priv_data;
@@ -543,7 +543,7 @@
     return 0;
 }
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_FFV1_ENCODER
 static av_cold int encode_init(AVCodecContext *avctx)
 {
     FFV1Context *s = avctx->priv_data;
@@ -607,7 +607,7 @@
 
     return 0;
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* CONFIG_FFV1_ENCODER */
 
 
 static void clear_state(FFV1Context *f){
@@ -632,7 +632,7 @@
     }
 }
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_FFV1_ENCODER
 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
     FFV1Context *f = avctx->priv_data;
     RangeCoder * const c= &f->c;
@@ -688,7 +688,7 @@
         return used_count + (put_bits_count(&f->pb)+7)/8;
     }
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* CONFIG_FFV1_ENCODER */
 
 static av_cold int common_end(AVCodecContext *avctx){
     FFV1Context *s = avctx->priv_data;
@@ -1025,7 +1025,7 @@
     .long_name= NULL_IF_CONFIG_SMALL("FFmpeg codec #1"),
 };
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_FFV1_ENCODER
 AVCodec ffv1_encoder = {
     "ffv1",
     CODEC_TYPE_VIDEO,
--- a/g726.c	Wed Sep 03 04:45:01 2008 +0000
+++ b/g726.c	Wed Sep 03 12:33:21 2008 +0000
@@ -285,7 +285,7 @@
     return 0;
 }
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_ADPCM_G726_ENCODER
 static int16_t g726_encode(G726Context* c, int16_t sig)
 {
     uint8_t i;
@@ -342,7 +342,7 @@
     return 0;
 }
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_ADPCM_G726_ENCODER
 static int g726_encode_frame(AVCodecContext *avctx,
                             uint8_t *dst, int buf_size, void *data)
 {
@@ -381,7 +381,7 @@
     return buf_size;
 }
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_ADPCM_G726_ENCODER
 AVCodec adpcm_g726_encoder = {
     "g726",
     CODEC_TYPE_AUDIO,
@@ -394,7 +394,7 @@
     .sample_fmts = (enum SampleFormat[]){SAMPLE_FMT_S16,SAMPLE_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("G.726 ADPCM"),
 };
-#endif //CONFIG_ENCODERS
+#endif
 
 AVCodec adpcm_g726_decoder = {
     "g726",
--- a/huffyuv.c	Wed Sep 03 04:45:01 2008 +0000
+++ b/huffyuv.c	Wed Sep 03 12:33:21 2008 +0000
@@ -261,7 +261,7 @@
     return 0;
 }
 
-#ifdef CONFIG_ENCODERS
+#if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER)
 typedef struct {
     uint64_t val;
     int name;
@@ -317,7 +317,7 @@
         if(i==size) break;
     }
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) */
 
 static void generate_joint_tables(HYuvContext *s){
     uint16_t symbols[1<<VLC_BITS];
@@ -575,7 +575,7 @@
 }
 #endif /* defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) */
 
-#ifdef CONFIG_ENCODERS
+#if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER)
 static int store_table(HYuvContext *s, uint8_t *len, uint8_t *buf){
     int i;
     int index= 0;
@@ -725,7 +725,7 @@
 
     return 0;
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) */
 
 /* TODO instead of restarting the read when the code isn't in the first level
  * of the joint table, jump into the 2nd level of the individual table. */
@@ -761,7 +761,7 @@
     }
 }
 
-#ifdef CONFIG_ENCODERS
+#if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER)
 static int encode_422_bitstream(HYuvContext *s, int count){
     int i;
 
@@ -854,7 +854,7 @@
     }
     return 0;
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) */
 
 static av_always_inline void decode_bgr_1(HYuvContext *s, int count, int decorrelate, int alpha){
     int i;
@@ -1226,7 +1226,7 @@
 }
 #endif /* defined(CONFIG_HUFFYUV_DECODER) || defined(CONFIG_FFVHUFF_DECODER) */
 
-#ifdef CONFIG_ENCODERS
+#if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER)
 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){
     HYuvContext *s = avctx->priv_data;
     AVFrame *pict = data;
@@ -1431,7 +1431,7 @@
 
     return 0;
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) */
 
 #ifdef CONFIG_HUFFYUV_DECODER
 AVCodec huffyuv_decoder = {
@@ -1465,8 +1465,7 @@
 };
 #endif
 
-#ifdef CONFIG_ENCODERS
-
+#ifdef CONFIG_HUFFYUV_ENCODER
 AVCodec huffyuv_encoder = {
     "huffyuv",
     CODEC_TYPE_VIDEO,
@@ -1478,7 +1477,9 @@
     .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV422P, PIX_FMT_RGB32, PIX_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
 };
+#endif
 
+#ifdef CONFIG_FFVHUFF_ENCODER
 AVCodec ffvhuff_encoder = {
     "ffvhuff",
     CODEC_TYPE_VIDEO,
@@ -1490,5 +1491,4 @@
     .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_RGB32, PIX_FMT_NONE},
     .long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"),
 };
-
-#endif //CONFIG_ENCODERS
+#endif
--- a/rv10.c	Wed Sep 03 04:45:01 2008 +0000
+++ b/rv10.c	Wed Sep 03 12:33:21 2008 +0000
@@ -229,8 +229,8 @@
     return -code;
 }
 
-#ifdef CONFIG_ENCODERS
 
+#if defined(CONFIG_RV10_ENCODER) || defined(CONFIG_RV20_ENCODER)
 /* write RV 1.0 compatible frame header */
 void rv10_encode_picture_header(MpegEncContext *s, int picture_number)
 {
@@ -304,7 +304,7 @@
 }
 #endif
 
-#endif //CONFIG_ENCODERS
+#endif /* defined(CONFIG_RV10_ENCODER) || defined(CONFIG_RV20_ENCODER) */
 
 /* read RV 1.0 compatible frame header */
 static int rv10_decode_picture_header(MpegEncContext *s)
--- a/sonic.c	Wed Sep 03 04:45:01 2008 +0000
+++ b/sonic.c	Wed Sep 03 12:33:21 2008 +0000
@@ -408,7 +408,7 @@
     return x;
 }
 
-#ifdef CONFIG_ENCODERS
+#if defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER)
 // Heavily modified Levinson-Durbin algorithm which
 // copes better with quantization, and calculates the
 // actual whitened result as it goes.
@@ -479,13 +479,12 @@
 
     av_free(state);
 }
-#endif /* CONFIG_ENCODERS */
+#endif /* defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) */
 
 static const int samplerate_table[] =
     { 44100, 22050, 11025, 96000, 48000, 32000, 24000, 16000, 8000 };
 
-#ifdef CONFIG_ENCODERS
-
+#if defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER)
 static inline int code_samplerate(int samplerate)
 {
     switch (samplerate)
@@ -748,7 +747,7 @@
     flush_put_bits(&pb);
     return (put_bits_count(&pb)+7)/8;
 }
-#endif //CONFIG_ENCODERS
+#endif /* defined(CONFIG_SONIC_ENCODER) || defined(CONFIG_SONIC_LS_ENCODER) */
 
 #ifdef CONFIG_SONIC_DECODER
 static av_cold int sonic_decode_init(AVCodecContext *avctx)
@@ -937,7 +936,7 @@
 }
 #endif /* CONFIG_SONIC_DECODER */
 
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_SONIC_ENCODER
 AVCodec sonic_encoder = {
     "sonic",
     CODEC_TYPE_AUDIO,
@@ -949,7 +948,9 @@
     NULL,
     .long_name = NULL_IF_CONFIG_SMALL("Sonic"),
 };
+#endif
 
+#ifdef CONFIG_SONIC_LS_ENCODER
 AVCodec sonic_ls_encoder = {
     "sonicls",
     CODEC_TYPE_AUDIO,
--- a/vcr1.c	Wed Sep 03 04:45:01 2008 +0000
+++ b/vcr1.c	Wed Sep 03 12:33:21 2008 +0000
@@ -175,8 +175,7 @@
     .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"),
 };
 #if 0
-#ifdef CONFIG_ENCODERS
-
+#ifdef CONFIG_VCR1_ENCODER
 AVCodec vcr1_encoder = {
     "vcr1",
     CODEC_TYPE_VIDEO,
@@ -187,6 +186,5 @@
     //encode_end,
     .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"),
 };
-
-#endif //CONFIG_ENCODERS
 #endif
+#endif