[FFmpeg-cvslog] r15174 - in trunk/libavcodec: asv1.c cljr.c ffv1.c g726.c huffyuv.c rv10.c sonic.c vcr1.c
diego
subversion
Wed Sep 3 14:33:22 CEST 2008
Author: diego
Date: Wed Sep 3 14:33:21 2008
New Revision: 15174
Log:
Replace generic CONFIG_ENCODERS preprocessor conditionals by more specific
CONFIG_FOO_ENCODER conditionals where appropriate.
Modified:
trunk/libavcodec/asv1.c
trunk/libavcodec/cljr.c
trunk/libavcodec/ffv1.c
trunk/libavcodec/g726.c
trunk/libavcodec/huffyuv.c
trunk/libavcodec/rv10.c
trunk/libavcodec/sonic.c
trunk/libavcodec/vcr1.c
Modified: trunk/libavcodec/asv1.c
==============================================================================
--- trunk/libavcodec/asv1.c (original)
+++ trunk/libavcodec/asv1.c Wed Sep 3 14:33:21 2008
@@ -465,7 +465,7 @@ for(i=0; i<s->avctx->extradata_size; i++
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 @@ static int encode_frame(AVCodecContext *
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 @@ static av_cold int decode_init(AVCodecCo
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 @@ static av_cold int encode_init(AVCodecCo
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 @@ AVCodec asv2_decoder = {
.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 @@ AVCodec asv1_encoder = {
.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 @@ AVCodec asv2_encoder = {
.pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
.long_name= NULL_IF_CONFIG_SMALL("ASUS V2"),
};
-
-#endif //CONFIG_ENCODERS
+#endif
Modified: trunk/libavcodec/cljr.c
==============================================================================
--- trunk/libavcodec/cljr.c (original)
+++ trunk/libavcodec/cljr.c Wed Sep 3 14:33:21 2008
@@ -143,8 +143,7 @@ AVCodec cljr_decoder = {
.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 @@ AVCodec cljr_encoder = {
//encode_end,
.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
};
-
-#endif //CONFIG_ENCODERS
+#endif
#endif
Modified: trunk/libavcodec/ffv1.c
==============================================================================
--- trunk/libavcodec/ffv1.c (original)
+++ trunk/libavcodec/ffv1.c Wed Sep 3 14:33:21 2008
@@ -350,7 +350,7 @@ static inline int get_vlc_symbol(GetBitC
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 @@ static void write_header(FFV1Context *f)
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 @@ static av_cold int common_init(AVCodecCo
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 @@ static av_cold int encode_init(AVCodecCo
return 0;
}
-#endif /* CONFIG_ENCODERS */
+#endif /* CONFIG_FFV1_ENCODER */
static void clear_state(FFV1Context *f){
@@ -632,7 +632,7 @@ static void clear_state(FFV1Context *f){
}
}
-#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 @@ static int encode_frame(AVCodecContext *
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 @@ AVCodec ffv1_decoder = {
.long_name= NULL_IF_CONFIG_SMALL("FFmpeg codec #1"),
};
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_FFV1_ENCODER
AVCodec ffv1_encoder = {
"ffv1",
CODEC_TYPE_VIDEO,
Modified: trunk/libavcodec/g726.c
==============================================================================
--- trunk/libavcodec/g726.c (original)
+++ trunk/libavcodec/g726.c Wed Sep 3 14:33:21 2008
@@ -285,7 +285,7 @@ static av_cold int g726_reset(G726Contex
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 @@ static av_cold int g726_close(AVCodecCon
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 @@ static int g726_decode_frame(AVCodecCont
return buf_size;
}
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_ADPCM_G726_ENCODER
AVCodec adpcm_g726_encoder = {
"g726",
CODEC_TYPE_AUDIO,
@@ -394,7 +394,7 @@ AVCodec adpcm_g726_encoder = {
.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",
Modified: trunk/libavcodec/huffyuv.c
==============================================================================
--- trunk/libavcodec/huffyuv.c (original)
+++ trunk/libavcodec/huffyuv.c Wed Sep 3 14:33:21 2008
@@ -261,7 +261,7 @@ static int generate_bits_table(uint32_t
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 @@ static void generate_len_table(uint8_t *
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 @@ s->bgr32=1;
}
#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 @@ static av_cold int encode_init(AVCodecCo
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 @@ static void decode_gray_bitstream(HYuvCo
}
}
-#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 @@ static int encode_gray_bitstream(HYuvCon
}
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 @@ static av_cold int decode_end(AVCodecCon
}
#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 @@ static av_cold int encode_end(AVCodecCon
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 @@ AVCodec ffvhuff_decoder = {
};
#endif
-#ifdef CONFIG_ENCODERS
-
+#ifdef CONFIG_HUFFYUV_ENCODER
AVCodec huffyuv_encoder = {
"huffyuv",
CODEC_TYPE_VIDEO,
@@ -1478,7 +1477,9 @@ AVCodec huffyuv_encoder = {
.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 @@ AVCodec ffvhuff_encoder = {
.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
Modified: trunk/libavcodec/rv10.c
==============================================================================
--- trunk/libavcodec/rv10.c (original)
+++ trunk/libavcodec/rv10.c Wed Sep 3 14:33:21 2008
@@ -229,8 +229,8 @@ int rv_decode_dc(MpegEncContext *s, int
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 @@ static int get_num(GetBitContext *gb)
}
#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)
Modified: trunk/libavcodec/sonic.c
==============================================================================
--- trunk/libavcodec/sonic.c (original)
+++ trunk/libavcodec/sonic.c Wed Sep 3 14:33:21 2008
@@ -408,7 +408,7 @@ static int predictor_calc_error(int *k,
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 @@ static void modified_levinson_durbin(int
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 @@ static int sonic_encode_frame(AVCodecCon
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 @@ static int sonic_decode_frame(AVCodecCon
}
#endif /* CONFIG_SONIC_DECODER */
-#ifdef CONFIG_ENCODERS
+#ifdef CONFIG_SONIC_ENCODER
AVCodec sonic_encoder = {
"sonic",
CODEC_TYPE_AUDIO,
@@ -949,7 +948,9 @@ AVCodec sonic_encoder = {
NULL,
.long_name = NULL_IF_CONFIG_SMALL("Sonic"),
};
+#endif
+#ifdef CONFIG_SONIC_LS_ENCODER
AVCodec sonic_ls_encoder = {
"sonicls",
CODEC_TYPE_AUDIO,
Modified: trunk/libavcodec/vcr1.c
==============================================================================
--- trunk/libavcodec/vcr1.c (original)
+++ trunk/libavcodec/vcr1.c Wed Sep 3 14:33:21 2008
@@ -175,8 +175,7 @@ AVCodec vcr1_decoder = {
.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 @@ AVCodec vcr1_encoder = {
//encode_end,
.long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"),
};
-
-#endif //CONFIG_ENCODERS
+#endif
#endif
More information about the ffmpeg-cvslog
mailing list