User Tools

Site Tools


doc:appunti:hardware:ambarella_custom_firmware

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:hardware:ambarella_custom_firmware [2022/02/26 14:58] niccolodoc:appunti:hardware:ambarella_custom_firmware [2022/05/01 14:56] – [Chroma curves examples] niccolo
Line 1: Line 1:
-====== Customizing the Ambarella firmware ======+====== SJCAM SJ8 Pro Custom Firmware ======
  
-**How to customize the firmware of a SJCAM SJ8 Pro action camera, using BitrateEditor**+**How to customize the Ambarella firmware using BitrateEditor** 
 + 
 +See also my SJCAM SJ8 Pro review in page **[[sjcam-8pro]]**.
  
 In this page there are some notes about customizing the firmware of the **[[sjcam-8pro|SJCAM SJ8 Pro]]** action camera, using the **[[https://github.com/vmax1145/BitrateEditor|BitrateEditor]]** software. BitrateEditor is not just about bitrates, it can also change firmware tables about gamma values, YUV values, exposure and many others. In this page there are some notes about customizing the firmware of the **[[sjcam-8pro|SJCAM SJ8 Pro]]** action camera, using the **[[https://github.com/vmax1145/BitrateEditor|BitrateEditor]]** software. BitrateEditor is not just about bitrates, it can also change firmware tables about gamma values, YUV values, exposure and many others.
Line 11: Line 13:
 ===== My Custom firmware ===== ===== My Custom firmware =====
  
-This is my list for firmware customizations:+Download the custom firmware: **{{.:sjcam:sj8pro_mod-rigacci.org_v1.0_20211225.tgz|SJ8PRO_MOD-rigacci.org_V1.0_20211225.tgz}}** 
 + 
 +This is a breif list of customizations, see the README.txt contained into the archive for more details:
  
   * Increased **bitrates**, as per other 4K action cameras. Particular attention to default settings and 1920x1080 mode.   * Increased **bitrates**, as per other 4K action cameras. Particular attention to default settings and 1920x1080 mode.
Line 87: Line 91:
  
 For all that reasons, I decided to replace the curves with linear ones. It may be that I will intervene in the future if I notice any problems in the footages. For all that reasons, I decided to replace the curves with linear ones. It may be that I will intervene in the future if I notice any problems in the footages.
 +
 +=== Chroma curves ===
 +
 +At the moment I leaved the same chroma curves as the original 1.3.2 SJCAM firmware.
 +
  
 === Sounds === === Sounds ===
Line 418: Line 427:
  
 Also **photos** have their chroma tables contained into **adj_still_default_00_Imx377** and **adj_hiso_still_default_00_Imx377**. Also **photos** have their chroma tables contained into **adj_still_default_00_Imx377** and **adj_hiso_still_default_00_Imx377**.
- 
  
 ^ Tables  ^ Contained in file  ^ Used for video modes  ^ ^ Tables  ^ Contained in file  ^ Used for video modes  ^
Line 432: Line 440:
  
 Each chroma curve is **defined by 128 points** that map to a chrominance value ranging from 0 to 2048. On the X axis there is the brightness of the image pixels, on the Y axis there is the chroma correction factor to be applied. A value of **zero** means to **remove all the chroma** information, thus producing a grayscale image; the maximum value of **2048** instead means an **over-saturated color**. The median //natural// value should be 1024. Each chroma curve is **defined by 128 points** that map to a chrominance value ranging from 0 to 2048. On the X axis there is the brightness of the image pixels, on the Y axis there is the chroma correction factor to be applied. A value of **zero** means to **remove all the chroma** information, thus producing a grayscale image; the maximum value of **2048** instead means an **over-saturated color**. The median //natural// value should be 1024.
 +
 +In the following image you can see how BitrateEditor shows the chroma **4K30/128 table**. All values are equal to 1024, thus resulting into a stright line:
  
 {{.:ambarella:bitrateeditor-chroma.png?direct&600|Chroma curve}} {{.:ambarella:bitrateeditor-chroma.png?direct&600|Chroma curve}}
  
-The three curves are applied by stretching the full range **over the full brightness range** of the image, i.e. the leftmost point of the curve applies to the darkest points of the image, the rightmost point of the curve applies to the brightest points of the image. The three curves are combined together, probably each one is **weighed upon the overall exposition of the image**. It seems that the **4K30/128** is the most effective for evenly exposed images, so it is the most effective correction on the overall result. The curve **4K30/0** weighs more when the image is overexposed and the curve **4K30/255** weighs more when the image is underexposed (generally the effect of the last one is barely notable). Probably, after applying the weigh calculated on exposure, the three values are added together and trimmed to 2048.+BitrateEditor can show the tables also as **curves**, here there are the ones provided by the original SJCAM firmware 1.3.2: 
 + 
 +{{.:sjcam:chroma-curve_sjcam-1.3.2_255.png?direct&180|Chroma 4K60/255}} 
 +{{.:sjcam:chroma-curve_sjcam-1.3.2_128.png?direct&180|Chroma 4K60/128}} 
 +{{.:sjcam:chroma-curve_sjcam-1.3.2_000.png?direct&180|Chroma 4K60/0}} 
 + 
 +The three curves are applied by stretching the full range **over the full brightness range** of the image, i.e. the leftmost point of the curve applies to the darkest points of the image, the rightmost point of the curve applies to the brightest points of the image. The three curves are combined together, probably each one is **weighed upon the overall exposition of the image**. It seems that the **4K30/128** is the most effective for evenly exposed images, so it is the most effective correction on the overall result. The curve **4K30/0** weighs more when the image is overexposed and the curve **4K30/255** weighs more when the image is underexposed (generally the effect of the last one is barely noticeable). Probably, after applying the weigh calculated on exposure, the three values are added together and trimmed to 2048. 
  
 Changes made on tables **%%4K30/*%%** will be written by BitrateEditor into the file **adj_video_default_00_Imx377**, changes on tables **%%FHD30/*%%** should go instead into **adj_video_default_02_Imx377**. Changes made on tables **%%4K30/*%%** will be written by BitrateEditor into the file **adj_video_default_00_Imx377**, changes on tables **%%FHD30/*%%** should go instead into **adj_video_default_02_Imx377**.
Line 452: Line 469:
 We tried to understand when the **4K30/255** curve is used. It turned out that it is used only for underexposed images: only using an **EV -2.0** it was possibile to barely view the effect of the square tooth at the center of the graph: We tried to understand when the **4K30/255** curve is used. It turned out that it is used only for underexposed images: only using an **EV -2.0** it was possibile to barely view the effect of the square tooth at the center of the graph:
  
-{{.:ambarella:chroma-4k30-255-ev-1.0.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-255-ev-1.0.jpg?direct&400|EV -1.0, 4K30/255 not noticeable}}
  
-{{.:ambarella:chroma-4k30-255-ev-2.0-test1.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-255-ev-2.0-test1.jpg?direct&400|EV -2.0, 4K30/255 narrow teeth}}
  
-{{.:ambarella:chroma-4k30-255-ev-2.0-test2.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-255-ev-2.0-test2.jpg?direct&400|EV -2.0, 4K30/255 wide teeth}}
  
-Using an exposition of **EV -1.0** or higher, no chrominance is added at all. Some mild effect is visible at **EV -2.0**, despite the chroma graph teeth were set to the maximum value of 2048. In the darker part of the image the effect is not noticeable; the first tooth on the left produces almost no effect. Also the third tooth on the right does not produces any noticeable effect. Only the central **narrow tooth** produces a **narrow band of color**. If the tooth instead expands from the center to the right (last image), the colored area expands from the center towards the brightest part.+Using an exposition of **EV -1.0** or higher, no chrominance is added at all. Some mild effect is visible at **EV -2.0**, despite the chroma graph teeth were set to the maximum value of 2048. In the darker part of the image the effect is not noticeable; the first tooth on the left produces almost no effect. Also the third tooth on the right does not produces any noticeable effect. Only the central **narrow tooth** produces a **narrow band of color**. If the tooth instead expands from the center to the right (last image), the colored area expands from the center towards the upper brightest part.
  
 So the maximum effect of the **4K30/255** curve is at **EV -2.0**, but is very mild even if the curve is all set to **2048 max** value (which is the SJ8 Pro defualt): So the maximum effect of the **4K30/255** curve is at **EV -2.0**, but is very mild even if the curve is all set to **2048 max** value (which is the SJ8 Pro defualt):
  
-{{.:ambarella:chroma-4k30-255-ev-2.0-test3.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-255-ev-2.0-test3.jpg?direct&400|EV -2.0, 4K30/255 all max values}}
  
 === Curve 4K30/128 === === Curve 4K30/128 ===
Line 468: Line 485:
 The curve **4K30/128** is the most effective; its effect is visible very well from **EV -2.0** to **EV +2.0**: The curve **4K30/128** is the most effective; its effect is visible very well from **EV -2.0** to **EV +2.0**:
  
-{{.:ambarella:chroma-4k30-128-ev-2.0.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-128-ev-2.0.jpg?direct&400|EV -2.0, 4K30/128 all max values}}
  
-{{.:ambarella:chroma-4k30-128-ev_0.0.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-128-ev_0.0.jpg?direct&400|EV +0.0, 4K30/128 all max values}}
  
-{{.:ambarella:chroma-4k30-128-ev_2.0.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-128-ev_2.0.jpg?direct&400|EV +2.0, 4K30/128 all max values}}
  
 === Curve 4K30/0 === === Curve 4K30/0 ===
Line 478: Line 495:
 The curve **4K30/0** is effective, using the maximum value of 2048, starting from **EV 0.0** and above: The curve **4K30/0** is effective, using the maximum value of 2048, starting from **EV 0.0** and above:
  
-{{.:ambarella:chroma-4k30-000-ev-2.0.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-000-ev-2.0.jpg?direct&400|EV -2.0, 4K30/0 all max values}}
  
-{{.:ambarella:chroma-4k30-000-ev_0.0.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-000-ev_0.0.jpg?direct&400|EV +0.0, 4K30/0 all max values}}
  
-{{.:ambarella:chroma-4k30-000-ev_2.0.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-000-ev_2.0.jpg?direct&400|EV +2.0, 4K30/0 all max values}}
  
 === Mixing the curves === === Mixing the curves ===
  
-The first example shows the effect of creating some **disjointed theet on the three curves**; each tooth is set at the maximum value of 2048. Actually the single tooth of the curve 4k30/255 produces almos no visble effect, you can see **only three narrow bands of colors** corresponding to teeth on curves **4k30/128** and **4k30/0**:+The first example shows the effect of creating some **disjointed theet on the three curves**; each tooth is set at the maximum value of 2048. Actually the single tooth of the curve 4k30/255 produces almos no visble effect, you can see **only three narrow bands of colors** corresponding to teeth on curves **4K30/128** and **4K30/0**:
  
-{{.:ambarella:chroma-4k30-curves-separed.jpg?direct&400|}}+{{.:ambarella:chroma-4k30-curves-separed.jpg?direct&400|Chroma bands: one from 4K30/128, two from 4K30/0}}
  
 The last example is used to show how curves are **mixed together**. In this case a **wide teeth** on curve **4K30/128** is mixed with a **narrow teeth** on curve **4K30/0**. Each teeth is set to 1024 (half of the maximum), so taht the more satured color band on the overlapping region can be apreciated. The last example is used to show how curves are **mixed together**. In this case a **wide teeth** on curve **4K30/128** is mixed with a **narrow teeth** on curve **4K30/0**. Each teeth is set to 1024 (half of the maximum), so taht the more satured color band on the overlapping region can be apreciated.
  
-{{.:ambarella:chroma-4k-curves-mixed.jpg?direct&400|}}+{{.:ambarella:chroma-4k-curves-mixed.jpg?direct&400|One narrow chroma band from 4K30/0 overlapping a larger one from 4K30/128}}
  
 ===== AGC and digital gain ===== ===== AGC and digital gain =====
doc/appunti/hardware/ambarella_custom_firmware.txt · Last modified: 2022/05/05 06:26 by niccolo