[SCM] libav/experimental: Use the correct collocated field in pred_direct_motion() when it differs in parity. Fixes at least: FRExt/HPCAFL_BRCM_C.264 FRExt/HPCAFLNL_BRCM_C.264 FRExt/HPCVFL_BRCM_A.264 FRExt/HPCVFLNL_BRCM_A.264

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:26:35 UTC 2013


The following commit has been merged in the experimental branch:
commit 71041842ec0be33cd120c8bfa6a2186220757071
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Mon Aug 4 02:41:19 2008 +0000

    Use the correct collocated field in pred_direct_motion() when it differs in parity.
    Fixes at least:
    FRExt/HPCAFL_BRCM_C.264
    FRExt/HPCAFLNL_BRCM_C.264
    FRExt/HPCVFL_BRCM_A.264
    FRExt/HPCVFLNL_BRCM_A.264
    
    Originally committed as revision 14529 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index da2e0f1..5de23da 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -936,9 +936,10 @@ static inline void direct_ref_list_init(H264Context * const h){
 
 static inline void pred_direct_motion(H264Context * const h, int *mb_type){
     MpegEncContext * const s = &h->s;
-    const int mb_xy =   h->mb_xy;
-    const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride;
-    const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride;
+    const int fieldoff= (s->picture_structure & h->ref_list[1][0].reference) ? 0 : (3-2*s->picture_structure);
+    const int mb_xy =   h->mb_xy + s->mb_stride*fieldoff;
+    const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride + 2*h->b8_stride*fieldoff;
+    const int b4_xy = 4*s->mb_x + 4*s->mb_y*h-> b_stride + 4*h-> b_stride*fieldoff;
     const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy];
     const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy];
     const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy];

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list