[FFmpeg-soc] [soc]: r1013 - in eac3: ac3dec.c ac3tab.c ac3tab.h eac3.h eac3dec.c
bwolowiec
subversion at mplayerhq.hu
Sun Aug 19 08:22:32 CEST 2007
Author: bwolowiec
Date: Sun Aug 19 08:22:32 2007
New Revision: 1013
Log:
fixing small bugs
Modified:
eac3/ac3dec.c
eac3/ac3tab.c
eac3/ac3tab.h
eac3/eac3.h
eac3/eac3dec.c
Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c (original)
+++ eac3/ac3dec.c Sun Aug 19 08:22:32 2007
@@ -40,12 +40,6 @@
#include "ac3dec.h"
/**
- * Table of bin locations for rematrixing bands
- * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions
- */
-static const uint8_t rematrix_band_tbl[5] = { 13, 25, 37, 61, 253 };
-
-/**
* table for exponent to scale_factor mapping
* ff_ac3_scale_factors[i] = 2 ^ -i
*/
@@ -637,8 +631,8 @@ void ff_ac3_do_rematrixing(float (*trans
for(bnd=0; bnd<nrematbnd; bnd++) {
if(rematflg[bnd]) {
- bndend = FFMIN(end, rematrix_band_tbl[bnd+1]);
- for(i=rematrix_band_tbl[bnd]; i<bndend; i++) {
+ bndend = FFMIN(end, ff_ac3_rematrix_band_tbl[bnd+1]);
+ for(i=ff_ac3_rematrix_band_tbl[bnd]; i<bndend; i++) {
tmp0 = transform_coeffs[1][i];
tmp1 = transform_coeffs[2][i];
transform_coeffs[1][i] = tmp0 + tmp1;
Modified: eac3/ac3tab.c
==============================================================================
--- eac3/ac3tab.c (original)
+++ eac3/ac3tab.c Sun Aug 19 08:22:32 2007
@@ -1390,3 +1390,10 @@ const float ff_eac3_spxattentab[32][3] =
{0.238710401, 0.056982656, 0.013602353},
{0.227930622, 0.051952369, 0.011841536}
};
+
+/**
+ * Table of bin locations for rematrixing bands
+ * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions
+ */
+const uint8_t ff_ac3_rematrix_band_tbl[5] = { 13, 25, 37, 61, 253 };
+
Modified: eac3/ac3tab.h
==============================================================================
--- eac3/ac3tab.h (original)
+++ eac3/ac3tab.h Sun Aug 19 08:22:32 2007
@@ -60,5 +60,6 @@ extern const uint8_t ff_eac3_defcplbndst
extern const uint8_t ff_eac3_defspxbndstrc[17];
extern const float ff_eac3_spxattentab[32][3];
+extern const uint8_t ff_ac3_rematrix_band_tbl[5];
#endif /* AC3TAB_H */
Modified: eac3/eac3.h
==============================================================================
--- eac3/eac3.h (original)
+++ eac3/eac3.h Sun Aug 19 08:22:32 2007
@@ -158,7 +158,6 @@ typedef struct EAC3Context{
int ecplangle[AC3_MAX_CHANNELS][23]; ///< Enhanced coupling angle
int ecplchaos[AC3_MAX_CHANNELS][23]; ///< Enhanced coupling chaos
int ecpltrans[AC3_MAX_CHANNELS]; ///< Enhanced coupling transient present
- int rematstr; ///< Rematrixing strategy
int rematflg[4]; ///< Rematrixing flag
int cplabsexp; ///< Coupling absolute exponent
Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c (original)
+++ eac3/eac3dec.c Sun Aug 19 08:22:32 2007
@@ -117,7 +117,7 @@ static int parse_bsi(GetBitContext *gbc,
GET_BITS(s->lfemixlevcod, gbc, 5);
}
}
- if(s->strmtyp == AC3_ACMOD_DUALMONO){
+ if(s->strmtyp == 0){
/* if independent stream */
for(i = 0; i < (s->acmod?1:2); i++){
if(get_bits1(gbc)){
@@ -726,9 +726,6 @@ static int parse_audblk(GetBitContext *g
/* Rematrixing operation in the 2/0 mode */
if(s->acmod == AC3_ACMOD_STEREO) /* if in 2/0 mode */{
if (!blk || get_bits1(gbc)){
- s->rematstr = 1;
- }
- if(s->rematstr){
/* nrematbnds determined from cplinu, ecplinu, spxinu, cplbegf, ecplbegf and spxbegf
* TODO XXX (code from AC-3) */
s->nrematbnds = 4;
@@ -739,7 +736,7 @@ static int parse_audblk(GetBitContext *g
}
}
}
- /* This field for channel bandwidth code */
+ /* Channel bandwidth code */
for(ch = 1; ch <= s->nfchans; ch++){
if(!blk && s->chexpstr[blk][ch]==EXP_REUSE){
av_log(s->avctx, AV_LOG_ERROR, "no channel exponent strategy in first block");
@@ -1323,7 +1320,6 @@ static int eac3_decode_frame(AVCodecCont
return -1;
if(c->fscod == 3){
- assert(c->fscod != 3);
avctx->sample_rate = ff_ac3_freqs[c->fscod2] / 2;
}else{
avctx->sample_rate = ff_ac3_freqs[c->fscod];
More information about the FFmpeg-soc
mailing list