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.

Two VLIB questions

Hi all

I am trying to use the Gauss5x5PyramidKernel_8()  function in VLIB 2.1.

1)  My program compiles but will not link. I have added the library to my project, but it can not resolve the symbol:

VLIB_gauss5x5PyramidKernel_8

Im stumped

 

2) The VLIB documentation states that the 'cols'  parameter should be equal to (W-4) and should be divisible by 8.

BUT the example program in VLIB folder for this function is calling it with  (16-4)  which is not divisible by 8,  but W (=16) is.

Is this a typo in the document.

From the VLIB pdf doc

24.2.2 Inputs
char                          *restrict pIn 5 x width input array (UQ8.0)
unsigned int           *restrict pB 5 x (width-4) temporary array (UQ16.0)
unsigned short       cols cols = W-4; must be divisible by 8 (UQ16.0)
unsigned short       pitch Pitch of the input data (UQ16.0)
unsigned short       rows rows = H; height of the input data; must be >4 (UQ16.0)
char *restrict            pOut 1 x (width-4)/2 output (UQ8.0)


24.2.3 Output
int Returns VLIB Error Status


24.2.4 Method
The value of cols = W-4 must be a multiple of 8, rows = H (height of the input data) must be > 4; while pIn,
pB, and pOut must be 64-bit aligned.

 

TIA

Dave

  • Some more info:

    I noticed the #pragma STRUCT_ALIGN in the VLIB_Protoypes.h file is only of the C style.

    I must compile as CPP.  Is this the possible reason the library reference can not resolve?

  •  you compile in c++ then the headers need to be c++ ready.

    a typical header file design contains

      ....extern "C" {...

      ...}...

  • Hello Dave,

    I checked with the VLIB_gauss5x5PyramidKernel_8 symbol. It seems to work fine.

    Please try with the test file provided for this kernel first and see if it works in the test project. ( VLIB_testGauss5x5PyramidKernel_8.c)

    Which library did you use ? C64x+, C64x or PC version ?

     

    Regarding the second question...

    The restriction is not a typo. It is required because of the usage of 8 byte loads.

    I understand that this condition may not hold good usually. I have informed the author about this and I will get back to you in sometime.

     

    Regards

    Senthil

  • Thanks all for the input.

    Yes, I resolved the c++ issue as suggested, I should have posted back.

    I understand the restriction on 8 byte boundaries.and the -4 being due to loss by 5x5 filter. fine.

    But  the supplied sample code is violating that requirement.

    In the doc, para 24.2.1,  says the output will be (w-4)/2 wide.   rather than cols/2.

    To me this implies that the w-4 is the number of processed columns and cols is redundant. But since cols it in the argument list, I would guess

    cols is actually the number processed columns and W must >= cols+4

     

    For example if I have a 640 pixel wide input,  cols = 640-4 is not divisible by 8.

    So do I fudge the W parameter as below and live with the additional loss of data?

    W = 636

    Cols = 632

    pitch = 640

     

    What happens if I violate these requirements? Do I get bad data, error, or just slower performance?

    Is there more complete documentation somewhere?

    thanks

    Dave

  •  

    Dave,

    There is no other documentation available.

    If the condition is violated, there will be an error in the last few values(<8).

    Regards

    Senthil

  • Wonderful.

    So is my example of how to set it up for 640 wide input correct?

     

  •  

    Dave,


    There seems to be a confusion with the terminolgies used.

    Let me try to clarify.

    In test case, Input image is of size 16*5.

    width = 12

    pitch = 16

    height = 5

    Now, (width - 4) =8  is a multiple of 8.

     

    For your case ( 640 wide input),

    just use the following parameters and it would work correctly.

    width = 640-4

    pitch = 640

     

    Regards

    Senthil