caseCOLORMODE_JP4DIFF:/// jp4, 4 blocks, differential red := (R-G1), blue:=(B-G1), green=G1, green2 (G2-G1). G1 is defined by Bayer shift, any pixel can be used
caseCOLORMODE_JP4DIFF2:/// jp4, 4 blocks, differential, divide differences by 2: red := (R-G1)/2, blue:=(B-G1)/2, green=G1, green2 (G2-G1)/2
HEADER_COPY_SOF(sof_jp4diff);
//header_sof
//bshift
//header_sof
//bshift
buf[header_sof+12+3*((4-params->byrshift)&3)]=0;/// set quantization table 0 for the "base color"
break;
caseCOLORMODE_JP4HDR:/// jp4, 4 blocks, differential HDR: red := (R-G1), blue:=(B-G1), green=G1, green2 (high gain)=G2) (G1 and G2 - diagonally opposite)
* move below two lines to circbuf_all_lseek to remove ccam_dma_buf_ptr and simplify dependencies
rp= (offset >>2) & (~7); // convert to index to long, align to 32-bytes
fp = (struct interframe_params_t *) &ccam_dma_buf_ptr[X313_BUFFSUB(rp, 8)]; //! 32 bytes before the frame pointer, may roll-over to the end of ccam_dma_buf_ptr
*/
//if ((fp->signffff != 0xffff) || //! signature is overwritten
if((fp->signffff!=MARKER_FFFF)||//! signature is overwritten
file->f_pos=jpeghead_priv[chn].jpeg_h_sz+offset;
}else{
file->f_pos=0;// reset it to 0 anyway
if((fp->signffff!=MARKER_FFFF)||// signature is overwritten
((fp->timestamp_sec)&X313_LENGTH_MASK))return-EINVAL;//! acquisition of this frame is not done yet - length word high byte is non-zero
///FIXME: pp_index=fp->past_index; /// unsigned short
/// if (pp_index>=PASTPARS_SAVE_ENTRIES) return -EINVAL; /// wrong index