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.

20-16 Non Linear LUT Creation

Hi team,

1)The Bit Bucket link shared earlier is not working please post an updated link here.

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1250611/rawfe-20-16-customization--tda4?tisearch=e2e-sitesearch&keymatch=rawfe%2020%20to%2016%20bit%20data#

2) I checked the TRM and rawfe_lut_20to16_0.txt that is stored in the sdk, there seems to be some deviation with what TRM says about the step function related logic, I was expecting a step value of 32 for 0-2^12 and 2048 for 2^13-2^20. When i checked the sdk shared data the starting is 0,45 and it seems to follow a different function, Am i missing something here or misinterpreting it?

Regards,
Dinesh

  • Hi Dinesh,

    Please try this link instead -- https://git.ti.com/cgit/processor-sdk/imaging/tree/tools/default_DCC_profile_gen?h=main

    TRM should be correct -- step value is dependent on input bit depth and not uniform.

  • Hi Gang,

    But for some reason the LUT given in the SDK is slightly different than what TRM says. 
     

    0    ,
    45   ,
    74   ,
    98   ,
    119  ,
    140  ,
    159  ,
    177  ,
    194  ,
    211  ,
    227  ,
    242  ,
    258  ,
    273  ,
    287  ,
    301  ,
    315  ,
    329  ,
    342  ,
    355  ,
    368  ,
    381  ,
    394  ,
    406  ,
    419  ,
    431  ,
    443  ,
    455  ,
    466  ,
    478  ,
    489  ,
    501  ,
    512  ,
    523  ,
    534  ,
    545  ,
    556  ,
    567  ,
    577  ,
    588  ,
    599  ,
    609  ,
    619  ,
    630  ,
    640  ,
    650  ,
    660  ,
    670  ,
    680  ,
    690  ,
    700  ,
    710  ,
    719  ,
    729  ,
    738  ,
    748  ,
    758  ,
    767  ,
    776  ,
    786  ,
    795  ,
    804  ,
    813  ,
    823  ,
    832  ,
    841  ,
    850  ,
    859  ,
    868  ,
    877  ,
    886  ,
    894  ,
    903  ,
    912  ,
    921  ,
    929  ,
    938  ,
    947  ,
    955  ,
    964  ,
    972  ,
    981  ,
    989  ,
    998  ,
    1006 ,
    1015 ,
    1023 ,
    1031 ,
    1039 ,
    1048 ,
    1056 ,
    1064 ,
    1072 ,
    1080 ,
    1089 ,
    1097 ,
    1105 ,
    1113 ,
    1121 ,
    1129 ,
    1137 ,
    1145 ,
    1153 ,
    1161 ,
    1168 ,
    1176 ,
    1184 ,
    1192 ,
    1200 ,
    1207 ,
    1215 ,
    1223 ,
    1231 ,
    1238 ,
    1246 ,
    1254 ,
    1261 ,
    1269 ,
    1276 ,
    1284 ,
    1291 ,
    1299 ,
    1307 ,
    1314 ,
    1321 ,
    1329 ,
    1336 ,
    1344 ,
    1351 ,
    1794 ,
    2195 ,
    2566 ,
    2915 ,
    3247 ,
    3566 ,
    3872 ,
    4168 ,
    4456 ,
    4736 ,
    5009 ,
    5276 ,
    5537 ,
    5792 ,
    6044 ,
    6290 ,
    6533 ,
    6772 ,
    7007 ,
    7239 ,
    7468 ,
    7694 ,
    7917 ,
    8137 ,
    8355 ,
    8570 ,
    8783 ,
    8994 ,
    9203 ,
    9410 ,
    9615 ,
    9818 ,
    10019,
    10219,
    10417,
    10613,
    10808,
    11001,
    11193,
    11383,
    11572,
    11760,
    11946,
    12132,
    12316,
    12498,
    12680,
    12861,
    13040,
    13219,
    13396,
    13573,
    13748,
    13923,
    14096,
    14269,
    14441,
    14611,
    14782,
    14951,
    15119,
    15287,
    15454,
    15620,
    15785,
    15949,
    16113,
    16276,
    16439,
    16601,
    16762,
    16922,
    17082,
    17241,
    17399,
    17557,
    17714,
    17871,
    18027,
    18183,
    18338,
    18492,
    18646,
    18799,
    18952,
    19104,
    19256,
    19407,
    19558,
    19708,
    19858,
    20007,
    20156,
    20304,
    20452,
    20599,
    20746,
    20892,
    21038,
    21184,
    21329,
    21474,
    21618,
    21762,
    21906,
    22049,
    22192,
    22334,
    22476,
    22617,
    22759,
    22899,
    23040,
    23180,
    23320,
    23459,
    23598,
    23736,
    23875,
    24013,
    24150,
    24288,
    24425,
    24561,
    24697,
    24833,
    24969,
    25104,
    25239,
    25374,
    25509,
    25643,
    25776,
    25910,
    26043,
    26176,
    26309,
    26441,
    26573,
    26705,
    26836,
    26968,
    27099,
    27229,
    27360,
    27490,
    27620,
    27749,
    27879,
    28008,
    28137,
    28265,
    28394,
    28522,
    28650,
    28777,
    28905,
    29032,
    29159,
    29285,
    29412,
    29538,
    29664,
    29790,
    29915,
    30040,
    30166,
    30290,
    30415,
    30539,
    30664,
    30788,
    30911,
    31035,
    31158,
    31281,
    31404,
    31527,
    31649,
    31772,
    31894,
    32016,
    32137,
    32259,
    32380,
    32501,
    32622,
    32743,
    32863,
    32984,
    33104,
    33224,
    33344,
    33463,
    33583,
    33702,
    33821,
    33940,
    34059,
    34177,
    34296,
    34414,
    34532,
    34650,
    34767,
    34885,
    35002,
    35119,
    35236,
    35353,
    35470,
    35586,
    35702,
    35819,
    35935,
    36050,
    36166,
    36282,
    36397,
    36512,
    36627,
    36742,
    36857,
    36971,
    37086,
    37200,
    37314,
    37428,
    37542,
    37656,
    37769,
    37883,
    37996,
    38109,
    38222,
    38335,
    38448,
    38560,
    38673,
    38785,
    38897,
    39009,
    39121,
    39232,
    39344,
    39455,
    39567,
    39678,
    39789,
    39900,
    40011,
    40121,
    40232,
    40342,
    40452,
    40562,
    40672,
    40782,
    40892,
    41002,
    41111,
    41220,
    41330,
    41439,
    41548,
    41657,
    41765,
    41874,
    41983,
    42091,
    42199,
    42307,
    42415,
    42523,
    42631,
    42739,
    42846,
    42954,
    43061,
    43168,
    43275,
    43382,
    43489,
    43596,
    43703,
    43809,
    43916,
    44022,
    44128,
    44234,
    44340,
    44446,
    44552,
    44658,
    44763,
    44869,
    44974,
    45079,
    45184,
    45289,
    45394,
    45499,
    45604,
    45708,
    45813,
    45917,
    46022,
    46126,
    46230,
    46334,
    46438,
    46542,
    46645,
    46749,
    46852,
    46956,
    47059,
    47162,
    47265,
    47368,
    47471,
    47574,
    47677,
    47780,
    47882,
    47985,
    48087,
    48189,
    48291,
    48394,
    48496,
    48597,
    48699,
    48801,
    48903,
    49004,
    49106,
    49207,
    49308,
    49409,
    49510,
    49611,
    49712,
    49813,
    49914,
    50015,
    50115,
    50216,
    50316,
    50416,
    50516,
    50617,
    50717,
    50817,
    50916,
    51016,
    51116,
    51216,
    51315,
    51415,
    51514,
    51613,
    51713,
    51812,
    51911,
    52010,
    52109,
    52207,
    52306,
    52405,
    52503,
    52602,
    52700,
    52799,
    52897,
    52995,
    53093,
    53191,
    53289,
    53387,
    53485,
    53582,
    53680,
    53778,
    53875,
    53973,
    54070,
    54167,
    54264,
    54361,
    54458,
    54555,
    54652,
    54749,
    54846,
    54943,
    55039,
    55136,
    55232,
    55328,
    55425,
    55521,
    55617,
    55713,
    55809,
    55905,
    56001,
    56097,
    56193,
    56288,
    56384,
    56479,
    56575,
    56670,
    56766,
    56861,
    56956,
    57051,
    57146,
    57241,
    57336,
    57431,
    57526,
    57621,
    57715,
    57810,
    57904,
    57999,
    58093,
    58187,
    58282,
    58376,
    58470,
    58564,
    58658,
    58752,
    58846,
    58940,
    59033,
    59127,
    59221,
    59314,
    59408,
    59501,
    59594,
    59688,
    59781,
    59874,
    59967,
    60060,
    60153,
    60246,
    60339,
    60432,
    60525,
    60617,
    60710,
    60802,
    60895,
    60987,
    61080,
    61172,
    61264,
    61357,
    61449,
    61541,
    61633,
    61725,
    61817,
    61908,
    62000,
    62092,
    62184,
    62275,
    62367,
    62458,
    62550,
    62641,
    62732,
    62824,
    62915,
    63006,
    63097,
    63188,
    63279,
    63370,
    63461,
    63552,
    63643,
    63733,
    63824,
    63915,
    64005,
    64096,
    64186,
    64276,
    64367,
    64457,
    64547,
    64637,
    64727,
    64817,
    64907,
    64997,
    65087,
    65177,
    65267,
    65357,
    65446,
    65535
    



    Regards,
    Dinesh

  • Hi Dinesh,

    This is the same as TRM specified -- 639 x 16-bit entries.

  • Hi Gang,

    yeah except that the increment is different here, TRM says the step size of 32 till 4095. And 2048 from 4096 t0 2^20. The number of entries are the same but the value is a 16bit value and the step size are different completely.

    Regards,
    Dinesh

  • yeah except that the increment is different here,

    The increment is implicitly and not included in the LUT above.
    Everything looks correct to me in "rawfe_lut_20to16_0.txt" -- it is for a mapping from 20-bit to 16-bit.

    I don't see "rawfe_lut_20to16_0.txt" is used anywhere in SDK though.

    TRM says the step size of 32 till 4095. And 2048 from 4096 t0 2^20.

    Yes, this is correct for 20-bit input.

    BTW, you won't get 20-bit input for LUT except for some very special cases.
    Where are you using the 20-to-16 conversion in VISS?

  • I don't see "rawfe_lut_20to16_0.txt" is used anywhere in SDK though.

    Oh I was expecting this to be default table. Then i wonder how does the system convert the 20 bit decompanded data to 16 bits

    you won't get 20-bit input for LUT except for some very special cases.

    But we are decompanding from 12 to 20 bits right. 

    Where are you using the 20-to-16 conversion in VISS?

    This 20-16 is intended for the RAWFE Decompand LUT as mentioned in the TRM. Where the blocks after Decompanding supports 16 bits only.

  • I don't see "rawfe_lut_20to16_0.txt" is used anywhere in SDK though.

    I could see it here : vx_vpac_viss_target_defaults.c

  • I could see it here : vx_vpac_viss_target_defaults.c

    Yes, you are correct on that.

    Please also note that this LUT is just a place holder and it is not enabled.

                lutCfg->enable    = 0u;
                lutCfg->inputBits = 16u;
                lutCfg->clip      = 4095u;
                lutCfg->tableAddr = grawfe_lut_20to16;
    
    

  • I see. Then does this conversion happen within the DCC configuration?

    0,
    1,
    3,
    5,
    7,
    9,
    11,
    13,
    15,
    17,
    19,
    21,
    23,
    25,
    27,
    29,
    31,
    33,
    35,
    37,
    39,
    41,
    43,
    45,
    47,
    49,
    51,
    53,
    55,
    57,
    59,
    61,
    63,
    79,
    95,
    111,
    127,
    143,
    159,
    175,
    191,
    207,
    223,
    239,
    255,
    271,
    287,
    303,
    319,
    335,
    351,
    367,
    383,
    399,
    415,
    431,
    447,
    463,
    479,
    495,
    511,
    639,
    767,
    895,
    1023,
    1151,
    1279,
    1407,
    1535,
    1663,
    1791,
    1919,
    2047,
    2175,
    2303,
    2431,
    2559,
    2687,
    2815,
    2943,
    3071,
    3199,
    3327,
    3455,
    3583,
    3711,
    3839,
    3967,
    4095,
    5328,
    7404,
    9480,
    11556,
    13632,
    15708,
    17785,
    19861,
    21937,
    24013,
    26089,
    28165,
    30241,
    32317,
    34393,
    36469,
    38545,
    40621,
    42698,
    44774,
    46850,
    48926,
    51002,
    53078,
    55154,
    57230,
    59306,
    61382,
    63458,
    65534,
    65534,
    65534,
    65534,
    65534,
    65534,
    65534,
    65534,
    65534,
    65534,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    65535,
    
    As mentioned this file?

  • This looks like the 12-bit to 16-bit conversion for decompanding and gamma compression.