src/binreducelow.c
void
reduceBinary2Low(l_uint32  *datad,
                 l_int32    wpld,
                 l_uint32  *datas,
                 l_int32    hs,
                 l_int32    wpls,
                 l_uint8   *tab)
{
l_int32    i, id, j, wplsi;
l_uint8    byte0, byte1;
l_uint16   shortd;
l_uint32   word;
l_uint32  *lines, *lined;

        /* e.g., if ws = 65: wd = 32, wpls = 3, wpld = 1 --> trouble */
    wplsi = L_MIN(wpls, 2 * wpld);  /* iterate over this number of words */

    for (i = 0, id = 0; i < hs - 1; i += 2, id++) {
        lines = datas + i * wpls;
        lined = datad + id * wpld;
        for (j = 0; j < wplsi; j++) {
            word = *(lines + j);
            word = word & 0xaaaaaaaa;  /* mask */
            word = word | (word << 7);  /* fold; data in bytes 0 & 2 */
            byte0 = word >> 24;
            byte1 = (word >> 8) & 0xff;
            shortd = (tab[byte0] << 8) | tab[byte1];
            SET_DATA_TWO_BYTES(lined, j, shortd);
        }
    }

    return;
}
/*!
 *  reduceBinary2Low()
 *
 *  After folding, the data is in bytes 0 and 2 of the word,
 *  and the bits in each byte are in the following order
 *  (with 0 being the leftmost originating pair and 7 being
 *  the rightmost originating pair):
 *
 *      0 4 1 5 2 6 3 7
 *
 *  These need to be permuted to
 *
 *      0 1 2 3 4 5 6 7
 *
 *  which is done with an 8-bit table generated by
 *  makeSubsampleTab2x().
 *
 */
reduceBinary2Low()
After folding, the data is in bytes 0 and 2 of the word,
and the bits in each byte are in the following order
(with 0 being the leftmost originating pair and 7 being
the rightmost originating pair).



These need to be permuted to



which is done with an 8-bit table generated by
makeSubsampleTab2x().
reduceBinary2Low () After folding the data is in bytes 0 and 2 of the word and the bits in each byte are in the following order ( with 0 being the leftmost originating pair and 7 being the rightmost originating pair ) . These need to be permuted to which is done with an 8 - bit table generated by makeSubsampleTab2x () .
void
reduceBinary2Low(l_uint32  *datad,
                 l_int32    wpld,
                 l_uint32  *datas,
                 l_int32    hs,
                 l_int32    wpls,
                 l_uint8   *tab)
{
l_int32    i, id, j, wplsi;
l_uint8    byte0, byte1;
l_uint16   shortd;
l_uint32   word;
l_uint32  *lines, *lined;
    wplsi = L_MIN(wpls, 2 * wpld);  
    for (i = 0, id = 0; i < hs - 1; i += 2, id++) {
        lines = datas + i * wpls;
        lined = datad + id * wpld;
        for (j = 0; j < wplsi; j++) {
            word = *(lines + j);
            word = word & 0xaaaaaaaa;  
            word = word | (word << 7);  
            byte0 = word >> 24;
            byte1 = (word >> 8) & 0xff;
            shortd = (tab[byte0] << 8) | tab[byte1];
            SET_DATA_TWO_BYTES(lined, j, shortd);
        }
    }
    return;
}
void reduceBinary2Low ( l_uint32 * datad , l_int32 wpld , l_uint32 * datas , l_int32 hs , l_int32 wpls , l_uint8 * tab ) { l_int32 i , id , j , wplsi ; l_uint8 byte0 , byte1 ; l_uint16 shortd ; l_uint32 word ; l_uint32 * lines , * lined ; wplsi = L_MIN ( wpls , 2 * wpld ) ; for ( i = 0 , id = 0 ; i < hs - 1 ; i += 2 , id ++ ) { lines = datas + i * wpls ; lined = datad + id * wpld ; for ( j = 0 ; j < wplsi ; j ++ ) { word = * ( lines + j ) ; word = word & 0xaaaaaaaa ; word = word | ( word << 7 ) ; byte0 = word >> 24 ; byte1 = ( word >> 8 ) & 0xff ; shortd = ( tab [ byte0 ] << 8 ) | tab [ byte1 ] ; SET_DATA_TWO_BYTES ( lined , j , shortd ) ; } } return ; }
reduceBinary2Low()
  After folding, the data is in bytes 0 and 2 of the word,
  and the bits in each byte are in the following order
  (with 0 being the leftmost originating pair and 7 being
  the rightmost originating pair):
reduceBinary2Low () After folding the data is in bytes 0 and 2 of the word and the bits in each byte are in the following order ( with 0 being the leftmost originating pair and 7 being the rightmost originating pair ) :
/* e.g., if ws = 65: wd = 32, wpls = 3, wpld = 1 --> trouble */ /* iterate over this number of words */ /* mask */ /* fold; data in bytes 0 & 2 */