Learning about Dolby Vision and CoreELEC development

yes, correct

1 Like

Thank you for answering the question and the amazing build. Brought new life in to my odroid n2. The odroid n2 has been my media player since it launched.

@DMDreview Would you (or anyone else with a capture card) be able to do some more captures on a test build to see how well the reshaping / p5 can be done?

it´s says file not available

Jump to post 598
Is latest build i think…

Also post 478,503,580, have links to builds

Hi. yes, i have ugoos x4 pro without DV s905x4.
Only show where i can download a CE build to be tested

Great, will make some test sample and post them and the build later.

Can you do lossless 12-bit 422 captures? Or do I need to convert that into 8-bit RGB to get a lossless capture (as you did before for the tv-led captures)?

I understand we are testing tv-led playback. So I can capture in RGBA it’s 3 by 8 bit color and 8 bit alpha channel or in RGB 10 bit per alpha channel, codec R210.
This codec is used in TV & film production and stores raw 10-bit RGB data. Each red, green, and blue color component is 10 bits wide. RGB pixels contain 30 bits of information and are stored in 32-bit blocks (so there are 2 unused bits). Each group of 32 bits is laid out as:
XXrrrrrr rrrrgggg ggggggbb bbbbbbbb

1 Like

Will share a build and test clip in a day or two.

@DMDreview
Test build for reshaping: 260.79 MB file on MEGA
Test sample: 2.29 MB file on MEGA

Need two captures.

  1. To check the construction of the sample video. Enter the following commands via ssh
echo 0 > /sys/module/am_vecm/parameters/custom_lut_on
echo 0 > /sys/module/am_vecm/parameters/custom_cgain_en
echo 0 > /sys/module/am_vecm/parameters/custom_hist_en
echo 1024,0,0,0,1024,0,0,0,1024,0,0,0,0,0,0,0 > /sys/module/am_vecm/parameters/custom_mtx_in
echo 0,0,0 > /sys/module/am_vecm/parameters/custom_mtxi_pos_offset
echo 10,10,10 > /sys/module/am_vecm/parameters/custom_adpscl_shift
echo 1 > /sys/module/am_vecm/parameters/custom_adpscl_mode
echo 1024,0,0 > /sys/module/am_vecm/parameters/custom_adpscl_ys_coef
echo 0,360448,376832,385024,393216,397312,401408,405504,409600,411648,413696,415744,417792,419840,421888,423936,425984,434176,442368,446464,450560,454656,458752,460800,462848,464896,466944,468992,471040,473088,475136,476160,477184,478208,479232,480256,481280,482304,483328,484352,485376,486400,487424,488448,489472,490496,491520,492032,492544,493056,493568,494080,494592,495104,495616,496128,496640,497152,497664,498176,498688,499200,499712,500224,500736,501248,501760,502272,502784,503296,503808,504320,504832,505344,505856,506368,506880,507392,507904,508160,508416,508672,508928,509184,509440,509696,509952,510208,510464,510720,510976,511232,511488,511744,512000,512256,512512,512768,513024,513280,513536,513792,514048,514304,514560,514816,515072,515328,515584,515840,516096,516352,516608,516864,517120,517376,517632,517888,518144,518400,518656,518912,519168,519424,519680,519936,520192,520448,520704,520960,521216,521472,521728,521984,522240,522496,522752,523008,523264,523520,523776,524032,524287 > /sys/module/am_vecm/parameters/custom_eo_y_lut
echo N > /sys/module/am_vecm/parameters/adpscl_force
echo N > /sys/module/am_vecm/parameters/force_ootf_update
echo 0,1,1 > /sys/module/am_vecm/parameters/custom_adpscl_bypass
echo 1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024 > /sys/module/am_vecm/parameters/custom_oo_y_lut
echo 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,6,7,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384,416,448,480,512,576,640,704,768,832,896,960,1024,1152,1280,1408,1536,1664,1792,1920,2048,2176,2304,2432,2560,2688,2816,2944,3072,3200,3328,3456,3584,3712,3840,3968,4095 > /sys/module/am_vecm/parameters/custom_oe_y_lut
echo 0,0,0 > /sys/module/am_vecm/parameters/custom_mtxo_pos_offset
echo 1 > /sys/module/amvideo/parameters/vdr_dm_data_source

after entering the commands, play the video reshaping_test.mkv and take a capture.

  1. To check the reshaping. Entering the following commands
