Programming/php2014. 10. 7. 10:49

'Programming > php' 카테고리의 다른 글

php 5.3.22 버전 크로스컴파일시 주의사항  (0) 2014.10.08
php - register_globals  (0) 2014.10.07
php-fpm관련  (0) 2014.09.25
xcache apc  (0) 2014.09.23
lighthttpd / php / FastCGI  (0) 2014.08.28
Posted by 구차니
개소리 왈왈/컴퓨터2014. 10. 3. 22:41
앨리스 매드니스 엔딩보고 봉인해야 할 운명...? 이랄까
아무튼 딱히 할 것도 없고
할 시간도 없고

이래저래 봉인될 운명이라
팔아 먹기도 애매한 녀석인데 우찌해야 하나.. ㅠㅠ 

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

umid m1 한대 더 지르기!!  (0) 2014.12.20
ripple mini look - atom 330 / ion 관련  (0) 2014.10.12
nforce 560 / amd 770 HT 차이점?  (0) 2014.09.11
간만에 지름  (0) 2014.09.10
와.. 이거 갖고 싶다 ㅠㅠ  (8) 2014.07.23
Posted by 구차니
게임/컨트롤러2014. 10. 2. 21:27
기본으로 설치해서 하니
니드포 스피드에서 제대로 인식을 못한다.

1. 악셀이 아주 천천히 가속됨
2. 기어가 안됨

아무튼 드라이버 받아서 깔아야 겨우 작동이 된다.
근데.. 왜 게임이 더 어려워진거 같지? ㅠㅠ


