Skip to content

Instantly share code, notes, and snippets.

void __cdecl filter_impl(int thread_id, int thread_num, FILTER *fp, FILTER_PROC_INFO *fpip)
{
int seed; // ecx@10
signed int counter3; // ebx@13
char *range_lut_1_iter_2; // esi@13
signed int counter2; // ebx@16
char *ditherC_lut_2_iter; // esi@16
int v9; // edx@17
signed int counter4; // ebx@18
char *w_range_map_iter; // esi@18
@SAPikachu
SAPikachu / zhou_tai_death_rate.py
Created July 6, 2011 06:27
周泰死亡率模拟
# 周泰死亡率模拟
# 假设各点数出现的概率完全一样
import random
import math
p = [0 for x in range(14)]
count = 0
@SAPikachu
SAPikachu / gist:1113190
Created July 29, 2011 05:35
Enable market in android
#!/bin/sh
code='310260'
if [ `getprop gsm.sim.operator.numeric` != "$code" ]
then
echo "$0: Setting GSM operator to $code ..."
setprop gsm.sim.operator.numeric $code
killall com.android.vending
rm -rf /data/data/com.android.vending/cache/*
else
@SAPikachu
SAPikachu / gist:1117711
Created August 1, 2011 07:18
x264 avisynth 16bit hack
input/avs.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/input/avs.c b/input/avs.c
index 59fab8c..373fa68 100644
--- a/input/avs.c
+++ b/input/avs.c
@@ -267,6 +267,14 @@ static int open_file( char *psz_filename, hnd_t *p_handle, video_info_t *info, c
info->csp = X264_CSP_NONE;
info->vfr = 0;
@SAPikachu
SAPikachu / gist:1131739
Created August 8, 2011 13:26
x264: skips depth filter when possible
a68cd9bf80f359d376cce02a295299302ed95d02
filters/video/depth.c | 7 +++++++
input/avs.c | 5 +++++
x264.h | 1 +
3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/filters/video/depth.c b/filters/video/depth.c
index 25dde25..b6cf1a5 100644
--- a/filters/video/depth.c
+++ b/filters/video/depth.c
@SAPikachu
SAPikachu / gist:1216216
Created September 14, 2011 09:48
read and dither v210 in avisynth
# modified from http://forum.doom9.org/showthread.php?p=1469679#post1469679
function readv210(string fn, int file_head, int frame_width, int frame_height, bool "flip") {
line_size = (frame_width * 16 / 6 + 127) / 128 * 128 # all lines are padded to 128 bytes boundary
base=RawReader (fn, format="y8", width=line_size, height=frame_height, numframes=0, filehead=file_head, framehead=0, flip=default(flip,false))
p0=base.every(4,0)
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
def hack_httplib2_response():
original_init = httplib2.Response.__init__
def hacked_init(self, info):
self["_original_response"] = info
original_init(self, info)
httplib2.Response.__init__ = hacked_init
@SAPikachu
SAPikachu / gist:1323933
Created October 29, 2011 00:44
hacked inttypes.h
/* 7.8 Format conversion of integer types <inttypes.h> */
#ifndef _INTTYPES_H_
#define _INTTYPES_H_
#include <stdint.h>
#define __need_wchar_t
#include <stddef.h>
#ifdef __cplusplus
./configure --enable-static --enable-gpl --enable-postproc --disable-debug --disable-muxers --disable-encoders --disable-filters --disable-hwaccels --disable-network --disable-devices --enable-runtime-cpudetect --enable-w32threads