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.

Problem with 4x upscale using the resizer driver on dm6446

I'm trying to do an exact 4x upscale using the resizer, and it's not happy with it.  Looking at the linux driver code, it appears that the calculation of hrsz in the driver yields <64, which is then kicked out as invalid.

 

Input:

params->in_hsize = 200;

params->in_vsize = 120;

params->in_pitch = 1600;

params->out_hsize = 800;

params->out_vsize = 480;

params->out_pitch = 1600;

params->pix_fmt = RSZ_PIX_FMT_YUYV;

params->inptyp = RSZ_INTYPE_YCBCR422_16BIT;

params->cbilin = 0;

params->vert_starting_pixel = 0;

params->horz_starting_pixel = 0;

params->hstph = 0;

params->vstph = 0;

params->yenh_params.type = RSZ_YENH_DISABLE;

status = ioctl(rsz_fd, RSZ_S_PARAM, params);

 

The calculation in the resizer driver is:

    vrsz = ((params->in_vsize - NUM_D2TAPS) * RATIO_MULTIPLIER) /
        (params->out_vsize - 1);

 or vrsz = ((120-7)*256)/(480-1) = 60.39

It then recalculates it as

    vrsz = (params->in_vsize - NUM_TAPS) * RATIO_MULTIPLIER /
            (params->out_vsize - 1);

or vrsz = (120-4)*256/(480-1) = 61.99

Since vrsz < UP_RSZ_RATIO (64), it errors out.

 

hrsz is similar:

hrsz = 61.84, then recalculated as 62.80, and will also error out.

 

So, how do I get a 4x upscale?

BTW, the calcoeffs tool is misleading at best - it will happily (with -p) give you a resizer param structure with >4x upscale ("calccoef --insize 180x100 --outsize 800x480 --in_pitch 1600 --print_param " for example)

  • Someone moved this here from the DM64x forum, however the real question isn't so much the linux driver -- the driver simply implements the formulas found in the Understanding the Resizer  document from TI.  So far as I can tell, it implements them exactly as given in the document, and correctly back-calculates the register values for iw and ih per the document.  So there's no driver "bug" I can see.

    I need to do a 4x upscale, which all the documentation says the hardware is capable of.  However, it isn't clear that this is actually achievable unless the documentation is wrong or it left out something important.

    The real problem appears to be that the calculations you're given in the document yield illegal values for a 4x scale.

     

    Please move this thread back to where it came from. My apologies if it wasn't clear that the driver is doing what it's "supposed" to (per the document)