Index: apps/codecs/libcook/cook.h =================================================================== --- apps/codecs/libcook/cook.h (revision 21938) +++ apps/codecs/libcook/cook.h (working copy) @@ -96,6 +96,6 @@ int cook_decode_init(RMContext *rmctx, COOKContext *q); int cook_decode_frame(RMContext *rmctx,COOKContext *q, - int16_t *outbuffer, int *data_size, + int32_t *outbuffer, int *data_size, const uint8_t *inbuffer, int buf_size); #endif /*_COOK_H */ Index: apps/codecs/libcook/cook_fixpoint.h =================================================================== --- apps/codecs/libcook/cook_fixpoint.h (revision 21940) +++ apps/codecs/libcook/cook_fixpoint.h (working copy) @@ -336,19 +336,17 @@ /** - * Final converion from floating point values to - * signed, 16 bit sound samples. Round and clip. + * Interleave mono channel into a stereo channel * * @param q pointer to the COOKContext * @param out pointer to the output buffer * @param chan 0: left or single channel, 1: right channel */ -static inline void output_math(COOKContext *q, int16_t *out, int chan) +static inline void output_math(COOKContext *q, int32_t *out, int chan) { int j; for (j = 0; j < q->samples_per_channel; j++) { - out[chan + q->nb_channels * j] = - av_clip(fixp_pow2(q->mono_mdct_output[j], -11), -32768, 32767); + out[chan + q->nb_channels * j] = (q->mono_mdct_output[j]); } } Index: apps/codecs/libcook/cook.c =================================================================== --- apps/codecs/libcook/cook.c (revision 21938) +++ apps/codecs/libcook/cook.c (working copy) @@ -59,7 +59,7 @@ #define SUBBAND_SIZE 20 #define MAX_SUBPACKETS 5 -//#define COOKDEBUG +#define COOKDEBUG #ifndef COOKDEBUG #undef DEBUGF #define DEBUGF(...) @@ -584,7 +584,7 @@ static inline void mlt_compensate_output(COOKContext *q, REAL_T *decode_buffer, cook_gains *gains, REAL_T *previous_buffer, - int16_t *out, int chan) + int32_t *out, int chan) { REAL_T *buffer = q->mono_mdct_output; int i; @@ -620,7 +620,7 @@ static int decode_subpacket(COOKContext *q, const uint8_t *inbuffer, - int sub_packet_size, int16_t *outbuffer) { + int sub_packet_size, int32_t *outbuffer) { /* packet dump */ // for (i=0 ; imono_previous_buffer2, outbuffer, 1); } } - return q->samples_per_frame * sizeof(int16_t); + return q->samples_per_frame * sizeof(int32_t); } @@ -663,7 +663,7 @@ */ int cook_decode_frame(RMContext *rmctx,COOKContext *q, - int16_t *outbuffer, int *data_size, + int32_t *outbuffer, int *data_size, const uint8_t *inbuffer, int buf_size) { //COOKContext *q = avctx->priv_data; //COOKContext *q; Index: apps/codecs/cook.c =================================================================== --- apps/codecs/cook.c (revision 21938) +++ apps/codecs/cook.c (working copy) @@ -43,7 +43,7 @@ static size_t buff_size; int datasize, res, consumed, i, time_offset; uint8_t *bit_buffer; - int16_t outbuf[2048] __attribute__((aligned(32))); + int32_t outbuf[2048] ; uint16_t fs,sps,h; uint32_t packet_count; int scrambling_unit_size, num_units; @@ -64,7 +64,7 @@ init_rm(&rmctx); ci->configure(DSP_SET_FREQUENCY, ci->id3->frequency); - ci->configure(DSP_SET_SAMPLE_DEPTH, 16); + ci->configure(DSP_SET_SAMPLE_DEPTH, 27); ci->configure(DSP_SET_STEREO_MODE, rmctx.nb_channels == 1 ? STEREO_MONO : STEREO_INTERLEAVED);