static int adx_encode_frame(AVCodecContext *avctx,

			    unsigned char *frame, int buf_size, const void *data)

{

	ADXContext *c = avctx->priv_data;

	const short *samples = data;

	unsigned char *dst = frame;

	int rest = avctx->frame_size;



/*

	input data size =

	ffmpeg.c: do_audio_out()

	frame_bytes = enc->frame_size * 2 * enc->channels;

*/



//	printf("sz=%d ",buf_size); fflush(stdout);

	if (!c->header_parsed) {

		int hdrsize = adx_encode_header(avctx,dst,buf_size);

		dst+=hdrsize;

		c->header_parsed = 1;

	}



	if (avctx->channels==1) {

		while(rest>=32) {

			adx_encode(dst,samples,c->prev);

			dst+=18;

			samples+=32;

			rest-=32;

		}

	} else {

		while(rest>=32*2) {

			short tmpbuf[32*2];

			int i;



			for(i=0;i<32;i++) {

				tmpbuf[i] = samples[i*2];

				tmpbuf[i+32] = samples[i*2+1];

			}



			adx_encode(dst,tmpbuf,c->prev);

			adx_encode(dst+18,tmpbuf+32,c->prev+1);

			dst+=18*2;

			samples+=32*2;

			rest-=32*2;

		}

	}

	return dst-frame;

}

static int adx_encode_frame(AVCodecContext *avctx,

			    unsigned char *frame, int buf_size, const void *data)

{

	ADXContext *c = avctx->priv_data;

	const short *samples = data;

	unsigned char *dst = frame;

	int rest = avctx->frame_size;

















	if (!c->header_parsed) {

		int hdrsize = adx_encode_header(avctx,dst,buf_size);

		dst+=hdrsize;

		c->header_parsed = 1;

	}



	if (avctx->channels==1) {

		while(rest>=32) {

			adx_encode(dst,samples,c->prev);

			dst+=18;

			samples+=32;

			rest-=32;

		}

	} else {

		while(rest>=32*2) {

			short tmpbuf[32*2];

			int i;



			for(i=0;i<32;i++) {

				tmpbuf[i] = samples[i*2];

				tmpbuf[i+32] = samples[i*2+1];

			}



			adx_encode(dst,tmpbuf,c->prev);

			adx_encode(dst+18,tmpbuf+32,c->prev+1);

			dst+=18*2;

			samples+=32*2;

			rest-=32*2;

		}

	}

	return dst-frame;

}

			    unsigned char *frame, int buf_size, const void *data) 	ADXContext *c = avctx->priv_data; 	const short *samples = data; 	unsigned char *dst = frame; 	int rest = avctx->frame_size; 	if (!c->header_parsed) { 		int hdrsize = adx_encode_header(avctx,dst,buf_size); 		dst+=hdrsize; 		c->header_parsed = 1; 	if (avctx->channels==1) { 		while(rest>=32) { 			adx_encode(dst,samples,c->prev); 			dst+=18; 			samples+=32; 			rest-=32; 	} else { 		while(rest>=32*2) { 			short tmpbuf[32*2]; 			int i; 			for(i=0;i<32;i++) { 				tmpbuf[i] = samples[i*2]; 				tmpbuf[i+32] = samples[i*2+1]; 			adx_encode(dst,tmpbuf,c->prev); 			adx_encode(dst+18,tmpbuf+32,c->prev+1); 			dst+=18*2; 			samples+=32*2; 			rest-=32*2; 	return dst-frame; 	ADXContext *c = avctx->priv_data; 	ADXContext *c = avctx->priv_data; 	if (!c->header_parsed) { 		c->header_parsed = 1; 	if (avctx->channels==1) { 			samples+=32; 	} else { 			samples+=32*2;
static int FUNC_0(AVCodecContext *VAR_0,

			    unsigned char *VAR_1, int VAR_2, const void *VAR_3)

{

	ADXContext *c = VAR_0->priv_data;

	const short *VAR_4 = VAR_3;

	unsigned char *VAR_5 = VAR_1;

	int VAR_6 = VAR_0->frame_size;

















	if (!c->header_parsed) {

		int VAR_7 = adx_encode_header(VAR_0,VAR_5,VAR_2);

		VAR_5+=VAR_7;

		c->header_parsed = 1;

	}



	if (VAR_0->channels==1) {

		while(VAR_6>=32) {

			adx_encode(VAR_5,VAR_4,c->prev);

			VAR_5+=18;

			VAR_4+=32;

			VAR_6-=32;

		}

	} else {

		while(VAR_6>=32*2) {

			short VAR_8[32*2];

			int VAR_9;



			for(VAR_9=0;VAR_9<32;VAR_9++) {

				VAR_8[VAR_9] = VAR_4[VAR_9*2];

				VAR_8[VAR_9+32] = VAR_4[VAR_9*2+1];

			}



			adx_encode(VAR_5,VAR_8,c->prev);

			adx_encode(VAR_5+18,VAR_8+32,c->prev+1);

			VAR_5+=18*2;

			VAR_4+=32*2;

			VAR_6-=32*2;

		}

	}

	return VAR_5-VAR_1;

}

static int FUNC_0(AVCodecContext *VAR_0,
unsigned char *VAR_1, int VAR_2, const void *VAR_3)
{ ADXContext *c = VAR_0->priv_data; const short *VAR_4 = VAR_3; unsigned char *VAR_5 = VAR_1; int VAR_6 = VAR_0->frame_size; if (!c->header_parsed) { int VAR_7 = adx_encode_header(VAR_0,VAR_5,VAR_2); VAR_5+=VAR_7; c->header_parsed = 1; } if (VAR_0->channels==1) { while(VAR_6>=32) { adx_encode(VAR_5,VAR_4,c->prev); VAR_5+=18; VAR_4+=32; VAR_6-=32; } } else { while(VAR_6>=32*2) { short VAR_8[32*2]; int VAR_9; for(VAR_9=0;VAR_9<32;VAR_9++) { VAR_8[VAR_9] = VAR_4[VAR_9*2]; VAR_8[VAR_9+32] = VAR_4[VAR_9*2+1]; } adx_encode(VAR_5,VAR_8,c->prev); adx_encode(VAR_5+18,VAR_8+32,c->prev+1); VAR_5+=18*2; VAR_4+=32*2; VAR_6-=32*2; } } return VAR_5-VAR_1; }