diff h261.c @ 2291:c4e882a7c07c libavcodec

h.261 loop filter fix closes bug #1033108
author michael
date Fri, 08 Oct 2004 22:57:39 +0000
parents 89a5e4601343
children 5e5cf598a48b
line wrap: on
line diff
--- a/h261.c	Fri Oct 08 21:45:29 2004 +0000
+++ b/h261.c	Fri Oct 08 22:57:39 2004 +0000
@@ -57,14 +57,17 @@
     int gob_start_code_skipped; // 1 if gob start code is already read before gob header is read
 }H261Context;
 
-void ff_h261_loop_filter(H261Context * h){
-    MpegEncContext * const s = &h->s;
+void ff_h261_loop_filter(MpegEncContext *s){
+    H261Context * h= (H261Context*)s;
     const int linesize  = s->linesize;
     const int uvlinesize= s->uvlinesize;
     uint8_t *dest_y = s->dest[0];
     uint8_t *dest_cb= s->dest[1];
     uint8_t *dest_cr= s->dest[2];
-    
+
+    if(!(IS_FIL (h->mtype)))
+        return;
+
     s->dsp.h261_loop_filter(dest_y                   , linesize);
     s->dsp.h261_loop_filter(dest_y                + 8, linesize);
     s->dsp.h261_loop_filter(dest_y + 8 * linesize    , linesize);
@@ -256,6 +259,7 @@
         s->mv[0][0][0] = 0;
         s->mv[0][0][1] = 0;
         s->mb_skiped = 1;
+        h->mtype &= ~MB_TYPE_H261_FIL;
 
         MPV_decode_mb(s, s->block);
     }
@@ -388,10 +392,6 @@
 
     MPV_decode_mb(s, s->block);
 
-    if(IS_FIL (h->mtype)){
-        ff_h261_loop_filter(h);
-    }
-
     return SLICE_OK;
 }