Lines Matching +full:- +full:j
3 * Copyright (C) 2012-2014 Erik de Castro Lopo <erikd@mega-nerd.com>
11 * http://www.apache.org/licenses/LICENSE-2.0
27 Copyright: (c) 2004-2011 Apple, Inc.
34 // up to 24-bit "offset" macros for the individual bytes of a 20/24-bit word
46 There is no plain middle-side option ; instead there are various mixing
47 modes including middle-side, each lossless, as embodied in the mix ()
48 and unmix () functions. These functions exploit a generalized middle-side
51 u := [(rL + (m-r)R)/m] ;
52 v := L - R ;
56 L = u + v - [rV/m] ;
57 R = L - v ;
60 // 16-bit routines
65 int32_t j ; in unmix16() local
70 for (j = 0 ; j < numSamples ; j++) in unmix16()
74 l = u [j] + v [j] - ((mixres * v [j]) >> mixbits) ; in unmix16()
75 r = l - v [j] ; in unmix16()
85 for (j = 0 ; j < numSamples ; j++) in unmix16()
87 out [0] = u [j] << 16 ; in unmix16()
88 out [1] = v [j] << 16 ; in unmix16()
94 // 20-bit routines
95 // - the 20 bits of data are left-justified in 3 bytes of storage but right-aligned for input/outpu…
100 int32_t j ; in unmix20() local
105 for (j = 0 ; j < numSamples ; j++) in unmix20()
109 l = u [j] + v [j] - ((mixres * v [j]) >> mixbits) ; in unmix20()
110 r = l - v [j] ; in unmix20()
120 for (j = 0 ; j < numSamples ; j++) in unmix20()
122 out [0] = arith_shift_left (u [j], 12) ; in unmix20()
123 out [1] = arith_shift_left (v [j], 12) ; in unmix20()
129 // 24-bit routines
130 // - the 24 bits of data are right-justified in the input/output predictor buffers
138 int32_t j, k ; in unmix24() local
145 for (j = 0, k = 0 ; j < numSamples ; j++, k += 2) in unmix24()
147 l = u [j] + v [j] - ((mixres * v [j]) >> mixbits) ; in unmix24()
148 r = l - v [j] ; in unmix24()
160 for (j = 0 ; j < numSamples ; j++) in unmix24()
162 l = u [j] + v [j] - ((mixres * v [j]) >> mixbits) ; in unmix24()
163 r = l - v [j] ; in unmix24()
176 for (j = 0, k = 0 ; j < numSamples ; j++, k += 2) in unmix24()
178 l = u [j] ; in unmix24()
179 r = v [j] ; in unmix24()
191 for (j = 0 ; j < numSamples ; j++) in unmix24()
193 out [0] = u [j] << 8 ; in unmix24()
194 out [1] = v [j] << 8 ; in unmix24()
201 // 32-bit routines
202 // - note that these really expect the internal data width to be < 32 but the arrays are 32-bit
203 // - otherwise, the calculations might overflow into the 33rd bit and be lost
204 // - therefore, these routines deal with the specified "unused lower" bytes in the "shift" buffers
212 int32_t j, k ; in unmix32() local
219 for (j = 0, k = 0 ; j < numSamples ; j++, k += 2) in unmix32()
223 lt = u [j] ; in unmix32()
224 rt = v [j] ; in unmix32()
226 l = lt + rt - ((mixres * rt) >> mixbits) ; in unmix32()
227 r = l - rt ; in unmix32()
239 for (j = 0 ; j < numSamples ; j++) in unmix32()
241 out [0] = u [j] ; in unmix32()
242 out [1] = v [j] ; in unmix32()
249 for (j = 0, k = 0 ; j < numSamples ; j++, k += 2) in unmix32()
251 out [0] = (u [j] << shift) | (uint32_t) shiftUV [k + 0] ; in unmix32()
252 out [1] = (v [j] << shift) | (uint32_t) shiftUV [k + 1] ; in unmix32()
259 // 20/24-bit <-> 32-bit helper routines (not really matrixing but convenient to put here)
264 int32_t j ; in copyPredictorTo24() local
266 for (j = 0 ; j < numSamples ; j++) in copyPredictorTo24()
268 out [0] = in [j] << 8 ; in copyPredictorTo24()
277 int32_t j ; in copyPredictorTo24Shift() local
281 for (j = 0 ; j < numSamples ; j++) in copyPredictorTo24Shift()
283 int32_t val = in [j] ; in copyPredictorTo24Shift()
285 val = arith_shift_left (val, shiftVal) | (uint32_t) shift [j] ; in copyPredictorTo24Shift()
294 int32_t j ; in copyPredictorTo20() local
296 // 32-bit predictor values are right-aligned but 20-bit output values should be left-aligned in copyPredictorTo20()
297 // in the 24-bit output buffer in copyPredictorTo20()
298 for (j = 0 ; j < numSamples ; j++) in copyPredictorTo20()
300 out [0] = arith_shift_left (in [j], 12) ; in copyPredictorTo20()
308 int32_t i, j ; in copyPredictorTo32() local
310 // this is only a subroutine to abstract the "iPod can only output 16-bit data" problem in copyPredictorTo32()
311 for (i = 0, j = 0 ; i < numSamples ; i++, j += stride) in copyPredictorTo32()
312 out [j] = arith_shift_left (in [i], 8) ; in copyPredictorTo32()
320 int32_t j ; in copyPredictorTo32Shift() local
324 // this is only a subroutine to abstract the "iPod can only output 16-bit data" problem in copyPredictorTo32Shift()
325 for (j = 0 ; j < numSamples ; j++) in copyPredictorTo32Shift()
327 op [0] = arith_shift_left (in [j], shiftVal) | (uint32_t) shift [j] ; in copyPredictorTo32Shift()