[FFmpeg-soc] [soc]: r2594 - alacenc/alacenc.c

jai_menon subversion at mplayerhq.hu
Mon Jun 30 11:57:08 CEST 2008


Author: jai_menon
Date: Mon Jun 30 11:57:08 2008
New Revision: 2594

Log:
compute predictor parameters in a separate function

Modified:
   alacenc/alacenc.c

Modified: alacenc/alacenc.c
==============================================================================
--- alacenc/alacenc.c	(original)
+++ alacenc/alacenc.c	Mon Jun 30 11:57:08 2008
@@ -142,6 +142,12 @@ static void write_frame_header(AlacEncod
     put_bits(&s->pbctx, 32, s->avctx->frame_size);          // No. of samples in the frame
 }
 
+static void calc_predictor_params(AlacEncodeContext *s, int ch)
+{
+    // Set default predictor order
+    s->lpc.lpc_order = 31;
+}
+
 static void alac_linear_predictor(AlacEncodeContext *s, int ch)
 {
     int i;
@@ -211,6 +217,9 @@ static void write_compressed_frame(AlacE
     put_bits(&s->pbctx, 8, 0);      // FIXME: interlacing leftweight
 
     for(i=0;i<s->channels;i++) {
+
+        calc_predictor_params(s, i);
+
         put_bits(&s->pbctx, 4, 0);  // prediction type : currently only type 0 has been RE'd
         put_bits(&s->pbctx, 4, 0);  // FIXME: prediction quantization
 
@@ -257,9 +266,6 @@ static av_cold int alac_encode_init(AVCo
     s->rc.k_modifier      = 14;
     s->rc.rice_modifier   = 4;
 
-    // Set default predictor order
-    s->lpc.lpc_order      = 31;
-
     s->max_coded_frame_size = (ALAC_FRAME_HEADER_SIZE + ALAC_FRAME_FOOTER_SIZE +
                                avctx->frame_size*s->channels*avctx->bits_per_sample)>>3;
 



More information about the FFmpeg-soc mailing list