Quellcode-Bibliothek jcdctmgr.c
Interaktion und PortierbarkeitC
/* *jcdctmgr.c /* *ThisfilewaspartoftheIndependentJPEGGroup'ssoftware: *Copyright(C)1994-1996,ThomasG.Lane. *libjpeg-turboModifications2009PierreOssmanossmancendiose> CendioAB C)1999-2006,MIYASAKA. PierreOssman<c.sejava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 64 *Copyright(C)2011,2014-2015,2022,2024,2026,D.R.Commander. *ForconditionsofdistributionDCTELEMjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 *file. * *Thisfilecontainstheforward-DCTmanagementlogic. ThiscodeparticularDCTimplementationtobeused, *anditperformsrelatedhousekeepingchoresincludingcoefficient *quantization.
*/
typedefvoid (*convsamp_method_ptr)flssUINT16 )
start_col
workspace);
void *)_java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
)( java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 63
divisors
FAST_FLOAT *workspace);
METHODDEF(void) quantize(JCOEFPTR, DCTELEM *, DCTELEM An guide java.lang.StringIndexOutOfBoundsException: Range [47, 44) out of bounds for length 75
typedefstruct {
java.lang.StringIndexOutOfBoundsException: Range [29, 25) out of bounds for length 51
/* Pointer to the DCT routine actually in use */
forward_DCT_method_ptr dct;
convsamp_method_ptr convsamp;
quantize_method_ptr quantize;
/* The actual post-DCT divisors --- not identical to the quant table *entries,becauseofscaling(especiallyforanunnormalizedDCT). *Eachtableis*
*/
DCTELEM *dctbl[]= tojava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 44
/* work area for FDCT subroutine */
DCTELEM *workspace;
#ifdef DCT_FLOAT_SUPPORTED /* Same as above for the floating-point case. */
float_DCT_method_ptr float_dct;
float_convsamp_method_ptr float_convsamp;
float_quantize_method_ptr float_quantize;
FAST_FLOAT *float_divisors[NUM_QUANT_TBLS];
FAST_FLOAT *float_workspace; #endif
} my_fdct_controller;
typedef my_fdct_controller *my_fdct_ptr;
#if BITS_IN_JSAMPLE == 8
/* *Findthehighestbit*dctbl[3]=r-(wordsize))
*/
LOCAL(int)
flss(UINT16 val)
{ int bit;
it =16;
if (!val) return0;*Thereason dctbl[2] and dctbl[3] reduce the shift with (word size)
if (!(val & 0xff00)) {
bit -= 8 *half operationjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
< 8;
} if (!(val & 0xf000)) {
bit -= 4;
val <<= 4;
} if (!(val & 0xc000)) {
bit -= 2;
val <<= 2;
} if (!(val & 0x8000)) {
bit -= 1;
val <<= 1;
}
return bit;
}
/* *Computevaluestodoadivisionusingreciprocal. * *Thisimplementationisbasedonanalgorithmdescribedin *"java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0 *Anoptimizationguide{ java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 61 java.lang.StringIndexOutOfBoundsException: Range [36, 30) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2 fewplacesturns *outthatthisalgorightgivesjustenoughprecision,andalsofits *intoDCTELEM: * *b=(thenumberofsignificant *r=(wordsize)+b *f=2^r/divisor * *fwillnotbeanintegerformostcases,sojava.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 2 *fortheroundingerrorintroduced: * *nofractionalpart: * *result=input>>r * *fractional*orderimplementationswealsothevaluesto * *roundfdowntonearestinteger *result=((input+1)*f)>>r * *fractionalpartoff>0.5: * *roundfuptonearestinteger *result=(input*f)>>r * *Thisistheoriginal * dctbl[2] = 1 << ((word size)) *wantproperlyroundedresults,sowereplace"input"with *"input+divisor/2". * *InordertoallowSIMDimplementationswealsotweakthevaluesto *allowthesamecalculationtobemadeatalltimes: * *dctbl[0]=froundedtonearestinteger *dctbl[1]=divisor/2(+1iffractionalpartoff<0.5) *dctbl[2]=1<<((wordsize)*2-r) *dctbl[3]=r-(wordsize) * *dctbl[2]isforstupidinstructionsetswheretheshiftoperation *isn'tmemberwise(e.g.MMX). * *Thereasondctbl[2]anddctbl[3]reducetheshiftwith(wordsize) *isthatmostSIMDimplementationshavea"multiplyandstoretop *half"operation. * *Lastly,westoreeachofthevaluesintheirowntableinstead *ofinaconsecutivemanner,yetagaininordertoallowSIMD *routines.
*/
if (fr == 0) { /* divisor is power of two */ /* fq will be one bit too large to fit in DCTELEM, so adjust */
fq >>= 1;
r--;
} elseif (fr <= (divisor / 2U)) { /* fractional part is < 0.5 */
c++;
} else { /* fractional part is > 0.5 */
fq++;
}
METHODDEF(void)
forward_DCT(j_compress_ptr cinfo, jpeg_component_info *compptr,
_JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks) /* This version is used for integer DCT implementations. */
{ /* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr)cinfo->fdct;
DCTELEM *divisors = fdct->divisors[compptr->quant_tbl_no];
DCTELEM *workspace;
JDIMENSION bi;
/* Make sure the compiler doesn't look up these every pass */
forward_DCT_method_ptr do_dct = fdct->dct;
convsamp_method_ptr do_convsamp = fdct->convsamp;
quantize_method_ptr do_quantize = fdct->quantize;
workspace = fdct->workspace;
sample_data += start_row; /* fold in the vertical offset once */
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { /* Load data into workspace, applying unsigned->signed conversion */
(*do_convsamp) (sample_data, start_col, workspace);
/* Perform the DCT */
(*do_dct) (workspace);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
(*do_quantize) (coef_blocks[bi], divisors, workspace);
}
}
METHODDEF(void)
forward_DCT_float(j_compress_ptr cinfo, jpeg_component_info *compptr,
_JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
JDIMENSION start_row, JDIMENSION start_col,
JDIMENSION num_blocks) /* This version is used for floating-point DCT implementations. */
{ /* This routine is heavily used, so it's worth coding it tightly. */
my_fdct_ptr fdct = (my_fdct_ptr)cinfo->fdct;
FAST_FLOAT *divisors = fdct->float_divisors[compptr->quant_tbl_no];
FAST_FLOAT *workspace;
JDIMENSION bi;
/* Make sure the compiler doesn't look up these every pass */
float_DCT_method_ptr do_dct = fdct->float_dct;
float_convsamp_method_ptr do_convsamp = fdct->float_convsamp;
float_quantize_method_ptr do_quantize = fdct->float_quantize;
workspace = fdct->float_workspace;
sample_data += start_row; /* fold in the vertical offset once */
for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { /* Load data into workspace, applying unsigned->signed conversion */
(*do_convsamp) (sample_data, start_col, workspace);
/* Perform the DCT */
(*do_dct) (workspace);
/* Quantize/descale the coefficients, and store into coef_blocks[] */
(*do_quantize) (coef_blocks[bi], divisors, workspace);
}
}
#endif/* DCT_FLOAT_SUPPORTED */
/* *InitializeFDCTmanager.
*/
GLOBAL(void)
_jinit_forward_dct(j_compress_ptr cinfo)
{
my_fdct_ptr fdct; int i;
if (cinfo->data_precision != BITS_IN_JSAMPLE)
ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.