[FFmpeg-devel] [PATCH 2/2] vc1dec: Implement Interlaced field hybrid MV prediction

Michael Niedermayer michaelni at gmx.at
Wed Apr 24 00:29:16 CEST 2013


This makes no difference with any samples i tried
If you have a sample for which this makes a difference, please
send me the sample

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/vc1dec.c |   27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index bc7ffd7..343b03f 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1580,6 +1580,32 @@ static inline void vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
         /* Calculate hybrid prediction as specified in 8.3.5.3.5 (also 10.3.5.4.3.5) */
         hybridmv_thresh = 32;
         if (a_valid && c_valid) {
+          if(v->field_mode) {
+            if (!is_intra[xy - wrap] && !is_intra[xy - 1]) {
+
+                sum = FFABS(px - field_predA[0]) + FFABS(py - field_predA[1]);
+                if (sum > hybridmv_thresh) {
+                    if (get_bits1(&s->gb)) {     // read HYBRIDPRED bit
+                        px = field_predA[0];
+                        py = field_predA[1];
+                    } else {
+                        px = field_predC[0];
+                        py = field_predC[1];
+                    }
+                } else {
+                    sum = FFABS(px - field_predC[0]) + FFABS(py - field_predC[1]);
+                    if (sum > hybridmv_thresh) {
+                        if (get_bits1(&s->gb)) {
+                            px = field_predA[0];
+                            py = field_predA[1];
+                        } else {
+                            px = field_predC[0];
+                            py = field_predC[1];
+                        }
+                    }
+                }
+            }
+          } else {
             if (is_intra[xy - wrap])
                 sum = FFABS(px) + FFABS(py);
             else
@@ -1607,6 +1633,7 @@ static inline void vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y,
                     }
                 }
             }
+          }
         }
     }
 
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list