Skip to content

Instantly share code, notes, and snippets.

@dumbledore
dumbledore / YUV_formats.md
Created June 19, 2025 12:23 — forked from Jim-Bar/YUV_formats.md
About YUV formats

About YUV formats

First of all: YUV pixel formats and Recommended 8-Bit YUV Formats for Video Rendering. Chromium's source code contains good documentation about those formats too: chromium/src/media/base/video_types.h and chromium/src/media/base/video_frame.cc (search for RequiresEvenSizeAllocation(), NumPlanes() and those kinds of functions).

YUV?

You can think of an image as a superposition of several planes (or layers in a more natural language). YUV formats have three planes: Y, U, and V.

Y is the luma plane, and can be seen as the image as grayscale. U and V are reffered to as the chroma planes, which are basically the colours. All the YUV formats have these three planes, and differ by the different orderings of them.

@dumbledore
dumbledore / mount-bitlocker
Created February 20, 2018 21:05
Mount/umount wrapper for dislocker on MacOS
#!/bin/bash
BITLOCKER_PARTITION="${1}"
BITLOCKER_PASSWORD="${2}"
function usage() {
echo "$(basename ${0}) <partition> <password>"
echo "Unlocks and mounts a bitlocker partition as read-only"
}
if [ -z "${BITLOCKER_PARTITION}" ]
@dumbledore
dumbledore / gist:636705
Created October 20, 2010 16:02
Example for using html_safe in Rails 3
<%= stylesheet_link_tag 'suggest.min' %>
<%= javascript_include_tag 'jquery.min' %>
<%= javascript_include_tag 'suggest.min' %>
<script type="text/javascript">
$(function() {
$("#<%= @search_field %>")
.suggest({
"type": "<%= @type_info %>"
<%= ", \"mql_filter\": [{#{h(@mql_filter)}}]".html_safe unless @mql_filter.nil? %>
})