diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2014-12-07 09:43:10 +1100 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2014-12-07 16:45:12 +1100 |
commit | 249e526a0f3313af960a2709531446110079d145 (patch) | |
tree | c48d5abbc8455bddd73d80c9599efc42bcc7cc53 /src/ALAC/matrix_enc.c | |
parent | 9f1fbafb56c5b985bce9589ad81c5f7b4a1a3418 (diff) |
src/ALAC/ : Code improvements.
* Make internal APIs const correct.
* Use mNumSamples field from encoder/decoder state struct
instead of passing to encode/decode functions.
Diffstat (limited to 'src/ALAC/matrix_enc.c')
-rw-r--r-- | src/ALAC/matrix_enc.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ALAC/matrix_enc.c b/src/ALAC/matrix_enc.c index b6a9dc2..b50f83b 100644 --- a/src/ALAC/matrix_enc.c +++ b/src/ALAC/matrix_enc.c @@ -47,7 +47,8 @@ // 16-bit routines -void mix16 (int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres) +void +mix16 (const int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres) { int32_t j ; @@ -84,7 +85,8 @@ void mix16 (int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t num // 20-bit routines // - the 20 bits of data are left-justified in 3 bytes of storage but right-aligned for input/output predictor buffers -void mix20 (int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres) +void +mix20 (const int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres) { int32_t l, r ; int32_t j ; @@ -120,7 +122,8 @@ void mix20 (int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t num // 24-bit routines // - the 24 bits of data are right-justified in the input/output predictor buffers -void mix24 (int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, +void +mix24 (const int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted) { int32_t l, r ; @@ -203,7 +206,8 @@ void mix24 (int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t num // - otherwise, the calculations might overflow into the 33rd bit and be lost // - therefore, these routines deal with the specified "unused lower" bytes in the "shift" buffers -void mix32 (int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, +void +mix32 (const int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t numSamples, int32_t mixbits, int32_t mixres, uint16_t * shiftUV, int32_t bytesShifted) { int32_t shift = bytesShifted * 8 ; @@ -269,4 +273,3 @@ void mix32 (int32_t * in, uint32_t stride, int32_t * u, int32_t * v, int32_t num } } } - |