changeset 11201:4e2d74d7bad8 libavcodec

Speedup decode_cabac_field_decoding_flag() by 9 cpu cycles.
author michael
date Thu, 18 Feb 2010 12:13:21 +0000
parents cd8a77473dd1
children 778139a5e058
files h264_cabac.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/h264_cabac.c	Wed Feb 17 23:58:59 2010 +0000
+++ b/h264_cabac.c	Thu Feb 18 12:13:21 2010 +0000
@@ -707,12 +707,11 @@
 
 static int decode_cabac_field_decoding_flag(H264Context *h) {
     MpegEncContext * const s = &h->s;
-    const long mba_xy = h->mb_xy - 1L;
     const long mbb_xy = h->mb_xy - 2L*s->mb_stride;
 
     unsigned long ctx = 0;
 
-    ctx += (s->current_picture.mb_type[mba_xy]>>7)&(h->slice_table[mba_xy] == h->slice_num);
+    ctx += h->mb_field_decoding_flag & !!s->mb_x; //for FMO:(s->current_picture.mb_type[mba_xy]>>7)&(h->slice_table[mba_xy] == h->slice_num);
     ctx += (s->current_picture.mb_type[mbb_xy]>>7)&(h->slice_table[mbb_xy] == h->slice_num);
 
     return get_cabac_noinline( &h->cabac, &(h->cabac_state+70)[ctx] );