comparison jfdctint.c @ 1064:b32afefe7d33 libavcodec

* UINTX -> uintx_t INTX -> intx_t
author kabi
date Tue, 11 Feb 2003 16:35:48 +0000
parents de12d5b9c9ad
children 1e39f273ecd6
comparison
equal deleted inserted replaced
1063:fdeac9642346 1064:b32afefe7d33
76 * 76 *
77 * The outputs of the first pass are scaled up by PASS1_BITS bits so that 77 * The outputs of the first pass are scaled up by PASS1_BITS bits so that
78 * they are represented to better-than-integral precision. These outputs 78 * they are represented to better-than-integral precision. These outputs
79 * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word 79 * require BITS_IN_JSAMPLE + PASS1_BITS + 3 bits; this fits in a 16-bit word
80 * with the recommended scaling. (For 12-bit sample data, the intermediate 80 * with the recommended scaling. (For 12-bit sample data, the intermediate
81 * array is INT32 anyway.) 81 * array is int32_t anyway.)
82 * 82 *
83 * To avoid overflow of the 32-bit intermediate results in pass 2, we must 83 * To avoid overflow of the 32-bit intermediate results in pass 2, we must
84 * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis 84 * have BITS_IN_JSAMPLE + CONST_BITS + PASS1_BITS <= 26. Error analysis
85 * shows that the values given below are the most effective. 85 * shows that the values given below are the most effective.
86 */ 86 */
99 * If you change CONST_BITS you may want to add appropriate values. 99 * If you change CONST_BITS you may want to add appropriate values.
100 * (With a reasonable C compiler, you can just rely on the FIX() macro...) 100 * (With a reasonable C compiler, you can just rely on the FIX() macro...)
101 */ 101 */
102 102
103 #if CONST_BITS == 13 103 #if CONST_BITS == 13
104 #define FIX_0_298631336 ((INT32) 2446) /* FIX(0.298631336) */ 104 #define FIX_0_298631336 ((int32_t) 2446) /* FIX(0.298631336) */
105 #define FIX_0_390180644 ((INT32) 3196) /* FIX(0.390180644) */ 105 #define FIX_0_390180644 ((int32_t) 3196) /* FIX(0.390180644) */
106 #define FIX_0_541196100 ((INT32) 4433) /* FIX(0.541196100) */ 106 #define FIX_0_541196100 ((int32_t) 4433) /* FIX(0.541196100) */
107 #define FIX_0_765366865 ((INT32) 6270) /* FIX(0.765366865) */ 107 #define FIX_0_765366865 ((int32_t) 6270) /* FIX(0.765366865) */
108 #define FIX_0_899976223 ((INT32) 7373) /* FIX(0.899976223) */ 108 #define FIX_0_899976223 ((int32_t) 7373) /* FIX(0.899976223) */
109 #define FIX_1_175875602 ((INT32) 9633) /* FIX(1.175875602) */ 109 #define FIX_1_175875602 ((int32_t) 9633) /* FIX(1.175875602) */
110 #define FIX_1_501321110 ((INT32) 12299) /* FIX(1.501321110) */ 110 #define FIX_1_501321110 ((int32_t) 12299) /* FIX(1.501321110) */
111 #define FIX_1_847759065 ((INT32) 15137) /* FIX(1.847759065) */ 111 #define FIX_1_847759065 ((int32_t) 15137) /* FIX(1.847759065) */
112 #define FIX_1_961570560 ((INT32) 16069) /* FIX(1.961570560) */ 112 #define FIX_1_961570560 ((int32_t) 16069) /* FIX(1.961570560) */
113 #define FIX_2_053119869 ((INT32) 16819) /* FIX(2.053119869) */ 113 #define FIX_2_053119869 ((int32_t) 16819) /* FIX(2.053119869) */
114 #define FIX_2_562915447 ((INT32) 20995) /* FIX(2.562915447) */ 114 #define FIX_2_562915447 ((int32_t) 20995) /* FIX(2.562915447) */
115 #define FIX_3_072711026 ((INT32) 25172) /* FIX(3.072711026) */ 115 #define FIX_3_072711026 ((int32_t) 25172) /* FIX(3.072711026) */
116 #else 116 #else
117 #define FIX_0_298631336 FIX(0.298631336) 117 #define FIX_0_298631336 FIX(0.298631336)
118 #define FIX_0_390180644 FIX(0.390180644) 118 #define FIX_0_390180644 FIX(0.390180644)
119 #define FIX_0_541196100 FIX(0.541196100) 119 #define FIX_0_541196100 FIX(0.541196100)
120 #define FIX_0_765366865 FIX(0.765366865) 120 #define FIX_0_765366865 FIX(0.765366865)
127 #define FIX_2_562915447 FIX(2.562915447) 127 #define FIX_2_562915447 FIX(2.562915447)
128 #define FIX_3_072711026 FIX(3.072711026) 128 #define FIX_3_072711026 FIX(3.072711026)
129 #endif 129 #endif
130 130
131 131
132 /* Multiply an INT32 variable by an INT32 constant to yield an INT32 result. 132 /* Multiply an int32_t variable by an int32_t constant to yield an int32_t result.
133 * For 8-bit samples with the recommended scaling, all the variable 133 * For 8-bit samples with the recommended scaling, all the variable
134 * and constant values involved are no more than 16 bits wide, so a 134 * and constant values involved are no more than 16 bits wide, so a
135 * 16x16->32 bit multiply can be used instead of a full 32x32 multiply. 135 * 16x16->32 bit multiply can be used instead of a full 32x32 multiply.
136 * For 12-bit samples, a full 32-bit multiplication will be needed. 136 * For 12-bit samples, a full 32-bit multiplication will be needed.
137 */ 137 */
148 */ 148 */
149 149
150 GLOBAL(void) 150 GLOBAL(void)
151 ff_jpeg_fdct_islow (DCTELEM * data) 151 ff_jpeg_fdct_islow (DCTELEM * data)
152 { 152 {
153 INT32 tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; 153 int32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
154 INT32 tmp10, tmp11, tmp12, tmp13; 154 int32_t tmp10, tmp11, tmp12, tmp13;
155 INT32 z1, z2, z3, z4, z5; 155 int32_t z1, z2, z3, z4, z5;
156 DCTELEM *dataptr; 156 DCTELEM *dataptr;
157 int ctr; 157 int ctr;
158 SHIFT_TEMPS 158 SHIFT_TEMPS
159 159
160 /* Pass 1: process rows. */ 160 /* Pass 1: process rows. */