드라이버가 다운로드. 공식 사이트에서 다시 찾아봐야지 ㅠㅠ
[링크 : http://sacrificio.tistory.com/1012]

+
2018.03.04


'게임 > 컨트롤러' 카테고리의 다른 글

track IR  (2) 2018.04.08
으으.. 조이스틱 망가졌네 ㅠㅠ (joytron air twister FX)  (0) 2018.04.08
JOYTRON EX M AIR 조이스틱  (2) 2018.03.10
usb joystick DIY / Force Feedback  (2) 2018.03.04
joytron cyvox  (0) 2018.03.03
Posted by 구차니
모종의 음모/mp3 분석2014. 10. 1. 16:36
음.. 크게와 닫지 않는데.. ADPCM 같은 느낌?

과거에는 확실하게 디코더가 작동하지 않아 문제가 되었지만
요즘에는 디코더가 좋아져서 문제없이 작동하기에 동일 bitrate일 경우 음질이 더 좋아진다고 한다.
일단 frame 단위로 설정이 되므로 mp3 내에서도 프레임 단위로 M/S stereo 와 Joint Stereo를 오갈수 있는 듯

M/S (Mid/Main - Side)
[링크 : http://www.sounddevices.com/notes/general/ms-stereo-basics/]


한정대역에서 고품질 오디오 서비스를 위한 코딩 방식의 일종. 
스테레오 처럼 무조건 좌우측 신호를 나누어 기록하는 것이 아니고 좌우축 신호에서 공통되는 신호는 1가지만 기록하며 좌우측에는 각각 다른 신호만을 기록하므로 스테레오와 비교하면 남는 공간에 데이터를 더 기록할 수 있어 음질을 향상시킬 수 있는 방식이다. MP3나 DAB방송에서 한정된 대역으로 고음질 서비스를 위해 사용된다.
 
[링크 : http://word.tta.or.kr/terms/termsView.jsp?gubun=1&terms_num=28873

[링크 : http://en.wikipedia.org/wiki/Joint_(audio_engineering)]
[링크 : http://ko.goldenears.net/board/1160186]
[링크 : http://www.clien.net/cs2/bbs/board.php?bo_table=cm_mac&wr_id=384226&page=

'모종의 음모 > mp3 분석' 카테고리의 다른 글

mp3 id3 태그 내의 jpeg 추출  (0) 2014.10.01
mp3 format  (0) 2014.10.01
bitrate / sampling rate / mp3 / 등등등...  (0) 2014.09.16
Posted by 구차니
모종의 음모/mp3 분석2014. 10. 1. 16:27
mp3 파일을 들여다 보다 보니.. JFIF 라는 문구 발견
심심해서 적당하게 잘라내 보니 된다.

일단 시작 지점은 JFIF 앞 6바이트 부터
mp3 헤더인 FFFB... 이전 0x00 부분을 제외한(패딩으로 생각되니)

추출한 녀석은 320x320 인데 IDv3 에 표준 사이즈인지는 미지수



 

'모종의 음모 > mp3 분석' 카테고리의 다른 글

mp3 joint stereo  (0) 2014.10.01
mp3 format  (0) 2014.10.01
bitrate / sampling rate / mp3 / 등등등...  (0) 2014.09.16
Posted by 구차니
모종의 음모/mp3 분석2014. 10. 1. 13:10
mp3
[링크 : http://en.wikipedia.org/wiki/ID3]

일단 FFFBA040 이라고 아래에서 예를 들지만
mpeg1 - Layer 3냐 
mpeg2 - Layer 3냐에 따라서도 조금씩 달라지지만
FFFx 로 시작하는건 "거의" 확실하다는 점



[링크 : http://en.wikipedia.org/wiki/MP3]
[링크 : http://www.datavoyage.com/mpgscript/mpeghdr.htm]

MP3 file is divided into a small blocks - frames. Each frame has constant time length 0.026 sec.
But size of one frame (in Bytes) varies according to bitrate. Eg. for 128kbps it is (normally) 417 Bytes and for 192kbps 626 Bytes.
[링크 : http://www.multiweb.cz/twoinches/mp3inside.htm]

--

96kbps / 44k / 2ch mp3의 덤프
팟인코더로 해서 앞에 ID3 태그에 간략하게 팟 인코더로 나오고 FFFB7064로 프레임당 313 바이트 정도로 나온다.
이유는 모르겠지만.. CBR이라고 해도 313/314로 오락가락하는데 패딩 문제인거 같긴하지만 계산법을 찾아 봐야 할 듯

 

320kbps / 44k / 2ch mp3의 덤프
FFFBE064 로 프레임당 1044 / 1045 바이트


mp3 헤더 분석 및 프레임 크기 계산


// MPEG versions - use [version]

const uint8_t mpeg_versions[4] = { 25, 0, 2, 1 };


// Layers - use [layer]

const uint8_t mpeg_layers[4] = { 0, 3, 2, 1 };


// Bitrates - use [version][layer][bitrate]

const uint16_t mpeg_bitrates[4][4][16] = {

  { // Version 2.5

    { 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 0 }, // Reserved

    { 0,   8,  16,  24,  32,  40,  48,  56,  64,  80,  96, 112, 128, 144, 160, 0 }, // Layer 3

    { 0,   8,  16,  24,  32,  40,  48,  56,  64,  80,  96, 112, 128, 144, 160, 0 }, // Layer 2

    { 0,  32,  48,  56,  64,  80,  96, 112, 128, 144, 160, 176, 192, 224, 256, 0 }  // Layer 1

  },

  { // Reserved

    { 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 0 }, // Invalid

    { 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 0 }, // Invalid

    { 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 0 }, // Invalid

    { 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 0 }  // Invalid

  },

  { // Version 2

    { 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 0 }, // Reserved

    { 0,   8,  16,  24,  32,  40,  48,  56,  64,  80,  96, 112, 128, 144, 160, 0 }, // Layer 3

    { 0,   8,  16,  24,  32,  40,  48,  56,  64,  80,  96, 112, 128, 144, 160, 0 }, // Layer 2

    { 0,  32,  48,  56,  64,  80,  96, 112, 128, 144, 160, 176, 192, 224, 256, 0 }  // Layer 1

  },

  { // Version 1

    { 0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, 0 }, // Reserved

    { 0,  32,  40,  48,  56,  64,  80,  96, 112, 128, 160, 192, 224, 256, 320, 0 }, // Layer 3

    { 0,  32,  48,  56,  64,  80,  96, 112, 128, 160, 192, 224, 256, 320, 384, 0 }, // Layer 2

    { 0,  32,  64,  96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0 }, // Layer 1

  }

};


// Sample rates - use [version][srate]

const uint16_t mpeg_srates[4][4] = {

    { 11025, 12000,  8000, 0 }, // MPEG 2.5

    {     0,     0,     0, 0 }, // Reserved

    { 22050, 24000, 16000, 0 }, // MPEG 2

    { 44100, 48000, 32000, 0 }  // MPEG 1

};


// Samples per frame - use [version][layer]

const uint16_t mpeg_frame_samples[4][4] = {

//    Rsvd     3     2     1  < Layer  v Version

    {    0,  576, 1152,  384 }, //       2.5

    {    0,    0,    0,    0 }, //       Reserved

    {    0,  576, 1152,  384 }, //       2

    {    0, 1152, 1152,  384 }  //       1

};


// Slot size (MPEG unit of measurement) - use [layer]

const uint8_t mpeg_slot_size[4] = { 0, 1, 1, 4 }; // Rsvd, 3, 2, 1



uint16_t mpg_get_frame_size (char *hdr) {

    

    // Quick validity check

    if ( ( ((unsigned char)hdr[0] & 0xFF) != 0xFF)

      || ( ((unsigned char)hdr[1] & 0xE0) != 0xE0)   // 3 sync bits

      || ( ((unsigned char)hdr[1] & 0x18) == 0x08)   // Version rsvd

      || ( ((unsigned char)hdr[1] & 0x06) == 0x00)   // Layer rsvd

      || ( ((unsigned char)hdr[2] & 0xF0) == 0xF0)   // Bitrate rsvd

    ) return 0;

    

    // Data to be extracted from the header

    uint8_t   ver = (hdr[1] & 0x18) >> 3;   // Version index

    uint8_t   lyr = (hdr[1] & 0x06) >> 1;   // Layer index

    uint8_t   pad = (hdr[2] & 0x02) >> 1;   // Padding? 0/1

    uint8_t   brx = (hdr[2] & 0xf0) >> 4;   // Bitrate index

    uint8_t   srx = (hdr[2] & 0x0c) >> 2;   // SampRate index

    

    // Lookup real values of these fields

    uint32_t  bitrate   = mpeg_bitrates[ver][lyr][brx] * 1000;

    uint32_t  samprate  = mpeg_srates[ver][srx];

    uint16_t  samples   = mpeg_frame_samples[ver][lyr];

    uint8_t   slot_size = mpeg_slot_size[lyr];

    

    // In-between calculations

    float     bps       = (float)samples / 8.0;

    float     fsize     = ( (bps * (float)bitrate) / (float)samprate ) + ( (pad) ? slot_size : 0 );

    

    // Frame sizes are truncated integers

    return (uint16_t)fsize;

}
[링크 : http://www.hydrogenaud.io/forums/index.php?showtopic=85125]

'모종의 음모 > mp3 분석' 카테고리의 다른 글

mp3 joint stereo  (0) 2014.10.01
mp3 id3 태그 내의 jpeg 추출  (0) 2014.10.01
bitrate / sampling rate / mp3 / 등등등...  (0) 2014.09.16
Posted by 구차니

일단, 이렇게 하드웨어 가상화 부분을 끄면 아래와 같이 경고를 발생하게 된다.


혹시나 해서 테스트 겸
bios에서 가상화를 끄고 왔더니 "가속" 탭 자체가 비활성화 되어버린다.


실행하면 에러가 발생하고
커널에서 부팅을 못하면서 먹통이 되어버려서.. ctrl-alt-del로 겨우 탈출 -_-

Posted by 구차니
virtualbox 4.3.12 버전에서 사용가능한 네트워크는


Not attached

NAT - Network Address Translation

NAT Network

Bridged networking

Internal networking

Host-only networking

Generic networking
7가지인데

인터넷이 되는 설정은 NAT / Bridged networking 뿐이다?
NAT Network 로 설정하면
NAT Network 로 설정한 VM 들 끼리는 통신이 가능하지만
외부로 인터넷 접속이 안된다 -_-

(제대로 된 테스트 필요)

   internet  other VMs
 Not attached  x  x
 NAT   o  x / DHCP
 NAT Network  x  o / DHCP
 Bridged networking  o  o (단, 다른 VM도 Bridged)
 Internal networking    
 Host-only networking  x  x

[링크 : https://www.virtualbox.org/manual/ch06.html]
[링크 : https://www.virtualbox.org/manual/ch06.html#network_nat_service

 Network Address Translation (NAT) is the simplest way of accessing an external network from a virtual machine. Usually, it does not require any configuration on the host network and guest system. For this reason, it is the default networking mode in VirtualBox.

 The Network Address Translation (NAT) service works in a similar way to a home router, grouping the systems using it into a network and preventing systems outside of this network from directly accessing systems inside it, but letting systems inside communicate with each other and with systems outside using TCP and UDP over IPv4 and IPv6.

 Internal Networking is similar to bridged networking in that the VM can directly communicate with the outside world. However, the "outside world" is limited to other VMs on the same host which connect to the same internal network.

 With bridged networking, VirtualBox uses a device driver on your host system that filters data from your physical network adapter.

 Host-only networking is another networking mode that was added with version 2.2 of VirtualBox. It can be thought of as a hybrid between the bridged and internal networking modes: as with bridged networking, the virtual machines can talk to each other and the host as if they were connected through a physical Ethernet switch. 
Posted by 구차니
embeded/ARM2014. 9. 29. 17:37
ffmpeg 컴파일 옵션중에
  --enable-thumb           compile for Thumb instruction set

thumb 활성화가 있고 cpu도 지원을 해서
Processor       : ARM926EJ-S rev 5 (v5l)
BogoMIPS        : 226.09
Features        : swp half thumb fastmult edsp java 

 --enable-armv5te 랑 같이 썼더니.... 안되잖아!!!! ㅠㅠ
Assembler messages:
Error: instruction not supported in Thumb16 mode -- `adds r2,r5,r4,lsr#31'
Error: selected processor does not support `itet ne'
Error: Thumb does not support conditional execution

armv5te의 DSP enhancement 명령어들이 16bit(thumb mode) 가 아닌 32bit라 안되는게 아닐까 라고 추측되는데..
아무튼..  thumb의 장점으로는 ARM에서 코드 밀도가 올라간다(코드 사이즈가 65%까지 준다고..) 는 것 외에는
성능 향상적인 측면은 크게 없으니 굳이 무리하게 thumb 옵션을 쓰지 않아도 될 듯.
 
단점들을 나열해 볼게요. 
 
1. 분기 명령어를 제외하고는 조건부 실행이 안됩니다. 
2. 레지스터 사용이 R0~R7으로 제안 됩니다.
3. Immediate 상수 값의 사용 범위가 제한적입니다.
4. Inline barrel shifter의 사용이 제안적입니다.
5. Exception 처리를 할 수 없습니다.
[링크 : http://recipes.egloos.com/viewer/5651064

8.1 Thumb Instruction 특징
(1) 16-bit length instruction set
(2) ARM 명령어보다 코드의 집적도가 높습니다.( about 65% of ARM instruction )
(3) 일반적으로는 32bit ARM명령어 보다는 속도가 느리지만 16bit memory 시스템에서는 그렇지 않을 수도 있습니다.

8.2 Thumb Instruction 제약 사항

- Limited Access to Registers : R0-R7 registers are accessible.
- Narrow Range of Immediate Value
- Not Flexible for Exception Mode
- Exception Handler should be executed in ARM mode. : Exception이 발생하면 항상 ARM 모드로 전환이 됩니다.
- Limited conditional instruction.
- Branch instructions can be executed conditionally.
- Inline Barrel Shifter is not used. 
 
[링크 : http://www.jkelec.co.kr/img/lecture/arm_arch/arm_arch_4.html#8]  

'embeded > ARM' 카테고리의 다른 글

크로스 컴파일 옵션 configure --host  (0) 2014.10.13
iWMMX / iWMMXt - Intel XScale SIMD instructions  (0) 2014.10.08
dsp & simd / neon  (0) 2014.09.22
Freescale Multimedia framwork  (0) 2014.09.17
freescale i.mx283 / i.mx515  (0) 2014.08.19
Posted by 구차니
mplayer에서는 -ao alsa:device=hw:0.0 식으로 음악을 바로 재생을 할 수 있는데..
ffmpeg은 입력을 받아서 저장은 되도.. 플레이는 안되나.. 보다 싶긴하다.
$ man ffmpeg
   Video and Audio grabbing
       If you specify the input format and device then ffmpeg can grab video and audio directly.

               ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg

       Or with an ALSA audio source (mono input, card id 1) instead of OSS:

               ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg

       Note that you must activate the right video source and channel before launching ffmpeg with any TV viewer
       such as <http://linux.bytesex.org/xawtv/> by Gerd Knorr. You also have to set the audio recording levels
       correctly with a standard mixer. 

$ mam mplayer
AUDIO OUTPUT DRIVERS (MPLAYER ONLY)
       Audio output drivers are interfaces to different audio output facilities.  The syntax is:

       -ao <driver1[:suboption1[=value]:...],driver2,...[,]>
              Specify a priority list of audio output drivers to be used.

       If  the  list has a trailing ',' MPlayer will fall back on drivers not contained in the list.  Suboptions
       are optional and can mostly be omitted.
       NOTE: See -ao help for a list of compiled-in audio output drivers.

       EXAMPLE:
                 -ao alsa,oss,
                      Try the ALSA driver, then the OSS driver, then others.
                 -ao alsa:noblock:device=hw=0.3
                      Sets noblock-mode and the device-name as first card, fourth device. 

'프로그램 사용 > ffmpeg & ffserver' 카테고리의 다른 글

MPlayer 1.1 크로스컴파일  (0) 2014.10.08
live555 관련링크  (0) 2014.10.07
ffmpeg armv5te performance  (0) 2014.09.26
ffmpeg armv5te 옵션  (0) 2014.09.25
lame을 이용한 mp3 포맷변경  (0) 2014.09.24
Posted by 구차니