src/main/java/org/jcodec/codecs/h264/decode/BlockInterpolator.java
private static void getChromaXX(byte[] pels, int picW, int picH, byte[] blk, int blkOff, int blkStride, int fullX,
            int fullY, int fracX, int fracY, int blkW, int blkH) {
        int w00 = fullY * picW + fullX;
        int w01 = w00 + (fullY < picH - 1 ? picW : 0);
        int w10 = w00 + (fullX < picW - 1 ? 1 : 0);
        int w11 = w10 + w01 - w00;
        int eMx = 8 - fracX;
        int eMy = 8 - fracY;

        for (int j = 0; j < blkH; j++) {
            for (int i = 0; i < blkW; i++) {

                blk[blkOff + i] = (byte) ((eMx * eMy * pels[w00 + i] + fracX * eMy * pels[w10 + i] + eMx * fracY
                        * pels[w01 + i] + fracX * fracY * pels[w11 + i] + 32) >> 6);
            }
            blkOff += blkStride;
            w00 += picW;
            w01 += picW;
            w10 += picW;
            w11 += picW;
        }
    }
private static void getChromaXX(byte[] pels, int picW, int picH, byte[] blk, int blkOff, int blkStride, int fullX,
            int fullY, int fracX, int fracY, int blkW, int blkH) {
        int w00 = fullY * picW + fullX;
        int w01 = w00 + (fullY < picH - 1 ? picW : 0);
        int w10 = w00 + (fullX < picW - 1 ? 1 : 0);
        int w11 = w10 + w01 - w00;
        int eMx = 8 - fracX;
        int eMy = 8 - fracY;

        for (int j = 0; j < blkH; j++) {
            for (int i = 0; i < blkW; i++) {

                blk[blkOff + i] = (byte) ((eMx * eMy * pels[w00 + i] + fracX * eMy * pels[w10 + i] + eMx * fracY
                        * pels[w01 + i] + fracX * fracY * pels[w11 + i] + 32) >> 6);
            }
            blkOff += blkStride;
            w00 += picW;
            w01 += picW;
            w10 += picW;
            w11 += picW;
        }
    }
private static void getChromaXX ( byte [ ] pels , int picW , int picH , byte [ ] blk , int blkOff , int blkStride , int fullX , int fullY , int fracX , int fracY , int blkW , int blkH ) { int w00 = fullY * picW + fullX ; int w01 = w00 + ( fullY < picH - 1 ? picW : 0 ) ; int w10 = w00 + ( fullX < picW - 1 ? 1 : 0 ) ; int w11 = w10 + w01 - w00 ; int eMx = 8 - fracX ; int eMy = 8 - fracY ; for ( int j = 0 ; j < blkH ; j ++ ) { for ( int i = 0 ; i < blkW ; i ++ ) { blk [ blkOff + i ] = ( byte ) ( ( eMx * eMy * pels [ w00 + i ] + fracX * eMy * pels [ w10 + i ] + eMx * fracY * pels [ w01 + i ] + fracX * fracY * pels [ w11 + i ] + 32 ) >> 6 ) ; } blkOff += blkStride ; w00 += picW ; w01 += picW ; w10 += picW ; w11 += picW ; } }
Chroma (X,X)
Chroma ( X X )