From 3859736446d112dab7f1df00eca28290789df0fa Mon Sep 17 00:00:00 2001 From: Wolfgang Hesseler Date: Tue, 20 May 2003 00:42:14 +0000 Subject: [PATCH] CONFIG_ENCODERS patch by (Wolfgang Hesseler ) Originally committed as revision 1892 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/asv1.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index f17a0e6a1b..bc36f1b003 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -95,6 +95,8 @@ static inline int get_level(GetBitContext *gb){ else return code - 3; } +#ifdef CONFIG_ENCODERS + static inline void put_level(PutBitContext *pb, int level){ unsigned int index= level + 3; @@ -105,6 +107,8 @@ static inline void put_level(PutBitContext *pb, int level){ } } +#endif //CONFIG_ENCODERS + static inline int decode_block(ASV1Context *a, DCTELEM block[64]){ int i; @@ -130,6 +134,8 @@ static inline int decode_block(ASV1Context *a, DCTELEM block[64]){ return 0; } +#ifdef CONFIG_ENCODERS + static inline void encode_block(ASV1Context *a, DCTELEM block[64]){ int i; int nc_count=0; @@ -163,6 +169,8 @@ static inline void encode_block(ASV1Context *a, DCTELEM block[64]){ put_bits(&a->pb, ccp_tab[16][1], ccp_tab[16][0]); } +#endif //CONFIG_ENCODERS + static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64]){ int i; @@ -175,6 +183,8 @@ static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64]){ return 0; } +#ifdef CONFIG_ENCODERS + static inline void encode_mb(ASV1Context *a, DCTELEM block[6][64]){ int i; @@ -183,6 +193,8 @@ static inline void encode_mb(ASV1Context *a, DCTELEM block[6][64]){ } } +#endif //CONFIG_ENCODERS + static inline void idct_put(ASV1Context *a, int mb_x, int mb_y){ DCTELEM (*block)[64]= a->block; int linesize= a->picture.linesize[0]; @@ -202,6 +214,8 @@ static inline void idct_put(ASV1Context *a, int mb_x, int mb_y){ } } +#ifdef CONFIG_ENCODERS + static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){ DCTELEM (*block)[64]= a->block; int linesize= a->picture.linesize[0]; @@ -226,6 +240,8 @@ static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){ } } +#endif //CONFIG_ENCODERS + static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) @@ -308,6 +324,8 @@ for(i=0; iavctx->extradata_size; i++){ return (get_bits_count(&a->gb)+31)/32*4; } +#ifdef CONFIG_ENCODERS + static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ ASV1Context * const a = avctx->priv_data; AVFrame *pict = data; @@ -356,6 +374,8 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, return size*4; } +#endif //CONFIG_ENCODERS + static void common_init(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; @@ -396,6 +416,8 @@ static int decode_init(AVCodecContext *avctx){ return 0; } +#ifdef CONFIG_ENCODERS + static int encode_init(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; int i; @@ -419,6 +441,8 @@ static int encode_init(AVCodecContext *avctx){ return 0; } +#endif //CONFIG_ENCODERS + static int decode_end(AVCodecContext *avctx){ ASV1Context * const a = avctx->priv_data; @@ -443,6 +467,8 @@ AVCodec asv1_decoder = { CODEC_CAP_DR1, }; +#ifdef CONFIG_ENCODERS + AVCodec asv1_encoder = { "asv1", CODEC_TYPE_VIDEO, @@ -452,3 +478,5 @@ AVCodec asv1_encoder = { encode_frame, //encode_end, }; + +#endif //CONFIG_ENCODERS