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.

AM62A3: H3A Weight Problem for Each Partition

Part Number: AM62A3

Tool/software:

Hello, TI expert
When I tried to execute the TI-AE-do function again, I found that there was a parameter called uint8_t * weight, which should be the weight of each block in H3A. However, he did not design the actual parameters. Coincidentally, I wanted to set different weights for each partition in H3A module. Have you had any experience setting different weights for each partition in H3A before, and is there a convenient interface for setting weights?

   

  • Hi enrui,

    I found that there was a parameter called uint8_t * weight, which should be the weight of each block in H3A

    Yes, there is a weight input for AE.

    Coincidentally, I wanted to set different weights for each partition in H3A module

    You may see how weight is applied to the H3A output in the code inside TI_AE_do as below.

        for (i = 0; i < height; i++)
        {
            for (j = 0; j < width; j++)
            {
                cnt_tol++;
                if (weight != NULL)
                {
                    // 1024 * 64 * 64 * 128 = 2**29
                    rsum += (int32_t)h3a_data[i * width + j].red   * weight[i * width + j];
                    gsum += (int32_t)h3a_data[i * width + j].green * weight[i * width + j];
                    bsum += (int32_t)h3a_data[i * width + j].blue  * weight[i * width + j];
                    // 64 * 64 * 128 = 2**19
                    wsum += weight[i * width + j];
                }
                else
                {
                    rsum += (int32_t) h3a_data[i * width + j].red;
                    gsum += (int32_t) h3a_data[i * width + j].green;
                    bsum += (int32_t) h3a_data[i * width + j].blue;
                    wsum += 1;
                }
    

    is there a convenient interface for setting weights?

    You may simply make your own spatial weighting array as input to TI_AE_do.