[FFmpeg-soc] [soc]: r2841 - in aacenc: aacenc.c aacpsy.c aacpsy.h

kostya subversion at mplayerhq.hu
Thu Jul 24 11:31:59 CEST 2008


Author: kostya
Date: Thu Jul 24 11:31:59 2008
New Revision: 2841

Log:
Change psy model interface, so it's possible to provide lookahead data
and there's no need to feed waveform data to model later.


Modified:
   aacenc/aacenc.c
   aacenc/aacpsy.c
   aacenc/aacpsy.h

Modified: aacenc/aacenc.c
==============================================================================
--- aacenc/aacenc.c	(original)
+++ aacenc/aacenc.c	Thu Jul 24 11:31:59 2008
@@ -655,13 +655,13 @@ static int aac_encode_frame(AVCodecConte
     AACEncContext *s = avctx->priv_data;
     int16_t *samples = data;
 
-    ff_aac_psy_suggest_window(&s->psy, samples, 0, &s->cpe);
+    ff_aac_psy_suggest_window(&s->psy, samples, NULL, 0, &s->cpe);
 
     analyze(avctx, s, &s->cpe, samples, 0);
     if(avctx->channels > 1)
         analyze(avctx, s, &s->cpe, samples, 1);
 
-    ff_aac_psy_analyze(&s->psy, samples, 0, &s->cpe);
+    ff_aac_psy_analyze(&s->psy, 0, &s->cpe);
 
     init_put_bits(&s->pb, frame, buf_size*8);
     if(!avctx->frame_number && !(avctx->flags & CODEC_FLAG_BITEXACT)){

Modified: aacenc/aacpsy.c
==============================================================================
--- aacenc/aacpsy.c	(original)
+++ aacenc/aacpsy.c	Thu Jul 24 11:31:59 2008
@@ -164,7 +164,7 @@ static void psy_create_output(AACPsyCont
     }
 }
 
-static void psy_null_window(AACPsyContext *apc, int16_t *audio, int channel, ChannelElement *cpe)
+static void psy_null_window(AACPsyContext *apc, int16_t *audio, int16_t *la, int channel, ChannelElement *cpe)
 {
     int ch;
 
@@ -179,7 +179,7 @@ static void psy_null_window(AACPsyContex
     cpe->common_window = cpe->ch[0].ics.use_kb_window[0] == cpe->ch[1].ics.use_kb_window[0];
 }
 
-static void psy_null_process(AACPsyContext *apc, int16_t *audio, int channel, ChannelElement *cpe)
+static void psy_null_process(AACPsyContext *apc, int channel, ChannelElement *cpe)
 {
     int start;
     int ch, g, i;
@@ -220,7 +220,7 @@ static void psy_null_process(AACPsyConte
     psy_create_output(apc, cpe, 1);
 }
 
-static void psy_null8_window(AACPsyContext *apc, int16_t *audio, int channel, ChannelElement *cpe)
+static void psy_null8_window(AACPsyContext *apc, int16_t *audio, int16_t *la, int channel, ChannelElement *cpe)
 {
     int ch, i;
 
@@ -253,7 +253,7 @@ static void psy_null8_window(AACPsyConte
     cpe->common_window = cpe->ch[0].ics.use_kb_window[0] == cpe->ch[1].ics.use_kb_window[0];
 }
 
-static void psy_null8_process(AACPsyContext *apc, int16_t *audio, int channel, ChannelElement *cpe)
+static void psy_null8_process(AACPsyContext *apc, int channel, ChannelElement *cpe)
 {
     int start;
     int w, ch, g, i;
@@ -397,7 +397,7 @@ static av_cold int psy_3gpp_init(AACPsyC
  * Tell encoder which window types to use.
  * @see 3GPP TS26.403 5.4.1
  */
-static void psy_3gpp_window(AACPsyContext *apc, int16_t *audio, int channel, ChannelElement *cpe)
+static void psy_3gpp_window(AACPsyContext *apc, int16_t *audio, int16_t *la, int channel, ChannelElement *cpe)
 {
     int ch;
 
@@ -449,7 +449,7 @@ static void calc_pe(Psy3gppBand *band, i
  * Determine scalefactors and prepare coefficients for encoding.
  * @see 3GPP TS26.403 5.4
  */
-static void psy_3gpp_process(AACPsyContext *apc, int16_t *audio, int channel, ChannelElement *cpe)
+static void psy_3gpp_process(AACPsyContext *apc, int channel, ChannelElement *cpe)
 {
     int start;
     int ch, g, i;
@@ -667,14 +667,14 @@ int av_cold ff_aac_psy_init(AACPsyContex
     return 0;
 }
 
-void ff_aac_psy_suggest_window(AACPsyContext *ctx, int16_t *audio, int channel, ChannelElement *cpe)
+void ff_aac_psy_suggest_window(AACPsyContext *ctx, int16_t *audio, int16_t *la, int channel, ChannelElement *cpe)
 {
-    ctx->model->window(ctx, audio, channel, cpe);
+    ctx->model->window(ctx, audio, la, channel, cpe);
 }
 
-void ff_aac_psy_analyze(AACPsyContext *ctx, int16_t *audio, int channel, ChannelElement *cpe)
+void ff_aac_psy_analyze(AACPsyContext *ctx, int channel, ChannelElement *cpe)
 {
-    ctx->model->process(ctx, audio, channel, cpe);
+    ctx->model->process(ctx, channel, cpe);
 }
 
 void av_cold ff_aac_psy_end(AACPsyContext *ctx)

Modified: aacenc/aacpsy.h
==============================================================================
--- aacenc/aacpsy.h	(original)
+++ aacenc/aacpsy.h	Thu Jul 24 11:31:59 2008
@@ -170,16 +170,16 @@ typedef struct AACPsyContext {
 typedef struct AACPsyModel {
     const char *name;
     int   (*init)   (AACPsyContext *apc);
-    void  (*window) (AACPsyContext *apc, int16_t *audio, int channel, ChannelElement *cpe);
-    void  (*process)(AACPsyContext *apc, int16_t *audio, int channel, ChannelElement *cpe);
+    void  (*window) (AACPsyContext *apc, int16_t *audio, int16_t *la, int channel, ChannelElement *cpe);
+    void  (*process)(AACPsyContext *apc,int channel, ChannelElement *cpe);
     void  (*end)    (AACPsyContext *apc);
 }AACPsyModel;
 
 int ff_aac_psy_init(AACPsyContext *ctx, AVCodecContext *avctx, int model, int flags,
                     const uint8_t *bands1024, int num_bands1024,
                     const uint8_t *bands128,  int num_bands128);
-void ff_aac_psy_suggest_window(AACPsyContext *ctx, int16_t *audio, int channel, ChannelElement *cpe);
-void ff_aac_psy_analyze(AACPsyContext *ctx, int16_t *audio, int channel, ChannelElement *cpe);
+void ff_aac_psy_suggest_window(AACPsyContext *ctx, int16_t *audio, int16_t *la, int channel, ChannelElement *cpe);
+void ff_aac_psy_analyze(AACPsyContext *ctx, int channel, ChannelElement *cpe);
 void ff_aac_psy_end(AACPsyContext *ctx);
 #endif /* FFMPEG_AACPSY_H */
 



More information about the FFmpeg-soc mailing list