[FFmpeg-soc] [soc]: r3572 - in aacenc: aac.h aacenc.c
kostya
subversion at mplayerhq.hu
Sun Aug 24 09:18:56 CEST 2008
Author: kostya
Date: Sun Aug 24 09:18:56 2008
New Revision: 3572
Log:
Remove temporal noise shaping coding as it's unused and bulky
Modified:
aacenc/aac.h
aacenc/aacenc.c
Modified: aacenc/aac.h
==============================================================================
--- aacenc/aac.h (original)
+++ aacenc/aac.h Sun Aug 24 09:18:56 2008
@@ -196,11 +196,7 @@ typedef struct {
int length[8][4];
int direction[8][4];
int order[8][4];
- int coef_res[8];
- int coef_compress[8][4];
- int coef_len[8][4];
- const float *tmp2_map[8][4];
- int coef[8][4][TNS_MAX_ORDER];
+ float coef[8][4][TNS_MAX_ORDER];
} TemporalNoiseShaping;
/**
Modified: aacenc/aacenc.c
==============================================================================
--- aacenc/aacenc.c (original)
+++ aacenc/aacenc.c Sun Aug 24 09:18:56 2008
@@ -28,6 +28,7 @@
* TODOs:
* psy model selection with some option
* add sane pulse detection
+ * add temporal noise shaping
***********************************/
#include "avcodec.h"
@@ -638,47 +639,6 @@ static void encode_pulses(AACEncContext
}
/**
- * Encode temporal noise shaping data.
- */
-static void encode_tns_data(AACEncContext *s, SingleChannelElement *sce)
-{
- int i, w;
- TemporalNoiseShaping *tns = &sce->tns;
-
- put_bits(&s->pb, 1, tns->present);
- if(!tns->present) return;
- if(sce->ics.window_sequence[0] == EIGHT_SHORT_SEQUENCE){
- for(w = 0; w < sce->ics.num_windows; w++){
- put_bits(&s->pb, 1, tns->n_filt[w]);
- if(!tns->n_filt[w]) continue;
- put_bits(&s->pb, 1, tns->coef_res[w] - 3);
- put_bits(&s->pb, 4, tns->length[w][0]);
- put_bits(&s->pb, 3, tns->order[w][0]);
- if(tns->order[w][0]){
- put_bits(&s->pb, 1, tns->direction[w][0]);
- put_bits(&s->pb, 1, tns->coef_compress[w][0]);
- for(i = 0; i < tns->order[w][0]; i++)
- put_bits(&s->pb, tns->coef_len[w][0], tns->coef[w][0][i]);
- }
- }
- }else{
- put_bits(&s->pb, 1, tns->n_filt[0]);
- if(!tns->n_filt[0]) return;
- put_bits(&s->pb, 1, tns->coef_res[0] - 3);
- for(w = 0; w < tns->n_filt[0]; w++){
- put_bits(&s->pb, 6, tns->length[0][w]);
- put_bits(&s->pb, 5, tns->order[0][w]);
- if(tns->order[0][w]){
- put_bits(&s->pb, 1, tns->direction[0][w]);
- put_bits(&s->pb, 1, tns->coef_compress[0][w]);
- for(i = 0; i < tns->order[0][w]; i++)
- put_bits(&s->pb, tns->coef_len[0][w], tns->coef[0][w][i]);
- }
- }
- }
-}
-
-/**
* Encode spectral coefficients processed by psychoacoustic model.
*/
static void encode_spectral_coeffs(AACEncContext *s, SingleChannelElement *sce)
@@ -730,7 +690,7 @@ static int encode_individual_channel(AVC
encode_band_info(s, sce);
encode_scale_factors(avctx, s, sce, global_gain);
encode_pulses(s, &sce->pulse);
- encode_tns_data(s, sce);
+ put_bits(&s->pb, 1, 0); //tns
put_bits(&s->pb, 1, 0); //ssr
encode_spectral_coeffs(s, sce);
return 0;
More information about the FFmpeg-soc
mailing list