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.

resizing problem

Other Parts Discussed in Thread: TMS320DM6437

hello

I have the davinci TMS320DM6437

my video input is NTSC

when I am trying to use the resizer to upscale from 240x240 to 420x420 every thing works fine (i used the linux coefficient calculator)

but when i am trying to upscale from 240x360 to 420x720 or 120x120 to 240x240

it shows me this:

120x120 to 420x420

I am reciving 420x720 video

and sending to the resizer 120x120 of the picture

and then overwriting the 240x240 outbuff to the output

code:

#define INHEIGHT    (120u)
#define INWIDTH     (120u)
#define OUTHEIGHT   (240u)
#define OUTWIDTH    (240u)

 

#define gRDRV_reszFilter4TapX2v1 0, 256, 0, 0, -11, 245, 23,-1,    -17, \
    220, 58, -5, -18, 184, 100, -10, -15, 143, 143, -15, -10, 100, 184, -18, -5, \
    58, 220, -17, -1, 23, 245, -11

static PSP_RSZparams params =
{
    INWIDTH,                        /* Input image width */
    INHEIGHT,                       /* Input image height */
    INWIDTH*(2u),                    /* Input image pitch */
    PSP_RSZ_INTYPE_YCBCR422_16BIT,  /* Input image type */
    0,                              /* Vertical starting pixel */
    0,                              /* Horizonatl starting pixel */
    0,                              /* Chroma position */
    PSP_RSZ_PIX_FMT_YUYV,           /* Image format */
    OUTWIDTH,                       /* Intermediate image width */
    OUTHEIGHT,                      /* Intermediate image height */
    OUTWIDTH*(2u),                  /* Intermediate image pitch */
    0,                              /* Horizontal starting phase */
    0,                              /* Vertical starting phase */
    gRDRV_reszFilter4TapX2v1,         /* Horizontal filter coefficients */
    gRDRV_reszFilter4TapX2v1,          /* Vertical filter coefficients */
    PSP_RSZ_YENH_DISABLE             /* Luma enhancement options */
};

thank you!

 

  • It looks like the output line length is too short with respect to the input length.

    Try increasing and decreasing each input/output register individually by single increments/decrements to see if you can achieve alignment.

    This type of skew is typical of when source and destination line lengths are somehow mis-aligned.

    There are many places the mis-alignment could be introduced. Sometimes the settings necessary in the registers are (length-1) for example.

    I am not 100% familiar with this particular software interface, but have seen this result many time, and is pretty much always cause by line length errors.

    Just something to try :)

    BR,

    Steve

  • Hi,

     

    As far as i remember, line length has to be 32 byte aligned. Try making line length 32 byte aligned.

     

    Thanks,

    Brijesh Jadav

  • Brijesh Jadav said:

    Hi,

     

    As far as i remember, line length has to be 32 byte aligned. Try making line length 32 byte aligned.

     

    Thanks,

    Brijesh Jadav

    I tried your suggestion but it gives the same results

    #pragma DATA_ALIGN(array,32);
    char array[INHEIGHT*INWIDTH*2];
    #pragma DATA_ALIGN(outarray,32);
    char outarray[OUTHEIGHT*OUTWIDTH*2];

     

  • Steve Clynes said:

    It looks like the output line length is too short with respect to the input length.

    Try increasing and decreasing each input/output register individually by single increments/decrements to see if you can achieve alignment.

    This type of skew is typical of when source and destination line lengths are somehow mis-aligned.

    There are many places the mis-alignment could be introduced. Sometimes the settings necessary in the registers are (length-1) for example.

    I am not 100% familiar with this particular software interface, but have seen this result many time, and is pretty much always cause by line length errors.

    Just something to try :)

    BR,

    Steve

    I am trying your suggestion but I get alot of GIO errors when I try to play with the buffer sizes

    what is really weird is that when the line output size is 420 it always works,,,,,

  • Hi,

     

    Not only buffer pointer, but line offset i.e. pitch has to be 323 byte aligned. If you are resizing 120x120 to 240x240, you are setting pitch of the input image as 240, which is not 32 byte aligned. Try making input and output buffer pitch to be 32 byte aligned.

     

    Thanks,

    Brijesh Jadav

  •  

    Brijesh Jadav said:

    Hi,

     

    Not only buffer pointer, but line offset i.e. pitch has to be 323 byte aligned. If you are resizing 120x120 to 240x240, you are setting pitch of the input image as 240, which is not 32 byte aligned. Try making input and output buffer pitch to be 32 byte aligned.

     

    Thanks,

    Brijesh Jadav

    thank you!

    that was the problem... :)

  • Hi Brijesh

    Period of time I just touch Resize,can you tell me thelinux coefficient calculator how to get.

    Thanks

    Man Dai

  • Man Dai said:

    Hi Brijesh

    Period of time I just touch Resize,can you tell me thelinux coefficient calculator how to get.

    Thanks

    Man Dai

    I'd like to know where this is as well.

    John A

  • See if you can get it from apps in below document

     

    http://focus.ti.com.cn/cn/lit/an/spraai7b/spraai7b.pdf

     

    Thanks,

    Brijesh Jadav

  • Hi,

    I want to upscale a video from 320x240 (UYVY) to 720x576.

    Input and output are  32 byte aligned, but the resizer doesn't work properly.

    0x01C70428 status register says error.

    I've tried other resolution:

    320x240 -> 720x480  OK

    320x240 -> 640x576  OK

    320x240 -> 720x something > 480 KO !!!

    can someone help me ?

    Thanks,

    Angelo