src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java
void getLuma21(byte[] pic, int picW, byte[] blk, int blkOff, int blkStride, int x, int y, int blkW, int blkH) {
        getLuma20NoRound(pic, picW, tmp1, 0, blkW, x, y - 2, blkW, blkH + 7);
        getLuma02NoRoundInt(tmp1, blkW, tmp2, blkOff, blkStride, 0, 2, blkW, blkH);

        int off = blkW << 1;
        for (int j = 0; j < blkH; j++) {
            for (int i = 0; i < blkW; i++) {
                int rounded = clip((tmp2[blkOff + i] + 512) >> 10, -128, 127);
                int rounded2 = clip((tmp1[off + i] + 16) >> 5, -128, 127);
                blk[blkOff + i] = (byte) ((rounded + rounded2 + 1) >> 1);
            }
            blkOff += blkStride;
            off += blkW;
        }
    }
void getLuma21(byte[] pic, int picW, byte[] blk, int blkOff, int blkStride, int x, int y, int blkW, int blkH) {
        getLuma20NoRound(pic, picW, tmp1, 0, blkW, x, y - 2, blkW, blkH + 7);
        getLuma02NoRoundInt(tmp1, blkW, tmp2, blkOff, blkStride, 0, 2, blkW, blkH);

        int off = blkW << 1;
        for (int j = 0; j < blkH; j++) {
            for (int i = 0; i < blkW; i++) {
                int rounded = clip((tmp2[blkOff + i] + 512) >> 10, -128, 127);
                int rounded2 = clip((tmp1[off + i] + 16) >> 5, -128, 127);
                blk[blkOff + i] = (byte) ((rounded + rounded2 + 1) >> 1);
            }
            blkOff += blkStride;
            off += blkW;
        }
    }
void getLuma21 ( byte [ ] pic , int picW , byte [ ] blk , int blkOff , int blkStride , int x , int y , int blkW , int blkH ) { getLuma20NoRound ( pic , picW , tmp1 , 0 , blkW , x , y - 2 , blkW , blkH + 7 ) ; getLuma02NoRoundInt ( tmp1 , blkW , tmp2 , blkOff , blkStride , 0 , 2 , blkW , blkH ) ; int off = blkW << 1 ; for ( int j = 0 ; j < blkH ; j ++ ) { for ( int i = 0 ; i < blkW ; i ++ ) { int rounded = clip ( ( tmp2 [ blkOff + i ] + 512 ) >> 10 , - 128 , 127 ) ; int rounded2 = clip ( ( tmp1 [ off + i ] + 16 ) >> 5 , - 128 , 127 ) ; blk [ blkOff + i ] = ( byte ) ( ( rounded + rounded2 + 1 ) >> 1 ) ; } blkOff += blkStride ; off += blkW ; } }
Hpel horizontal, Qpel vertical (2, 1)
Hpel horizontal Qpel vertical ( 2 1 )