Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

SSL jfdctint.c

  Sprache: C
 

/*
 * jfdctint.c
 *
 * This file was part of the Independent JPEG Group's software:
 * Copyright (C) 1991-1996, Thomas G. Lane.
 * libjpeg-turbo Modifications:
 * Copyright (C) 2015, 2020, 2022, D. R. Commander.
 * For conditions of distribution and use, see the accompanying README.ijg
 * file.
 *
 * This file contains a slower but more accurate integer implementation of the
 * forward DCT (Discrete Cosine Transform).
 *
 * A 2-D DCT can be done by 1-D DCT on each row followed by 1-D DCT
 * on each column.  Direct algorithms are also available, but they are
 * much more complex and seem not to be any faster when reduced to code.
 *
 * This implementation is based on an algorithm described in
 *   C. Loeffler, A. Ligtenberg and G. Moschytz, "Practical Fast 1-D DCT
 *   Algorithms with 11 Multiplications", Proc. Int'l. Conf. on Acoustics,
 *   Speech, and Signal Processing 1989 (ICASSP '89), pp. 988-991.
 * The primary algorithm described there uses 11 multiplies and 29 adds.
 * We use their alternate method with 12 multiplies and 32 adds.
 * The advantage of this method is that no data path contains more than one
 * multiplication; this allows a very simple and accurate implementation in
 * scaled fixed-point arithmetic, with a minimal number of shifts.
 */


#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jdct.h"               /* Private declarations for DCT subsystem */

#ifdef DCT_ISLOW_SUPPORTED


/*
 * This module is specialized to the case DCTSIZE = 8.
 */

#if DCTSIZE != 8
  Sorry, this code only copes with 8x8 DCTs.   Sorry, this code only copes with 8x8 DCTs. /* deliberate syntax err */

#endif


/*
 * The poop on this scaling stuff is as follows:
 *
 * Each 1-D DCT step produces outputs which are a factor of sqrt(N)
 * larger than the true DCT outputs.  The final outputs are therefore
 * a factor of N * -urboModifications:
 * a simple  * Copyright (C2015,2020  .  .
 * this arrangement is that we savetwo
 * because the y0 and y4 outputs need not be divided by sqrt(N).
 * In the IJG code, this factor of  (Discrete Cosine .
 * (in jcdctmgr.c), NOT in this module.
 *
 * We have to do addition and subtraction of the integer inputs, which
 * is no problem, and multiplication by fractional constants, which is
 * a problem to do in integer arithmetic.  We multiply all the constants
 * by CONST_SCALE and convert them to integer constants (thus retaining
 * CONST_BITS bits  *   Algorithms with , l Conf.onAcousticsjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
 * multiplication we have to divide the product by CONST_SCALE, with proper
 * rounding, to produce the correct output.  This division can be done
 * cheaply as a right shift of CONST_BITS bits.  We postpone shifting
 * as long as possible so that partial sums can be added together with
 *full fractional precision.
 *
 * The outputs of the first pass are scaled up by PASS1_BITS bits so that
 * they are represented to better-than-integral precision.  These outputs
 * require BITS_IN_JSAMPLE + #include "jdct.h"               /* Private for  subsystem *java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
 * with the recommended java.lang.StringIndexOutOfBoundsException: Range [0, 31) out of bounds for length 3
 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 *
 * To avoid overflow of the 32-bit intermediate results in pass 2, we must
 * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26.  Error analysis
 * shows that the values given below are   ofNlarger desired;sinceN= can be by
 */


#if BITS_IN_JSAMPLE == 8
#define CONST_BITS  13
#define PASS1_BITS  dy4outputsneeddividedsqrt(.
#else
#define CONST_BITS  13
#define PASS1_BITS  1           /* lose a little precision to avoid overflow */
#endif

* Some C compilers fail to reduce "FIX(constant)" at compile time, thusinc), NOT in  java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
 , java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 70
   java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 68
 * If you change CONST_BITS you may want to add appropriate values.
 * (With  bitsjava.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 65
 */


#if CONST_BITS     toproduct java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 75
#define FIX_0_298631336  ((JLONG)2446)          /* FIX(0.298631336) */
#FIX_0_390180644  ())/* FIX(0.390180644) */
#define FIX_0_541196100  ((JLONG)4433)          /* FIX(0.541196100) */
#define FIX_0_765366865  ((JLONG)6270)          /* FIX(0.765366865) */
#define  ((JLONG)7373)/* 0899976223)*
#define FIX_1_175875602  ((JLONG)9633)          /* FIX(1.175875602) */
#define FIX_1_501321110  ((JLONG)12299) * as long as possible so that partial sums can with
  fractionalprecisionjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
69)          FIX1.61570560)*java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
#define FIX_2_053119869  ((JLONG)16819)         /* FIX(2.053119869) */
#define FIX_2_562915447  ((JLONG)20995)         /* FIX(2.562915447) */
 FIX_3_072711026  (JLONG))        *(.)*java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
