comparison mlp.h @ 9533:b724134599eb libavcodec

mlpdec: Don't overallocate buffers. Now that max channels and primitive matrices are properly validated, there is no need to be paranoid that random data will be overwritten. As a bonus this makes matrix_coeff 16-byte aligned between matrices.
author ramiro
date Tue, 21 Apr 2009 22:53:46 +0000
parents 2aabf1a58f19
children d0fe5dc427f0
comparison
equal deleted inserted replaced
9532:2aabf1a58f19 9533:b724134599eb
27 #include "avcodec.h" 27 #include "avcodec.h"
28 28
29 /** Last possible matrix channel for each codec */ 29 /** Last possible matrix channel for each codec */
30 #define MAX_MATRIX_CHANNEL_MLP 5 30 #define MAX_MATRIX_CHANNEL_MLP 5
31 #define MAX_MATRIX_CHANNEL_TRUEHD 7 31 #define MAX_MATRIX_CHANNEL_TRUEHD 7
32 /** Maximum number of channels that can be decoded. */ 32 /** Maximum number of channels in a valid stream.
33 #define MAX_CHANNELS 16 33 * MLP : 5.1 + 2 noise channels -> 8 channels
34 * TrueHD: 7.1 -> 8 channels
35 */
36 #define MAX_CHANNELS 8
34 37
35 /** Maximum number of matrices used in decoding; most streams have one matrix 38 /** Maximum number of matrices used in decoding; most streams have one matrix
36 * per output channel, but some rematrix a channel (usually 0) more than once. 39 * per output channel, but some rematrix a channel (usually 0) more than once.
37 */ 40 */
38 #define MAX_MATRICES_MLP 6 41 #define MAX_MATRICES_MLP 6
39 #define MAX_MATRICES_TRUEHD 8 42 #define MAX_MATRICES_TRUEHD 8
40 #define MAX_MATRICES 15 43 #define MAX_MATRICES 8
41 44
42 /** Maximum number of substreams that can be decoded. 45 /** Maximum number of substreams that can be decoded.
43 * MLP's limit is 2. TrueHD supports at least up to 3. 46 * MLP's limit is 2. TrueHD supports at least up to 3.
44 */ 47 */
45 #define MAX_SUBSTREAMS 3 48 #define MAX_SUBSTREAMS 3