GetBitContext gb;
int mmap_size, mclr_size, full_size, type_size;
- mmap_size = LE_32(smk->avctx->extradata);
- mclr_size = LE_32(smk->avctx->extradata + 4);
- full_size = LE_32(smk->avctx->extradata + 8);
- type_size = LE_32(smk->avctx->extradata + 12);
+ mmap_size = AV_RL32(smk->avctx->extradata);
+ mclr_size = AV_RL32(smk->avctx->extradata + 4);
+ full_size = AV_RL32(smk->avctx->extradata + 8);
+ type_size = AV_RL32(smk->avctx->extradata + 12);
init_get_bits(&gb, smk->avctx->extradata + 16, (smk->avctx->extradata_size - 16) * 8);
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
{
- SmackVContext * const smk = (SmackVContext *)avctx->priv_data;
+ SmackVContext * const smk = avctx->priv_data;
uint8_t *out;
uint32_t *pal;
GetBitContext gb;
*/
static int decode_init(AVCodecContext *avctx)
{
- SmackVContext * const c = (SmackVContext *)avctx->priv_data;
+ SmackVContext * const c = avctx->priv_data;
c->avctx = avctx;
- avctx->has_b_frames = 0;
c->pic.data[0] = NULL;
*/
static int decode_end(AVCodecContext *avctx)
{
- SmackVContext * const smk = (SmackVContext *)avctx->priv_data;
+ SmackVContext * const smk = avctx->priv_data;
av_freep(&smk->mmap_tbl);
av_freep(&smk->mclr_tbl);
int bits, stereo;
int pred[2] = {0, 0};
- unp_size = LE_32(buf);
+ unp_size = AV_RL32(buf);
init_get_bits(&gb, buf + 4, (buf_size - 4) * 8);
}
}
if(bits) { //decode 16-bit data
- pred[0] = get_bits(&gb, 8);
- pred[0] |= get_bits(&gb, 8);
- *samples++ = pred[0];
- if(stereo) {
- pred[1] = get_bits(&gb, 8);
- pred[1] |= get_bits(&gb, 8);
- *samples++ = pred[1];
- }
+ for(i = stereo; i >= 0; i--)
+ pred[i] = bswap_16(get_bits(&gb, 16));
+ for(i = 0; i < stereo; i++)
+ *samples++ = pred[i];
for(i = 0; i < unp_size / 2; i++) {
if(i & stereo) {
if(vlc[2].table)
}
}
} else { //8-bit data
- pred[0] = get_bits(&gb, 8);
- *samples++ = (pred[0] - 0x80) << 8;
- if(stereo) {
- pred[1] = get_bits(&gb, 8);
- *samples++ = (pred[1] - 0x80) << 8;
- }
+ for(i = stereo; i >= 0; i--)
+ pred[i] = get_bits(&gb, 8);
+ for(i = 0; i < stereo; i++)
+ *samples++ = (pred[i] - 0x80) << 8;
for(i = 0; i < unp_size; i++) {
if(i & stereo){
if(vlc[1].table)