comparison h264.c @ 7474:9ed1ef44127b libavcodec

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
author michael
date Mon, 04 Aug 2008 02:41:19 +0000
parents 856df346b536
children 6abd94f87b45
comparison
equal deleted inserted replaced
7473:e2f3016867a0 7474:9ed1ef44127b
934 } 934 }
935 } 935 }
936 936
937 static inline void pred_direct_motion(H264Context * const h, int *mb_type){ 937 static inline void pred_direct_motion(H264Context * const h, int *mb_type){
938 MpegEncContext * const s = &h->s; 938 MpegEncContext * const s = &h->s;
939 const int mb_xy = h->mb_xy; 939 const int fieldoff= (s->picture_structure & h->ref_list[1][0].reference) ? 0 : (3-2*s->picture_structure);
940 const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride; 940 const int mb_xy = h->mb_xy + s->mb_stride*fieldoff;
941 const int b4_xy = 4*s->mb_x + 4*s->mb_y*h->b_stride; 941 const int b8_xy = 2*s->mb_x + 2*s->mb_y*h->b8_stride + 2*h->b8_stride*fieldoff;
942 const int b4_xy = 4*s->mb_x + 4*s->mb_y*h-> b_stride + 4*h-> b_stride*fieldoff;
942 const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy]; 943 const int mb_type_col = h->ref_list[1][0].mb_type[mb_xy];
943 const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy]; 944 const int16_t (*l1mv0)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[0][b4_xy];
944 const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy]; 945 const int16_t (*l1mv1)[2] = (const int16_t (*)[2]) &h->ref_list[1][0].motion_val[1][b4_xy];
945 const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy]; 946 const int8_t *l1ref0 = &h->ref_list[1][0].ref_index[0][b8_xy];
946 const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy]; 947 const int8_t *l1ref1 = &h->ref_list[1][0].ref_index[1][b8_xy];