Skip to content

Instantly share code, notes, and snippets.

import sys
import re
import os
def read_tc_v1(f, params):
frame_count = None
if "frame-count" in params:
frame_count = int(params["frame-count"])
parts = []
@SAPikachu
SAPikachu / gist:1408441
Created November 30, 2011 08:37
support yv16 and yv24 in avs4x264mod
--- E:\avs4x264mod_v0.3\src\avs4x264mod.c 2011-11-29 10:44:43.000000000 +0800
+++ E:\avs4x264mod_v0.3\src\avs4x264mod - Copy.c 2011-11-30 16:46:54.000000000 +0800
@@ -116,13 +116,13 @@
return 0;
fail:
FreeLibrary( h->library );
return -1;
}
-char* generate_new_commadline(int argc, char *argv[], int i_frame_total, int i_fps_num, int i_fps_den, int i_width, int i_height, char* infile )
@SAPikachu
SAPikachu / gist:1504560
Created December 21, 2011 04:20
extract images from m2ts
----------------- extract.cmd -----------------
setlocal
set TMPDIR=%CD%\temp\%~n1
set OUTDIR=%CD%\output\%~n1
md %TMPDIR%
tsmuxer "%~f1" | parse_track.py "V_MPEG4/ISO/AVC, %~f1, fps=23.976, insertSEI, contSPS, track={}"> "%TMPDIR%\file.meta"
tsmuxer "%TMPDIR%\file.meta" "%TMPDIR%"
set VIDEO=
@SAPikachu
SAPikachu / gist:1526215
Created December 28, 2011 04:15
MCTDMod 3 - add support for 16bit debanding output
###################################################################################################################################
### ###
### Motion-Compensated Temporal Denoise: MCTD() ###
### ###
### v1.4.20 by "LaTo INV.", mod 2 by 06_taro ###
### ###
### 29 November 2011 ###
###
/* Debian specific configuration to work as a recursive resolver */
global {
perm_cache = 2048;
cache_dir = "/var/cache/pdnsd";
run_as = "pdnsd";
server_ip = any; // Use eth0 here if you want to allow other
// machines on your network to query pdnsd.
status_ctl = on;
paranoid = off;
import re, sys
from xml.dom import minidom, Node
import math
import argparse
class Matrix:
def m(self, i, j, value=None):
if i >= self.rows or j >= self.cols:
raise ValueError("Argument out of range")
@SAPikachu
SAPikachu / gist:1805921
Created February 12, 2012 02:47
MP_Pipeline performance test
Script:
LoadPlugin("MP_Pipeline.dll")
MP_Pipeline("""
ColorBars(640,480,"YV12")
### ###
""")
Result:
set nocompatible
let $VIM_ROOT=expand("<sfile>:p:h")
if has('win32') || has ('win64')
let path_sep='\\'
else
let path_sep='/'
endif
ImageReader("D:\Dropbox\Projects\flash3kyuu_deband\Release\wallorig.ebmp")
org=last
f3kdb(range=16, Y=36, Cb=0, Cr=0, grainY=0, grainC=0, sample_mode=2, seed=0, blur_first=true, dynamic_grain=false, dither_algo=3, keep_tv_range=true, output_mode=2, output_depth=10, random_algo_ref=2, random_algo_grain=2)
##### Debug #####
f3kdb_dither(mode=1, stacked=false, input_depth=10, keep_tv_range=true) #for previewing
StackHorizontal(org, last)
ImageReader("D:\Dropbox\Projects\flash3kyuu_deband\Release\wallorig.ebmp")
org=last
f3kdb(range=16, Y=72, Cb=0, Cr=0, grainY=0, grainC=0, sample_mode=2, seed=0, blur_first=true, dynamic_grain=false, dither_algo=2, keep_tv_range=true, output_mode=1, output_depth=9, random_algo_ref=2, random_algo_grain=2)
Histogram("luma")
return last