summaryrefslogtreecommitdiff
path: root/jdsample.c
diff options
context:
space:
mode:
authorAaron Gable <agable@chromium.org>2015-08-03 09:34:32 -0700
committerAaron Gable <agable@chromium.org>2015-08-03 09:34:32 -0700
commitc9c8755c326b42c8d0dc938ec3f0d1d648bd361a (patch)
tree7ebff33dec9b7cc37d65746e0d89f32cb74d141e /jdsample.c
parent7a6ab4e9ce76b07ac406a20700eb97b7dd6d05f5 (diff)
Add jpeg_skip_scanlines() API to libjpeg-turbo
jpeg_skip_scanlines() API, a subset decoding optimization aimed at Android, was submitted upstream r1582. Pull that change, and sundry fixes, into the Chromium repo. This new API is targetted at Android devices, not Chrome, and should have no affect on JPEG decode behavior or perf of Chrome. Chrome uses suspending data source JPEG decoding, and the new API does not support such sources. Adding support for suspending data sources is a future TODO, should the need arise (refer to skbug.com/4036). BUG=515694 BUG=468914 patch from issue 256280043 at patchset 50001 (http://crrev.com/256280043#ps50001) R=agable@chromium.org Review URL: https://codereview.chromium.org/1271803002 .
Diffstat (limited to 'jdsample.c')
-rw-r--r--jdsample.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/jdsample.c b/jdsample.c
index 361b589..92d6b8a 100644
--- a/jdsample.c
+++ b/jdsample.c
@@ -21,50 +21,11 @@
* Pub. by IEEE Computer Society Press, Los Alamitos, CA. ISBN 0-8186-8944-7.
*/
-#define JPEG_INTERNALS
-#include "jinclude.h"
-#include "jpeglib.h"
+#include "jdsample.h"
#include "jsimd.h"
#include "jpegcomp.h"
-/* Pointer to routine to upsample a single component */
-typedef JMETHOD(void, upsample1_ptr,
- (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
-
-/* Private subobject */
-
-typedef struct {
- struct jpeg_upsampler pub; /* public fields */
-
- /* Color conversion buffer. When using separate upsampling and color
- * conversion steps, this buffer holds one upsampled row group until it
- * has been color converted and output.
- * Note: we do not allocate any storage for component(s) which are full-size,
- * ie do not need rescaling. The corresponding entry of color_buf[] is
- * simply set to point to the input data array, thereby avoiding copying.
- */
- JSAMPARRAY color_buf[MAX_COMPONENTS];
-
- /* Per-component upsampling method pointers */
- upsample1_ptr methods[MAX_COMPONENTS];
-
- int next_row_out; /* counts rows emitted from color_buf */
- JDIMENSION rows_to_go; /* counts rows remaining in image */
-
- /* Height of an input row group for each component. */
- int rowgroup_height[MAX_COMPONENTS];
-
- /* These arrays save pixel expansion factors so that int_expand need not
- * recompute them each time. They are unused for other upsampling methods.
- */
- UINT8 h_expand[MAX_COMPONENTS];
- UINT8 v_expand[MAX_COMPONENTS];
-} my_upsampler;
-
-typedef my_upsampler * my_upsample_ptr;
-
/*
* Initialize for an upsampling pass.