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

jai_menon subversion at mplayerhq.hu
Sat Jun 28 18:04:27 CEST 2008


Author: jai_menon
Date: Sat Jun 28 18:04:27 2008
New Revision: 2586

Log:
rename lpc function and generalize existing code

Modified:
   alacenc/alacenc.c

Modified: alacenc/alacenc.c
==============================================================================
--- alacenc/alacenc.c	(original)
+++ alacenc/alacenc.c	Sat Jun 28 18:04:27 2008
@@ -139,15 +139,18 @@ static void write_frame_header(AlacEncod
     put_bits(&s->pbctx, 32, s->avctx->frame_size);          // No. of samples in the frame
 }
 
-static void first_order_predictor(AlacEncodeContext *s, int ch)
+static void alac_linear_predictor(AlacEncodeContext *s, int ch)
 {
     int i;
 
+    if(s->lpc.lpc_order == 31) {
     i = s->avctx->frame_size - 1;
     while(i > 0) {
         s->sample_buf[ch][i] -= s->sample_buf[ch][i-1];
         i--;
     }
+    return;
+    }
 }
 
 static void alac_entropy_coder(AlacEncodeContext *s, int ch)
@@ -219,7 +222,7 @@ static void write_compressed_frame(AlacE
     // apply lpc and entropy coding to audio samples
 
     for(i=0;i<s->channels;i++) {
-        first_order_predictor(s, i);
+        alac_linear_predictor(s, i);
         alac_entropy_coder(s, i);
     }
 }



More information about the FFmpeg-soc mailing list