fix identifier to fix compilation
[ffmpeg.git] / libavcodec / wmv2.c
index 1097b7c..ea4f407 100644 (file)
@@ -55,8 +55,8 @@ typedef struct Wmv2Context{
 static void wmv2_common_init(Wmv2Context * w){
     MpegEncContext * const s= &w->s;
         
-    ff_init_scantable(s, &w->abt_scantable[0], wmv2_scantableA);
-    ff_init_scantable(s, &w->abt_scantable[1], wmv2_scantableB);
+    ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[0], wmv2_scantableA);
+    ff_init_scantable(s->dsp.idct_permutation, &w->abt_scantable[1], wmv2_scantableB);
 }
 
 static int encode_ext_header(Wmv2Context *w){
@@ -349,7 +349,7 @@ static int decode_ext_header(Wmv2Context *w){
 int ff_wmv2_decode_picture_header(MpegEncContext * s)
 {
     Wmv2Context * const w= (Wmv2Context*)s;
-    int code, i;
+    int code;
 
 #if 0
 {
@@ -370,6 +370,15 @@ return -1;
         printf("I7:%X/\n", code);
     }
     s->qscale = get_bits(&s->gb, 5);
+    if(s->qscale < 0)
+       return -1;
+       
+    return 0;
+}
+
+int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s)
+{
+    Wmv2Context * const w= (Wmv2Context*)s;
 
     if (s->pict_type == I_TYPE) {
         if(w->j_type_bit) w->j_type= get_bits1(&s->gb);
@@ -641,7 +650,7 @@ void ff_mspel_motion(MpegEncContext *s,
     if(s->flags&CODEC_FLAG_EMU_EDGE){
         if(src_x<1 || src_y<1 || src_x + 17  >= s->h_edge_pos
                               || src_y + h+1 >= v_edge_pos){
-            ff_emulated_edge_mc(s, ptr - 1 - s->linesize, s->linesize, 19, 19, 
+            ff_emulated_edge_mc(s->edge_emu_buffer, ptr - 1 - s->linesize, s->linesize, 19, 19, 
                              src_x-1, src_y-1, s->h_edge_pos, s->v_edge_pos);
             ptr= s->edge_emu_buffer + 1 + s->linesize;
             emu=1;
@@ -682,7 +691,7 @@ void ff_mspel_motion(MpegEncContext *s,
     offset = (src_y * uvlinesize) + src_x;
     ptr = ref_picture[1] + offset;
     if(emu){
-        ff_emulated_edge_mc(s, ptr, s->uvlinesize, 9, 9, 
+        ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, 
                          src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
         ptr= s->edge_emu_buffer;
     }
@@ -690,7 +699,7 @@ void ff_mspel_motion(MpegEncContext *s,
 
     ptr = ref_picture[2] + offset;
     if(emu){
-        ff_emulated_edge_mc(s, ptr, s->uvlinesize, 9, 9, 
+        ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize, 9, 9, 
                          src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
         ptr= s->edge_emu_buffer;
     }
@@ -717,6 +726,7 @@ static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
             s->mv[0][0][0] = 0;
             s->mv[0][0][1] = 0;
             s->mb_skiped = 1;
+            w->hshift=0;
             return 0;
         }