*/
/**
- * @file shorten.c
+ * @file libavcodec/shorten.c
* Shorten decoder
* @author Jeff Muizelaar
*
#define DEBUG
#include <limits.h>
#include "avcodec.h"
-#include "bitstream.h"
+#include "get_bits.h"
#include "golomb.h"
#define MAX_CHANNELS 8
avctx->sample_rate = get_le32(&hb);
avctx->bit_rate = get_le32(&hb) * 8;
avctx->block_align = get_le16(&hb);
- avctx->bits_per_sample = get_le16(&hb);
+ avctx->bits_per_coded_sample = get_le16(&hb);
- if (avctx->bits_per_sample != 16) {
+ if (avctx->bits_per_coded_sample != 16) {
av_log(avctx, AV_LOG_ERROR, "unsupported number of bits per sample\n");
return -1;
}
static int shorten_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;
ShortenContext *s = avctx->priv_data;
int i, input_buf_size = 0;
int16_t *samples = data;
{
int maxnlpc = 0;
/* shorten signature */
- if (get_bits_long(&s->gb, 32) != bswap_32(ff_get_fourcc("ajkg"))) {
+ if (get_bits_long(&s->gb, 32) != AV_RB32("ajkg")) {
av_log(s->avctx, AV_LOG_ERROR, "missing shorten magic 'ajkg'\n");
return -1;
}