*/
/**
- * @file mpc7.c Musepack SV7 decoder
+ * @file libavcodec/mpc7.c Musepack SV7 decoder
* MPEG Audio Layer 1/2 -like codec with frames of 1152 samples
* divided into 32 subbands.
*/
+#include "libavutil/lfg.h"
#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
-#include "random.h"
-
-#ifdef CONFIG_MPEGAUDIO_HP
-#define USE_HIGHPRECISION
-#endif
#include "mpegaudio.h"
#include "mpc.h"
return -1;
}
memset(c->oldDSCF, 0, sizeof(c->oldDSCF));
- av_init_random(0xDEADBEEF, &c->rnd);
+ av_lfg_init(&c->rnd, 0xDEADBEEF);
dsputil_init(&c->dsp, avctx);
c->dsp.bswap_buf((uint32_t*)buf, (const uint32_t*)avctx->extradata, 4);
ff_mpc_init();
}
}
vlc_initialized = 1;
+ avctx->sample_fmt = SAMPLE_FMT_S16;
+ avctx->channel_layout = (avctx->channels==2) ? CH_LAYOUT_STEREO : CH_LAYOUT_MONO;
return 0;
}
switch(idx){
case -1:
for(i = 0; i < SAMPLES_PER_BAND; i++){
- *dst++ = (av_random(&c->rnd) & 0x3FC) - 510;
+ *dst++ = (av_lfg_get(&c->rnd) & 0x3FC) - 510;
}
break;
case 1:
static int mpc7_decode_frame(AVCodecContext * avctx,
void *data, int *data_size,
- const uint8_t * buf, int buf_size)
+ AVPacket *avpkt)
{
+ const uint8_t *buf = avpkt->data;
+ int buf_size = avpkt->size;
MPCContext *c = avctx->priv_data;
GetBitContext gb;
uint8_t *bits;
NULL,
mpc7_decode_frame,
.flush = mpc7_decode_flush,
- .long_name = "Musepack SV7",
+ .long_name = NULL_IF_CONFIG_SMALL("Musepack SV7"),
};