changeset 11009:3d8426123947 libavcodec

Fix qp_thres loop filter check for MBAFF.
author michael
date Tue, 26 Jan 2010 13:27:22 +0000
parents ec192d9ebac5
children cf9dd5b2cc30
files h264.h
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/h264.h	Tue Jan 26 10:35:36 2010 +0000
+++ b/h264.h	Tue Jan 26 13:27:22 2010 +0000
@@ -799,9 +799,12 @@
         int qp = s->current_picture.qscale_table[mb_xy];
         if(qp <= qp_thresh
            && (left_xy[0]<0 || ((qp + s->current_picture.qscale_table[left_xy[0]] + 1)>>1) <= qp_thresh)
-           && (left_xy[1]<0 || ((qp + s->current_picture.qscale_table[left_xy[1]] + 1)>>1) <= qp_thresh)
            && (top_xy   < 0 || ((qp + s->current_picture.qscale_table[top_xy ] + 1)>>1) <= qp_thresh)){
-            return 1;
+            if(!FRAME_MBAFF)
+                return 1;
+            if(   (left_xy[0]< 0            || ((qp + s->current_picture.qscale_table[left_xy[0]+s->mb_stride] + 1)>>1) <= qp_thresh)
+               && (top_xy    < s->mb_stride || ((qp + s->current_picture.qscale_table[top_xy    -s->mb_stride] + 1)>>1) <= qp_thresh))
+                return 1;
         }
         if(IS_INTRA(mb_type))
             return 0;