component_colorsS<={2'h3,~bayer_phase_onehot[3:0]|(hdr_r?{~bayer_phase_onehot[1:0],~bayer_phase_onehot[3:2]}:4'h0)};// use color quantization table (YCbCR, jp4diff)
component_firstsS<=6'h3f;// first_r this component in a frame (DC absolute, otherwise - difference to previous)
end
endcase
wirelimit_diff=1'b1;
csconvert18i_csconvert18(
.RST(!en_converters[0]),
.CLK(clk),
.mono(ignore_color_r),
.limit_diff(limit_diff),// 1 - limit color outputs to -128/+127 range, 0 - let them be limited downstream
.m_cb(m_cb[9:0]),// [9:0] scale for CB - default 0.564 (10'h90)
.m_cr(m_cr[9:0]),// [9:0] scale for CB - default 0.713 (10'hb6)
.din(di[7:0]),
.pre_first_in(first_pixel),
.signed_y(conv18_y_in[7:0]),
.q(conv18_c_in[8:0]),
.yaddr(conv18_yaddrw[7:0]),//
.ywe(conv18_ywe),
.caddr(conv18_caddrw[6:0]),
.cwe(conv18_cwe),
.pre_first_out(conv18_pre_first_out),
.bayer_phase(bayer_phase_r[1:0]),
.n000(n000[7:0]),// TODO:remove ?
.n255(n255[7:0]));
csconvert_monoi_csconvert_mono(
.en(en_converters[2]),
.clk(clk),
.din(di[7:0]),
.pre_first_in(first_pixel),
.y_out(mono_y_in[7:0]),
.yaddr(mono_yaddrw[7:0]),
.ywe(mono_ywe),
.pre_first_out(mono_pre_first_out));
csconvert_jp4i_csconvert_jp4(
.en(en_converters[3]),
.clk(clk),
.din(di[7:0]),
.pre_first_in(first_pixel),
.y_out(jp4_y_in[7:0]),
.yaddr(jp4_yaddrw[7:0]),
.ywe(jp4_ywe),
.pre_first_out(jp4_pre_first_out));
csconvert_jp4diffi_csconvert_jp4diff(
.en(en_converters[4]),
.clk(clk),
.scale_diff(scale_diff_r),
.hdr(hdr_r),
.din(di[7:0]),
.pre_first_in(first_pixel),
.y_out(jp4diff_y_in[8:0]),
.yaddr(jp4diff_yaddrw[7:0]),
.ywe(jp4diff_ywe),
.pre_first_out(jp4diff_pre_first_out),
.bayer_phase(bayer_phase_r[1:0]));
//TODO: temporary plugs, until module for 20x20 is created
// will be wrong, of course
assignconv20_y_in[7:0]=conv18_y_in[7:0];
assignconv20_yaddrw[7:0]=conv18_yaddrw[7:0];
assignconv20_ywe=conv18_ywe;
assignconv20_c_in[8:0]=conv18_c_in[8:0];
assignconv20_caddrw[6:0]=conv18_caddrw[6:0];
assignconv20_cwe=conv18_cwe;
assignconv20_pre_first_out=conv18_pre_first_out;
// currently only 8 bits are used in the memories
ramp_var_w_var_r#(
.REGISTERS(1),// will need to delay output strobe(s) by 1