summaryrefslogtreecommitdiffstats
path: root/core/jni/android
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2010-03-10 17:08:58 +0800
committerChia-chi Yeh <chiachi@android.com>2010-03-10 17:08:58 +0800
commitaa86859b1035f865147b4f76ad2a9eed7ee098a5 (patch)
treedf308eb549f002b43e8c28535d93548621fd598b /core/jni/android
parentfe62d04c30e7b3abe408b56c7744c7f547c57640 (diff)
downloadframeworks_base-aa86859b1035f865147b4f76ad2a9eed7ee098a5.zip
frameworks_base-aa86859b1035f865147b4f76ad2a9eed7ee098a5.tar.gz
frameworks_base-aa86859b1035f865147b4f76ad2a9eed7ee098a5.tar.bz2
YuvImage: jpeg_set_quality() should be called after jpeg_set_defaults().
Change-Id: I6579ad9241dd5ee6aabf54e1a1128d17b4f6b3e6
Diffstat (limited to 'core/jni/android')
-rw-r--r--core/jni/android/graphics/YuvToJpegEncoder.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/core/jni/android/graphics/YuvToJpegEncoder.cpp b/core/jni/android/graphics/YuvToJpegEncoder.cpp
index 819cce8..0a0c5b3 100644
--- a/core/jni/android/graphics/YuvToJpegEncoder.cpp
+++ b/core/jni/android/graphics/YuvToJpegEncoder.cpp
@@ -49,19 +49,16 @@ bool YuvToJpegEncoder::encode(SkWStream* stream, void* inYuv, int width,
void YuvToJpegEncoder::setJpegCompressStruct(jpeg_compress_struct* cinfo,
int width, int height, int quality) {
- jpeg_set_quality(cinfo, quality, TRUE);
-
cinfo->image_width = width;
cinfo->image_height = height;
-
cinfo->input_components = 3;
cinfo->in_color_space = JCS_YCbCr;
jpeg_set_defaults(cinfo);
+
+ jpeg_set_quality(cinfo, quality, TRUE);
jpeg_set_colorspace(cinfo, JCS_YCbCr);
cinfo->raw_data_in = TRUE;
-
cinfo->dct_method = JDCT_IFAST;
-
configSamplingFactors(cinfo);
}