Skip to content

Instantly share code, notes, and snippets.

Compression ratio 155.038239 %
Compression ratio 779.847168 %
Compression ratio 791.140869 %
Compression ratio 803.992065 %
Compression ratio 805.629639 %
Compression ratio 806.447388 %
Compression ratio 795.257446 %
Compression ratio 802.165588 %
Compression ratio 802.319214 %
Compression ratio 787.948242 %
#pragma pack(push, 1)
typedef struct elf32_hdr_struct
{
unsigned char e_ident[EI_NIDENT];
Elf32_Half e_type; //file type
Elf32_Half e_machine; //architecture
Elf32_Word e_version; //file version
Elf32_Addr e_entry; //virtual address the system first transfers control to.
Elf32_Off e_phoff; //program header offset in bytes, or 0 if there is none
Elf32_Off e_shoff; //section header offset in bytes, or 0 if there is none
@Tomwi
Tomwi / gist:4100534
Created November 17, 2012 21:47
Fir
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#define FILTER_LEN (100)
#define N_CHAN (2)
#define BUFFER_SIZE (512*sizeof(int16_t))
#define FILTERED (100)
#define ORIGINAL (0)
/* fix_fft.c - Fixed-point in-place Fast Fourier Transform */
/*
All data are fixed-point short integers, in which -32768
to +32768 represent -1.0 to +1.0 respectively. Integer
arithmetic is used for speed, instead of the more natural
floating-point.
For the forward FFT (time -> freq), fixed scaling is
performed to prevent arithmetic overflow, and to map a 0dB
sine/cosine wave (i.e. amplitude = 32767) to two -6dB freq
@Tomwi
Tomwi / gist:3083476
Created July 10, 2012 14:08
RGB conversion
.global RGB24_to_ARGB16
.hidden RGB24_to_ARGB16
.type RGB24_to_ARGB16, %function
.arm
.align 2
@ r0 in
@ r1 dest
@ r2 = len