So we have added a special JP4 mode that bypasses the Demosaic in the FPGA and provides an image with pixels in each 16x16 macroblock that are rearranged to separate Bayer colors in individual 8x8 blocks, then encoded as monochrome. Demosaic will be applied during post-processing on the host PC. This section describe different algorithms and implementations used to provide this functionality.
- compression speed improvement - possibility to obtain more high quality image (near to RAW) - drasticaly lowering data size
JP4 format can be easy manipulated by Matlab
function y=deblock16x16(I) y0=zeros(size(I)); for x=1:16:size(I,1) for y=1:16:size(I,2) blk16=I(x:x+15,y:y+15); for dx=0:7 for dy=0:7 y0(x+2*dx ,y+2*dy) = blk16(dx+1,dy+1); y0(x+2*dx+1,y+2*dy) = blk16(dx+9,dy+1); y0(x+2*dx ,y+2*dy+1) = blk16(dx+1,dy+9); y0(x+2*dx+1,y+2*dy+1) = blk16(dx+9,dy+9); end end end end y=y0;