The reference encoder does not generate any streams using this, but the
reference decoder can handle it, so we should as well.
---
 libavcodec/alac.c |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index eb6c1cf..a66cf7f 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -462,13 +462,25 @@ static int alac_decode_frame(AVCodecContext *avctx, void 
*data,
                                                predictor_coef_num[ch],
                                                prediction_quantitization[ch]);
             } else {
-                av_log(avctx, AV_LOG_ERROR, "FIXME: unhandled prediction type: 
%i\n", prediction_type[ch]);
-                /* I think the only other prediction type (or perhaps this is
-                 * just a boolean?) runs adaptive fir twice.. like:
-                 * predictor_decompress_fir_adapt(predictor_error, tempout, 
...)
-                 * predictor_decompress_fir_adapt(predictor_error, 
outputsamples ...)
-                 * little strange..
+                /* The only other prediction type runs the adaptive FIR twice.
+                 * The first pass uses the special-case coef_num = 31, while
+                 * the second pass uses the coefs from the bitstream.
+                 *
+                 * However, this prediction type is not currently used by the
+                 * reference encoder.
+                 *
+                 * TODO: implement in the alac encoder to generate test 
samples.
                  */
+                predictor_decompress_fir_adapt(alac->predicterror_buffer[ch],
+                                               alac->predicterror_buffer[ch],
+                                               outputsamples, readsamplesize,
+                                               NULL, 31, 0);
+                predictor_decompress_fir_adapt(alac->predicterror_buffer[ch],
+                                               alac->outputsamples_buffer[ch],
+                                               outputsamples, readsamplesize,
+                                               predictor_coef_table[ch],
+                                               predictor_coef_num[ch],
+                                               prediction_quantitization[ch]);
             }
         }
     } else {
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to