dscully
New Contributor
3 months agoTone Mapping Operator IP Malfunctioning
Hello,
I am currently evaluating the Tone Mapping Operator IP from the Video and Vision Processing Suite for integration into our video camera product. The issue is that when attempting to enable the tone mapping operation the core either stops producing frames or if I use the region of interest (ROI) function the video displays but the ROI area appears solid black regardless of volume and threshold levels.
Setup
Quartus Version: 23.4.0 Pro Edition
IP Configuration:
- OpenCore Evaluation Mode (time limted SOF loaded with nios2-configure)
- Number of pixels in parallel: 4
- Number of color planes: 3
- Bits per color sample: 12
- internal_cpu_clock/external_cpu_clock frequency: 150Mhz
- vid_clock frequency: 172Mhz
- Resets are associated with their clocks
Software Configuration (running on Nios II Core):
On startup, intel_vvp_tmo_init_instance is called and succeeds with a zero return code.
If debug prints are enabled (INTEL_VVP_TMO_ENABLE_LOGGING)
then the following prints out:
then the following prints out:
TILES: 4 BPP: 12 PPC: 4
intel_vvp_tmo_set_bypass is set to 1, and intel_vvp_tmo_set_resolution sets 1920x1080
The video pipeline starts at this point and frames pass normally.
Dumping the results of all get get functions of the TMO API results in:
get_bypass: 1 get_volume: 0 get_threshold: 0 get_debug: 15 get_roi_en: 0 get_roi_swap: 0 get_roi_horizontal_x0: 0 get_roi_horizontal_x1: 0 get_roi_vertical_y0: 0 get_roi_vertical_y1: 0 get_pip: 4 get_resolution_width: 1920 get_resolution_height: 1080
The debug register isn't directly documented as far as I can tell, but the "Software Driver Example" section gives the impression that 15 means all four rows are "Missing data collection per tile". I then clear the status with intel_vvp_tmo_set_debug(&tmo_instance, 15) which is reflected when I dump the registers again.
If I then set a region of interest using these commands:
intel_vvp_tmo_set_roi_horizontal_x0x1(&tmo_instance, 200, 400) intel_vvp_tmo_set_roi_vertical_y0y1(&tmo_instance, 200, 400)
I see a black bar appear over the video feed.
I tried many combinations of volume/threshold and the pattern is unchanging. On some attempts writing those commands causes the processor to hang. If I try to disable bypass without using ROI, the core stops producing frames immediately.
Here is a direct dump of all registers for the ROI mode:
TMO_HW_INFO_0: 0x14A0043C TMO_HW_INFO_1: 0x16565156 TMO_HW_INFO_2: 0x00094014 TMO_FLOW_CTL: 0x00000002 TMO_ACT_GEOM: 0x07800438 TMO_VOL_CTL: 0x00000000 TMO_CENTRE_TILE_WIDTH: 0x01E00000 TMO_CORNER_TILE_NORM: 0x0000102E TMO_X_TILE_NORM: 0x00000817 TMO_Y_TILE_NORM: 0x00000817 TMO_CENTRE_TILE_NORM: 0x0000040B TMO_ACT_TILE_DIM: 0x0078010E TMO_BORDER_INFO_00: 0x007600EE TMO_BORDER_INFO_01: 0x016601DF TMO_BORDER_INFO_02: 0x01DE010E TMO_BORDER_INFO_03: 0x010D021C TMO_BORDER_INFO_04: 0x021B032A TMO_BORDER_INFO_05: 0x03290438 TMO_BORDER_INFO_06: 0x043700F0 TMO_BORDER_INFO_07: 0x02D004B0 TMO_BORDER_INFO_08: 0x06900087 TMO_BORDER_INFO_09: 0x019502A3 TMO_BORDER_INFO_10: 0x043703B1 TMO_BORDER_INFO_11: 0x00EF02CF TMO_BORDER_INFO_12: 0x04AF068F TMO_BORDER_INFO_13: 0x00EE02CE TMO_BORDER_INFO_14: 0x04AE068E TMO_BORDER_INFO_15: 0x00ED02CD TMO_BORDER_INFO_16: 0x04AD068D TMO_BORDER_INFO_17: 0x00EC02CC TMO_BORDER_INFO_18: 0x04AC068C TMO_BORDER_INFO_19: 0x077F077E TMO_BORDER_INFO_20: 0x077D077C TMO_BORDER_INFO_21: 0x00860194 TMO_BORDER_INFO_22: 0x02A203B0 TMO_ROI_X0X1: 0x00C80190 TMO_ROI_Y0Y1: 0x00C80190
Are there any problems with this configuration that is preventing this from working?
Thank you,
David
Hi @dscully David,
Does this IP have undocumented restrictions on input resolution?
>> Yes, there is restrictions on the input resolution.
For the input width, it needs to be multiple of the pixels in parallels (PIP) and the number of internal tiles (it is fixed as 4)- So, if PIP = 4 and Number of tiles = 4, then the width needs to be multiple of 4x4 = 16
- For the given two widths you could see that condition is not met, 1944/16 = 121.5 and 3268/16=204.25
- I suggest your to try: 1952 for the first case,
- and 3280 for the second case, then if need be, you could use a clipper to put the width back to your desired width.
- For the input height, it needs to be multiple of the number of internal tiles (it is fixed as 4)
- In this case, your current values are both fine.
Regards,
Wincent_Altera