r22073 - trunk/libavcodec/h264.h
Author: michael Date: Fri Feb 26 10:13:40 2010 New Revision: 22073 Log: Simplify code to set cbp_* this seems 1 cpu cycle slower even though we practically just remove code. Speed loss seems caused by the merge of if(left_type), iam commiting this anyway as i cant imagine this to be anything but compiler messup. Modified: trunk/libavcodec/h264.h Modified: trunk/libavcodec/h264.h ============================================================================== --- trunk/libavcodec/h264.h Fri Feb 26 09:55:43 2010 (r22072) +++ trunk/libavcodec/h264.h Fri Feb 26 10:13:40 2010 (r22073) @@ -947,24 +947,16 @@ static void fill_decode_caches(H264Conte // top_cbp if(top_type) { h->top_cbp = h->cbp_table[top_xy]; - } else if(IS_INTRA(mb_type)) { - h->top_cbp = 0x1CF; } else { - h->top_cbp = 0x00F; + h->top_cbp = IS_INTRA(mb_type) ? 0x1CF : 0x00F; } // left_cbp if (left_type[0]) { h->left_cbp = h->cbp_table[left_xy[0]] & 0x1f0; - } else if(IS_INTRA(mb_type)) { - h->left_cbp = 0x1CF; - } else { - h->left_cbp = 0x00F; - } - if (left_type[0]) { h->left_cbp |= ((h->cbp_table[left_xy[0]]>>((left_block[0]&(~1))+1))&0x1) << 1; - } - if (left_type[1]) { h->left_cbp |= ((h->cbp_table[left_xy[1]]>>((left_block[2]&(~1))+1))&0x1) << 3; + } else { + h->left_cbp = IS_INTRA(mb_type) ? 0x1CF : 0x00F; } } }
On Fri, Feb 26, 2010 at 10:13:40AM +0100, michael wrote:
Author: michael Date: Fri Feb 26 10:13:40 2010 New Revision: 22073
Log: Simplify code to set cbp_* this seems 1 cpu cycle slower even though we practically just remove code. Speed loss seems caused by the merge of if(left_type), iam commiting this anyway as i cant imagine this to be anything but compiler messup.
looking at the asm shows that gcc made significant changes to completely unrelated code which probably affected my benchmark which covered the whole fill_decode_caches() meassuring fill_decode_caches() with 4 seperate timers to cover the differnt parts reveals a 2 cpu cycle speedup. And a timer just over the changes code prevents gcc from messing with unrelated code. [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
participants (2)
-
michaelni@gmx.at -
subversion@mplayerhq.hu