comparison adx.c @ 5863:ad587a64ef52 libavcodec

remove useless initialization to 0 of adx context
author aurel
date Thu, 01 Nov 2007 17:50:05 +0000
parents cf77b8588f15
children 0fc269ea2919
comparison
equal deleted inserted replaced
5862:8983530be918 5863:ad587a64ef52
174 AV_WB32(buf+0x18,0x00000000); 174 AV_WB32(buf+0x18,0x00000000);
175 memcpy(buf+0x1c,"\0\0(c)CRI",8); 175 memcpy(buf+0x1c,"\0\0(c)CRI",8);
176 return 0x20+4; 176 return 0x20+4;
177 } 177 }
178 178
179 static int adx_decode_init(AVCodecContext *avctx);
180 static int adx_encode_init(AVCodecContext *avctx) 179 static int adx_encode_init(AVCodecContext *avctx)
181 { 180 {
182 if (avctx->channels > 2) 181 if (avctx->channels > 2)
183 return -1; /* only stereo or mono =) */ 182 return -1; /* only stereo or mono =) */
184 avctx->frame_size = 32; 183 avctx->frame_size = 32;
187 avctx->coded_frame->key_frame= 1; 186 avctx->coded_frame->key_frame= 1;
188 187
189 // avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32; 188 // avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32;
190 189
191 av_log(avctx, AV_LOG_DEBUG, "adx encode init\n"); 190 av_log(avctx, AV_LOG_DEBUG, "adx encode init\n");
192 adx_decode_init(avctx);
193 191
194 return 0; 192 return 0;
195 } 193 }
196 194
197 static int adx_encode_close(AVCodecContext *avctx) 195 static int adx_encode_close(AVCodecContext *avctx)
280 avctx->channels = channels; 278 avctx->channels = channels;
281 avctx->bit_rate = freq*channels*18*8/32; 279 avctx->bit_rate = freq*channels*18*8/32;
282 // avctx->frame_size = 18*channels; 280 // avctx->frame_size = 18*channels;
283 281
284 return offset; 282 return offset;
285 }
286
287 static int adx_decode_init(AVCodecContext * avctx)
288 {
289 ADXContext *c = avctx->priv_data;
290
291 // printf("adx_decode_init\n"); fflush(stdout);
292 c->prev[0].s1 = 0;
293 c->prev[0].s2 = 0;
294 c->prev[1].s1 = 0;
295 c->prev[1].s2 = 0;
296 c->header_parsed = 0;
297 c->in_temp = 0;
298 return 0;
299 } 283 }
300 284
301 #if 0 285 #if 0
302 static void dump(unsigned char *buf,size_t len) 286 static void dump(unsigned char *buf,size_t len)
303 { 287 {
389 AVCodec adpcm_adx_decoder = { 373 AVCodec adpcm_adx_decoder = {
390 "adpcm_adx", 374 "adpcm_adx",
391 CODEC_TYPE_AUDIO, 375 CODEC_TYPE_AUDIO,
392 CODEC_ID_ADPCM_ADX, 376 CODEC_ID_ADPCM_ADX,
393 sizeof(ADXContext), 377 sizeof(ADXContext),
394 adx_decode_init, 378 NULL,
395 NULL, 379 NULL,
396 NULL, 380 NULL,
397 adx_decode_frame, 381 adx_decode_frame,
398 }; 382 };
399 383