diff --git a/HyperDRM.manifest.json b/HyperDRM.manifest.json index 29a926a..239de8a 100644 --- a/HyperDRM.manifest.json +++ b/HyperDRM.manifest.json @@ -1,15 +1,15 @@ { "id": "org.webosbrew.histogramhyperion", - "version": "0.13.2", + "version": "0.13.3", "type": "web", "title": "HyperDRM", "appDescription": "Ambient lighting for webOS, Hyperion and HyperHDR", "iconUri": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/app/icon.png", "sourceUrl": "https://gitea.adnau.de/matze19999/HyperDRM", "rootRequired": true, - "ipkUrl": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/HyperDRM_0.13.2_arm.ipk", + "ipkUrl": "https://gitea.adnau.de/matze19999/HyperDRM/raw/branch/main/HyperDRM_0.13.3_arm.ipk", "ipkHash": { - "sha256": "d83eed088b5a1cc8a90d96bc781359db219aa50f51218e3ae3c2ef52510f6ed7" + "sha256": "acb0978100796e8765e586a91183599ef4eb783631d8b68205d716621790e232" }, - "ipkSize": 1207844 + "ipkSize": 1208120 } diff --git a/HyperDRM_0.13.2_arm.ipk b/HyperDRM_0.13.3_arm.ipk similarity index 92% rename from HyperDRM_0.13.2_arm.ipk rename to HyperDRM_0.13.3_arm.ipk index 7df99f9..25035b7 100644 Binary files a/HyperDRM_0.13.2_arm.ipk and b/HyperDRM_0.13.3_arm.ipk differ diff --git a/README.md b/README.md index c6187d6..faeb85f 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Only the own service is modified. Optional Auto PicCap can configure its receive ## Installation -The current package is [HyperDRM_0.13.2_arm.ipk](HyperDRM_0.13.2_arm.ipk). Install it using the TV's webOS/Homebrew package installation workflow. +The current package is [HyperDRM_0.13.3_arm.ipk](HyperDRM_0.13.3_arm.ipk). Install it using the TV's webOS/Homebrew package installation workflow. Elevate the installed own service through Homebrew Channel: @@ -235,3 +235,5 @@ receiver-output and simulated service-lifecycle tests with ASan/UBSan. These hos tests do not replace real LG capture and remote-control validation on a TV. Histogram near-black handling suppresses colors with a maximum RGB channel of 16 or less, gradually restores brightness between 16 and 32, and preserves brighter colors. This applies only to histogram output; PicCap, receiver calibration and raw calibration samples are unchanged. + +Thin letterbox detection compares both edges against lit interior histogram samples and requires a consistently dark upper edge for at least two seconds. Histogram probes cannot determine the exact bar height or guarantee detection on every scene. diff --git a/VERSION b/VERSION index 9beb74d..288adf5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.13.2 +0.13.3 diff --git a/app/appinfo.json b/app/appinfo.json index e8a6f14..1134cc0 100644 --- a/app/appinfo.json +++ b/app/appinfo.json @@ -1,6 +1,6 @@ { "id": "org.webosbrew.histogramhyperion", - "version": "0.13.2", + "version": "0.13.3", "vendor": "Local development", "type": "web", "main": "index.html", diff --git a/app/version.js b/app/version.js index fd9640d..82a0b94 100644 --- a/app/version.js +++ b/app/version.js @@ -1,2 +1,2 @@ 'use strict'; -var HYPERDRM_APP_VERSION = '0.13.2'; +var HYPERDRM_APP_VERSION = '0.13.3'; diff --git a/docs/release-0.13.3.md b/docs/release-0.13.3.md new file mode 100644 index 0000000..e543e62 --- /dev/null +++ b/docs/release-0.13.3.md @@ -0,0 +1,3 @@ +# HyperDRM 0.13.3 + +Detect thinner horizontal black bars using edge-versus-interior contrast, distributed upper-edge support and lower-edge support. Preserve the existing dark-scene rejection, wide-bar rule and two-second stability gate. Regression tests include live G4 measurements, one-sided and isolated dark edges, dim frames and insufficient contrast. This is a histogram heuristic; it does not measure exact bar heights. diff --git a/native/blackbars.h b/native/blackbars.h index dee18c3..86a6bbd 100644 --- a/native/blackbars.h +++ b/native/blackbars.h @@ -4,14 +4,17 @@ * or dark frame so darkness alone cannot switch the active capture mode. */ static inline int letterbox_candidate(const unsigned black[16], const unsigned char color[16][3]) { const unsigned interior[] = {2, 6, 10, 15}; - unsigned lit = 0; + unsigned lit = 0, interior_black = 0, interior_peak = 0; for (unsigned i = 0; i < 4; i++) { unsigned r = interior[i], peak = color[r][0]; for (unsigned c = 1; c < 3; c++) if (color[r][c] > peak) peak = color[r][c]; - if (black[r] < 20 && peak > 35) + if (black[r] < 20 && peak > 35) { lit++; + interior_black += black[r]; + interior_peak += peak; + } } if (lit < 2) return -1; @@ -19,6 +22,26 @@ static inline int letterbox_candidate(const unsigned black[16], const unsigned c unsigned bottom = (black[1] + black[5] + black[9]) / 3; if (top >= 55 && bottom >= 25) return 1; + /* Thin bars occupy only part of an edge probe. Require a broad upper + * dark edge, lower-edge support and contrast against lit interior probes. + * This remains a histogram heuristic, not a pixel-accurate crop. */ + const unsigned top_regions[] = {3, 11, 12}; + const unsigned bottom_regions[] = {1, 5, 9}; + unsigned top_support = 0, bottom_support = 0, top_peak = 0; + for (unsigned i = 0; i < 3; i++) { + unsigned r = top_regions[i], peak = color[r][0]; + for (unsigned c = 1; c < 3; c++) + if (color[r][c] > peak) + peak = color[r][c]; + top_peak += peak; + top_support += black[r] >= 12; + bottom_support += black[bottom_regions[i]] >= 8; + } + unsigned baseline = interior_black / lit; + if (top_support == 3 && bottom_support >= 2 && top >= 12 && bottom >= 10 && + top >= baseline + 8 && bottom >= baseline + 8 && + (unsigned long)top_peak * lit * 100 <= (unsigned long)interior_peak * 3 * 60) + return 1; if (top < 20 && bottom < 20) return 0; return -1; diff --git a/native/test_blackbars.c b/native/test_blackbars.c index 8373d0d..a510adb 100644 --- a/native/test_blackbars.c +++ b/native/test_blackbars.c @@ -11,5 +11,22 @@ int main(void){ for(unsigned i=0;i<16;i++)black[i]=100; memset(color,0,sizeof(color));assert(letterbox_candidate(black,color)==-1); memset(black,0,sizeof(black));assert(letterbox_candidate(black,color)==-1); - puts("PASS: full frame, measured letterbox, one edge only, black frame, dark frame"); + unsigned thin_black[16]={12,23,1,21,9,6,6,16,18,12,26,23,23,22,37,8}; + unsigned char thin_color[16][3]={{57,52,48},{97,94,92},{51,42,35},{25,24,21}, + {71,65,60},{128,122,118},{84,74,67},{34,32,27},{47,41,36},{59,47,43}, + {37,29,25},{19,18,15},{22,20,16},{22,19,15},{14,13,11},{78,75,72}}; + assert(letterbox_candidate(thin_black,thin_color)==1); + thin_black[1]=thin_black[5]=thin_black[9]=0; + assert(letterbox_candidate(thin_black,thin_color)!=1); + thin_black[1]=23;thin_black[5]=6;thin_black[9]=12; + thin_black[11]=0; + assert(letterbox_candidate(thin_black,thin_color)!=1); + thin_black[11]=23; + memset(thin_color,10,sizeof(thin_color)); + assert(letterbox_candidate(thin_black,thin_color)==-1); + memset(thin_color,100,sizeof(thin_color)); + assert(letterbox_candidate(thin_black,thin_color)!=1); + memset(thin_black,15,sizeof(thin_black)); + assert(letterbox_candidate(thin_black,thin_color)!=1); + puts("PASS: measured wide/thin bars, full frame, one-sided/isolated edges, dark frame and low contrast"); } diff --git a/native/version.h b/native/version.h index 1263c46..606126d 100644 --- a/native/version.h +++ b/native/version.h @@ -1,4 +1,4 @@ #ifndef HYPERDRM_VERSION_H #define HYPERDRM_VERSION_H -#define HYPERDRM_VERSION "0.13.2" +#define HYPERDRM_VERSION "0.13.3" #endif diff --git a/package/packageinfo.json b/package/packageinfo.json index b8bf389..cd94e1b 100644 --- a/package/packageinfo.json +++ b/package/packageinfo.json @@ -1,6 +1,6 @@ { "id": "org.webosbrew.histogramhyperion", - "version": "0.13.2", + "version": "0.13.3", "vendor": "Local development", "app": "org.webosbrew.histogramhyperion", "services": [ diff --git a/service/histogram-service b/service/histogram-service index 3a0fa27..64658f9 100644 Binary files a/service/histogram-service and b/service/histogram-service differ