]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/4xm.c
remove impossible condition from msrle_decode_pal4()
[ffmpeg] / libavcodec / 4xm.c
index 9bd026b5a246cd8a2530ef133ec5c3b60962258e..b6a97aa187763e41d19e99979f14e7f774da55c7 100644 (file)
@@ -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_8(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,