Skip to content

Instantly share code, notes, and snippets.

View LukeNewNew's full-sized avatar

Luke New LukeNewNew

View GitHub Profile
.prose-slate, .prose-slate :not(.katex, .katex *) {
font-size: revert !important;
line-height: unset !important;
}
.whitespace-pre-wrap {
white-space: normal;
}
html body :not(.katex, .katex *) {
img[style][src^="data:"] {
margin: auto;
width: revert !important;
height: revert !important;
max-width: 100% !important;
max-height: 100% !important;
}
[data-message-author-role="user"] .bg-token-message-surface {
outline: 2px #d00000 solid
}
button.absolute.cursor-pointer:has(svg.icon-md.text-token-text-primary) {
display: none;
}
.text-token-text-secondary:has(.tabular-nums) {
background: #0f6c
}
.group\/conversation-turn [class*="turn-messages:opacity-100"] {

How to transcode Dolby Vision with correct color on non-Dolby device?

Below is a step‑by‑step workflow to “flatten” Dolby Vision into a single‑layer HDR10 (or SDR) encode that preserves the correct color on devices without Dolby Vision support.

At a high level, Dolby Vision streams consist of a backward‑compatible HDR10 base layer plus one or two enhancement layers (dynamic metadata) that non‑Dolby decoders ignore; our goal is to merge and tone‑map these into a single output the target device can render accurately.

1. Understand Dolby Vision’s Dual‑Layer Architecture

Dolby Vision encodes a mandatory HDR10 base layer plus one (Profile 8.1) or two (Profile 7.6) enhancement layers (RPU and optional MEL/FEL) carrying dynamic metadata.

/*
Y Combinator: From Factorial to Fixed-point Combinator
Modern JS Implementation
https://picasso250.github.io/2015/03/31/reinvent-y.html
https://gist.github.com/igstan/388351
*/
/* STEP 1: Basic recursive factorial */
const fact1 = n => n < 2 ? 1 : n * fact1(n - 1);
message-content.model-response-text .markdown h1,
message-content.model-response-text .markdown h2,
message-content.model-response-text .markdown h3,
message-content.model-response-text .markdown h4,
message-content.model-response-text .markdown h5,
message-content.model-response-text .markdown h6 {
font-size: revert !important;
line-height: 1.5em !important;
}
main:has(div.h-full.max-h-screen.min-h-screen.w-full div.flex.flex-col.items-start a[href^="/explore"].bg-token-bg-active) div[class^="absolute bottom-2 left-1/2 hidden w-full max-w-[800px] -translate-x-1/2 px-3 tablet:block tablet:left-[calc(var(--sidebar-width)+2*var(--sidebar-gap)+(100%-(var(--sidebar-width)+2*var(--sidebar-gap)))/2)] tablet:w-[calc(100%-(var(--sidebar-width)+2*var(--sidebar-gap)))]"]:has(textarea[placeholder^="Describe your"]) {
display: none !important
}
div[role="dialog"].dialog-content:has([style*="scrollbar-gutter"]) {
height: 100vh !important;
max-width: 100vw !important;
img, video {
object-fit: contain !important;
}
:root {
--tab-min-height: 28px !important;
}
#ytp-caption-window-container, #ytp-caption-window-container * {
user-select: none;
pointer-events: none;
}
.caption-window.ytp-caption-window-bottom {
margin-bottom: unset !important;
}
ytd-app[scrolling] {
overflow: hidden !important;
}
html, body, :root, :host, * {
--font-primary: sans-serif;
--font-display: sans-serif;
--font-headline: sans-serif;
--font-code: monospace;
--font-clan-body: sans-serif;
--font-clan-signature: sans-serif;
--font-display-marketing: sans-serif;
--font-display-marketing-header: sans-serif;
letter-spacing: unset !important;