+++ /dev/null
-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
+++ /dev/null
-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)
-
+++ /dev/null
-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.
-
+++ /dev/null
-usr/bin
-usr/sbin
+++ /dev/null
-@PREFIX@/include/*
+++ /dev/null
-@PREFIX@/lib/*.so*
+++ /dev/null
-#!/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
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
#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 */
/* video state */
unsigned int width, height;
int bufsize = 0;
+ int result_alloc_size = 0;
/* the jpeg line buffer */
guchar **line[3];
_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:
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);