// Copyright (C) 2023-2025 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
include "memoryManagement.fbs";

namespace MVCNN;

enum M2IFormat : uint8 {
  // Prefix notation:
  // 'PL' = planar
  // 'SP' = semi-planar
  // 'IL' = interleaved

  PL_YUV444_8 = 0,
  PL_YUV420_8 = 1,
  PL_RGB24    = 2,
  PL_RGB30    = 3,
  PL_GRAY8    = 4,
  PL_FP16_RGB = 5,
  PL_FP16_YUV = 6,
  PL_YUV422_8 = 7,
  SP_NV12_8   = 8,
  SP_NV12_10  = 9,
  SP_P010     = 10,
  IL_YUV422_8 = 24,
  IL_RGB8888  = 25,
  IL_RGB888   = 26,
  IL_RGB30    = 27
}

enum M2IInterp : uint8 {
  // Interpolation method
  NEAREST  = 0,
  BILINEAR = 1
}

table M2ITask {
  // M2I (Media-to-Inference HW block, VPU4000)

  do_csc:  bool = false; // color space conversion
  do_norm: bool = false; // normalization
  interp:  M2IInterp = NEAREST;

  // Input/output format
  in_fmt:  M2IFormat;
  out_fmt: M2IFormat;

  // Normalization coefficients (fp16 values)
  // channel grouped, e.g. {A0,B0,C0,D0, A1,B1,C1,D1, ...}
  norm_coefs: [uint16];

  // Inputs/outputs
  src: [TensorReference];
  dst: [TensorReference];

  //Chroma order, represents YCbCr or RGB order
  // for YCbCr, this bit represents: 0 - YCbCr , 1 - YCrCb
  // for RGB, this bit represents: 0 - RGB, 1 - BGR
  chroma_in_reverse_channels: uint8;
  chroma_out_reverse_channels: uint8;

  //Luma order, 0 - Y before Cb/Cr, 1 - Y after Cb/Cr
  luma_in_reverse_channels: uint8;
  luma_out_reverse_channels: uint8;

  // Tiling offsets (fixed point 15.17 represented in u32)
  tile_offset_x: uint32;
  tile_offset_y: uint32;

  // Scale factors (fixed point 15.17 represented in u32)
  scale_factor_x: uint32;
  scale_factor_y: uint32;
}