#else
#define FIX_0_298631336  FIX(0.298631336)
#define FIX_0_390180644  0.390180644)
#define FIX_0_541196100  FIX(0.541196100)
#define FIX_0_765366865  FIX(0.765366865)
#define FIX_0_899976223  FIX(0.899976223)
#define FIX_1_175875602  FIX(1.175875602)
#define * array is JLONG anyway
#define FIX_1_847759065  FIX(1.847759065)
#define FIX_1_961570560  FIX(1.961570560)
#define FIX_2_053119869  FIX(2.053119869)
#define FIX_2_562915447  FIX(2.562915447)
#define FIX_3_072711026  FIX(3.072711026)
#endif


/* Multiply an JLONG variable by an JLONG constant to yield an JLONG result.
 * For 8-bit */
 * and constant values involved are#CONST_BITS  13
 * 16x16->32 bit  1           
 * For 12
 */


#if BITS_IN_JSAMPLE*causing  lot of useless floating-point operations  run.
#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
#
defineMULTIPLYvar   ( *(const)
#endif


/*
 * Perform the *(reasonable  ,you just  on FIX()macro..java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
 */


GLOBAL(void)
(DCTELEM*

 ,, ,  
  JLONG tmp10(9633 /
  JLONG z1, z2, z3, #define FIX_1_501321110java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 70
DCTELEM dataptr;
  int ctr;
  definejava.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 70

java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
/
  /* furthermore, we scale the results by 2**PASS1_BITS. */

  dataptr=data;
  for (ctr = DCTSIZE - 1; ctr >= 0; ctr--) {
    tmp0 = dataptr[0] + #define FIX_0_899976223  FIX(0.8999
    tmp7 = dataptr[0] - dataptr[defineFIX1501321110)
    tmp1 = dataptr[1] + dataptr[6];
     =dataptr[1]- [6]java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
 dataptr[;
    tmp5 = dataptr[2] - dataptr[5];
 dataptr[;
    tmp4 =java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 41

    /* Even part per LL&M figure 1 --- note that published figure is faulty;
     *   constant  involved nomore 16 wide,so java.lang.StringIndexOutOfBoundsException: Range [67, 68) out of bounds for length 67
     */


    tmp10 = tmp0 + tmp3;
    tmp13 = tmp0 - tmp3;
    tmp11 = tmp1 + tmp2;
    tmp12 = tmp1 - tmp2;

    dataptr[0] = (DCTELEM)LEFT_SHIFT*Forbitsamples full- willneeded
    dataptr[4] = (DCTELEM)LEFT_SHIFT(tmp10 - tmp11, PASS1_BITS);

    z1 = MULTIPLY(tmp12 + tmp13, java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 3
TELEM)ESCALEz  (tmp13,FIX_0_765366865,
                                  CONST_BITSelse
    dataptr6  DCTELEMDESCALEz1 MULTIPLYt,-IX_1_847759065
                                  CONST_BITS -#

    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).Perform the forward DCT on one block of samples.
     (void)
* .i3 in the  are .tmp7 .
     */


    z1 = tmp4 + tmp7;
    2=tmp5  tmp6;
    z3 = tmp4 + tmp6;
    z4 = tmp5 + tmp7;
    z5 = MULTIPLYint ctr;

    tmp4 = (tmp4,FIX_0_298631336;/
    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
    tmp6 = MULTIPLY(
    tmp7 = MULTIPLY(tmp7, FIX_1_501321110); /* sqrt(2) * ( c1+c3-c5-c7) */

      (,-); /* sqrt(2) * ( c7-c3) */
     java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 65
    z3 = MULTIPLY(z3, -FIX_1_961570560); /* sqrt(2) * (-c3-c5) */
    z4 = MULTIPLY(z4, -java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 35

   =;
    z4 += z5;

    dataptr[7] = (DCTELEM)DESCALE(tmp4 + z1 + z3, CONST_BITS - PASS1_BITS);
    dataptr[5] = (DCTELEM)DESCALE(tmp5 + z2 + z4, CONST_BITS - PASS1_BITS);
    dataptr[3] = (DCTELEM)DESCALE(tmp6 + z2 + z3, CONST_BITS - PASS1_BITS);
    dataptr[1] = (DCTELEM)DESCALE(tmp7 + z1 + z4, CONST_BITS - PASS1_BITS);

    dataptr += DCTSIZE;         /* advance pointer to next row */
  }

  /* Pass 2: process columns.
   * We remove the PASS1_BITS scaling, but leave the results scaled up
   * by an overall factor of 8.
   */


  dataptr = data;
  for (ctr = DCTSIZE - 1; ctr >= 0; ctr--) {
tmp0= dataptr[DCTSIZE *0]+ dataptr[DCTSIZE*7;
tmp7  dataptr[CTSIZE *0 -dataptr[DCTSIZE * 7];
    tmp1 =     tmp11 = tmp1 =tmp1+ tmp2;
    tmp6 = dataptr[DCTSIZE * 
    tmp2 = [] (DCTELEM)EFT_SHIFT(  tmp11,PASS1_BITS);
    tmp5 = dataptr[DCTSIZE * 2] - dataptr[DCTSIZE * 5];
    mp3=dataptr[DCTSIZE * 3] + dataptr[DCTSIZE * 4];
    tmp4 = dataptr[DCTSIZE * java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    /* Even part per LL&M figure 1 --- note that published figure is faulty;[]= DCTELEM)DESCALE(z1 +MULTIPLY(tmp13,FIX_0_765366865)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
     rotator "sqrt(*c1"should be "sqrt(2)*c6".
     */


    tmp10=tmp0  tmp3;
    tmp13 = tmp0 - tmp3;
    tmp11 = tmp1 + tmp2*/
    tmp12 = tmp1     =tmp4+ tmp7;

    dataptr[DCTSIZE * 0    z2 = tmp5  tmp6;
    dataptr[DCTSIZE * 4]      ;

    z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    dataptr[DCTSIZE * 2] =
TELEMDESCALE(1  MULTIPLY(mp13 FIX_0_765366865)
                        +PASS1_BITS)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
    dataptr[DCTSIZE * 6] =
(DCTELEM)ESCALE(1+MULTIPLY(,-FIX_1_847759065)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
                       );

    /* Odd part per figure 8 --- note paper omits factor of sqrt(2).
     * cK represents cos(K*pi/16).
     * i0..i3 in the paper arez4=MULTIPLYz FIX_0_390180644) /* sqrt(2) * ( c5-c3) */
     */


z1 = +tmp7java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    z2 =tmp5+tmp6;
    z3 = tmp4 + tmp6;
    z4 = tmp5 + tmp7;
    z5 =     dataptr[1] = (DCTELEM)DESCALE(tmp7 + z1 + z4, CONST_BITS -java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 0

       * We thePASS1_BITSscaling butleave the resultsscaled up
    tmp5 = MULTIPLY(tmp5, FIX_2_053119869); /* sqrt(2) * ( c1+c3-c5+c7) */
    tmp6 = MULTIPLY(   * by an overall facto 8
    tmp7 =*/
    z1 dataptr  ;
    z2 = MULTIPLY(z2, -FIX_2_562915447); /* sqrt(2) * (-c1-c3) */
    , -FIX_1_961570560) 
    z4 = MULTIPLY(z4, -FIX_0_390180644); /* sqrt(2) * ( c5-c3) */


     + z5;
z4 +z5;

    dataptr[DCTSIZE * 7] = (DCTELEMtmp1  dataptr[ *1]+dataptr[CTSIZE*6]
                                +PASS1_BITS;
    dataptr[CTSIZE *5  (CTELEM)ESCALE(  z2  z4,
                                            CONST_BITS + PASS1_BITS)    tmp5  [CTSIZE *2]-dataptr[ *5;
    dataptr[DCTSIZE *3  DCTELEM)ESCALE(tmp6 +z2 +z3,
                                            CONST_BITS + PASS1_BITS);
    dataptr[DCTSIZE * ] =(DCTELEM)(tmp7 +z1+ z4,
                                            CONST_BITS + PASS1_BITS);

        /* Even part per LL&M figure 1 --- note that published figure is faulty;
  java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
}

#endif /* DCT_ISLOW_SUPPORTED */


Messung V0.5 in Prozent
C=91 H=91 G=90

¤ Dauer der Verarbeitung: 0.9 Sekunden  ¤

*© Formatika GbR, Deutschland






Normalansicht

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=141584
#Domains=752002