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.

DM385-AR0331: In HDR and Linear modes - rings of color observed

Part Number: TMS320DM8127
Other Parts Discussed in Thread: DM385

Hello,

I have successfully programmed the AR0331 sensor for HDR mode on our proprietary board. See register definitions attached.

I observe colored rings in the darker areas and I wonder what causes them and how the colors can be made smoother.

The Iss_Ar0331GainCalc function in issdrv_ar0331Api.c had no code for gains < 10000. This means that there's no code for outdoor-sunlight video.

We use the TI 2A and issdrv_ar0331Api -New.c has the new fixes for our proprietary application.

I fixed up the code, but possibly this is causing the rings of color?

I'd appreciate any ideas,

Thanks,

Mechi

issdrv_ar0331Api.cissdrv_ar0331Api -New.c

  • Here's the list of register definitions

    AR0331_reg_0.txt
    0x1000 	 0x1
    0x1004 	 0x1
    0x1006 	 0x1
    0x1008 	 0x0
    0x100A 	 0x384
    0x1080 	 0x1
    0x1084 	 0x1
    0x1086 	 0x7FF
    0x1088 	 0x1
    0x1100 	 0x4000
    0x1104 	 0x4280
    0x1108 	 0x1
    0x110A 	 0x40
    0x110C 	 0x4080
    0x1110 	 0x41C0
    0x1114 	 0x20
    0x1116 	 0x180
    0x1118 	 0x43C0
    0x111C 	 0x4440
    0x1120 	 0x1
    0x1122 	 0x10
    0x1124 	 0x41F0
    0x1128 	 0x4439
    0x112C 	 0x40C0
    0x1130 	 0x4294
    0x1134 	 0x4
    0x1136 	 0x10
    0x1140 	 0x12
    0x1142 	 0xFFFFFFFF
    0x1144 	 0x44C
    0x1146 	 0xFFFFFFFE
    0x1148 	 0xA4
    0x114A 	 0x10
    0x1180 	 0x6
    0x1182 	 0x0
    0x1184 	 0x805
    0x1186 	 0x607
    0x11C0 	 0x1
    0x11C2 	 0x1
    0x11C4 	 0x1
    0x11C6 	 0x5
    0x1200 	 0x0
    0x1400 	 0x0
    0x1402 	 0x0
    0x1404 	 0x0
    0x1406 	 0x0
    0x1408 	 0x0
    0x140A 	 0x0
    0x140C 	 0x0
    0x140E 	 0x0
    0x1410 	 0x0
    0x2400 	 0x2
    0x2402 	 0x4
    0x2404 	 0x3E9
    0x2406 	 0x0
    0x2408 	 0x30E
    0x240A 	 0x0
    0x240C 	 0xFFFFA293
    0x240E 	 0x0
    0x2410 	 0x10
    0x2412 	 0x10
    0x2414 	 0x3
    0x2416 	 0xFA0
    0x2418 	 0x33
    0x241A 	 0x33
    0x241C 	 0x33
    0x241E 	 0x2
    0x2420 	 0x13
    0x2422 	 0x0
    0x2424 	 0x0
    0x2426 	 0x0
    0x2428 	 0x0
    0x242A 	 0xD
    0x242C 	 0x0
    0x242E 	 0x4FA8
    0x2430 	 0x0
    0x2432 	 0xFFFF89F5
    0x2434 	 0x0
    0x2436 	 0x4
    0x2438 	 0x10
    0x243A 	 0x20
    0x243C 	 0x0
    0x243E 	 0x200
    0x2440 	 0x2
    0x2442 	 0x80
    0x2444 	 0x0
    0x2446 	 0x4
    0x2448 	 0x14
    0x244A 	 0x0
    0x244C 	 0xFFFF9F46
    0x244E 	 0x0
    0x2450 	 0x0
    0x3000 	 0x2602
    0x3002 	 0x14
    0x3004 	 0x66
    0x3006 	 0x5F3
    0x3008 	 0x7A5
    0x300A 	 0x605
    0x300C 	 0x504
    0x300E 	 0x2000
    0x3010 	 0xFFFFBEEF
    0x3012 	 0xFE
    0x3014 	 0x0
    0x3016 	 0x10
    0x3018 	 0x0
    0x301A 	 0x10DC
    0x301C 	 0x100
    0x301D 	 0x0
    0x301E 	 0x0
    0x3021 	 0x0
    0x3022 	 0x0
    0x3026 	 0x6500
    0x3028 	 0x10
    0x302A 	 0x6
    0x302C 	 0x1
    0x302E 	 0x5
    0x3030 	 0x80
    0x3036 	 0xC
    0x3038 	 0x1
    0x303A 	 0x7C59
    0x303C 	 0x0
    0x303E 	 0x44C
    0x3040 	 0x0
    0x3042 	 0x0
    0x3044 	 0x400
    0x3046 	 0x0
    0x3048 	 0x100
    0x304A 	 0x20
    0x304C 	 0x200
    0x304E 	 0x0
    0x3050 	 0x6980
    0x3052 	 0xFFFFA124
    0x3054 	 0x0
    0x3056 	 0x29
    0x3058 	 0x29
    0x305A 	 0x29
    0x305C 	 0x29
    0x305E 	 0x29
    0x3060 	 0x0
    0x3062 	 0x333
    0x3064 	 0x1982
    0x306A 	 0x0
    0x306C 	 0x1000
    0x306E 	 0xFFFF9010
    0x3070 	 0x0
    0x3072 	 0x0
    0x3074 	 0x0
    0x3076 	 0x0
    0x3078 	 0x0
    0x307A 	 0x0
    0x307C 	 0xF
    0x3082 	 0x8
    0x3084 	 0x9
    0x3086 	 0x1600
    0x3088 	 0x1CE
    0x308A 	 0x42
    0x308C 	 0x4
    0x308E 	 0x7C9
    0x3090 	 0x603
    0x3092 	 0xF
    0x3094 	 0x0
    0x3096 	 0x80
    0x3098 	 0x80
    0x309A 	 0x215
    0x309E 	 0x1D0
    0x30A0 	 0x1
    0x30A2 	 0x1
    0x30A4 	 0x1
    0x30A6 	 0x1
    0x30A8 	 0x1
    0x30AA 	 0x610
    0x30AE 	 0x5
    0x30B0 	 0x0
    0x30B2 	 0x0
    0x30B4 	 0x0
    0x30B6 	 0x2FE
    0x30B8 	 0x202D
    0x30BA 	 0x7EC
    0x30BC 	 0x80
    0x30BE 	 0x80
    0x30C0 	 0x80
    0x30C2 	 0x80
    0x30C4 	 0x80
    0x30C6 	 0x1D4
    0x30C8 	 0x1C0
    0x30CA 	 0xFFFFA034
    0x30CC 	 0xFFFFC623
    0x30CE 	 0x0
    0x30D0 	 0x5
    0x30D2 	 0x4
    0x30DA 	 0xA
    0x30DE 	 0x10C0
    0x30E0 	 0x1208
    0x30E2 	 0x7000
    0x30E4 	 0x1200
    0x30E6 	 0x3000
    0x30E8 	 0x1210
    0x30EA 	 0x1110
    0x30EC 	 0x0
    0x30EE 	 0x10C0
    0x30F0 	 0x1208
    0x30F2 	 0x1200
    0x30F4 	 0x4000
    0x30F6 	 0x1210
    0x30F8 	 0x1110
    0x30FA 	 0x0
    0x30FC 	 0x0
    0x30FE 	 0x0
    0x3130 	 0xF1F
    0x3132 	 0xF1F
    0x3134 	 0x1818
    0x3136 	 0x3131
    0x3138 	 0x4431
    0x313A 	 0x0
    0x313C 	 0x0
    0x313E 	 0x0
    0x3140 	 0x0
    0x3142 	 0x0
    0x3144 	 0x4B0
    0x3146 	 0x4B0
    0x3148 	 0x0
    0x314A 	 0xFFFFFFFF
    0x314C 	 0x100
    0x314E 	 0x20
    0x3150 	 0x0
    0x3152 	 0x7B3
    0x3154 	 0x0
    0x3156 	 0x10
    0x3158 	 0x0
    0x315A 	 0x4FFF
    0x315C 	 0x0
    0x315E 	 0xC1
    0x3160 	 0x48A8
    0x3162 	 0x76
    0x3176 	 0x80
    0x3178 	 0x80
    0x317A 	 0x80
    0x317C 	 0x80
    0x317E 	 0xFFFF87FF
    0x3180 	 0xFFFF8089
    0x3182 	 0x1FFF
    0x3184 	 0x1FFF
    0x3186 	 0x1FFF
    0x3188 	 0x1FFF
    0x318A 	 0xE10
    0x318C 	 0xFFFF8001
    0x318E 	 0x0
    0x3190 	 0x0
    0x3192 	 0x400
    0x3194 	 0xBB8
    0x3196 	 0xDAC
    0x3198 	 0x61E
    0x319E 	 0x5040
    0x31A0 	 0x6100
    0x31A2 	 0xBB8
    0x31A4 	 0x1FFF
    0x31A6 	 0x1FFF
    0x31A8 	 0x1FFF
    0x31AA 	 0x1FFF
    0x31AC 	 0xC0C
    0x31AE 	 0x301
    0x31C0 	 0xFFFF8000
    0x31C2 	 0xFFFFFFFF
    0x31C4 	 0xFFFFF555
    0x31C6 	 0xFFFF8000
    0x31C8 	 0x0
    0x31CA 	 0x0
    0x31CC 	 0x0
    0x31CE 	 0x0
    0x31D0 	 0x0
    0x31D2 	 0x0
    0x31D6 	 0xFFFFA66D
    0x31DA 	 0x0
    0x31DC 	 0x0
    0x31DE 	 0x0
    0x31E0 	 0x200
    0x31E2 	 0x1DE1
    0x31E4 	 0xD0
    0x31E6 	 0x0
    0x31E8 	 0x0
    0x31EA 	 0x0
    0x31EC 	 0x0
    0x31EE 	 0x0
    0x31F4 	 0x0
    0x31F6 	 0x0
    0x31F8 	 0x0
    0x31FA 	 0x0
    0x31FC 	 0x3020
    0x31FE 	 0x2
    0x3200 	 0x2
    0x3202 	 0xCF
    0x3204 	 0xB6D
    0x3206 	 0xA06
    0x3208 	 0x1A12
    0x320A 	 0x0
    0x320C 	 0x80
    0x320E 	 0x100
    0x3210 	 0x200
    0x3600 	 0xC55
    0x3602 	 0x32EC
    0x3604 	 0x4811
    0x3606 	 0xFFFFDF7F
    0x3608 	 0xFFFF8001
    0x360A 	 0xFFFF8001
    0x360C 	 0x7DE0
    0x360E 	 0xFFFF8001
    0x3610 	 0xFFFF8001
    0x3612 	 0xFFFF8001
    0x3614 	 0x6077
    0x3616 	 0x2482
    0x3618 	 0xFFFF8001
    0x361A 	 0xFFFFCD4A
    0x361C 	 0xFFFFB0D0
    0x361E 	 0xFFFFBCDE
    0x3620 	 0xFFFF8081
    0x3622 	 0xFFFF8001
    0x3624 	 0xFFFF999D
    0x3626 	 0xFFFF8001
    0x3640 	 0xB3D
    0x3642 	 0x54D8
    0x3644 	 0x1888
    0x3646 	 0x3672
    0x3648 	 0x7DC7
    0x364A 	 0xFFFF8001
    0x364C 	 0xFFFFB394
    0x364E 	 0xFFFFDB27
    0x3650 	 0xFFFF8813
    0x3652 	 0xFFFF8001
    0x3654 	 0xFFFF99B3
    0x3656 	 0xFFFF8001
    0x3658 	 0xFFFFDCD9
    0x365A 	 0xFFFFFB05
    0x365C 	 0xFFFFACE9
    0x365E 	 0xFFFFC5AF
    0x3660 	 0x95
    0x3662 	 0x4A1
    0x3664 	 0x5ECC
    0x3666 	 0xFFFF8001
    0x3680 	 0x13A4
    0x3682 	 0x4564
    0x3684 	 0xFFFFE179
    0x3686 	 0x3AA2
    0x3688 	 0x7CE8
    0x368A 	 0xFFFF8001
    0x368C 	 0x5A01
    0x368E 	 0xFFFFC005
    0x3690 	 0xFFFF8001
    0x3692 	 0xFFFF8001
    0x3694 	 0xFFFF8001
    0x3696 	 0x506E
    0x3698 	 0x96B
    0x369A 	 0xFFFFE1B7
    0x369C 	 0xFFFFBC14
    0x369E 	 0xFFFF9D4D
    0x36A0 	 0xFFFFB1C0
    0x36A2 	 0xFFFFA82C
    0x36A4 	 0xFFFF8001
    0x36A6 	 0xFFFFC045
    0x36C0 	 0xFFFFB70D
    0x36C2 	 0xFFFFEE88
    0x36C4 	 0x1222
    0x36C6 	 0x25
    0x36C8 	 0xFFFF8001
    0x36CA 	 0xFFFF8001
    0x36CC 	 0x2844
    0x36CE 	 0xFFFF8001
    0x36D0 	 0xFFFF8001
    0x36D2 	 0xFFFF8001
    0x36D4 	 0xFFFF8001
    0x36D6 	 0xFFFF8001
    0x36D8 	 0xFFFFC901
    0x36DA 	 0xFFFFA64C
    0x36DC 	 0xFFFF8001
    0x36DE 	 0xFFFF8001
    0x36E0 	 0xFFFFD203
    0x36E2 	 0xFFFFDC02
    0x36E4 	 0xFFFF8001
    0x36E6 	 0xFFFF8001
    0x3700 	 0xFFFFE5C1
    0x3702 	 0x4080
    0x3704 	 0x305
    0x3706 	 0x3701
    0x3708 	 0xFFFFD004
    0x370A 	 0xFFFFE953
    0x370C 	 0xFFFF8001
    0x370E 	 0xFFFFB92C
    0x3710 	 0xFFFF8001
    0x3712 	 0xFFFF8001
    0x3714 	 0xFFFF8938
    0x3716 	 0x752A
    0x3718 	 0xFFFFD854
    0x371A 	 0xFFFF8001
    0x371C 	 0xFFFF8442
    0x371E 	 0xFFFFC181
    0x3720 	 0xFFFF8001
    0x3722 	 0xFFFF9480
    0x3724 	 0xFFFF8001
    0x3726 	 0xFFFF88B0
    0x3780 	 0x0
    0x3782 	 0xCDB
    0x3784 	 0x18C
    0x37C0 	 0x5A7D
    0x37C2 	 0xFFFFC800
    0x37C4 	 0xFFFFEC8B
    0x37C6 	 0xFFFF9A50
    0x3800 	 0x0
    0x3802 	 0x0
    0x3804 	 0x0
    0x3806 	 0x0
    0x3808 	 0x0
    0x380A 	 0x0
    0x380C 	 0x0
    0x380E 	 0x0
    0x3810 	 0x0
    0x3812 	 0x0
    0x3814 	 0x0
    0x3816 	 0x0
    0x3818 	 0x0
    0x381A 	 0x0
    0x381C 	 0x0
    0x381E 	 0x0
    0x3820 	 0x0
    0x3822 	 0x0
    0x3824 	 0x0
    0x3826 	 0x0
    0x3828 	 0x0
    0x382A 	 0x0
    0x382C 	 0x0
    0x382E 	 0x0
    0x3830 	 0x0
    0x3832 	 0x0
    0x3834 	 0x0
    0x3836 	 0x0
    0x3838 	 0x0
    0x383A 	 0x0
    0x383C 	 0x0
    0x383E 	 0x0
    0x3840 	 0x0
    0x3842 	 0x0
    0x3844 	 0x0
    0x3846 	 0x0
    0x3848 	 0x0
    0x384A 	 0x0
    0x384C 	 0x0
    0x384E 	 0x0
    0x3850 	 0x0
    0x3852 	 0x0
    0x3854 	 0x0
    0x3856 	 0x0
    0x3858 	 0x0
    0x385A 	 0x0
    0x385C 	 0x0
    0x385E 	 0x0
    0x3860 	 0x0
    0x3862 	 0x0
    0x3864 	 0x0
    0x3866 	 0x0
    0x3868 	 0x0
    0x386A 	 0x0
    0x386C 	 0x0
    0x386E 	 0x0
    0x3870 	 0x0
    0x3872 	 0x0
    0x3874 	 0x0
    0x3876 	 0x0
    0x3878 	 0x0
    0x387A 	 0x0
    0x387C 	 0x0
    0x387E 	 0x0
    0x3880 	 0x0
    0x3882 	 0x0
    0x3884 	 0x0
    0x3886 	 0x0
    0x3888 	 0x0
    0x388A 	 0x0
    0x388C 	 0x0
    0x388E 	 0x0
    0x3890 	 0x0
    0x3892 	 0x0
    0x3894 	 0x0
    0x3896 	 0x0
    0x3898 	 0x0
    0x389A 	 0x0
    0x389C 	 0x0
    0x389E 	 0x0
    0x38A0 	 0x0
    0x38A2 	 0x0
    0x38A4 	 0x0
    0x38A6 	 0x0
    0x38A8 	 0x0
    0x38AA 	 0x0
    0x38AC 	 0x0
    0x38AE 	 0x0
    0x38B0 	 0x0
    0x38B2 	 0x0
    0x38B4 	 0x0
    0x38B6 	 0x0
    0x38B8 	 0x0
    0x38BA 	 0x0
    0x38BC 	 0x0
    0x38BE 	 0x0
    0x38C0 	 0x0
    0x38C2 	 0x0
    0x38C4 	 0x0
    0x38C6 	 0x0
    0x38C8 	 0x0
    0x38CA 	 0x0
    0x38CC 	 0x0
    0x38CE 	 0x0
    0x38D0 	 0x0
    0x38D2 	 0x0
    0x38D4 	 0x0
    0x38D6 	 0x0
    0x38D8 	 0x0
    0x38DA 	 0x0
    0x38DC 	 0x0
    0x38DE 	 0x0
    0x38E0 	 0x0
    0x38E2 	 0x0
    0x38E4 	 0x0
    0x38E6 	 0x0
    0x38E8 	 0x0
    0x38EA 	 0x0
    0x38EC 	 0x0
    0x38EE 	 0x0
    0x38F0 	 0x0
    0x38F2 	 0x0
    0x38F4 	 0x0
    0x38F6 	 0x0
    0x38F8 	 0x0
    0x38FA 	 0x0
    0x38FC 	 0x0
    0x38FE 	 0x0
    0x3900 	 0x0
    0x3902 	 0x0
    0x3904 	 0x0
    0x3906 	 0x0
    0x3908 	 0x0
    0x390A 	 0x0
    0x390C 	 0x0
    0x390E 	 0x0
    0x3910 	 0x0
    0x3912 	 0x0
    0x3914 	 0x0
    0x3916 	 0x0
    0x3918 	 0x0
    0x391A 	 0x0
    0x391C 	 0x0
    0x391E 	 0x0
    0x3920 	 0x0
    0x3922 	 0x0
    0x3924 	 0x0
    0x3926 	 0x0
    0x3928 	 0x0
    0x392A 	 0x0
    0x392C 	 0x0
    0x392E 	 0x0
    0x3930 	 0x0
    0x3932 	 0x0
    0x3934 	 0x0
    0x3936 	 0x0
    0x3938 	 0x0
    0x393A 	 0x0
    0x393C 	 0x0
    0x393E 	 0x0
    0x3940 	 0x0
    0x3942 	 0x0
    0x3944 	 0x0
    0x3946 	 0x0
    0x3948 	 0x0
    0x394A 	 0x0
    0x394C 	 0x0
    0x394E 	 0x0
    0x3950 	 0x0
    0x3952 	 0x0
    0x3954 	 0x0
    0x3956 	 0x0
    0x3958 	 0x0
    0x395A 	 0x0
    0x395C 	 0x0
    0x395E 	 0x0
    0x3960 	 0x0
    0x3962 	 0x0
    0x3964 	 0x0
    0x3966 	 0x0
    0x3968 	 0x0
    0x396A 	 0x0
    0x396C 	 0x0
    0x396E 	 0x0
    0x3970 	 0x0
    0x3972 	 0x0
    0x3974 	 0x0
    0x3976 	 0x0
    0x3978 	 0x0
    0x397A 	 0x0
    0x397C 	 0x0
    0x397E 	 0x0
    0x3980 	 0x0
    0x3982 	 0x0
    0x3984 	 0x0
    0x3986 	 0x0
    0x3988 	 0x0
    0x398A 	 0x0
    0x398C 	 0x0
    0x398E 	 0x0
    0x3990 	 0x0
    0x3992 	 0x0
    0x3994 	 0x0
    0x3996 	 0x0
    0x3998 	 0x0
    0x399A 	 0x0
    0x399C 	 0x0
    0x399E 	 0x0
    0x39A0 	 0x0
    0x39A2 	 0x0
    0x39A4 	 0x0
    0x39A6 	 0x0
    0x39A8 	 0x0
    0x39AA 	 0x0
    0x39AC 	 0x0
    0x39AE 	 0x0
    0x39B0 	 0x0
    0x39B2 	 0x0
    0x39B4 	 0x0
    0x39B6 	 0x0
    0x39B8 	 0x0
    0x39BA 	 0x0
    0x39BC 	 0x0
    0x39BE 	 0x0
    0x39C0 	 0x0
    0x39C2 	 0x0
    0x39C4 	 0x0
    0x39C6 	 0x0
    0x39C8 	 0x0
    0x39CA 	 0x0
    0x39CC 	 0x0
    0x39CE 	 0x0
    0x39D0 	 0x0
    0x39D2 	 0x0
    0x39D4 	 0x0
    0x39D6 	 0x0
    0x39D8 	 0x0
    0x39DA 	 0x0
    0x39DC 	 0x0
    0x39DE 	 0x0
    0x39E0 	 0x0
    0x39E2 	 0x0
    0x39E4 	 0x0
    0x39E6 	 0x0
    0x39E8 	 0x0
    0x39EA 	 0x0
    0x39EC 	 0x0
    0x39EE 	 0x0
    0x39F0 	 0x0
    0x39F2 	 0x0
    0x39F4 	 0x0
    0x39F6 	 0x0
    0x39F8 	 0x0
    0x39FA 	 0x0
    0x39FC 	 0x0
    0x39FE 	 0x0
    0x3ECC 	 0xF0C
    0x3ECE 	 0x11FF
    0x3ED0 	 0xFFFFE4F6
    0x3ED2 	 0x1F46
    0x3ED4 	 0xFFFF8F6C
    0x3ED6 	 0x66CC
    0x3ED8 	 0xFFFF8C42
    0x3EDA 	 0xFFFF8899
    0x3EDC 	 0xFFFF8863
    0x3EDE 	 0xFFFFAA04
    0x3EE0 	 0x15F0
    0x3EE2 	 0x6D4B
    0x3EE4 	 0xFFFF924B
    0x3EE6 	 0xF0
    0x3EE8 	 0x2024
    0x3EEA 	 0xFFFFFF1F
    0x3EEC 	 0x5F1F
    0x3F02 	 0x30
    0x3F04 	 0x120
    0x3F06 	 0x4F0
    0x3F08 	 0x370
    0x3FD0 	 0x0
    0x3FD2 	 0x0
    0x3FD4 	 0x0
    0x3FD6 	 0x0
    0x3FD8 	 0x0
    0x3FDA 	 0x0
    0x3FE0 	 0x0
    0x3FE2 	 0x0
    0x3FE4 	 0x0
    0x3FE6 	 0x0
    0x3FE8 	 0x0
    0x3FEA 	 0x0
    0x3FEC 	 0x0
    0x3FEE 	 0x0
    

  • And BTW - I've been combing the AR0331 literature and I haven't found an explanation about the formula used to translate from the TI 2A gain (1250 - 640,000) to the Analog/digital gain in the AR0331 sensor (code below).

    Where is the 78,125 factor from?

    Thanks,

    Mechi

    UInt32 Iss_Ar0331GainCalc(int gain)
    {
    	int Gain1 = 0;
    	unsigned int Gain2 = 0;
    	int GainSend = 0;
    
    	if( gain >= 640000 )
    	{
    		gain = 640000;
    	}
    
    	if( gain >= 80000 )
    	{
    		Gain1 = 0x30;
    		Gain2 = (unsigned int )gain*1000/8;
    		Gain2 /= 78125;
    	}
    	else if( gain >= 40000 )
    	{
    		Gain1 = 0x20;
    		Gain2 = (unsigned int )gain*1000/4;
    		Gain2 /= 78125;
    
    	}
    	else if( gain >= 20000 )
    	{
    		Gain1 = 0x10;
    		Gain2 = (unsigned int )gain*1000/2;
    		Gain2 /= 78125;
    
    	}
    	else if( gain >= 1250)  //10000 - for 0x80)  // 1250 for 0x10  //5000 for 0x40
    	{
    		Gain1 = 0x00;
    		Gain2 = (unsigned int )gain*1000;
    		Gain2 /= 78125;
    	}
    	else
    	{
    		Gain1 = 0x00;
    		Gain2 = 0x10;  // can go until 0x10
    	}
    
    	GainSend = (Gain2<<8)|Gain1;  //  digital | analog
    
    	return (UInt32)GainSend;
    }

  • Hi Mechi,

    Can you capture a raw image and check whether this issue is coming from Senosr or ISP ?

    ~Nithin
  • This is a screenshot of the YUV player for a YUV422 frame of 1856x1504.

    This is the most "raw" that I can get from the IPNC - and yes, the rings of color are still apparent.

    To be noted, the analog gain is at minimal and the digital gain is very low, too.

    HDR is apparent in the details of the flourescent lighting and the sunlit window-blinds.

  • Hi Mechi ,

    I meant Bayer image. If you are using IPNC RDK from TI,  their DCC tuning tool supports capturing Bayer image from the sensor. It will be helpful to narrow down the problem to sensor settings or ISP.

    Also, Are you using ATLM (adaptive local tone mapping) in the sensor and receiving tone mapped 12 bit data at DM385 or companding the data to 12bit and tone-mapping it in DM385 using WDR module ?

    If it is the latter case, can you check the knee points used for de-companding ?

    ~Nithin

  • We are not using ATLM.
    I will install the DCC on my current computer and get you a Bayer image. This may take a few days since the DCCTOOL license is not valid for my current workstation.
  • Hi,

    Attached is the RAW image downloaded using DCC with these parameters:

    I attached the RAW image and also the VLC image that corresponds to it. The RAW file was renamed to txt since the tool did not allow uploading of a file with extension RAW!AR0331_Date_23-10-2017_Time_09-03-26.txt

  • Hi,

    Can you read and verify whether the 0th bit in sensor register 0x31D0[0] is set to 1 (to check whether companding is enabled) ? If sensor ALTM is disabled (0x2400[0] = 0 or 0x2400[1] = 0) and companding is also disabled, it can create a data loss in the interface.

    Regarding the raw image you have shared, I tried to open it with DCC tool but it doesn't seems to be in unpacked 10/12 bit format. Are you able to view it with any viewer / DCC tool ?

    ~Nithin

  • The DCC tool seems to pack the bits but still gives a size of 1856x1504x2 - as if unpacked.

    My colleague was able to unpack another image downloaded using the DCC tool into a 24 bpp BMP. The rings are definitely apparent.

    Attached is also the register definitions. 0x2400 = 0x2, 0x31D0 = 0

    Thanks,

    Mechi

    1033.AR0331_reg_0.txt
    0x1000 	 0x1
    0x1004 	 0x1
    0x1006 	 0x1
    0x1008 	 0x0
    0x100A 	 0x384
    0x1080 	 0x1
    0x1084 	 0x1
    0x1086 	 0x7FF
    0x1088 	 0x1
    0x1100 	 0x4000
    0x1104 	 0x4280
    0x1108 	 0x1
    0x110A 	 0x40
    0x110C 	 0x4080
    0x1110 	 0x41C0
    0x1114 	 0x20
    0x1116 	 0x180
    0x1118 	 0x43C0
    0x111C 	 0x4440
    0x1120 	 0x1
    0x1122 	 0x10
    0x1124 	 0x41F0
    0x1128 	 0x4439
    0x112C 	 0x40C0
    0x1130 	 0x4294
    0x1134 	 0x4
    0x1136 	 0x10
    0x1140 	 0x12
    0x1142 	 0xFFFFFFFF
    0x1144 	 0x44C
    0x1146 	 0xFFFFFFFE
    0x1148 	 0xA4
    0x114A 	 0x10
    0x1180 	 0x6
    0x1182 	 0x0
    0x1184 	 0x805
    0x1186 	 0x607
    0x11C0 	 0x1
    0x11C2 	 0x1
    0x11C4 	 0x1
    0x11C6 	 0x5
    0x1200 	 0x0
    0x1400 	 0x0
    0x1402 	 0x0
    0x1404 	 0x0
    0x1406 	 0x0
    0x1408 	 0x0
    0x140A 	 0x0
    0x140C 	 0x0
    0x140E 	 0x0
    0x1410 	 0x0
    0x2400 	 0x2
    0x2402 	 0x4
    0x2404 	 0x3E9
    0x2406 	 0x0
    0x2408 	 0x30E
    0x240A 	 0x0
    0x240C 	 0xFFFFA293
    0x240E 	 0x0
    0x2410 	 0x10
    0x2412 	 0x10
    0x2414 	 0x3
    0x2416 	 0xFA0
    0x2418 	 0x33
    0x241A 	 0x33
    0x241C 	 0x33
    0x241E 	 0x2
    0x2420 	 0x13
    0x2422 	 0x0
    0x2424 	 0x0
    0x2426 	 0x0
    0x2428 	 0x0
    0x242A 	 0xD
    0x242C 	 0x0
    0x242E 	 0x4FA8
    0x2430 	 0x0
    0x2432 	 0xFFFF89F5
    0x2434 	 0x0
    0x2436 	 0x4
    0x2438 	 0x10
    0x243A 	 0x20
    0x243C 	 0x0
    0x243E 	 0x200
    0x2440 	 0x2
    0x2442 	 0x80
    0x2444 	 0x0
    0x2446 	 0x4
    0x2448 	 0x14
    0x244A 	 0x0
    0x244C 	 0xFFFF9F46
    0x244E 	 0x0
    0x2450 	 0x0
    0x3000 	 0x2602
    0x3002 	 0x14
    0x3004 	 0x66
    0x3006 	 0x5F3
    0x3008 	 0x7A5
    0x300A 	 0x605
    0x300C 	 0x504
    0x300E 	 0x2000
    0x3010 	 0xFFFFBEEF
    0x3012 	 0xFE
    0x3014 	 0x0
    0x3016 	 0x10
    0x3018 	 0x0
    0x301A 	 0x10DC
    0x301C 	 0x100
    0x301D 	 0x0
    0x301E 	 0x0
    0x3021 	 0x0
    0x3022 	 0x0
    0x3026 	 0x6500
    0x3028 	 0x10
    0x302A 	 0x6
    0x302C 	 0x1
    0x302E 	 0x5
    0x3030 	 0x80
    0x3036 	 0xC
    0x3038 	 0x1
    0x303A 	 0x7C59
    0x303C 	 0x0
    0x303E 	 0x44C
    0x3040 	 0x0
    0x3042 	 0x0
    0x3044 	 0x400
    0x3046 	 0x0
    0x3048 	 0x100
    0x304A 	 0x20
    0x304C 	 0x200
    0x304E 	 0x0
    0x3050 	 0x6980
    0x3052 	 0xFFFFA124
    0x3054 	 0x0
    0x3056 	 0x29
    0x3058 	 0x29
    0x305A 	 0x29
    0x305C 	 0x29
    0x305E 	 0x29
    0x3060 	 0x0
    0x3062 	 0x333
    0x3064 	 0x1982
    0x306A 	 0x0
    0x306C 	 0x1000
    0x306E 	 0xFFFF9010
    0x3070 	 0x0
    0x3072 	 0x0
    0x3074 	 0x0
    0x3076 	 0x0
    0x3078 	 0x0
    0x307A 	 0x0
    0x307C 	 0xF
    0x3082 	 0x8
    0x3084 	 0x9
    0x3086 	 0x1600
    0x3088 	 0x1CE
    0x308A 	 0x42
    0x308C 	 0x4
    0x308E 	 0x7C9
    0x3090 	 0x603
    0x3092 	 0xF
    0x3094 	 0x0
    0x3096 	 0x80
    0x3098 	 0x80
    0x309A 	 0x215
    0x309E 	 0x1D0
    0x30A0 	 0x1
    0x30A2 	 0x1
    0x30A4 	 0x1
    0x30A6 	 0x1
    0x30A8 	 0x1
    0x30AA 	 0x610
    0x30AE 	 0x5
    0x30B0 	 0x0
    0x30B2 	 0x0
    0x30B4 	 0x0
    0x30B6 	 0x2FE
    0x30B8 	 0x202D
    0x30BA 	 0x7EC
    0x30BC 	 0x80
    0x30BE 	 0x80
    0x30C0 	 0x80
    0x30C2 	 0x80
    0x30C4 	 0x80
    0x30C6 	 0x1D4
    0x30C8 	 0x1C0
    0x30CA 	 0xFFFFA034
    0x30CC 	 0xFFFFC623
    0x30CE 	 0x0
    0x30D0 	 0x5
    0x30D2 	 0x4
    0x30DA 	 0xA
    0x30DE 	 0x10C0
    0x30E0 	 0x1208
    0x30E2 	 0x7000
    0x30E4 	 0x1200
    0x30E6 	 0x3000
    0x30E8 	 0x1210
    0x30EA 	 0x1110
    0x30EC 	 0x0
    0x30EE 	 0x10C0
    0x30F0 	 0x1208
    0x30F2 	 0x1200
    0x30F4 	 0x4000
    0x30F6 	 0x1210
    0x30F8 	 0x1110
    0x30FA 	 0x0
    0x30FC 	 0x0
    0x30FE 	 0x0
    0x3130 	 0xF1F
    0x3132 	 0xF1F
    0x3134 	 0x1818
    0x3136 	 0x3131
    0x3138 	 0x4431
    0x313A 	 0x0
    0x313C 	 0x0
    0x313E 	 0x0
    0x3140 	 0x0
    0x3142 	 0x0
    0x3144 	 0x4B0
    0x3146 	 0x4B0
    0x3148 	 0x0
    0x314A 	 0xFFFFFFFF
    0x314C 	 0x100
    0x314E 	 0x20
    0x3150 	 0x0
    0x3152 	 0x7B3
    0x3154 	 0x0
    0x3156 	 0x10
    0x3158 	 0x0
    0x315A 	 0x4FFF
    0x315C 	 0x0
    0x315E 	 0xC1
    0x3160 	 0x48A8
    0x3162 	 0x76
    0x3176 	 0x80
    0x3178 	 0x80
    0x317A 	 0x80
    0x317C 	 0x80
    0x317E 	 0xFFFF87FF
    0x3180 	 0xFFFF8089
    0x3182 	 0x1FFF
    0x3184 	 0x1FFF
    0x3186 	 0x1FFF
    0x3188 	 0x1FFF
    0x318A 	 0xE10
    0x318C 	 0xFFFF8001
    0x318E 	 0x0
    0x3190 	 0x0
    0x3192 	 0x400
    0x3194 	 0xBB8
    0x3196 	 0xDAC
    0x3198 	 0x61E
    0x319E 	 0x5040
    0x31A0 	 0x6100
    0x31A2 	 0xBB8
    0x31A4 	 0x1FFF
    0x31A6 	 0x1FFF
    0x31A8 	 0x1FFF
    0x31AA 	 0x1FFF
    0x31AC 	 0xC0C
    0x31AE 	 0x301
    0x31C0 	 0xFFFF8000
    0x31C2 	 0xFFFFFFFF
    0x31C4 	 0xFFFFF555
    0x31C6 	 0xFFFF8000
    0x31C8 	 0x0
    0x31CA 	 0x0
    0x31CC 	 0x0
    0x31CE 	 0x0
    0x31D0 	 0x0
    0x31D2 	 0x0
    0x31D6 	 0xFFFFA66D
    0x31DA 	 0x0
    0x31DC 	 0x0
    0x31DE 	 0x0
    0x31E0 	 0x200
    0x31E2 	 0x1DE1
    0x31E4 	 0xD0
    0x31E6 	 0x0
    0x31E8 	 0x0
    0x31EA 	 0x0
    0x31EC 	 0x0
    0x31EE 	 0x0
    0x31F4 	 0x0
    0x31F6 	 0x0
    0x31F8 	 0x0
    0x31FA 	 0x0
    0x31FC 	 0x3020
    0x31FE 	 0x2
    0x3200 	 0x2
    0x3202 	 0xCF
    0x3204 	 0xB6D
    0x3206 	 0xA06
    0x3208 	 0x1A12
    0x320A 	 0x0
    0x320C 	 0x80
    0x320E 	 0x100
    0x3210 	 0x200
    0x3600 	 0xC55
    0x3602 	 0x32EC
    0x3604 	 0x4811
    0x3606 	 0xFFFFDF7F
    0x3608 	 0xFFFF8001
    0x360A 	 0xFFFF8001
    0x360C 	 0x7DE0
    0x360E 	 0xFFFF8001
    0x3610 	 0xFFFF8001
    0x3612 	 0xFFFF8001
    0x3614 	 0x6077
    0x3616 	 0x2482
    0x3618 	 0xFFFF8001
    0x361A 	 0xFFFFCD4A
    0x361C 	 0xFFFFB0D0
    0x361E 	 0xFFFFBCDE
    0x3620 	 0xFFFF8081
    0x3622 	 0xFFFF8001
    0x3624 	 0xFFFF999D
    0x3626 	 0xFFFF8001
    0x3640 	 0xB3D
    0x3642 	 0x54D8
    0x3644 	 0x1888
    0x3646 	 0x3672
    0x3648 	 0x7DC7
    0x364A 	 0xFFFF8001
    0x364C 	 0xFFFFB394
    0x364E 	 0xFFFFDB27
    0x3650 	 0xFFFF8813
    0x3652 	 0xFFFF8001
    0x3654 	 0xFFFF99B3
    0x3656 	 0xFFFF8001
    0x3658 	 0xFFFFDCD9
    0x365A 	 0xFFFFFB05
    0x365C 	 0xFFFFACE9
    0x365E 	 0xFFFFC5AF
    0x3660 	 0x95
    0x3662 	 0x4A1
    0x3664 	 0x5ECC
    0x3666 	 0xFFFF8001
    0x3680 	 0x13A4
    0x3682 	 0x4564
    0x3684 	 0xFFFFE179
    0x3686 	 0x3AA2
    0x3688 	 0x7CE8
    0x368A 	 0xFFFF8001
    0x368C 	 0x5A01
    0x368E 	 0xFFFFC005
    0x3690 	 0xFFFF8001
    0x3692 	 0xFFFF8001
    0x3694 	 0xFFFF8001
    0x3696 	 0x506E
    0x3698 	 0x96B
    0x369A 	 0xFFFFE1B7
    0x369C 	 0xFFFFBC14
    0x369E 	 0xFFFF9D4D
    0x36A0 	 0xFFFFB1C0
    0x36A2 	 0xFFFFA82C
    0x36A4 	 0xFFFF8001
    0x36A6 	 0xFFFFC045
    0x36C0 	 0xFFFFB70D
    0x36C2 	 0xFFFFEE88
    0x36C4 	 0x1222
    0x36C6 	 0x25
    0x36C8 	 0xFFFF8001
    0x36CA 	 0xFFFF8001
    0x36CC 	 0x2844
    0x36CE 	 0xFFFF8001
    0x36D0 	 0xFFFF8001
    0x36D2 	 0xFFFF8001
    0x36D4 	 0xFFFF8001
    0x36D6 	 0xFFFF8001
    0x36D8 	 0xFFFFC901
    0x36DA 	 0xFFFFA64C
    0x36DC 	 0xFFFF8001
    0x36DE 	 0xFFFF8001
    0x36E0 	 0xFFFFD203
    0x36E2 	 0xFFFFDC02
    0x36E4 	 0xFFFF8001
    0x36E6 	 0xFFFF8001
    0x3700 	 0xFFFFE5C1
    0x3702 	 0x4080
    0x3704 	 0x305
    0x3706 	 0x3701
    0x3708 	 0xFFFFD004
    0x370A 	 0xFFFFE953
    0x370C 	 0xFFFF8001
    0x370E 	 0xFFFFB92C
    0x3710 	 0xFFFF8001
    0x3712 	 0xFFFF8001
    0x3714 	 0xFFFF8938
    0x3716 	 0x752A
    0x3718 	 0xFFFFD854
    0x371A 	 0xFFFF8001
    0x371C 	 0xFFFF8442
    0x371E 	 0xFFFFC181
    0x3720 	 0xFFFF8001
    0x3722 	 0xFFFF9480
    0x3724 	 0xFFFF8001
    0x3726 	 0xFFFF88B0
    0x3780 	 0x0
    0x3782 	 0xCDB
    0x3784 	 0x18C
    0x37C0 	 0x5A7D
    0x37C2 	 0xFFFFC800
    0x37C4 	 0xFFFFEC8B
    0x37C6 	 0xFFFF9A50
    0x3800 	 0x0
    0x3802 	 0x0
    0x3804 	 0x0
    0x3806 	 0x0
    0x3808 	 0x0
    0x380A 	 0x0
    0x380C 	 0x0
    0x380E 	 0x0
    0x3810 	 0x0
    0x3812 	 0x0
    0x3814 	 0x0
    0x3816 	 0x0
    0x3818 	 0x0
    0x381A 	 0x0
    0x381C 	 0x0
    0x381E 	 0x0
    0x3820 	 0x0
    0x3822 	 0x0
    0x3824 	 0x0
    0x3826 	 0x0
    0x3828 	 0x0
    0x382A 	 0x0
    0x382C 	 0x0
    0x382E 	 0x0
    0x3830 	 0x0
    0x3832 	 0x0
    0x3834 	 0x0
    0x3836 	 0x0
    0x3838 	 0x0
    0x383A 	 0x0
    0x383C 	 0x0
    0x383E 	 0x0
    0x3840 	 0x0
    0x3842 	 0x0
    0x3844 	 0x0
    0x3846 	 0x0
    0x3848 	 0x0
    0x384A 	 0x0
    0x384C 	 0x0
    0x384E 	 0x0
    0x3850 	 0x0
    0x3852 	 0x0
    0x3854 	 0x0
    0x3856 	 0x0
    0x3858 	 0x0
    0x385A 	 0x0
    0x385C 	 0x0
    0x385E 	 0x0
    0x3860 	 0x0
    0x3862 	 0x0
    0x3864 	 0x0
    0x3866 	 0x0
    0x3868 	 0x0
    0x386A 	 0x0
    0x386C 	 0x0
    0x386E 	 0x0
    0x3870 	 0x0
    0x3872 	 0x0
    0x3874 	 0x0
    0x3876 	 0x0
    0x3878 	 0x0
    0x387A 	 0x0
    0x387C 	 0x0
    0x387E 	 0x0
    0x3880 	 0x0
    0x3882 	 0x0
    0x3884 	 0x0
    0x3886 	 0x0
    0x3888 	 0x0
    0x388A 	 0x0
    0x388C 	 0x0
    0x388E 	 0x0
    0x3890 	 0x0
    0x3892 	 0x0
    0x3894 	 0x0
    0x3896 	 0x0
    0x3898 	 0x0
    0x389A 	 0x0
    0x389C 	 0x0
    0x389E 	 0x0
    0x38A0 	 0x0
    0x38A2 	 0x0
    0x38A4 	 0x0
    0x38A6 	 0x0
    0x38A8 	 0x0
    0x38AA 	 0x0
    0x38AC 	 0x0
    0x38AE 	 0x0
    0x38B0 	 0x0
    0x38B2 	 0x0
    0x38B4 	 0x0
    0x38B6 	 0x0
    0x38B8 	 0x0
    0x38BA 	 0x0
    0x38BC 	 0x0
    0x38BE 	 0x0
    0x38C0 	 0x0
    0x38C2 	 0x0
    0x38C4 	 0x0
    0x38C6 	 0x0
    0x38C8 	 0x0
    0x38CA 	 0x0
    0x38CC 	 0x0
    0x38CE 	 0x0
    0x38D0 	 0x0
    0x38D2 	 0x0
    0x38D4 	 0x0
    0x38D6 	 0x0
    0x38D8 	 0x0
    0x38DA 	 0x0
    0x38DC 	 0x0
    0x38DE 	 0x0
    0x38E0 	 0x0
    0x38E2 	 0x0
    0x38E4 	 0x0
    0x38E6 	 0x0
    0x38E8 	 0x0
    0x38EA 	 0x0
    0x38EC 	 0x0
    0x38EE 	 0x0
    0x38F0 	 0x0
    0x38F2 	 0x0
    0x38F4 	 0x0
    0x38F6 	 0x0
    0x38F8 	 0x0
    0x38FA 	 0x0
    0x38FC 	 0x0
    0x38FE 	 0x0
    0x3900 	 0x0
    0x3902 	 0x0
    0x3904 	 0x0
    0x3906 	 0x0
    0x3908 	 0x0
    0x390A 	 0x0
    0x390C 	 0x0
    0x390E 	 0x0
    0x3910 	 0x0
    0x3912 	 0x0
    0x3914 	 0x0
    0x3916 	 0x0
    0x3918 	 0x0
    0x391A 	 0x0
    0x391C 	 0x0
    0x391E 	 0x0
    0x3920 	 0x0
    0x3922 	 0x0
    0x3924 	 0x0
    0x3926 	 0x0
    0x3928 	 0x0
    0x392A 	 0x0
    0x392C 	 0x0
    0x392E 	 0x0
    0x3930 	 0x0
    0x3932 	 0x0
    0x3934 	 0x0
    0x3936 	 0x0
    0x3938 	 0x0
    0x393A 	 0x0
    0x393C 	 0x0
    0x393E 	 0x0
    0x3940 	 0x0
    0x3942 	 0x0
    0x3944 	 0x0
    0x3946 	 0x0
    0x3948 	 0x0
    0x394A 	 0x0
    0x394C 	 0x0
    0x394E 	 0x0
    0x3950 	 0x0
    0x3952 	 0x0
    0x3954 	 0x0
    0x3956 	 0x0
    0x3958 	 0x0
    0x395A 	 0x0
    0x395C 	 0x0
    0x395E 	 0x0
    0x3960 	 0x0
    0x3962 	 0x0
    0x3964 	 0x0
    0x3966 	 0x0
    0x3968 	 0x0
    0x396A 	 0x0
    0x396C 	 0x0
    0x396E 	 0x0
    0x3970 	 0x0
    0x3972 	 0x0
    0x3974 	 0x0
    0x3976 	 0x0
    0x3978 	 0x0
    0x397A 	 0x0
    0x397C 	 0x0
    0x397E 	 0x0
    0x3980 	 0x0
    0x3982 	 0x0
    0x3984 	 0x0
    0x3986 	 0x0
    0x3988 	 0x0
    0x398A 	 0x0
    0x398C 	 0x0
    0x398E 	 0x0
    0x3990 	 0x0
    0x3992 	 0x0
    0x3994 	 0x0
    0x3996 	 0x0
    0x3998 	 0x0
    0x399A 	 0x0
    0x399C 	 0x0
    0x399E 	 0x0
    0x39A0 	 0x0
    0x39A2 	 0x0
    0x39A4 	 0x0
    0x39A6 	 0x0
    0x39A8 	 0x0
    0x39AA 	 0x0
    0x39AC 	 0x0
    0x39AE 	 0x0
    0x39B0 	 0x0
    0x39B2 	 0x0
    0x39B4 	 0x0
    0x39B6 	 0x0
    0x39B8 	 0x0
    0x39BA 	 0x0
    0x39BC 	 0x0
    0x39BE 	 0x0
    0x39C0 	 0x0
    0x39C2 	 0x0
    0x39C4 	 0x0
    0x39C6 	 0x0
    0x39C8 	 0x0
    0x39CA 	 0x0
    0x39CC 	 0x0
    0x39CE 	 0x0
    0x39D0 	 0x0
    0x39D2 	 0x0
    0x39D4 	 0x0
    0x39D6 	 0x0
    0x39D8 	 0x0
    0x39DA 	 0x0
    0x39DC 	 0x0
    0x39DE 	 0x0
    0x39E0 	 0x0
    0x39E2 	 0x0
    0x39E4 	 0x0
    0x39E6 	 0x0
    0x39E8 	 0x0
    0x39EA 	 0x0
    0x39EC 	 0x0
    0x39EE 	 0x0
    0x39F0 	 0x0
    0x39F2 	 0x0
    0x39F4 	 0x0
    0x39F6 	 0x0
    0x39F8 	 0x0
    0x39FA 	 0x0
    0x39FC 	 0x0
    0x39FE 	 0x0
    0x3ECC 	 0xF0C
    0x3ECE 	 0x11FF
    0x3ED0 	 0xFFFFE4F6
    0x3ED2 	 0x1F46
    0x3ED4 	 0xFFFF8F6C
    0x3ED6 	 0x66CC
    0x3ED8 	 0xFFFF8C42
    0x3EDA 	 0xFFFF8899
    0x3EDC 	 0xFFFF8863
    0x3EDE 	 0xFFFFAA04
    0x3EE0 	 0x15F0
    0x3EE2 	 0x6D4B
    0x3EE4 	 0xFFFF924B
    0x3EE6 	 0xF0
    0x3EE8 	 0x2024
    0x3EEA 	 0xFFFFFF1F
    0x3EEC 	 0x5F1F
    0x3F02 	 0x30
    0x3F04 	 0x120
    0x3F06 	 0x4F0
    0x3F08 	 0x370
    0x3FD0 	 0x0
    0x3FD2 	 0x0
    0x3FD4 	 0x0
    0x3FD6 	 0x0
    0x3FD8 	 0x0
    0x3FDA 	 0x0
    0x3FE0 	 0x0
    0x3FE2 	 0x0
    0x3FE4 	 0x0
    0x3FE6 	 0x0
    0x3FE8 	 0x0
    0x3FEA 	 0x0
    0x3FEC 	 0x0
    0x3FEE 	 0x0
    

  • I have the DevWare kit - using the same AR0331 sensor, using the same lens and register values and the rings don't appear.
    I'm wondering if there's something in the IPNC ISIF chain that causes them.

    The DCC tool downloads the image, but it comes packed all 12 bits packed with 0x80 and 0x00 at the end of each line. So the size is maintained (X x Y x 2) but the actual date is compressed into 3/4 of the size. It's too bad that the DCC tool doesn't have a viewer and or expander to standard RAW Bayer format.

    I'd appreciate any help on this issue.
    Thanks,
    Mechi
  • And, BTW, we are using ATLM and 12-bit data.

  • Hi Mechi,

    Sorry delayed response!. I just saw your the last comment. If you are feeding ALTM output to D385, using TI's AE and AWB algorithms can create potential issues.

    1. If the input to DM385 is tone mapped image, TI's AE control loop will not work properly. When AE is trying to decrease the exposure/gain to achieve target brightness, ALTM will try to increase the brightness of the frame, This might lead the AE to getting stuck in lower exposure. (TI's AE is designed for linear data)
    2. In developers guide AR0231 (Please confirm the same is true in AR0331 document) it is mentioned that  "it is recommended to use digital gain before linearization for white balancing to prevent potential colour artifacts" .If you are using TI's AWB the white balancing  gains will applied in SOC side.
    3. Also since the data is already tone mapped SOC gamma needs to be set to unity.

    In Deveware usually auto exposure HDR sensors will be based on embedded statistics data, which is collected before ALTM. 

    Can you check these possibilities ?

    Best Regards

    Nithin Varghese

  • Attached is a 12-bit RAW image captured using the DCC tool (I renamed it "jpg" because I couldn't attach a raw file in the forum).

    Attached is also the Developer's guide. In HDR mode, ALTM must be enabled.

    Previously in this thread I attached register definitions.

    We don't use TI's AE - just TI's AWB. The AE is done in proprietary code right after capturing a frame and modifies the Exposure and Gain registers.

    Gamma is set to 1.

    I haven't been able to see the 12-bit RAW picture without seeing the rings. Our suspicions are that the conversion from 12-bit RAW over ISIS pipeline to 8-bit for DSP processing is done by truncating - which may be what causes the rings. This still as to be confirmed...

    2068.AR0331_DG_B.pdf

  • Hi Mechi,

    Did you confirm whether the truncation is causing the problem or not ?

    In HDR mode it is not must that sensor ALTM has to be enabled. We can use companding and do tone mapping in DM385 side using WDR module. This is how TI has integrated AR0331 HDR mode in IPNC Reference Development Kit.

    Since you are using ALTM please make sure that WDR is not present in your usecase.

    It is strange that DCC is dumping packed 12 bit data in your case, IPNC RDK always dumps in unpacked 10/12 bit format. Is there any custom changes in the framework from IPNC-RDK?

    ~Nithin
  • Hi Nithin,

    1) I have no way of confirming - because I have no way to view the 12-bit image and prove that there are no "rings" in it. We tried a "lookup" table to convert from 12-bit to 8-bit smoothly, but the rings were still apparent

    2) WDR is totally disabled in our proprietary usecase.

    3) We made changes in the usecase but the frame data is dumped from the same RAW address as it is in the original code. I don't know why DCC packs it in such a funny way...because the "extra bits" saved by packing are included in the packed image - all with value of 0x80! So there is no saving of space and size of image - even after being packed.

    How can I view a totally RAW image after it is released from the sensor before any "tweaking"? I can download the image manually from memory, but I need to be able to access the place in the chain where the RAW, unadulterated imaged is captured. And then, how can I view the 12-bit image in a way that an 8-bit LCD can view it correctly?

    Thanks,

    Mechi

  • Hi Mechi,

    I went through DM385 TRM and there are 2 bits in ISIF register ISIF_CCDCFG. SDRPACK[1:0] which determines how the raw data is stored to SDRAM. There can be 8, 12 or 16 bits per pixel. I think in your case it is set to 12 bit, resulting in packed raw dump. You can read this register & verify this is the case, and modify sdram_pack_fmt paramter in the source code.

    Regarding the colour rings, have you checked the output with programming the senor in 12 bit linear mode (Instead of HDR) ? If this works fine we can rule out any DM385  interface/ electrical issues.

    ~Nithin

  • Hi Nithin,

    I switched to Linear mode and the rings were even more pronounced!

    Again - I don't know for sure if this has to do with 12bit to 8 bit truncation, or if there's something in the 2A engine (AWB - Automatic White Balance which takes care of colors) that causes this.

    If the sensor is outputting 12bit data and I change the sdram_pack_fmt to 8bit data, what can I expect to see? I don't really care how the data is tranformed to the DCC tool - rather how the data is viewed and stored.

    Thanks,

    Mechi

  • Hi Mechi,

    If the IPIPE is operating in on the fly mode, changing the sdram_pack_fmt  will only affect the raw capture. You will have to change it from 12bit to 16 bit packed. After this you should be able to view the raw capture image correctly in DCC tool itself.

    If the artifacts are present in the raw capture itself, AWB and conversion from 12bit to 8 bit will not have any impact, since these processing elements comes after the raw capture tapping point.

    Can you share the raw images captured in Linear mode ?

    Also can you check which blocks in ISIF module are enabled ? And try disabling one by one and see whether this has any impact on the video. You can use the DCC tool's Register view window to read and modify the values. 

    ~Nithin

  • >> If the IPIPE is operating in on the fly mode, changing the sdram_pack_fmt  will only affect the raw capture. You will have to change it from 12bit to 16 bit packed. After this you should be able to view the raw capture image correctly in DCC tool itself.

    I have no idea in which mode the IPIPE is operating. How can I check?

    >> Can you share the raw images captured in Linear mode ?

    I've attached 2 RAW pictures - one in HDR mode and one in Linear mode. I changed the suffix to TXT because i can't upload RAW. Also attached a shot from DevWare (DW) in HDR mode without any PC functions enabled - BMP and RAW.

    >> Also can you check which blocks in ISIF module are enabled ? And try disabling one by one and see whether this has any impact on the video. You can use the DCC tool's Register view window to read and modify the values. 

    How do I check this? using the DCC tool or in the IPNC?

    AR0331_Date_16-01-2018_Linear.txt DW_HDR_24bpp0002.txtAR0331_Date_16-01-2018_HDR.txt

  • Hi Mechi,

    One easy way to verify whether IPIPE is operating in 'on the fly mode' or not is to check your usecase (chain) and see whether the ISP link is present. If ISP link is not present in your chain, IPIPE will be in on the fly mode.

    Did you try changing  sdram_pack_fmt to 16 bit packed and capture raw image ? 

    As I mentioned in the previous reply, you can use the Register view window in DCC to read the ISIF registers and try disabling each processing modules (Eg: sensor linearization, input data formator, black clamp, VDFC, LSC etc)

    Please go through the TRM for more details on the register values.

    Since you don't see any issues with the same senosr register settings in Devware and the ring artifact is present in the raw capture itself, I am suspecting some processing elements in ISIF (which is before raw capture tap point) could be modifying the data.

    ~ Nithin

    nithin.varghese@pathpartnertech.com

  • I'm using the DM8127 - though I assume that the IPNC_RDK is the same.
    I tried to use the WDR_ON macro and compiled and received similar, though definitely better results.
    I played around with the T1 and T2 registers and enabled Motion Compensation.
    I haven't checked what you mention above - though I am installing DCC on my new Windows 10 platform and I hope to have an answer soon.

    I was wondering if you were able to see the rings in the 12-bit pictures that I downloaded and attached as RAW files. From the documentation, I understand that HDR takes 2 12-bit images, combines them into a 16-bit image and then downscales to 8-bit or 10-bit for output.
  • I don't seem to be able to find any documentation on the Register list. What is the TRM that you mentioned in a previous post? I can see all of the ISIF registers - but I have no idea what they mean.
    In the DCC Tuning tool I was able to open up the 12-bit image - but the colors are all distorted. I did observe rings around the bright areas of the picture.
  • I use the OnSemi wizard and put in the resolution settings and set my unit with the register definitions in order to get 15.8 FPS - as in the DevWare with the same PLL and frame size (FRAME_LENGTH_LINES, LINE_LENGTH_PCK). For some reason I'm only getting 5.8 FPS. I'm wondering why the IPNC causes such a loss in FPS.
  • In the IPNC_RDK_WDR_ApplicationNote.pdf there is the attached diagram.

    I have a few questions:

    1. When I output RAW data with the DCC tool, am I getting the data directly from the sensor or does it go through the ISIF and other filters in the graph, or is it straight from the sensor?
    2. Can I output images from the other steps in the graph to see where the rings are formed. Since data is expanded from 12-bit to 16-bit and then compressed to 8-bit - this all seems suspicious and may be causing the rings.
    3. Have there been any changes in the IPNC_RDK 3.9.1 compared to the IPNC_RDK 3.8.0 that deal with the WDR_ON and ARR0331 and HDR?

    I know that I've asked many questions in the past 2 days - but this project is nearing a deadline and I really need answers.

    Thanks,

    Mechi

  • I just realized that I wasn't using the WDR-Link in our usecase. This may be what is causing the rings around the lighted areas...

    I'll continue this discussion once i get the WDR-Link to work in our usecase.

    Thanks.

    Mechi

  • Part Number: TMS320DM8127

    This was finally proven to be a HW problem - the 12 parallel lines of data were not connected correctly