Y = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 | BT.709 | BT.2020 | |
---|---|---|---|
a | 0.299 | 0.2126 | 0.2627 |
b | 0.587 | 0.7152 | 0.6780 |
package com.example.glcube; | |
import java.nio.ByteBuffer; | |
import java.nio.ByteOrder; | |
import java.nio.FloatBuffer; | |
import java.nio.ShortBuffer; | |
import javax.microedition.khronos.egl.EGLConfig; | |
import javax.microedition.khronos.opengles.GL10; |
// http://mahisorn.blogspot.com/2009/01/3d-lut-using-glsl.html | |
uniform sampler2D image; | |
uniform sampler3D lookup; | |
uniform float imageWidth; | |
uniform float imageHeight; | |
varying vec2 pos; | |
void main(void) { | |
// find the texture coordinate corresponding to this fragment |
Y = a * R + b * G + c * B
Cb = (B - Y) / d
Cr = (R - Y) / e
BT.601 | BT.709 | BT.2020 | |
---|---|---|---|
a | 0.299 | 0.2126 | 0.2627 |
b | 0.587 | 0.7152 | 0.6780 |
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |
import android.content.ComponentName; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.ServiceConnection; | |
import android.os.IBinder; | |
import android.support.annotation.Nullable; | |
/** | |
* This class based on official | |
* <a href="http://developer.android.com/guide/components/bound-services.html">documentation</a> |
127 + // copied from the link bebow: | |
128 + // https://es.osdn.net/projects/android-x86/scm/git/external-mesa/commits/5a595cd3af15b99d266d3fd5cba41da33f1888ac | |
129 + | |
130 + bool ubwc = false; | |
131 + | |
132 + const uint32_t *handle_fds = (uint32_t *)gralloc_info->handle->data; | |
133 + const uint32_t *handle_data = &handle_fds[gralloc_info->handle->numFds]; | |
134 + int dma_buf; | |
135 + | |
136 + if (gralloc_info->handle->numFds == 1) { |
#!/bin/bash | |
sudo add-apt-repository -y ppa:git-core/ppa | |
sudo apt-get update | |
sudo apt-get install git -y |
# http://stackoverflow.com/questions/1855095/how-to-create-a-zip-archive-of-a-directory | |
import os | |
import zipfile | |
import hashlib | |
import time | |
def zipdir(path, ziph): | |
for root, dirs, files in os.walk(path): | |
if '.git' not in root: | |
for file in files: |
// Really awesome code taken from: http://apangborn.com/2011/05/pixel-processing-using-arm-assembly/ | |
inline static void neon_rgba_to_bgra(unsigned char *src, unsigned char *dst, int numPixels) | |
{ | |
#ifdef __ARM_NEON__ | |
int simd_pixels = numPixels & ~7; // round down to nearest 8 | |
int simd_iterations = simd_pixels >> 3; | |
int col; | |
if(simd_iterations) { // make sure at least 1 iteration | |
__asm__ __volatile__ ("1: \n\t" | |
// structured load of 8 pixels into d0-d3 (64-bit) NEON registers |
@see https://android.googlesource.com/platform/frameworks/base/+/ccbf84f44c9e6a5ed3c08673614826bb237afc54 | |
Some system apps are more system than others | |
"signatureOrSystem" permissions are no longer available to all apps | |
residing en the /system partition. Instead, there is a new /system/priv-app | |
directory, and only apps whose APKs are in that directory are allowed | |
to use signatureOrSystem permissions without sharing the platform cert. | |
This will reduce the surface area for possible exploits of system- | |
bundled applications to try to gain access to permission-guarded |