11958N/A--- ./src/ptlib/common/jidctflt.cxx.org 2007-11-19 11:39:14.333297000 +0800
11958N/A+++ ./src/ptlib/common/jidctflt.cxx 2007-11-19 12:48:36.796794000 +0800
11958N/A@@ -73,6 +73,12 @@
11958N/A
11958N/A #include <stdint.h>
11958N/A #include "tinyjpeg-internal.h"
11958N/A+#ifdef SOLARIS
11958N/A+#include "ptbuildopts.h"
11958N/A+#endif
11958N/A+#ifdef P_MEDIALIB
11958N/A+#include <mlib.h>
11958N/A+#endif
11958N/A
11958N/A #define FAST_FLOAT float
11958N/A #define DCTSIZE 8
11958N/A@@ -122,6 +128,7 @@
11958N/A void
11958N/A tinyjpeg_idct_float (struct component *compptr, uint8_t *output_buf, int stride)
11958N/A {
11958N/A+#ifndef P_MEDIALIB
11958N/A FAST_FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
11958N/A FAST_FLOAT tmp10, tmp11, tmp12, tmp13;
11958N/A FAST_FLOAT z5, z10, z11, z12, z13;
11958N/A@@ -282,5 +289,8 @@
11958N/A wsptr += DCTSIZE; /* advance pointer to next row */
11958N/A outptr += stride;
11958N/A }
11958N/A+#else
11958N/A+ mlib_VideoIDCT8x8_U8_S16_NA(output_buf, compptr->DCT, stride);
11958N/A+#endif
11958N/A }
11958N/A
11958N/A--- ./src/ptlib/common/tinyjpeg.cxx.org 2007-11-19 11:39:14.335828000 +0800
11958N/A+++ ./src/ptlib/common/tinyjpeg.cxx 2007-11-19 12:25:44.006754000 +0800
11958N/A@@ -403,7 +403,15 @@
11958N/A }
11958N/A
11958N/A for (j = 0; j < 64; j++)
11958N/A+#ifndef P_MEDIALIB
11958N/A c->DCT[j] = DCT[zigzag[j]];
11958N/A+#else
11958N/A+ {
11958N/A+ c->DCT[j] = DCT[zigzag[j]] * c->Q_table[j];
11958N/A+ if (j == 0)
11958N/A+ c->DCT[j] += 1024;
11958N/A+ }
11958N/A+#endif
11958N/A }
11958N/A
11958N/A /*
11958N/A@@ -1559,7 +1567,11 @@
11958N/A *
11958N/A ******************************************************************************/
11958N/A
11958N/A+#ifndef P_MEDIALIB
11958N/A static void build_quantization_table(float *qtable, const unsigned char *ref_table)
11958N/A+#else
11958N/A+static void build_quantization_table(uint16_t *qtable, const unsigned char *ref_table)
11958N/A+#endif
11958N/A {
11958N/A /* Taken from libjpeg. Copyright Independent JPEG Group's LLM idct.
11958N/A * For float AA&N IDCT method, divisors are equal to quantization
11958N/A@@ -1579,7 +1591,11 @@
11958N/A
11958N/A for (i=0; i<8; i++) {
11958N/A for (j=0; j<8; j++) {
11958N/A+#ifndef P_MEDIALIB
11958N/A *qtable++ = ref_table[*zz++] * aanscalefactor[i] * aanscalefactor[j];
11958N/A+#else
11958N/A+ *qtable++ = ref_table[*zz++];
11958N/A+#endif
11958N/A }
11958N/A }
11958N/A
11958N/A@@ -1588,7 +1604,11 @@
11958N/A static int parse_DQT(struct jdec_private *priv, const unsigned char *stream)
11958N/A {
11958N/A int qi;
11958N/A+#ifndef P_MEDIALIB
11958N/A float *table;
11958N/A+#else
11958N/A+ uint16_t *table;
11958N/A+#endif
11958N/A const unsigned char *dqt_block_end;
11958N/A
11958N/A trace("> DQT marker\n");
11958N/A--- ./src/ptlib/common/tinyjpeg-internal.h.org 2007-11-19 11:39:14.337567000 +0800
11958N/A+++ ./src/ptlib/common/tinyjpeg-internal.h 2007-11-19 12:47:57.414364000 +0800
11958N/A@@ -36,6 +36,9 @@
11958N/A #define __TINYJPEG_INTERNAL_H_
11958N/A
11958N/A #include <setjmp.h>
11958N/A+#ifdef SOLARIS
11958N/A+#include <ptbuildopts.h>
11958N/A+#endif
11958N/A
11958N/A #define SANITY_CHECK 1
11958N/A
11958N/A@@ -67,7 +70,11 @@
11958N/A {
11958N/A unsigned int Hfactor;
11958N/A unsigned int Vfactor;
11958N/A+#ifndef P_MEDIALIB
11958N/A float *Q_table; /* Pointer to the quantisation table to use */
11958N/A+#else
11958N/A+ uint16_t *Q_table; /* Pointer to the quantisation table to use */
11958N/A+#endif
11958N/A struct huffman_table *AC_table;
11958N/A struct huffman_table *DC_table;
11958N/A short int previous_DC; /* Previous DC coefficient */
11958N/A@@ -96,7 +103,11 @@
11958N/A unsigned int reservoir, nbits_in_reservoir;
11958N/A
11958N/A struct component component_infos[COMPONENTS];
11958N/A+#ifndef P_MEDIALIB
11958N/A float Q_tables[COMPONENTS][64]; /* quantization tables */
11958N/A+#else
11958N/A+ uint16_t Q_tables[COMPONENTS][64]; /* quantization tables */
11958N/A+#endif
11958N/A struct huffman_table HTDC[HUFFMAN_TABLES]; /* DC huffman tables */
11958N/A struct huffman_table HTAC[HUFFMAN_TABLES]; /* AC huffman tables */
11958N/A int default_huffman_table_initialized;