[Ffmpeg-devel] [PATCH RFC] h264 - explicit load/stores in C cabac

Michael Niedermayer michaelni
Fri Mar 16 01:15:19 CET 2007


Hi

On Thu, Mar 15, 2007 at 06:38:17PM -0400, Alexander Strange wrote:
> 
> On Mar 15, 2007, at 6:25 PM, Diego Biurrun wrote:
> 
> >On Thu, Mar 15, 2007 at 06:16:57PM -0400, Alexander Strange wrote:
> >>
> >>So, I made this patch,
> >
> >Which one would that be?
> >
> >Diego
> 
> I had to try sending this twice since the local mail server broke. It  
> was on there the first time, I promise!
> 

> Index: cabac.h
> ===================================================================
> --- cabac.h	(revision 8387)
> +++ cabac.h	(working copy)
> @@ -267,22 +267,24 @@
>      c->bytestream+= CABAC_BITS/8;
>  }
>  
> -static void refill2(CABACContext *c){
> +static int refill2(CABACContext *c, int low){
>      int i, x;
>  
> -    x= c->low ^ (c->low-1);
> +    x= low ^ (low-1);
>      i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)];
>  
> -    x= -CABAC_MASK;
> -
>  #if CABAC_BITS == 16
> -        x+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1);
> +        x= AV_RB16(c->bytestream)<<1;
>  #else
> -        x+= c->bytestream[0]<<1;
> +        x= c->bytestream[0]<<1;
>  #endif
> +        
> +    x -= CABAC_MASK;

reordering the arguments for this addition should be a seperate patch
so should the AV_RB16() change, neither is related to
passing low as argument or not
each should be benchmarked individually


[...]
> -    return bit;
> +    return bit&1;

factoring the &1 out also should be a seperate patch, IIRC i tried this
one already and it was slower


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070316/408d101f/attachment.pgp>



More information about the ffmpeg-devel mailing list