echo 1026,0,0,0,1293,0,0,0,1125,0,0,0,0,0,0,0 > /sys/module/am_vecm/parameters/custom_mtx_in
echo 0,-90,24 > /sys/module/am_vecm/parameters/custom_mtxi_pos_offset
echo 10,10,10 > /sys/module/am_vecm/parameters/custom_adpscl_shift
echo 1 > /sys/module/am_vecm/parameters/custom_adpscl_mode
echo 1024,0,0 > /sys/module/am_vecm/parameters/custom_adpscl_ys_coef
echo 0,360448,376832,385024,393216,397312,401408,405504,409600,411648,413696,415744,417792,419840,421888,423936,425984,434176,442368,446464,450560,454656,458752,460800,462848,464896,466944,468992,471040,473088,475136,476160,477184,478208,479232,480256,481280,482304,483328,484352,485376,486400,487424,488448,489472,490496,491520,492032,492544,493056,493568,494080,494592,495104,495616,496128,496640,497152,497664,498176,498688,499200,499712,500224,500736,501248,501760,502272,502784,503296,503808,504320,504832,505344,505856,506368,506880,507392,507904,508160,508416,508672,508928,509184,509440,509696,509952,510208,510464,510720,510976,511232,511488,511744,512000,512256,512512,512768,513024,513280,513536,513792,514048,514304,514560,514816,515072,515328,515584,515840,516096,516352,516608,516864,517120,517376,517632,517888,518144,518400,518656,518912,519168,519424,519680,519936,520192,520448,520704,520960,521216,521472,521728,521984,522240,522496,522752,523008,523264,523520,523776,524032,524287 > /sys/module/am_vecm/parameters/custom_eo_y_lut
echo Y > /sys/module/am_vecm/parameters/adpscl_force
echo Y > /sys/module/am_vecm/parameters/force_ootf_update
echo 1 > /sys/module/am_vecm/parameters/custom_lut_on
echo 1 > /sys/module/am_vecm/parameters/custom_cgain_en
echo 1 > /sys/module/am_vecm/parameters/custom_hist_en
echo 0,1,1 > /sys/module/am_vecm/parameters/custom_adpscl_bypass
echo 4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4063,3878,3619,3446,3322,3229,3156,3098,3050,3009,2975,2945,2920,2897,2859,2828,2802,2780,2761,2744,2729,2716,2693,2674,2657,2643,2630,2618,2606,2596,2577,2560,2545,2530,2516,2502,2490,2477,2453,2429,2407,2385,2363,2341,2320,2299,2257,2216,2175,2135,2094,2054,2013,1973,1893,1814,1780,1727,1681,1641,1605,1572,1516,1468,1426,1389,1356,1325,1297,1270,1231,1194,1162,1135,1112,1091,1072,1054,1024,997,973,951,934,917,901,887,862,840,822,806,791,778,766,754,744,734,724,715,707,699,692,685,678,671,665,659,653,648,643,644 > /sys/module/am_vecm/parameters/custom_oo_y_lut
echo 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,6,7,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384,416,448,480,512,576,640,704,768,832,896,960,1024,1152,1280,1408,1536,1664,1792,1920,2048,2176,2304,2432,2560,2688,2816,2944,3072,3200,3328,3456,3584,3712,3840,3968,4095 > /sys/module/am_vecm/parameters/custom_oe_y_lut 
echo 50,0,0 > /sys/module/am_vecm/parameters/custom_mtxo_pos_offset
echo 1 > /sys/module/amvideo/parameters/vdr_dm_data_source

then play the video reshaping_test.mkv and take a capture.

If you want to see it actually working, enter

