[FFmpeg-devel] [Ffmpeg-devel][H.264 CABAC] Branchless implementation.

Grigory A ryhor
Tue Jul 10 06:48:31 CEST 2007


Hi!

I 've looked at branchless version of CABAC entropy decoding and it looks 
like a little bit unclear for me in one point

Here it is
file:     cabac.h
function: get_cabac_inline()

....
#else /* BRANCHLESS_CABAC_DECODER */

     lps_mask  = ((c->range<<17) - c->low)>>31;

     c->low   -= (c->range<<17) & lps_mask;
     c->range += (RangeLPS - c->range) & lps_mask;

     s       ^=lps_mask;
....

Could some one correct me two following issues:
1.lps_mask - always may be 0 or 1 only (>>31). So
   operation (c->range<<17) & lps_mask always will give us 0.
   Is it correct? if it is - we can safely remove this:
   c->low   -= (c->range<<17) & lps_mask;

2.if we enter in routine with "normal" state of Arithm Coding
   (i.e. it is renormalized )it looks like our (c->range<<17)
   never will have bit 31 set to 1 - and our lps_mask always
   will be equal to 0. Not sure in this - could some one correct
   me if I am wrong. But if it is - we may safely remove several
   statements.

Thanks in advance.
      

-------
????? ?? ????? ????!?????????? ???????, ??????? ???????, ???????????? ????! 
????? ? ????????! http://www.vitrina.izrukvruki.by





More information about the ffmpeg-devel mailing list