sizeof(PredictorState) is different for the floating-point and the fixed-point AAC decoders; this is an obstacle for deduplicating code between these decoders. So don't include this array in SingleChannelElement, instead add a union of pointers to the fixed-point PredictorState and the floating-point PredictorState. The actual arrays are part of the extended ChannelElement to be allocated by ff_aac_sbr_ctx_alloc_init(); it also sets the pointers.
Showing the changes to libavcodec/aacenc.h (1 of 6 files). Show all
Unified · Split
| @@ -49,6 +49,20 @@ typedef enum AACCoder { · 48 unmodified lines | ||
| 49 | 49 | AAC_CODER_NB, |
| 50 | 50 | }AACCoder; |
| 51 | 51 | |
| 52 | +/** | |
| 53 | + * Predictor State | |
| 54 | + */ | |
| 55 | +typedef struct PredictorState { | |
| 56 | + float cor0; | |
| 57 | + float cor1; | |
| 58 | + float var0; | |
| 59 | + float var1; | |
| 60 | + float r0; | |
| 61 | + float r1; | |
| 62 | + float k1; | |
| 63 | + float x_est; | |
| 64 | +} PredictorState; | |
| 65 | + | |
| 52 | 66 | typedef struct AACEncOptions { |
| 53 | 67 | int coder; |
| 54 | 68 | int pns; |