This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM62A7: Question related to the scaling capability of AM62 DISPC

Part Number: AM62A7

Dear TI staff,

I'm investigating the capability of DISPC VID Scaler Unit and have some related question:

Our intention is to dynamically cropping the image while keeping a fixed output resolution to achieve a zooming feature. The resolution after cropping would be smaller that the desired output resolution, so we consdier using the DISPC scaling feature instead, given the fact that the MSC only supports downscaling.

My first attemp was to add a videocrop in a valid pipeline, and it worked as expected:

gst-launch-1.0 \
v4l2src device=/dev/video2 io-mode=5 ! \
video/x-bayer, width=2592, height=1944, format=bggi10 ! queue leaky=2 ! \
tiovxisp sensor-name=SENSOR_OX05B_RGBIR \
dcc-isp-file=/opt/imaging/ox05b/dcc_viss.bin \
sink_0::dcc-2a-file=/opt/imaging/ox05b/dcc_2a.bin sink_0::device=/dev/v4l-subdev2 format-msb=9 ! \
video/x-raw, format=NV12 ! \
tiovxmultiscaler ! \
video/x-raw, format=NV12, width=1920, height=1280, framerate=30/1 ! \
tiovxldc dcc-file=/opt/imaging/ox05b/dcc_ldc.bin sensor-name=SENSOR_OX05B_RGBIR ! \
videocrop top=200 left=480 ! \
video/x-raw, format=NV12, width=1280, height=720, framerate=30/1 ! queue ! \
kmssink driver-name=tidss sync=false 

Then I wrote a python script to modify the cropping parameters as well as the resolution in the capsfilter at the same time periodically. But the image would always stuck when the method for modification is invoked. Part of the code is as follows:

//cap definitions
    default_caps = Gst.Caps.from_string("video/x-raw, width=1920, height=1080")
    cropped_caps = Gst.Caps.from_string("video/x-raw, width=960, height=540")

//code snippet in the modification method    
	if zoom_in:
        crop_right += zoom_step1
        crop_bottom += zoom_step
    else:
        crop_right -= zoom_step1
        crop_bottom -= zoom_step

	if crop_right == 480:
		zoom_in = False
		capsfilter.set_property("caps", cropped_caps)
	elif crop_right == 0:
		zoom_in = True
		capsfilter.set_property("caps", default_caps)

    crop_element.set_property("right", crop_right)
    crop_element.set_property("bottom", crop_bottom)

While trying to debug with limited log printed by gstreamer, I want to ask whether DISPC can accept input stream with variable resolution? And if it is capable to do so, would you mind provide me with an example?

Looking forward to your reply.

Regards,

Huang Jingjie

  • Hello,

    The limitations of the scaler unit is defined in the TRM.

    Programmable poly-phase filter (scaler): • Independent horizontal and vertical resampling: up-sampling (up to x16), and down-sampling (down to 1/4) • Maximum input width supported: 1280 pixels (using 32-bit pixels and 5-tap mode), 2560 pixels (using 16-bit pixels and 5-tap mode), and 2560 pixels (using 32-bit pixels and 3-tap mode)

    Regards,
    Krunal

  • Hi Krunal,

    Thank you very much for the reply.

    Unfortunately the info you provided is what we already know from the TRM. To be precise, I will elaborate on our demand and the question:

    1. we want to implement a zooming feature by utilizing the DISPC scaler unit to do the up-sampling on the fly. In such condition, the input resolution for it is expected to be variable, and we wonder if it can accpet such input stream.

    2. since the scaler has its resampling and maximun input width limits, I will list our specs here:

    • input resolution after ISP, LDC and etc. is 1920x1280
    • the resolution after cropping is 960x540
    • output resolution to the screen should be 1280x720
    • the maximum up-sampling and down-sampling coefficient should be 1.34x and 0.67x
    • to achieve a smooth transformation, some value sets among the input resolution and resolution after cropping are expected. Of course all the value sets chosen should respect other limitations, if any.

    I hope these info can help you better comprehend our question. If there is anything unclear, please don't hesitate to tell us.

    Regards,

    Huang Jingjie

  • Hello,

    1. DSS should be able to accept variable input resolution.
    2. Based on the specs provided, I do not see any limitations with DSS. However, we have not tested the above usecases. We tested scaling using modetest and here are the instructions: https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_00_00_03/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/Display/DSS7.html?highlight=lvds (look for Scaling)

    Regards,
    Krunal

  • Hi Krunal,

    Thank you for the hint. With the help of the kmsprint, I actually found the problem in my program and managed to fix it.

    Now the program can achieve the feature as expected.

    Regards,

    Huang Jingjie