protected void shortLoop(RasterAccessor src, 
                             RasterAccessor dst,
                             int filterSize)  {
        int dwidth = dst.getWidth();
        int dheight = dst.getHeight();
        int dnumBands = dst.getNumBands();
 
        short dstDataArrays[][] = dst.getShortDataArrays();
        int dstBandOffsets[] = dst.getBandOffsets();
        int dstPixelStride = dst.getPixelStride();
        int dstScanlineStride = dst.getScanlineStride();
 
        short srcDataArrays[][] = src.getShortDataArrays();
        int srcBandOffsets[] = src.getBandOffsets();
        int srcPixelStride = src.getPixelStride();
        int srcScanlineStride = src.getScanlineStride();

        int medianValues[] = new int[filterSize];
        int tmpValues[] = new int[filterSize];
        int wp = filterSize;
        int tmpBuffer[] = new int[filterSize*dwidth];
        int tmpBufferSize = filterSize*dwidth;
 
        for (int k = 0; k < dnumBands; k++)  {
            short dstData[] = dstDataArrays[k];
            short srcData[] = srcDataArrays[k];
            int srcScanlineOffset = srcBandOffsets[k];
            int dstScanlineOffset = dstBandOffsets[k];
 
            int revolver = 0;
            for (int j = 0; j < filterSize-1; j++) {
                int srcPixelOffset = srcScanlineOffset;
 
                for (int i = 0; i < dwidth; i++) {
                     int imageOffset = srcPixelOffset;
                     for (int v = 0; v < wp; v++)  {
                          tmpValues[v] = srcData[imageOffset];
                          imageOffset += srcPixelStride;
                     }
                     tmpBuffer[revolver+i] = medianFilter(tmpValues);
                     srcPixelOffset += srcPixelStride;
                }
                revolver += dwidth;
                srcScanlineOffset += srcScanlineStride;
            }
 
            // srcScanlineStride already bumped by
            // filterSize-1*scanlineStride
 
            for (int j = 0; j < dheight; j++)  {
                int srcPixelOffset = srcScanlineOffset;
                int dstPixelOffset = dstScanlineOffset;
 
                for (int i = 0; i < dwidth; i++)  {
                    int imageOffset = srcPixelOffset;
                    for (int v = 0; v < wp; v++)  {
                         tmpValues[v] = srcData[imageOffset];
                         imageOffset += srcPixelStride;
                    }
                    tmpBuffer[revolver + i] = medianFilter(tmpValues);
 
                    int a = 0;
                    for (int b = i; b < tmpBufferSize; b += dwidth) {
                        medianValues[a++] = tmpBuffer[b];
                    }
                    int val = medianFilter(medianValues);
 
                    dstData[dstPixelOffset] = (short)val;
                    srcPixelOffset += srcPixelStride;
                    dstPixelOffset += dstPixelStride;
                }
                revolver += dwidth;
                if (revolver == tmpBufferSize) {
                    revolver = 0;
                }
                srcScanlineOffset += srcScanlineStride;
                dstScanlineOffset += dstScanlineStride;
            }
        }

 
    }