]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavcodec/svq1dec.c
Move ALIGN macro to libavutil/common.h and use it in various places
[frescor/ffmpeg.git] / libavcodec / svq1dec.c
index 7fef10bb99bd62883e23a461f5b849fd9dba3ac5..3d7749d4e4b8de305a604fceb1375563bbfe3eed 100644 (file)
@@ -642,8 +642,10 @@ static int svq1_decode_frame_header (GetBitContext *bitbuf,MpegEncContext *s) {
 
 static int svq1_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;
   MpegEncContext *s=avctx->priv_data;
   uint8_t        *current, *previous;
   int             result, i, x, y, width, height;
@@ -694,13 +696,13 @@ static int svq1_decode_frame(AVCodecContext *avctx,
   for (i=0; i < 3; i++) {
     int linesize;
     if (i == 0) {
-      width  = (s->width+15)&~15;
-      height = (s->height+15)&~15;
+      width  = FFALIGN(s->width, 16);
+      height = FFALIGN(s->height, 16);
       linesize= s->linesize;
     } else {
       if(s->flags&CODEC_FLAG_GRAY) break;
-      width  = (s->width/4+15)&~15;
-      height = (s->height/4+15)&~15;
+      width  = FFALIGN(s->width/4, 16);
+      height = FFALIGN(s->height/4, 16);
       linesize= s->uvlinesize;
     }
 
@@ -780,28 +782,28 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx)
 
     init_vlc(&svq1_block_type, 2, 4,
         &ff_svq1_block_type_vlc[0][1], 2, 1,
-        &ff_svq1_block_type_vlc[0][0], 2, 1, 1);
+        &ff_svq1_block_type_vlc[0][0], 2, 1, INIT_VLC_USE_STATIC);
 
     init_vlc(&svq1_motion_component, 7, 33,
         &mvtab[0][1], 2, 1,
-        &mvtab[0][0], 2, 1, 1);
+        &mvtab[0][0], 2, 1, INIT_VLC_USE_STATIC);
 
     for (i = 0; i < 6; i++) {
         init_vlc(&svq1_intra_multistage[i], 3, 8,
             &ff_svq1_intra_multistage_vlc[i][0][1], 2, 1,
-            &ff_svq1_intra_multistage_vlc[i][0][0], 2, 1, 1);
+            &ff_svq1_intra_multistage_vlc[i][0][0], 2, 1, INIT_VLC_USE_STATIC);
         init_vlc(&svq1_inter_multistage[i], 3, 8,
             &ff_svq1_inter_multistage_vlc[i][0][1], 2, 1,
-            &ff_svq1_inter_multistage_vlc[i][0][0], 2, 1, 1);
+            &ff_svq1_inter_multistage_vlc[i][0][0], 2, 1, INIT_VLC_USE_STATIC);
     }
 
     init_vlc(&svq1_intra_mean, 8, 256,
         &ff_svq1_intra_mean_vlc[0][1], 4, 2,
-        &ff_svq1_intra_mean_vlc[0][0], 4, 2, 1);
+        &ff_svq1_intra_mean_vlc[0][0], 4, 2, INIT_VLC_USE_STATIC);
 
     init_vlc(&svq1_inter_mean, 9, 512,
         &ff_svq1_inter_mean_vlc[0][1], 4, 2,
-        &ff_svq1_inter_mean_vlc[0][0], 4, 2, 1);
+        &ff_svq1_inter_mean_vlc[0][0], 4, 2, INIT_VLC_USE_STATIC);
 
     return 0;
 }