X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2F4xm.c;h=b6a97aa187763e41d19e99979f14e7f774da55c7;hb=81a646140f80c3e15c1e68883a5ecfb9b2bc8a6a;hp=cc0bcd4f86bf5ad61311d99adcb19d9e150c5dc5;hpb=b97e0d7fa226a2bd3b0b99a03ce9b8703c2d18d1;p=ffmpeg diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index cc0bcd4f86b..b6a97aa1877 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -20,7 +20,7 @@ */ /** - * @file libavcodec/4xm.c + * @file * 4XM codec. */ @@ -137,7 +137,7 @@ typedef struct FourXContext{ int mv[256]; VLC pre_vlc; int last_dc; - DECLARE_ALIGNED_16(DCTELEM, block[6][64]); + DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; void *bitstream_buffer; unsigned int bitstream_buffer_size; int version; @@ -333,16 +333,16 @@ static void decode_p_block(FourXContext *f, uint16_t *dst, uint16_t *src, int lo av_log(f->avctx, AV_LOG_ERROR, "mv out of pic\n"); return; } - mcdc(dst, src, log2w, h, stride, 1, le2me_16(*f->wordstream++)); + mcdc(dst, src, log2w, h, stride, 1, av_le2ne16(*f->wordstream++)); }else if(code == 5){ - mcdc(dst, src, log2w, h, stride, 0, le2me_16(*f->wordstream++)); + mcdc(dst, src, log2w, h, stride, 0, av_le2ne16(*f->wordstream++)); }else if(code == 6){ if(log2w){ - dst[0] = le2me_16(*f->wordstream++); - dst[1] = le2me_16(*f->wordstream++); + dst[0] = av_le2ne16(*f->wordstream++); + dst[1] = av_le2ne16(*f->wordstream++); }else{ - dst[0 ] = le2me_16(*f->wordstream++); - dst[stride] = le2me_16(*f->wordstream++); + dst[0 ] = av_le2ne16(*f->wordstream++); + dst[stride] = av_le2ne16(*f->wordstream++); } } } @@ -815,7 +815,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ init_vlcs(f); if(f->version>2) avctx->pix_fmt= PIX_FMT_RGB565; - else avctx->pix_fmt= PIX_FMT_RGB555; + else avctx->pix_fmt= PIX_FMT_BGR555; return 0; } @@ -832,13 +832,17 @@ static av_cold int decode_end(AVCodecContext *avctx){ f->cfrm[i].allocated_size= 0; } free_vlc(&f->pre_vlc); + if(f->current_picture.data[0]) + avctx->release_buffer(avctx, &f->current_picture); + if(f->last_picture.data[0]) + avctx->release_buffer(avctx, &f->last_picture); return 0; } AVCodec fourxm_decoder = { "4xm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_4XM, sizeof(FourXContext), decode_init,