Fix the side frame conditional coding rules.
b24e5746 introduced changes to LastGainIndex which broke conditional coding for side frames after a mid-only frame (i.e., in a 60 ms frame where the side is coded, not coded, then coded again). These rules were a mess in general, however, because the side channel state kept a different nFramesDecoded count from the mid channel state, and had no way to tell if the prior side frame was coded. This patch attempts to rationalize them by moving the conditional coding decision up to the top level, where all this information is available. The first coded side frame after an uncoded side frame now always uses independent coding. If such a frame is also not the first side frame in an Opus frame, then it doesn't include an LTP scaling parameter (because the LTP state is well-defined).
Showing
- silk/dec_API.c 26 additions, 2 deletionssilk/dec_API.c
- silk/decode_frame.c 4 additions, 3 deletionssilk/decode_frame.c
- silk/decode_indices.c 6 additions, 12 deletionssilk/decode_indices.c
- silk/decode_parameters.c 3 additions, 2 deletionssilk/decode_parameters.c
- silk/define.h 5 additions, 0 deletionssilk/define.h
- silk/enc_API.c 23 additions, 3 deletionssilk/enc_API.c
- silk/encode_indices.c 6 additions, 12 deletionssilk/encode_indices.c
- silk/fixed/LTP_scale_ctrl_FIX.c 4 additions, 2 deletionssilk/fixed/LTP_scale_ctrl_FIX.c
- silk/fixed/encode_frame_FIX.c 8 additions, 6 deletionssilk/fixed/encode_frame_FIX.c
- silk/fixed/find_pred_coefs_FIX.c 3 additions, 2 deletionssilk/fixed/find_pred_coefs_FIX.c
- silk/fixed/main_FIX.h 8 additions, 4 deletionssilk/fixed/main_FIX.h
- silk/fixed/process_gains_FIX.c 2 additions, 1 deletionsilk/fixed/process_gains_FIX.c
- silk/float/LTP_scale_ctrl_FLP.c 3 additions, 2 deletionssilk/float/LTP_scale_ctrl_FLP.c
- silk/float/encode_frame_FLP.c 11 additions, 8 deletionssilk/float/encode_frame_FLP.c
- silk/float/find_pred_coefs_FLP.c 3 additions, 2 deletionssilk/float/find_pred_coefs_FLP.c
- silk/float/main_FLP.h 8 additions, 4 deletionssilk/float/main_FLP.h
- silk/float/process_gains_FLP.c 3 additions, 2 deletionssilk/float/process_gains_FLP.c
- silk/main.h 8 additions, 4 deletionssilk/main.h
Loading
Please register or sign in to comment