summaryrefslogtreecommitdiffstats
path: root/libhb/encfaac.c
diff options
context:
space:
mode:
authormaurj <[email protected]>2007-04-11 15:23:57 +0000
committermaurj <[email protected]>2007-04-11 15:23:57 +0000
commitddc7ac09960746920ae8e48ac6f38a61c9f56d47 (patch)
tree0ad40c6da4ff1ef22f33f6b6543171f346643029 /libhb/encfaac.c
parent1ce785c8d342834c33ee09e63315c5997782f919 (diff)
Added libhb and CLI support for Dolby Pro Logic II 5.0 matrix encoding. *NOT YET ADDED TO THE GUI*. Handbrake now uses a more general "audio mixdown" concept. For each audio track to be converted you specify a mixdown. These are defined in common.h.
This checkin only allows you to specify one mixdown for all tracks in the CLI, although everything is in place internally to specify a different mixdown per track. In the CLI, the "-6 --surround" option has been repurposed as a "-6 --mixdown" option, with a string parameter of mono/stereo/dpl1/dpl2/6ch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@494 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encfaac.c')
-rw-r--r--libhb/encfaac.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libhb/encfaac.c b/libhb/encfaac.c
index 7ed9853d7..d46e8aedd 100644
--- a/libhb/encfaac.c
+++ b/libhb/encfaac.c
@@ -20,7 +20,7 @@ struct hb_work_private_s
hb_list_t * list;
int64_t pts;
- int channelsused;
+ int out_discrete_channels;
};
@@ -54,9 +54,9 @@ int encfaacInit( hb_work_object_t * w, hb_job_t * job )
pv->job = job;
/* pass the number of channels used into the private work data */
- pv->channelsused = w->config->aac.channelsused;
+ pv->out_discrete_channels = HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(w->amixdown);
- pv->faac = faacEncOpen( job->arate, pv->channelsused, &pv->input_samples,
+ pv->faac = faacEncOpen( job->arate, pv->out_discrete_channels, &pv->input_samples,
&pv->output_bytes );
pv->buf = malloc( pv->input_samples * sizeof( float ) );
@@ -65,7 +65,7 @@ int encfaacInit( hb_work_object_t * w, hb_job_t * job )
cfg->aacObjectType = LOW;
cfg->allowMidside = 1;
- if (pv->channelsused == 6) {
+ if (pv->out_discrete_channels == 6) {
/* we are preserving 5.1 audio into 6-channel AAC,
so indicate that we have an lfe channel */
cfg->useLfe = 1;
@@ -74,12 +74,12 @@ int encfaacInit( hb_work_object_t * w, hb_job_t * job )
}
cfg->useTns = 0;
- cfg->bitRate = job->abitrate * 1000 / pv->channelsused; /* Per channel */
+ cfg->bitRate = job->abitrate * 1000 / pv->out_discrete_channels; /* Per channel */
cfg->bandWidth = 0;
cfg->outputFormat = 0;
cfg->inputFormat = FAAC_INPUT_FLOAT;
- if (pv->channelsused == 6) {
+ if (pv->out_discrete_channels == 6) {
/* we are preserving 5.1 audio into 6-channel AAC, and need to
re-map the output of deca52 into our own mapping - the mapping
below is the default mapping expected by QuickTime */
@@ -147,8 +147,8 @@ static hb_buffer_t * Encode( hb_work_object_t * w )
&pts, &pos );
buf = hb_buffer_init( pv->output_bytes );
- buf->start = pts + 90000 * pos / pv->channelsused / sizeof( float ) / pv->job->arate;
- buf->stop = buf->start + 90000 * pv->input_samples / pv->job->arate / pv->channelsused;
+ buf->start = pts + 90000 * pos / pv->out_discrete_channels / sizeof( float ) / pv->job->arate;
+ buf->stop = buf->start + 90000 * pv->input_samples / pv->job->arate / pv->out_discrete_channels;
buf->size = faacEncEncode( pv->faac, (int32_t *) pv->buf,
pv->input_samples, buf->data, pv->output_bytes );
buf->key = 1;