프로그램 사용/libjpeg2009. 5. 18. 18:22
libtool: link: unable to infer tagged configuration
libtool: link: specify a tag with `--tag'

라는 에러가 날경우에는, make 파일에서
libtools를 찾은후 --tag=CXX 를 넣어 주면 된다.

vi jpeg-6b/Makefile
142 .c.lo:^M
143         $(LIBTOOL) --tag=CXX --mode=compile $(CC) $(CFLAGS) -c $(srcdir)/$*.c^M

[링크 : http://www.geodynamics.org/roundup/issues/issue40]



위의 방법은 제대로 된 해결 방법이 아니다.
./configure --prefix 를 하면 위의 설정을 하지 않아도 제대로 작동한다.

2009/05/20 - [프로그램 사용/libjpeg] - libjpeg 크로스컴파일 하기 - libjpeg cross-compile using libtool

Posted by 구차니
프로그램 사용/libjpeg2009. 5. 18. 17:29
unsigned int scale_num, scale_denom
    scale_num/scale_denom 의 분수비로 영상 비율을 조절합니다.
    기본값은 1/1 혹은 조절하지 않음입니다.
    현재, 지원되는 조정 비율은 1/1, 1/2, 1/4, 1/8 입니다.
    (라이브러리 설계는 무제한의 비율이 가능하도록 되어있지만,
    빠른시일내로 적용되기는 힘들것으로 보입니다.)
    작은 조절 비율은 적은 수의 픽셀 연산과 단순화된 IDCT 방법을
    사용 할 수 있기 때문에, 매우 빠른 속도의 변환을 합니다

(scale_num은 분자, scale_denom은 분모입니다.
만약에 1/4로 하려고 한다면 scale_num = 1; scale_denom = 4; 로 하면 될 듯 합니다
- 확인요망)



6. while (scan lines remain to be read)
    jpeg_read_scanlines(...);

jpeg_read_scanlines()을 한번 혹은 여러번 호출함으로서 압축해제 된 영상정보를 읽을 수 있습니다.
각각의 호출시에, 읽을 최대 scanline을 넘겨줍니다
(예를들어, working buffer의 높이); jpeg_read_scanlines() 은
많은 줄들의 값을 돌려줄 것 입니다. 돌려준 값은 실제로 읽은 줄의 갯수입니다.
돌려받은 영상정보의 형태(format)는 위의 "Data formats"에 기술되어 있습니다.
흑백과 색상이 있는 JPEG는 서로 다른 데이터 형태라는 것을 잊지마십시오!

영상정보는 상-하 순서로 주어집니다. 만약에 하-상 순서로 영상정보를 저장해야 한다면,
효과적으로 JPEG 라이브러리의 가상 배열 방식을 사용하여 뒤집을 수 있습니다.
예제 프로그램인 djpeg에서 이러한 사용예를 찾으실 수 있습니다.



Data formats

픽셀들은 scanline 단위로 왼쪽에서 오른쪽 방향으로 저장됩니다
각각의 픽셀을 위한 값들은 열단위로 나란히 있습니다;
24-bit RGB 를 예를 들자면, R,G,B,R,G,B,R,G,B 순서로 되어있습니다.  각각의 scanline은
JSAMPLE 데이터 형의 배열로 되어있습니다 --- jmorecfg.h를 수정하지 않았다면,
일반적으로 "unsigned char" 입니다.  (또한 jmorecfg.h를 수정함으로서
RGB 픽셀의 순서를 B,G,R 순서로 변경할수도 있습니다. 하지만 수정전에 제약사항을
먼저 읽어 보시기 바랍니다.)


Posted by 구차니
프로그램 사용/libjpeg2009. 5. 18. 00:54
int w = cinfo.image_width;
int h = cinfo.image_height;
int d = cinfo.jpeg_color_space;
int out_h = cinfo.output_height;

printf("width:%d height:%d depth:%d out_height:%d\n", w, h ,d, out_h);

unsigned char *data = new unsigned char[w * h * d];
while (cinfo.output_scanline < cinfo.output_height)
{
	jpeg_read_scanlines(&cinfo, &data, 1);
	data += d * cinfo.output_width;
}

jpeg_read_header() 한뒤
jpeg_read_scanline()까지는 알았지만, 문서를 대충 읽다 보니..
도무니 어떻게 메모리를 할당해야 할지 감이 안 잡혔는데..
이 문서를 보니 어떻게 하면 될꺼 같다라는 감이 조금은 온다..
내일 해보고 결과를 적도록 해야겠다.
위에서 대로 전체 할당하고 jpeg_read_scanlines로 읽어 오니 잘된다!

[링크 : http://www.korone.net/bbs/board.php?bo_table=etc_misc&wr_id=168]
Posted by 구차니
프로그램 사용/libjpeg2009. 5. 15. 20:40
Subject: [21] What if I need more than 8-bit precision?

Baseline JPEG stores images with 8 bits per color sample, in other words

24 bits per pixel for RGB images
,
8 bits/pixel for grayscale,
32 bits/pixel for CMYK, etc.

There is an extension that stores 12 bits/sample for applications that need higher accuracy.
Medical images, for example, are often 12-bit grayscale.  The 12-bit extension is not very widely supported,
however.  One package that does support it is the free IJG source code (see part 2, item 15).

For lossless JPEG, the standard permits any data precision between 2 and 16 bits per sample,
but high-precision lossless JPEG is even less widely supported than high-precision lossy JPEG.
The Stanford PVRG codec (see part 2, item 15) reportedly supports up to 16 bits/sample for lossless JPEG.

[링크 : http://www.faqs.org/faqs/jpeg-faq/part1/]




struct jpeg_decompress_struct {
  JDIMENSION image_width;    /* nominal image width (from SOF marker) */
  JDIMENSION image_height;    /* nominal image height */
  int num_components;        /* # of color components in JPEG image */
  J_COLOR_SPACE out_color_space; /* colorspace for output */
  UINT16 X_density;        /* Horizontal pixel density */
  UINT16 Y_density;        /* Vertical pixel density */
};

typedef enum {
    JCS_UNKNOWN,        /* error/unspecified */
    JCS_GRAYSCALE,        /* monochrome */
    JCS_RGB,        /* red/green/blue */
    JCS_YCbCr,        /* Y/Cb/Cr (also known as YUV) */
    JCS_CMYK,        /* C/M/Y/K */
    JCS_YCCK        /* Y/Cb/Cr/K */
} J_COLOR_SPACE;

순서는 조금 뒤바뀌지만, 윈도우에서 출력되는 데이터는 위의 6개로 거의 표기가 가능하다.
Posted by 구차니
프로그램 사용/nfs2009. 5. 12. 20:33
setenv bootargs console=ttyAS0,115200 root=/dev/nfs nwhwconf=device:eth0,hwaddr:00:00:00:00:00:00 nfsroot=192.168.10.10:/home/user,tcp ip=192.168.10.100::192.168.10.1:255.255.255.0:hostname::off bigphysarea=2000 systemid=01000000

u-boot에서 리눅스 커널로 bootargs를 넘겨주어 nfs를 연결할 경우, 기본값이면 UDP로 연결되게 된다.

mount로 확인해보면
# mount
rootfs on / type rootfs (rw)
/dev/root on / type nfs (rw,noatime,vers=2,rsize=4096,wsize=4096,hard,nolock,proto=tcp,timeo=600,retrans=2,addr=192.168.10.10)
proc on /proc type proc (rw)
/dev/sda1 on /root/sda1 type vfat (rw,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)
로 udp가 아닌 tcp로 붙은것을 알 수 있다.

자세한건 확인해 봐야겠지만, nfs ver=2 라서 udp 인지는 모르겠다.
Posted by 구차니
Recommended Repository Layout
While Subversion's flexibility allows you to lay out your repository in any way that you choose, we recommend that you create a trunk directory to hold the “main line” of development, a branches directory to contain branch copies,
and a tags directory to contain tag copies. For example:

$ svn list file:///var/svn/repos
/trunk
/branches
/tags

You'll learn more about tags and branches in Chapter 4, Branching and Merging. For details and how to set up multiple projects, see the section called “Repository Layout” and the section called “Planning Your Repository Organization” to read more about project roots.

[출처 : svnbook.red-bean.com/nightly/en/svn-book.pdf]

cvs2svn으로 변환해보니 저러한 구조가 나왔는데, 아무생각없이 저 391장에 이르는 문서를 대충 넘기다 보니
정말 아무생각없이 넘어간 듯 하다.(38페이지)



브랜치쪽 역시.. 그냥 그림만 봤지 자세한 내용을 안봤더니..(106페이지)

'프로그램 사용 > Version Control' 카테고리의 다른 글

SVN의 장점  (0) 2009.09.19
svn tagging/branching  (0) 2009.08.20
SVN과 CVS 저장소 용량비교(compare Repository Size of CVS & SVN)  (0) 2009.05.11
cvs2svn 사용방법  (0) 2009.05.10
SVN의 단점  (0) 2009.05.08
Posted by 구차니
프로그램 사용/busybox2009. 5. 11. 13:04
# ftp
ftp: ftp/tcp: unknown service

검색을 해보니 root로는 잘되는데 일반유저로는 안된다는 문제도 있고
-> /etc/services 의 퍼미션 문제
[링크 : 워낙 자주 나오니 생략]

services에 제대로 등록이 안되서 그렇다는 문제도 있고
-> /etc/services에
ftp-data         20/tcp
ftp              21/tcp
만 등록되어 있는 문제
[링크 : https://www.linuxquestions.org/questions/linux-software-2/ftptcpunknown-services-368671/]

그리고 내가 원했던 대답은
libncurse.so 뿐만 아니라 libnss_files.so 도 필요 하다는 것이었다.
[링크 : http://lists.busybox.net/pipermail/busybox/2004-August/012250.html]


일단 busybox에서 구동을 하다 보면, 용량을 위해서 사용하지 않는 각종 라이브러리들을 삭제하게 되는데
그로 인해서, nss관련 라이브러리가 삭제 되어 있었나보다.

문제는, ftp 프로그램이 ncurse가 없을때는 에러가 나더니
nss가 없을때는 nss 라이브러리 부족이라고 에러가 안나고 뜬금없는 unknown service라는 에러를 발생한다.
Posted by 구차니
SVN은 바이너리 타입으로 데이터를 저장한다.
그리고 데이터는 zlib를 사용하여 압축하기 때문에 텍스트의 경우 상당한 공간 절약 효과가 있다 (CVS 대비)

테스트 삼아 CVS -> SVN 변환하면서 어느정도 용량의 차이가 있을까 궁금해서 캡쳐를 해보았다.


보시다시피, SVN은 CVS를 변환한 것임에도 불구하고 거의 1/4 크기 정도 밖에 되지 않는다. (25% 크기로 압축됨)

[참고 : http://stackoverflow.com/questions/458182/does-svn-compress-the-binary-content]


'프로그램 사용 > Version Control' 카테고리의 다른 글

svn tagging/branching  (0) 2009.08.20
SVN repository 구조  (0) 2009.05.11
cvs2svn 사용방법  (0) 2009.05.10
SVN의 단점  (0) 2009.05.08
svn 저장소의 위치  (0) 2009.05.08
Posted by 구차니
A Few Examples

To create a new Subversion repository by converting an existing CVS repository, run the script like this:
   $ cvs2svn --svnrepos NEW_SVNREPOS CVSREPOS

To create a new Subversion repository containing only trunk commits, and omitting all branches and tags from the CVS repository, do
   $ cvs2svn --trunk-only --svnrepos NEW_SVNREPOS CVSREPOS

To create a Subversion dumpfile (suitable for 'svnadmin load') from a CVS repository, run it like this:
   $ cvs2svn --dumpfile DUMPFILE CVSREPOS

To use an options file to define all of the conversion parameters, specify --options:
   $ cvs2svn --options OPTIONSFILE

As it works, cvs2svn will create many temporary files in a temporary directory called "cvs2svn-tmp" (or the directory specified with --tmpdir). This is normal. If the entire conversion is successful, however, those tempfiles will be automatically removed. If the conversion is not successful, or if you specify the '--skip-cleanup' option, cvs2svn will leave the temporary files behind for possible debugging.

[출처  : http://cvs2svn.tigris.org/cvs2svn.html]

cvs2svn은 cvs 리파지터리를 svn으로 변환해주는 툴이다.
변환과정중에 하나라도 잘못된 ,v 파일(cvs의 history 파일)이 있으면 중지되고,
한글을 사용했을 경우, encoding 문제로 인해서 pass 2에서 문제가 발생한다.

ERROR: There were warnings converting author names and/or log messages
to unicode (see messages above).  Please restart this pass
with one or more '--encoding' parameters or with '--fallback-encoding'.

$ man cvs2svn
       --encoding=encoding
              Use  encoding  as  the  encoding for filenames, log messages, and
              author names in the CVS repos.  This option may be specified mul-
              tiple times, in which case the encodings are tried in order until
              one        succeeds.         Default:         ascii.          See
              http://docs.python.org/lib/standard-encodings.html  for a list of
              other standard encodings.

       --fallback-encoding=encoding
              If none of the encodings specified  with  --encoding  succeed  in
              decoding  an  author name or log message, then fall back to using
              encoding in lossy 'replace' mode.  Use of this option  may  cause
              information  to be lost, but at least it allows the conversion to
              run to completion.  This option only affects the encoding of  log
              messages  and  author  names;  there  is no fallback encoding for
              filenames.  (By using an --options file, it is possible to  spec-
              ify a fallback encoding for filenames.)  Default: disabled.

그래서 위에 나온 링크에서 encoding 항목을 뒤져 보았다.
 Codec  Aliases  Languages
 cp949  949, ms949, uhc  Korean
 euc_kr  euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001  Korean
 iso2022_jp_2  iso2022jp-2, iso-2022-jp-2  Japanese, Korean, Simplified Chinese, Western Europe, Greek
 iso2022_kr  csiso2022kr, iso2022kr, iso-2022-kr  Korean
 johab  cp1361, ms1361  Korean

[출처 : http://docs.python.org/library/codecs.html#standard-encodings]



acroedit에서 열어 보니 ANSI-UNIX-949 라고 나온다.
windows에서 TortoiseCVS로 사용했다면 cp949로 encoding을 설정하면 이상없이 변환된다.

아무튼 실행은 아래의 명령어로 한다.
$ cvs2svn --svnrepos svn/ --encoding=cp949 /home/cvs/

변환 pass가 상당히 많다. 오래 걸리는 것은 pass 1 과 pass 16이다.


변환된 결과


cvs에 여러개의 소스들이 있는데, 전부 trunk 아래로 들어가게 되엇다.
그리고 tag과 branch 역시 분리 되어있다.


로그메시지는, 너무 많은 관계로 100개씩 만 보이게 되어 있고,
하나의 리파지터리에 들어 오는 바람에, 연관이 없는 다른 프로젝트의 revision과 함께 섞였다.
이런 이유로, 다른 소스는 다른 리파지터리에 저장을 해줘야 할 듯 하다.
Posted by 구차니
$HOME/.subversion/config 파일의 [tunnels] 부분 내용이다.

### Section for configuring tunnel agents.
[tunnels]
### Configure svn protocol tunnel schemes here.  By default, only
### the 'ssh' scheme is defined.  You can define other schemes to
### be used with 'svn+scheme://hostname/path' URLs.  A scheme
### definition is simply a command, optionally prefixed by an
### environment variable name which can override the command if it
### is defined.  The command (or environment variable) may contain
### arguments, using standard shell quoting for arguments with
### spaces.  The command will be invoked as:
###   <command> <hostname> svnserve -t
### (If the URL includes a username, then the hostname will be
### passed to the tunnel agent as <user>@<hostname>.)  Here we
### redefine the built-in 'ssh' scheme to avoid an unfortunate
### interaction with the "ControlMaster auto" feature (for
### details, see Debian Bug #413102):
ssh = $SVN_SSH ssh -o ControlMaster=no
### If you wanted to define a new 'rsh' scheme, to be used with
### 'svn+rsh:' URLs, you could do so as follows:
# rsh = rsh
### Or, if you wanted to specify a full path and arguments:
# rsh = /path/to/rsh -l myusername
### On Windows, if you are specifying a full path to a command,
### use a forward slash (/) or a paired backslash (\\) as the
### path separator.  A single backslash will be treated as an
### escape for the following character.

http://www.pyrasis.com/main/Subversion-HOWTO#s-4.4 의 문서에 의하면 저기에 있는

ssh = $SVN_SSH ssh -o ControlMaster=no

ssh = ssh -l userid

로 하면 된다고 하는데.. 해도 안된다 ㅠ.ㅠ
svn client의 차이때문일려나... (예제는 콘솔에서이고 나는 TortoiseSVN에서)


그리고 TortoiseSVN의 설명에서는
.ssh/ 에 몇가지 RSA 키를 생성하고 접속시에
svn+ssh://svnuser@SvnConnection/repos
이렇게 하라는데.. 여전히 안된다...

Posted by 구차니