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.

resizer problem. artefacts

Hi.

When resizing artifacts occur. What could be the problem?

static Uint8 resizer_in_frame_buffer[IMAGE_DATA_SIZE];
static Uint8 resizer_out_frame_buffer[IMAGE_DATA_SIZE];
static Uint8 croped_frame[IMAGE_DATA_SIZE];

#pragma DATA_ALIGN(resizer_in_frame_buffer, 32);
#pragma DATA_ALIGN(resizer_out_frame_buffer, 32);
#pragma DATA_ALIGN(croped_frame, 32);

Bool hardware_resize_param(uint8_t *src, uint8_t *out, const int in_width, const int in_height, const int out_width, const int out_height)
{
Bool result = FALSE;
Bool empty_out = (out == 0);

memcpy(resizer_in_frame_buffer, src, in_width*in_height);

if(empty_out)
{
out = src;
}
memset(out, 0x80, out_width*out_height);

RSZ_params params = {
640, /* Input image width */
480, /* Input image height */
640, /* Input image pitch */
PSP_RSZ_INTYPE_PLANAR_8BIT, /* Input image type */
0, /* Vertical starting pixel */
0, /* Horizontal starting pixel */
0, /* Chroma position */
PSP_RSZ_PIX_FMT_PLANAR, /* Image format */
320, /* Intermediate image width */
240, /* Intermediate image height */
320, /* Intermediate image pitch */
0, /* Horizontal starting phase */
0, /* Vertical starting phase */
gRDRV_reszFilter4TapHighQuality,/* Horizontal filter coefficients */
gRDRV_reszFilter4TapHighQuality,/* Vertical filter coefficients */
PSP_RSZ_YENH_DISABLE /* Luma enhancement options */
};

params.inHsize = in_width;
params.inVsize = in_height;
params.inPitch = in_width;

params.outHsize = out_width;
params.outVsize = out_height;
params.outPitch = out_width;

resizer_params = params;

apply_params();

resizer_features.inBuf = resizer_in_frame_buffer;
resizer_features.inBufSize = in_width*in_height;
resizer_features.outBuf = resizer_out_frame_buffer;
resizer_features.outBufSize = out_width*out_height;

result = resize();

if(result)
{
memcpy(out, resizer_out_frame_buffer, out_width*out_height);
}

memset(resizer_in_frame_buffer, 0, IMAGE_DATA_SIZE);
memset(resizer_out_frame_buffer, 0, IMAGE_DATA_SIZE);

return result;
}

  • Hi,

    Thanks for your post.

    Did you tried looking at some existing resizer code for an example, in particular ~\dvsdk_1_11_00_00\pspdrivers_1_10_00\packages\ti\sdo\pspdrivers\drivers\resizer has code in it for setting up and running the resizer, though it is in the form of a BIOS driver it may still be of some help.

    Just for your reference, we are providing you configuration below for OMAP3 Resizer module which has exactly same IP as on DM6437 as far as Resizer is concerned.

    ./utrresizer -x 352 -y 288 -p 704 -v 88 -w 72 -q 192

    Where,

        x - input width

        y - input height

        p - input pitch

        v - output width

        w - output height

        q -  output pitch

    The important point note down here is that you have to consider pitch alignment for both input and output image. It means, while viewing image you must consider 32 byte alignment of pitch configuration.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    -------------------------------------------------------------------------------------------------------

  • Thank you,

    pspdrivers_1_10_03 I rebuilt under bios_6_41_00_26, it was long ago 1/10/2015.

     

    Minimize the Code to clarify the circumstances, also I tried callback resizer, but all bad:

     

    #pragma DATA_ALIGN(in_buff, 32);

    static Uint8 in_buff[640*480];

    ...

    while(TRUE)

    {

           static int count = 0;

          

           memset(in_buff, count++ % 2 ? 0x80 : 0x00, 640*480);

           hardware_resize_param(in_buff, out_buff, 640, 480, 320, 240);

     

           delay_msec(10);

    }

  • Hi Zorg,

    Have you tried the example mentioned here:
    e2e.ti.com/.../1767484
    From what I remember from the example the 640x480 to 320x240 resize was working.
    Can you try the example without modification as a test?

    Also there as some docs that you can look at that explain the internals of the resizer. See  :
    https://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/99/t/248906


    A.