Skip to content

Instantly share code, notes, and snippets.

@rianhunter
rianhunter / call_overhead.c
Last active December 21, 2023 23:25
Indirect vs Direct Function Call Overhead in C/C++
/*
This benchmark shows how indirect function calls have nearly
the same overhead costs as direct function calls.
This is comparing apples to apples, factoring out the savings
due to inlining optimizations that direct calls usually afford.
From this, it seems that inlining and other generic interprocedual
optimizations are the main drivers of direct function call optimization,
not the direct call itself.
@shyouhei
shyouhei / gist:0b7dab3e75bfbf96f895
Created March 31, 2015 15:26
新社会人の人が留意すべき事項

新社会人に必須である:

  • 勤務先との書面による「労働契約」。業務委託契約等NG。
  • 多寡を問わず毎月払われる給料。遅配等論外である。
  • 健康保険。
  • 労災保険。
  • 雇用保険。
  • 三六協定。
  • 年次有休。
  • 育児休業の制度があり取得者がいる会社に勤務する。
@orumin
orumin / mpegts2h264.sh
Last active February 10, 2023 09:25
MPEG2-TS to H.264 within gstreamer on RaspberryPi
#!/usr/bin/bash
#
# Usage: mpegts2h264.sh <src.ts> <dst.mp4>
#
program_no=$(ffmpeg -i $1 2>&1 | grep Program | head -n 1 | awk '{ print $2 }')
video_sid=$(ffmpeg -i $1 2>&1 | grep Stream | grep Video | sed -e "s/^.*Stream #0:0\[0x\([0-9a-f][0-9a-f][0-9a-f]\)\].*$/\1/g")
audio_sid=$(ffmpeg -i $1 2>&1 | grep Stream | grep Audio | sed -e "s/^.*Stream #0:1\[0x\([0-9a-f][0-9a-f][0-9a-f]\)\].*$/\1/g")
gst-launch-1.0 filesrc location=./$1 ! progressreport ! \