module ad_csc_CrYCb2RGB #(

  parameter   DELAY_DATA_WIDTH = 16) (

  // Cr-Y-Cb inputs

  input                               clk,
  input       [DELAY_DATA_WIDTH-1:0]  CrYCb_sync,
  input       [23:0]                  CrYCb_data,

  // R-G-B outputs

  output      [DELAY_DATA_WIDTH-1:0]  RGB_sync,
  output      [23:0]                  RGB_data);

  localparam  DW = DELAY_DATA_WIDTH - 1;

  // red

  ad_csc  #(
    .DELAY_DW (DELAY_DATA_WIDTH),
    .MUL_COEF_DW (18),
    .SUM_COEF_DW (28),
    .YCbCr_2_RGB (1))
  i_csc_R (
    .clk (clk),
    .sync (CrYCb_sync),
    .data (CrYCb_data),
    .C1 ( 18'd52299),
    .C2 ( 18'd38154),
    .C3 ( 18'd0),
    .C4 (-28'd7304675),
    .csc_sync (RGB_sync),
    .csc_data (RGB_data[23:16]));

  // green

  ad_csc  #(
    .MUL_COEF_DW (18),
    .SUM_COEF_DW (28),
    .YCbCr_2_RGB (1))
  i_csc_G (
    .clk (clk),
    .sync (1'd0),
    .data (CrYCb_data),
    .C1 (-18'd26639),
    .C2 ( 18'd38154),
    .C3 (-18'd12837),
    .C4 ( 28'd4442554),
    .csc_sync (),
    .csc_data (RGB_data[15:8]));

  // blue

  ad_csc #(
    .MUL_COEF_DW (18),
    .SUM_COEF_DW (28),
    .YCbCr_2_RGB (1))
  i_csc_B (
    .clk (clk),
    .sync (1'd0),
    .data (CrYCb_data),
    .C1 ( 18'd0),
    .C2 ( 18'd38154),
    .C3 ( 18'd66101),
    .C4 (-28'd9071362),
    .csc_sync (),
    .csc_data (RGB_data[7:0]));

endmodule