echo 1024,0,0,0,1611,0,0,0,1611,0,0,0,0,0,0,0 > /sys/module/am_vecm/parameters/custom_mtx_in
echo 0,-219,-178 > /sys/module/am_vecm/parameters/custom_mtxi_pos_offset
echo 10,10,10 > /sys/module/am_vecm/parameters/custom_adpscl_shift
echo 1 > /sys/module/am_vecm/parameters/custom_adpscl_mode
echo 1024,0,0 > /sys/module/am_vecm/parameters/custom_adpscl_ys_coef
echo 0,360448,376832,385024,393216,397312,401408,405504,409600,411648,413696,415744,417792,419840,421888,423936,425984,434176,442368,446464,450560,454656,458752,460800,462848,464896,466944,468992,471040,473088,475136,476160,477184,478208,479232,480256,481280,482304,483328,484352,485376,486400,487424,488448,489472,490496,491520,492032,492544,493056,493568,494080,494592,495104,495616,496128,496640,497152,497664,498176,498688,499200,499712,500224,500736,501248,501760,502272,502784,503296,503808,504320,504832,505344,505856,506368,506880,507392,507904,508160,508416,508672,508928,509184,509440,509696,509952,510208,510464,510720,510976,511232,511488,511744,512000,512256,512512,512768,513024,513280,513536,513792,514048,514304,514560,514816,515072,515328,515584,515840,516096,516352,516608,516864,517120,517376,517632,517888,518144,518400,518656,518912,519168,519424,519680,519936,520192,520448,520704,520960,521216,521472,521728,521984,522240,522496,522752,523008,523264,523520,523776,524032,524287 > /sys/module/am_vecm/parameters/custom_eo_y_lut
echo Y > /sys/module/am_vecm/parameters/adpscl_force
echo Y > /sys/module/am_vecm/parameters/force_ootf_update
echo 1 > /sys/module/am_vecm/parameters/custom_lut_on
echo 1 > /sys/module/am_vecm/parameters/custom_cgain_en
echo 1 > /sys/module/am_vecm/parameters/custom_hist_en
echo 0,1,1 > /sys/module/am_vecm/parameters/custom_adpscl_bypass
echo 4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,3889,3494,3211,3000,2704,2507,2366,2261,2114,2017,1948,1896,1856,1825,1799,1778,1761,1746,1733,1722,1705,1691,1681,1672,1666,1661,1657,1653,1649,1647,1646,1646,1647,1649,1652,1654,1661,1669,1677,1686,2558,2512,2472,2437,2377,2327,2286,2251,2220,2192,2168,2145,2106,2072,2042,2015,1991,1968,1946,1926,1888,1853,1820,1788,1757,1727,1698,1670,1677,1639,1607,1579,1555,1534,1514,1497,1465,1438,1414,1392,1371,1352,1334,1317,1284,1254,1225,1197,1180,1159,1139,1122,1091,1064,1040,1018,998,979,963,947,933,920,907,896,885,874,864,855,846,837,829,822,814,807,801,800 > /sys/module/am_vecm/parameters/custom_oo_y_lut
echo 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,3,3,3,3,4,4,5,5,6,6,7,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384,416,448,480,512,576,640,704,768,832,896,960,1024,1152,1280,1408,1536,1664,1792,1920,2048,2176,2304,2432,2560,2688,2816,2944,3072,3200,3328,3456,3584,3712,3840,3968,4095 > /sys/module/am_vecm/parameters/custom_oe_y_lut 
echo 3,0,0 > /sys/module/am_vecm/parameters/custom_mtxo_pos_offset
echo 0 > /sys/module/amvideo/parameters/vdr_dm_data_source

and then playing back glassblowing_frame.mkv should look correct.

I apologize, I’ve been busy. Okay, I’ll test and capture it this week.

2 Likes

Hi @doppingkoala i know you working on DV P5 fix, thanks. In the future Can VS10, converting non DV files to dv work?

Had the proof-of-concept for P5 working for individual frames for a while now, far as I can tell (without a capture card) it seems to work correctly. Would just need to spend some time to make it work on-the-fly, should be straightforward, but I don’t really have a use-case for it so haven’t spent time doing that.

Triggering DV for non-DV files is easy. The bigger question is what metadata should be embedded?

Looks like the hardware supports generating histograms on-the-fly, so may be able to do something similar to the HDR10+ conversion. Unconvinced that it would be worth it though compared to just giving the original to the TV to do it’s own tone-mapping on-the-fly.

2 Likes

That’ll be greatly appreciated if you can.
Many thanks again for all you hard work.

@doppingkoala , have you found a place in the code to be able to switch color channels for DV material from rgb to gbr and vice versa? Thank you.

Set the DATA_COMP_MAP bits of VPU_HDMI_SETTING to reorder the channels. The datasheets have what values correspond to what ordering.

I did it by using the hd_set_reg_bits(P_VPU_HDMI_SETTING, ) function after every call to hd_write_reg(P_VPU_HDMI_SETTING, ) in hdmi_tx_hw.c.

1 Like

@doppingkoala , thank you, found VPU_HDMI_SETTING, hd_set_reg_bits(P_VPU_HDMI_SETTING, ), and hd_write_reg(P_VPU_HDMI_SETTING, ) but I could not find DATA_COMP_MAP or the datasheets with the corresponding values? In what file/program is DATA_COMP_MAP and the datasheets with the corresponding values?

Also, I found these with reference to color channel assignment at your code (amlogic 5.X) but not on the amlogic 4.9 version. Although those functions are in amlogic 4.9 version there is no reference to color channel change as in amlogic 5.X. Is the color channel change only available on the newer amlogic version? Thank you again for your help.

Search for DATA_COMP_MAP in a datasheet, it is bits 5-7 of the VPU_HDMI_SETTING register.


It is mentioned (probably not as clearly) and definitely works in 4.9 as well as 5. Changing a software version number doesn’t change what the physical hardware is or it’s capability.

1 Like

@doppingkoala , thank you, I thought you mentioned DATA_COMP_MAP as an element on the amlogic code and I was confused with the term datasheet.

I have coded per your recommendations and all is working well. Thank you again for your help.