Commit 42077e8b authored by banan's avatar banan

Parameter added for user to set the cutoff frequency when encoding with faac.

Patch by Luca Abeni - lucabe72 at email dot it.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4837 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5d7eaaf8
...@@ -1982,6 +1982,13 @@ typedef struct AVCodecContext { ...@@ -1982,6 +1982,13 @@ typedef struct AVCodecContext {
* - decoding: unused * - decoding: unused
*/ */
int directpred; int directpred;
/**
* audio cutoff bandwidth (0 means "automatic") . Currently used only by FAAC
* - encoding: set by user.
* - decoding: unused
*/
int cutoff;
} AVCodecContext; } AVCodecContext;
/** /**
......
...@@ -57,6 +57,7 @@ static int Faac_encode_init(AVCodecContext *avctx) ...@@ -57,6 +57,7 @@ static int Faac_encode_init(AVCodecContext *avctx)
faac_cfg->useTns = 0; faac_cfg->useTns = 0;
faac_cfg->allowMidside = 1; faac_cfg->allowMidside = 1;
faac_cfg->bitRate = avctx->bit_rate / avctx->channels; faac_cfg->bitRate = avctx->bit_rate / avctx->channels;
faac_cfg->bandWidth = avctx->cutoff;
if(avctx->flags & CODEC_FLAG_QSCALE) { if(avctx->flags & CODEC_FLAG_QSCALE) {
faac_cfg->bitRate = 0; faac_cfg->bitRate = 0;
faac_cfg->quantqual = avctx->global_quality / FF_QP2LAMBDA; faac_cfg->quantqual = avctx->global_quality / FF_QP2LAMBDA;
......
...@@ -494,6 +494,7 @@ static AVOption options[]={ ...@@ -494,6 +494,7 @@ static AVOption options[]={
{"rate_emu", NULL, OFFSET(rate_emu), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, {"rate_emu", NULL, OFFSET(rate_emu), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
{"sample_rate", NULL, OFFSET(sample_rate), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, {"sample_rate", NULL, OFFSET(sample_rate), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
{"channels", NULL, OFFSET(channels), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, {"channels", NULL, OFFSET(channels), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX, A|E},
{"frame_size", NULL, OFFSET(frame_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, {"frame_size", NULL, OFFSET(frame_size), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
{"frame_number", NULL, OFFSET(frame_number), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, {"frame_number", NULL, OFFSET(frame_number), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
{"real_pict_num", NULL, OFFSET(real_pict_num), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX}, {"real_pict_num", NULL, OFFSET(real_pict_num), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment