www.pudn.com > core.rar   To Read all the content


[file head]:
/*****************************************************************************
* bs.h :
*****************************************************************************
* Copyright (C) 2003 Laurent Aimar
* $Id: bs.h,v 1.2 2003/12/13 20:46:12 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston
... ...

[file tail]:
... ...
,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,
15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
};

if( val < 255 )
{
return i_size0_254[val];
}
else
{
int i_size = 0;

val++;

if( val >= 0x10000 )
{
i_size += 32;
val = (val >> 16) - 1;
}
if( val >= 0x100 )
{
i_size += 16;
val = (val >> 8) - 1;
}
return i_size0_254[val] + i_size;
}
}

static inline int bs_size_se( int val )
{
return bs_size_ue( val <= 0 ? -val * 2 : val * 2 - 1);
}

static inline int bs_size_te( int x, int val )
{
if( x == 1 )
{
return 1;
}
else if( x > 1 )
{
return bs_size_ue( val );
}
return 0;
}



#endif