static int adx_decode_frame(AVCodecContext *avctx,

			    void *data, int *data_size,

			    const uint8_t *buf0, int buf_size)

{

	ADXContext *c = avctx->priv_data;

	short *samples = data;

	const uint8_t *buf = buf0;

	int rest = buf_size;



	if (!c->header_parsed) {

		int hdrsize = adx_decode_header(avctx,buf,rest);

		if (hdrsize==0) return -1;

		c->header_parsed = 1;

		buf  += hdrsize;

		rest -= hdrsize;

	}



	if (c->in_temp) {

		int copysize = 18*avctx->channels - c->in_temp;

		memcpy(c->dec_temp+c->in_temp,buf,copysize);

		rest -= copysize;

		buf  += copysize;

		if (avctx->channels==1) {

			adx_decode(samples,c->dec_temp,c->prev);

			samples += 32;

		} else {

			adx_decode_stereo(samples,c->dec_temp,c->prev);

			samples += 32*2;

		}

	}

	//

	if (avctx->channels==1) {

		while(rest>=18) {

			adx_decode(samples,buf,c->prev);

			rest-=18;

			buf+=18;

			samples+=32;

		}

	} else {

		while(rest>=18*2) {

			adx_decode_stereo(samples,buf,c->prev);

			rest-=18*2;

			buf+=18*2;

			samples+=32*2;

		}

	}

	//

	c->in_temp = rest;

	if (rest) {

		memcpy(c->dec_temp,buf,rest);

		buf+=rest;

	}

	*data_size = (uint8_t*)samples - (uint8_t*)data;

//	printf("%d:%d ",buf-buf0,*data_size); fflush(stdout);

	return buf-buf0;

}

static int adx_decode_frame(AVCodecContext *avctx,

			    void *data, int *data_size,

			    const uint8_t *buf0, int buf_size)

