2.0 init
authorJeongmo Yang <jm80.yang@samsung.com>
Tue, 21 Aug 2012 10:38:55 +0000 (19:38 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Tue, 21 Aug 2012 11:40:22 +0000 (20:40 +0900)
Change-Id: Ief6172bd6bf3c40d368628f2ca7a95125d5d0d6c

debian/changelog [deleted file]
debian/compat [deleted file]
debian/control [deleted file]
debian/copyright [deleted file]
debian/dirs [deleted file]
debian/docs [deleted file]
debian/libcamsrcjpegenc-sw-libjpeg-dev.install.in [deleted file]
debian/libcamsrcjpegenc-sw-libjpeg.install.in [deleted file]
debian/rules [deleted file]
packaging/libcamsrcjpegenc-sw-libjpeg.spec
src/camsrcjpegenc-sw-libjpeg.c

diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644 (file)
index 91481f8..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-libcamsrcjpegenc-sw-libjpeg (0.1.4-0) unstable; urgency=low
-
-  * Initial release
-  * Git: pkgs/l/libcamsrcjpegenc-sw-libjpeg
-  * Tag: libcamsrcjpegenc-sw-libjpeg_0.1.4-0
-
- -- Jeongmo Yang <jm80.yang@samsung.com>  Wed, 07 Dec 2011 12:38:25 +0900
diff --git a/debian/compat b/debian/compat
deleted file mode 100644 (file)
index 7ed6ff8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100644 (file)
index 9126cc5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Source: libcamsrcjpegenc-sw-libjpeg
-Section: libs
-Priority: extra
-Maintainer: Jeongmo Yang <jm80.yang@samsung.com>
-Uploaders: Jeongmo Yang <jm80.yang@samsung.com>, Sangchul Lee <sc11.lee@samsung.com>
-Build-Depends: debhelper (>= 5), autotools-dev, dlog-dev, libglib2.0-dev, libjpeg8-dev, libcamsrcjpegenc-dev, libmm-utility-dev
-Standards-Version: 3.7.2
-
-Package: libcamsrcjpegenc-sw-libjpeg
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libdlog-0, libglib2.0-0, libjpeg8
-Description: Multimedia Framework Camera Src Jpeg Encoder Library (Libjpeg)
-Package: libcamsrcjpegenc-sw-libjpeg-dbg
-Section: debug
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libcamsrcjpegenc-sw-libjpeg (= ${Source-Version})
-Description: Multimedia Framework Camera Src Jpeg Encoder Library (Libjpeg) (unstripped)
-
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644 (file)
index 2db5a49..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-
-Contact: Jeongmo Yang <jm80.yang@samsung.com>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
diff --git a/debian/dirs b/debian/dirs
deleted file mode 100644 (file)
index ca882bb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/sbin
diff --git a/debian/docs b/debian/docs
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/debian/libcamsrcjpegenc-sw-libjpeg-dev.install.in b/debian/libcamsrcjpegenc-sw-libjpeg-dev.install.in
deleted file mode 100644 (file)
index f7721bc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@PREFIX@/include/*
diff --git a/debian/libcamsrcjpegenc-sw-libjpeg.install.in b/debian/libcamsrcjpegenc-sw-libjpeg.install.in
deleted file mode 100644 (file)
index bf766f0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-@PREFIX@/lib/*.so*
diff --git a/debian/rules b/debian/rules
deleted file mode 100644 (file)
index 4a824b5..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-CFLAGS += -Wall -g -fPIC
-LDFLAGS ?= 
-PREFIX ?= /usr
-DATADIR ?= /opt
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-       CFLAGS += -O0
-else
-       CFLAGS += -O2
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--hash-style=both -Wl,--as-needed
-
-config.status:
-       dh_testdir
-       # Add here commands to configure the package.
-       ./autogen.sh
-       CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --prefix=$(PREFIX) --enable-dlog 
-
-build: build-stamp
-
-build-stamp:  config.status
-       dh_testdir
-
-       # Add here commands to compile the package.
-       $(MAKE)
-       #docbook-to-man debian/mm-ta.sgml > mm-ta.1
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               cat $$f > $${f%.in}; \
-               sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
-               sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
-       done
-
-       touch $@
-
-clean:
-       dh_testdir
-       dh_testroot
-       rm -f build-stamp 
-
-       # Add here commands to clean up after the build process.
-       -$(MAKE) distclean
-ifneq "$(wildcard /usr/share/misc/config.sub)" ""
-       cp -f /usr/share/misc/config.sub config.sub
-endif
-ifneq "$(wildcard /usr/share/misc/config.guess)" ""
-       cp -f /usr/share/misc/config.guess config.guess
-endif
-
-       for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
-               rm -f $${f%.in}; \
-       done
-
-       dh_clean 
-
-install: build
-       dh_testdir
-       dh_testroot
-       dh_clean -k 
-       dh_installdirs
-
-       # Add here commands to install the package into debian/mm-ta.
-       $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-       dh_testdir
-       dh_testroot
-       dh_installchangelogs 
-       dh_installdocs
-       dh_installexamples
-       dh_install --sourcedir=debian/tmp
-#      dh_installmenu
-#      dh_installdebconf       
-#      dh_installlogrotate
-#      dh_installemacsen
-#      dh_installpam
-#      dh_installmime
-#      dh_python
-#      dh_installinit
-#      dh_installcron
-#      dh_installinfo
-       dh_installman
-       dh_link
-       dh_strip --dbg-package=libcamsrcjpegenc-sw-libjpeg-dbg
-       dh_compress
-       dh_fixperms
-#      dh_perl
-       dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
-       dh_gencontrol
-       dh_md5sums
-       dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install 
index 5b4f76c..069f647 100644 (file)
@@ -1,5 +1,5 @@
 Name:       libcamsrcjpegenc-sw-libjpeg
-Summary:    Multimedia Framework Camera Src Jpeg Encoder Library (libjpeg) (unstripped)
+Summary:    Multimedia Framework Camera Src Jpeg Encoder Library (libjpeg)
 Version:    0.1.4
 Release:    2
 Group:      libdevel
index d3b011b..dd8fd49 100644 (file)
 #define I420_SIZE(w,h)     (I420_V_OFFSET(w,h)+(I420_V_ROWSTRIDE(w)*JPEGENC_ROUND_UP_2(h)/2))
 
 /* Limitations */
-#define MAX_JPG_WIDTH               2560
-#define MAX_JPG_HEIGHT              1920
-#define MAX_YUV_SIZE                (MAX_JPG_WIDTH * MAX_JPG_HEIGHT * 3)
-#define MAX_ENCODED_RESULT_SIZE               (MAX_JPG_WIDTH * MAX_JPG_HEIGHT / 3)
+#define MAX_JPG_WIDTH                           3264
+#define MAX_JPG_HEIGHT                          2448
+#define MAX_ENCODED_RESULT_SIZE(width, height)  ((width * height * 2) / 3)
 
 
 /* To use dlog instead of printf */
@@ -197,6 +196,7 @@ int  camsrcjpegencsub_encode ( jpegenc_parameter *enc_param )
        /* video state */
        unsigned int width, height;
        int bufsize = 0;
+       int result_alloc_size = 0;
 
        /* the jpeg line buffer */
        guchar **line[3];
@@ -323,14 +323,16 @@ int  camsrcjpegencsub_encode ( jpegenc_parameter *enc_param )
 
        _jpegenc_libjpegsw_info ("Set quality");
 
-       enc_param->result_data = malloc(MAX_ENCODED_RESULT_SIZE);
+       result_alloc_size = MAX_ENCODED_RESULT_SIZE(width, height);
+       enc_param->result_data = malloc(result_alloc_size);
        jdest.next_output_byte = enc_param->result_data;
-       jdest.free_in_buffer = MAX_ENCODED_RESULT_SIZE;
+       jdest.free_in_buffer = result_alloc_size;
 
        _jpegenc_libjpegsw_info ("compress start(%p, %d, %p, %d)", src_data, src_len, jdest.next_output_byte, jdest.free_in_buffer);
        jpeg_start_compress (&cinfo, TRUE);
 
-       _jpegenc_libjpegsw_info ("got buffer of %lu bytes", src_len);
+       _jpegenc_libjpegsw_info ("got src buffer of %lu bytes", src_len);
+       _jpegenc_libjpegsw_info ("allocated result buffer size %d bytes", result_alloc_size);
 
        switch (src_fmt) {
                case COLOR_FORMAT_I420:
@@ -385,9 +387,9 @@ int  camsrcjpegencsub_encode ( jpegenc_parameter *enc_param )
                break;
        }
 
-       _jpegenc_libjpegsw_info ("compressing DONE");
+       _jpegenc_libjpegsw_info("compressing DONE");
 
-       enc_param->result_len = JPEGENC_ROUND_UP_4 (MAX_ENCODED_RESULT_SIZE - jdest.free_in_buffer);
+       enc_param->result_len = JPEGENC_ROUND_UP_4(result_alloc_size - jdest.free_in_buffer);
        
        jpeg_finish_compress (&cinfo);
        jpeg_destroy_compress(&cinfo);