Mercurial > libavcodec.hg
comparison cljr.c @ 7784:e3f2d90a2295 libavcodec
Disable encoders by undefining CONFIG_FOO_ENCODER once instead of littering
the code with preprocessor directives.
author | diego |
---|---|
date | Wed, 03 Sep 2008 12:43:18 +0000 |
parents | 12a25666f1e4 |
children | 7a463923ecd1 |
comparison
equal
deleted
inserted
replaced
7783:12a25666f1e4 | 7784:e3f2d90a2295 |
---|---|
25 */ | 25 */ |
26 | 26 |
27 #include "avcodec.h" | 27 #include "avcodec.h" |
28 #include "dsputil.h" | 28 #include "dsputil.h" |
29 #include "bitstream.h" | 29 #include "bitstream.h" |
30 | |
31 /* Disable the encoder. */ | |
32 #undef CONFIG_CLJR_ENCODER | |
30 | 33 |
31 typedef struct CLJRContext{ | 34 typedef struct CLJRContext{ |
32 AVCodecContext *avctx; | 35 AVCodecContext *avctx; |
33 AVFrame picture; | 36 AVFrame picture; |
34 int delta[16]; | 37 int delta[16]; |
79 emms_c(); | 82 emms_c(); |
80 | 83 |
81 return buf_size; | 84 return buf_size; |
82 } | 85 } |
83 | 86 |
84 #if 0 | |
85 #ifdef CONFIG_CLJR_ENCODER | 87 #ifdef CONFIG_CLJR_ENCODER |
86 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ | 88 static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data){ |
87 CLJRContext * const a = avctx->priv_data; | 89 CLJRContext * const a = avctx->priv_data; |
88 AVFrame *pict = data; | 90 AVFrame *pict = data; |
89 AVFrame * const p= (AVFrame*)&a->picture; | 91 AVFrame * const p= (AVFrame*)&a->picture; |
103 size= get_bit_count(&a->pb)/32; | 105 size= get_bit_count(&a->pb)/32; |
104 | 106 |
105 return size*4; | 107 return size*4; |
106 } | 108 } |
107 #endif | 109 #endif |
108 #endif | |
109 | 110 |
110 static av_cold void common_init(AVCodecContext *avctx){ | 111 static av_cold void common_init(AVCodecContext *avctx){ |
111 CLJRContext * const a = avctx->priv_data; | 112 CLJRContext * const a = avctx->priv_data; |
112 | 113 |
113 avctx->coded_frame= (AVFrame*)&a->picture; | 114 avctx->coded_frame= (AVFrame*)&a->picture; |
121 avctx->pix_fmt= PIX_FMT_YUV411P; | 122 avctx->pix_fmt= PIX_FMT_YUV411P; |
122 | 123 |
123 return 0; | 124 return 0; |
124 } | 125 } |
125 | 126 |
126 #if 0 | |
127 #ifdef CONFIG_CLJR_ENCODER | 127 #ifdef CONFIG_CLJR_ENCODER |
128 static av_cold int encode_init(AVCodecContext *avctx){ | 128 static av_cold int encode_init(AVCodecContext *avctx){ |
129 | 129 |
130 common_init(avctx); | 130 common_init(avctx); |
131 | 131 |
132 return 0; | 132 return 0; |
133 } | 133 } |
134 #endif | |
135 #endif | 134 #endif |
136 | 135 |
137 AVCodec cljr_decoder = { | 136 AVCodec cljr_decoder = { |
138 "cljr", | 137 "cljr", |
139 CODEC_TYPE_VIDEO, | 138 CODEC_TYPE_VIDEO, |
144 NULL, | 143 NULL, |
145 decode_frame, | 144 decode_frame, |
146 CODEC_CAP_DR1, | 145 CODEC_CAP_DR1, |
147 .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), | 146 .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), |
148 }; | 147 }; |
149 #if 0 | 148 |
150 #ifdef CONFIG_CLJR_ENCODER | 149 #ifdef CONFIG_CLJR_ENCODER |
151 AVCodec cljr_encoder = { | 150 AVCodec cljr_encoder = { |
152 "cljr", | 151 "cljr", |
153 CODEC_TYPE_VIDEO, | 152 CODEC_TYPE_VIDEO, |
154 CODEC_ID_cljr, | 153 CODEC_ID_cljr, |
157 encode_frame, | 156 encode_frame, |
158 //encode_end, | 157 //encode_end, |
159 .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), | 158 .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), |
160 }; | 159 }; |
161 #endif | 160 #endif |
162 #endif |