src/binreducelow.c
l_uint8 *
makeSubsampleTab2x(void)
{
l_uint8  *tab;
l_int32   i;

    PROCNAME("makeSubsampleTab2x");

    if ((tab = (l_uint8 *) CALLOC(256, sizeof(l_uint8))) == NULL)
        return (l_uint8 *)ERROR_PTR("tab not made", procName, NULL);

    for (i = 0; i < 256; i++)
        tab[i] = ((i & 0x01)     ) |    /* 7 */
                 ((i & 0x04) >> 1) |    /* 6 */
                 ((i & 0x10) >> 2) |    /* 5 */
                 ((i & 0x40) >> 3) |    /* 4 */
                 ((i & 0x02) << 3) |    /* 3 */
                 ((i & 0x08) << 2) |    /* 2 */
                 ((i & 0x20) << 1) |    /* 1 */
                 ((i & 0x80)     );     /* 0 */

    return tab;
}
/*!
 *  makeSubsampleTab2x()
 *
 *  This table permutes the bits in a byte, from
 *      0 4 1 5 2 6 3 7
 *  to
 *      0 1 2 3 4 5 6 7
 */
makeSubsampleTab2x()
This table permutes the bits in a byte, from
0 4 1 5 2 6 3 7
to
0 1 2 3 4 5 6 7
makeSubsampleTab2x () This table permutes the bits in a byte from 0 4 1 5 2 6 3 7 to 0 1 2 3 4 5 6 7
l_uint8 *
makeSubsampleTab2x(void)
{
l_uint8  *tab;
l_int32   i;
    PROCNAME("makeSubsampleTab2x");
    if ((tab = (l_uint8 *) CALLOC(256, sizeof(l_uint8))) == NULL)
        return (l_uint8 *)ERROR_PTR("tab not made", procName, NULL);
    for (i = 0; i < 256; i++)
        tab[i] = ((i & 0x01)     ) |    
                 ((i & 0x04) >> 1) |    
                 ((i & 0x10) >> 2) |    
                 ((i & 0x40) >> 3) |    
                 ((i & 0x02) << 3) |    
                 ((i & 0x08) << 2) |    
                 ((i & 0x20) << 1) |    
                 ((i & 0x80)     );     
    return tab;
}
l_uint8 * makeSubsampleTab2x ( void ) { l_uint8 * tab ; l_int32 i ; PROCNAME ( " " ) ; if ( ( tab = ( l_uint8 * ) CALLOC ( 256 , sizeof ( l_uint8 ) ) ) == NULL ) return ( l_uint8 * ) ERROR_PTR ( " " , procName , NULL ) ; for ( i = 0 ; i < 256 ; i ++ ) tab [ i ] = ( ( i & 0x01 ) ) | ( ( i & 0x04 ) >> 1 ) | ( ( i & 0x10 ) >> 2 ) | ( ( i & 0x40 ) >> 3 ) | ( ( i & 0x02 ) << 3 ) | ( ( i & 0x08 ) << 2 ) | ( ( i & 0x20 ) << 1 ) | ( ( i & 0x80 ) ) ; return tab ; }
makeSubsampleTab2x()
  This table permutes the bits in a byte, from
      0 4 1 5 2 6 3 7
  to
      0 1 2 3 4 5 6 7
makeSubsampleTab2x () This table permutes the bits in a byte from 0 4 1 5 2 6 3 7 to 0 1 2 3 4 5 6 7
/* 7 */ /* 6 */ /* 5 */ /* 4 */ /* 3 */ /* 2 */ /* 1 */ /* 0 */