[FFmpeg-soc] [soc]: r502 - in eac3: eac3.h eac3_parser.c eac3dec.c
bwolowiec
subversion at mplayerhq.hu
Sun Jul 22 17:55:19 CEST 2007
Author: bwolowiec
Date: Sun Jul 22 17:55:18 2007
New Revision: 502
Log:
Add AVCodecContext to EAC3Context and fix av_log call
Modified:
eac3/eac3.h
eac3/eac3_parser.c
eac3/eac3dec.c
Modified: eac3/eac3.h
==============================================================================
--- eac3/eac3.h (original)
+++ eac3/eac3.h Sun Jul 22 17:55:18 2007
@@ -72,6 +72,8 @@ typedef enum {
typedef struct EAC3Context{
// TODO erase unused variables
// TODO add documentation
+
+ AVCodecContext *avctx;
//Syncinfo
int syncword;
Modified: eac3/eac3_parser.c
==============================================================================
--- eac3/eac3_parser.c (original)
+++ eac3/eac3_parser.c Sun Jul 22 17:55:18 2007
@@ -48,7 +48,7 @@ int ff_eac3_parse_bsi(GetBitContext *gbc
GET_BITS(s->fscod, gbc, 2);
if(s->fscod == 0x3)
{
- av_log(NULL, AV_LOG_ERROR, "NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "NOT IMPLEMENTED");
return -1;
#if 0
GET_BITS(s->fscod2, gbc, 2);
@@ -77,7 +77,7 @@ int ff_eac3_parse_bsi(GetBitContext *gbc
GET_BITS(s->bsid, gbc, 5);
if(s->bsid < 11 || s->bsid > 16){
- av_log(NULL, AV_LOG_ERROR, "bsid should be between 11 and 16");
+ av_log(s->avctx, AV_LOG_ERROR, "bsid should be between 11 and 16");
return -1;
}
@@ -153,7 +153,7 @@ int ff_eac3_parse_bsi(GetBitContext *gbc
else if(s->mixdef == 0x3) /* mixing option 4 */
{
GET_BITS(s->mixdeflen, gbc, 5);
- av_log(NULL, AV_LOG_ERROR, "NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "NOT IMPLEMENTED");
return -1;
// GET_BITS(s->mixdata, gbc, 8*(mixdeflen+2));
}
@@ -330,7 +330,7 @@ int ff_eac3_parse_audfrm(GetBitContext *
GET_BITS(s->frmchexpstr[ch], gbc, 5);
}
/* cplexpstr[blk] and chexpstr[blk][ch] derived from table lookups ? see Table E2.14 */
- av_log(NULL, AV_LOG_ERROR, "NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "NOT IMPLEMENTED");
return -1;
}
if(s->lfeon)
@@ -361,7 +361,7 @@ int ff_eac3_parse_audfrm(GetBitContext *
{
/* coupling can use AHT only when coupling in use for all blocks */
/* ncplregs derived from cplstre and cplexpstr ? see Section E3.3.2 */
- av_log(NULL, AV_LOG_ERROR, "AHT NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "AHT NOT IMPLEMENTED");
return -1;
/* AHT is only available in 6 block mode (numblkscod ==0x3) */
@@ -465,7 +465,7 @@ int ff_eac3_parse_audfrm(GetBitContext *
// where numblks is derived from the numblkscod in Table E2.15 <- TODO ???
// words_per_frame = frmsiz + 1
int nblkstrtbits = (ff_eac3_blocks[s->numblkscod]-1) * (4 + (av_log2(s->frmsiz-1)+1) );
- av_log(NULL, AV_LOG_INFO, "nblkstrtbits = %i\n", nblkstrtbits);
+ av_log(s->avctx, AV_LOG_INFO, "nblkstrtbits = %i\n", nblkstrtbits);
GET_BITS(s->blkstrtinfo, gbc, nblkstrtbits);
}
/* These fields for syntax state initialization */
@@ -528,7 +528,7 @@ int ff_eac3_parse_audblk(GetBitContext *
GET_BITS(s->spxstre, gbc, 1);
}
if(!blk && !s->spxstre){
- av_log(NULL, AV_LOG_ERROR, "no spectral extension strategy in first block");
+ av_log(s->avctx, AV_LOG_ERROR, "no spectral extension strategy in first block");
return -1;
}
if(s->spxstre)
@@ -587,7 +587,7 @@ int ff_eac3_parse_audblk(GetBitContext *
}
}
if(s->nspxbnds >= MAX_SPX_CODES){
- av_log(NULL, AV_LOG_ERROR, "s->nspxbnds >= MAX_SPX_CODES");
+ av_log(s->avctx, AV_LOG_ERROR, "s->nspxbnds >= MAX_SPX_CODES");
return -1;
}
}
@@ -618,7 +618,7 @@ int ff_eac3_parse_audblk(GetBitContext *
GET_BITS(s->spxcoe[ch], gbc, 1);
}
if(!blk && !s->spxcoe[ch]){
- av_log(NULL, AV_LOG_ERROR, "no spectral extension coordinates in first block");
+ av_log(s->avctx, AV_LOG_ERROR, "no spectral extension coordinates in first block");
return -1;
}
@@ -628,7 +628,7 @@ int ff_eac3_parse_audblk(GetBitContext *
GET_BITS(s->mstrspxco[ch], gbc, 2);
/* nspxbnds determined from spxbegf, spxendf, and spxbndstrc[ ] */
if(s->nspxbnds >= MAX_SPX_CODES){
- av_log(NULL, AV_LOG_ERROR, "s->nspxbnds >= MAX_SPX_CODES");
+ av_log(s->avctx, AV_LOG_ERROR, "s->nspxbnds >= MAX_SPX_CODES");
return -1;
}
for(bnd = 0; bnd < s->nspxbnds; bnd++)
@@ -699,7 +699,7 @@ int ff_eac3_parse_audblk(GetBitContext *
}
else /* enhanced coupling in use */
{
- av_log(NULL, AV_LOG_ERROR, "enhanced couplin NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "enhanced couplin NOT IMPLEMENTED");
return -1;
#if 0
GET_BITS(s->ecplbegf, gbc, 4);
@@ -761,7 +761,7 @@ int ff_eac3_parse_audblk(GetBitContext *
/* These fields for coupling coordinates */
if(s->cplinu[blk])
{
- av_log(NULL, AV_LOG_INFO, "NOT TESTED");
+ av_log(s->avctx, AV_LOG_INFO, "NOT TESTED");
if(s->ecplinu == 0) /* standard coupling in use */
{
@@ -872,7 +872,7 @@ int ff_eac3_parse_audblk(GetBitContext *
{
/* nrematbnds determined from cplinu, ecplinu, spxinu, cplbegf, ecplbegf and spxbegf
* TODO: how ? */
- av_log(NULL, AV_LOG_ERROR, "NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "NOT IMPLEMENTED");
return -1;
/*for(bnd = 0; bnd < s->nrematbnds; bnd++) {
GET_BITS(s->rematflg[bnd], gbc, 1);
@@ -883,7 +883,7 @@ int ff_eac3_parse_audblk(GetBitContext *
for(ch = 1; ch <= s->nfchans; ch++)
{
if(!blk && s->chexpstr[blk][ch]==EXP_REUSE){
- av_log(NULL, AV_LOG_ERROR, "no channel exponent strategy in first block");
+ av_log(s->avctx, AV_LOG_ERROR, "no channel exponent strategy in first block");
return -1;
}
if(s->chexpstr[blk][ch] != EXP_REUSE)
@@ -916,7 +916,7 @@ int ff_eac3_parse_audblk(GetBitContext *
GET_BITS(s->cplabsexp, gbc, 4);
/* ncplgrps derived from cplbegf, ecplbegf, cplendf, ecplendf, and cplexpstr */
/* how... ? */
- av_log(NULL, AV_LOG_ERROR, "NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "NOT IMPLEMENTED");
return -1;
/*for(grp = 0; grp< s->ncplgrps; grp++) {
GET_BITS(s->cplexps[grp], gbc, 7);
@@ -926,7 +926,7 @@ int ff_eac3_parse_audblk(GetBitContext *
for(ch = 1; ch <= s->nfchans; ch++) /* exponents for full bandwidth channels */
{
if(!blk && s->chexpstr[blk][ch] == EXP_REUSE){
- av_log(NULL, AV_LOG_ERROR, "no channel exponent strategy in first block");
+ av_log(s->avctx, AV_LOG_ERROR, "no channel exponent strategy in first block");
return -1;
}
if(s->chexpstr[blk][ch] != EXP_REUSE)
@@ -995,7 +995,7 @@ int ff_eac3_parse_audblk(GetBitContext *
}
else
{
- av_log(NULL, AV_LOG_INFO, "NOT TESTED");
+ av_log(s->avctx, AV_LOG_INFO, "NOT TESTED");
if(blk == 0) {
s->snroffste = 1;
}
@@ -1093,7 +1093,7 @@ int ff_eac3_parse_audblk(GetBitContext *
/* Delta bit allocation information */
if(s->dbaflde)
{
- av_log(NULL, AV_LOG_INFO, "NOT TESTED");
+ av_log(s->avctx, AV_LOG_INFO, "NOT TESTED");
GET_BITS(s->deltbaie, gbc, 1);
if(s->deltbaie)
{
@@ -1149,7 +1149,7 @@ int ff_eac3_parse_audblk(GetBitContext *
/* run bit allocation */
if(s->cplinu[blk]) {
- av_log(NULL, AV_LOG_ERROR, "NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "NOT IMPLEMENTED");
return -1;
}
@@ -1187,7 +1187,7 @@ int ff_eac3_parse_audblk(GetBitContext *
{
int snroffst = (((s->csnroffst - 15) << 4) + s->fsnroffst[ch]) << 2;
- //av_log(NULL, AV_LOG_INFO, "s->csnroffst=%i s->fsnroffst=%i snroffst = %i\n",
+ //av_log(s->avctx, AV_LOG_INFO, "s->csnroffst=%i s->fsnroffst=%i snroffst = %i\n",
// s->csnroffst, s->fsnroffst[ch], snroffst);
// TODO calculate hebap
@@ -1215,7 +1215,7 @@ int ff_eac3_parse_audblk(GetBitContext *
{
int endbap, bin, n;
- av_log(NULL, AV_LOG_INFO, "AHT NOT TESTED");
+ av_log(s->avctx, AV_LOG_INFO, "AHT NOT TESTED");
GET_BITS(s->chgaqmod[ch], gbc, 2);
@@ -1287,7 +1287,7 @@ int ff_eac3_parse_audblk(GetBitContext *
}
if(s->cplinu[blk] && s->chincpl[ch] && !got_cplchan)
{
- av_log(NULL, AV_LOG_ERROR, "NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "NOT IMPLEMENTED");
return -1;
#if 0
if(s->cplahtinu == 0)
@@ -1341,7 +1341,7 @@ int ff_eac3_parse_audblk(GetBitContext *
}
else if(s->lfeahtinu == 1)
{
- av_log(NULL, AV_LOG_ERROR, "NOT IMPLEMENTED");
+ av_log(s->avctx, AV_LOG_ERROR, "NOT IMPLEMENTED");
return -1;
#if 0
assert(0 && "TODO: AHT");
Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c (original)
+++ eac3/eac3dec.c Sun Jul 22 17:55:18 2007
@@ -205,6 +205,7 @@ static int eac3_decode_init(AVCodecConte
int ch;
EAC3Context *ctx = avctx->priv_data;
+ ctx->avctx = avctx;
ff_ac3_decoder_tables_init();
ac3_common_init();
av_init_random(0, &ctx->dith_state);
More information about the FFmpeg-soc
mailing list