{

	ADXContext *c = avctx->priv_data;

	short *samples = data;

	const uint8_t *buf = buf0;

	int rest = buf_size;



	if (!c->header_parsed) {

		int hdrsize = adx_decode_header(avctx,buf,rest);

		if (hdrsize==0) return -1;

		c->header_parsed = 1;

		buf  += hdrsize;

		rest -= hdrsize;

	}



	if (c->in_temp) {

		int copysize = 18*avctx->channels - c->in_temp;

		memcpy(c->dec_temp+c->in_temp,buf,copysize);

		rest -= copysize;

		buf  += copysize;

		if (avctx->channels==1) {

			adx_decode(samples,c->dec_temp,c->prev);

			samples += 32;

		} else {

			adx_decode_stereo(samples,c->dec_temp,c->prev);

			samples += 32*2;

		}

	}

	

	if (avctx->channels==1) {

		while(rest>=18) {

			adx_decode(samples,buf,c->prev);

			rest-=18;

			buf+=18;

			samples+=32;

		}

	} else {

		while(rest>=18*2) {

			adx_decode_stereo(samples,buf,c->prev);

			rest-=18*2;

			buf+=18*2;

			samples+=32*2;

		}

	}

	

	c->in_temp = rest;

	if (rest) {

		memcpy(c->dec_temp,buf,rest);

		buf+=rest;

	}

	*data_size = (uint8_t*)samples - (uint8_t*)data;

	printf("%d:%d ",buf-buf0,*data_size); fflush(stdout);

	return buf-buf0;

}

	ADXContext *c = avctx->priv_data; 	if (!c->header_parsed) { 		c->header_parsed = 1; 	if (avctx->channels==1) { 			samples+=32; 	} else { 			samples+=32*2; 	ADXContext *c = avctx->priv_data; 			    void *data, int *data_size, 			    const uint8_t *buf0, int buf_size) 	ADXContext *c = avctx->priv_data; 	short *samples = data; 	const uint8_t *buf = buf0; 	int rest = buf_size; 	if (!c->header_parsed) { 		int hdrsize = adx_decode_header(avctx,buf,rest); 		if (hdrsize==0) return -1; 		c->header_parsed = 1; 		buf  += hdrsize; 		rest -= hdrsize; 	if (c->in_temp) { 		int copysize = 18*avctx->channels - c->in_temp; 		memcpy(c->dec_temp+c->in_temp,buf,copysize); 		rest -= copysize; 		buf  += copysize; 		if (avctx->channels==1) { 			adx_decode(samples,c->dec_temp,c->prev); 			samples += 32; 		} else { 			adx_decode_stereo(samples,c->dec_temp,c->prev); 			samples += 32*2; 	if (avctx->channels==1) { 		while(rest>=18) { 			adx_decode(samples,buf,c->prev); 			rest-=18; 			buf+=18; 			samples+=32; 	} else { 		while(rest>=18*2) { 			adx_decode_stereo(samples,buf,c->prev); 			rest-=18*2; 			buf+=18*2; 			samples+=32*2; 	c->in_temp = rest; 	if (rest) { 		memcpy(c->dec_temp,buf,rest); 		buf+=rest; 	*data_size = (uint8_t*)samples - (uint8_t*)data; 	return buf-buf0;
static int FUNC_0(AVCodecContext *VAR_0,

			    void *VAR_1, int *VAR_2,

			    const uint8_t *VAR_3, int VAR_4)

{

	ADXContext *c = VAR_0->priv_data;

	short *VAR_5 = VAR_1;

	const uint8_t *VAR_6 = VAR_3;

	int VAR_7 = VAR_4;



	if (!c->header_parsed) {

		int VAR_8 = adx_decode_header(VAR_0,VAR_6,VAR_7);

		if (VAR_8==0) return -1;

		c->header_parsed = 1;

		VAR_6  += VAR_8;

		VAR_7 -= VAR_8;

	}



	if (c->in_temp) {

		int VAR_9 = 18*VAR_0->channels - c->in_temp;

		memcpy(c->dec_temp+c->in_temp,VAR_6,VAR_9);

		VAR_7 -= VAR_9;

		VAR_6  += VAR_9;

		if (VAR_0->channels==1) {

			adx_decode(VAR_5,c->dec_temp,c->prev);

			VAR_5 += 32;

		} else {

			adx_decode_stereo(VAR_5,c->dec_temp,c->prev);

			VAR_5 += 32*2;

		}

	}

	

	if (VAR_0->channels==1) {

		while(VAR_7>=18) {

			adx_decode(VAR_5,VAR_6,c->prev);

			VAR_7-=18;

			VAR_6+=18;

			VAR_5+=32;

		}

	} else {

		while(VAR_7>=18*2) {

			adx_decode_stereo(VAR_5,VAR_6,c->prev);

			VAR_7-=18*2;

			VAR_6+=18*2;

			VAR_5+=32*2;

		}

	}

	

	c->in_temp = VAR_7;

	if (VAR_7) {

		memcpy(c->dec_temp,VAR_6,VAR_7);

		VAR_6+=VAR_7;

	}

	*VAR_2 = (uint8_t*)VAR_5 - (uint8_t*)VAR_1;

	printf("%d:%d ",VAR_6-VAR_3,*VAR_2); fflush(stdout);

	return VAR_6-VAR_3;

}

static int FUNC_0(AVCodecContext *VAR_0,
void *VAR_1, int *VAR_2,
const uint8_t *VAR_3, int VAR_4)
{ ADXContext *c = VAR_0->priv_data; short *VAR_5 = VAR_1; const uint8_t *VAR_6 = VAR_3; int VAR_7 = VAR_4; if (!c->header_parsed) { int VAR_8 = adx_decode_header(VAR_0,VAR_6,VAR_7); if (VAR_8==0) return -1; c->header_parsed = 1; VAR_6  += VAR_8; VAR_7 -= VAR_8; } if (c->in_temp) { int VAR_9 = 18*VAR_0->channels - c->in_temp; memcpy(c->dec_temp+c->in_temp,VAR_6,VAR_9); VAR_7 -= VAR_9; VAR_6  += VAR_9; if (VAR_0->channels==1) { adx_decode(VAR_5,c->dec_temp,c->prev); VAR_5 += 32; } else { adx_decode_stereo(VAR_5,c->dec_temp,c->prev); VAR_5 += 32*2; } } if (VAR_0->channels==1) { while(VAR_7>=18) { adx_decode(VAR_5,VAR_6,c->prev); VAR_7-=18; VAR_6+=18; VAR_5+=32; } } else { while(VAR_7>=18*2) { adx_decode_stereo(VAR_5,VAR_6,c->prev); VAR_7-=18*2; VAR_6+=18*2; VAR_5+=32*2; } } c->in_temp = VAR_7; if (VAR_7) { memcpy(c->dec_temp,VAR_6,VAR_7); VAR_6+=VAR_7; } *VAR_2 = (uint8_t*)VAR_5 - (uint8_t*)VAR_1; printf("%d:%d ",VAR_6-VAR_3,*VAR_2); fflush(stdout); return VAR_6-VAR_3; }