# HG changeset patch # User michael # Date 1217935043 0 # Node ID 2090d67bbf165beb2205166e3e1ab0de0f3841ae # Parent b0a840bb7b126458da679ee2e42c7dd8057b8364 simplify y_shift/ref_shift code diff -r b0a840bb7b12 -r 2090d67bbf16 h264.c --- a/h264.c Tue Aug 05 11:04:49 2008 +0000 +++ b/h264.c Tue Aug 05 11:17:23 2008 +0000 @@ -1173,17 +1173,8 @@ } if(IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])){ /* FIXME assumes direct_8x8_inference == 1 */ - int y_shift; - int ref_shift; - - if(IS_INTERLACED(*mb_type)){ - /* frame to field scaling */ - y_shift = 0; - ref_shift= FRAME_MBAFF ? 0 : 1; - }else{ - y_shift = 2; - ref_shift= FRAME_MBAFF ? 2 : 1; - } + int y_shift = 2*!IS_INTERLACED(*mb_type); + int ref_shift= FRAME_MBAFF ? y_shift : 1; for(i8=0; i8<4; i8++){ const int x8 = i8&1;