summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-04-05 18:50:29 +0000
committerjstebbins <[email protected]>2010-04-05 18:50:29 +0000
commitd7dc1c11f93fe701893899471a5d729869d8f5c6 (patch)
tree5d087d19b5092465f471e1ef76138b5f42396c97 /libhb/decavcodec.c
parent453a109aae42e4ce540b16977c4ffe3631b7dce3 (diff)
generalize audio channel map reordering
this allows remapping any channel order to any other channel order with the appropriate map definitions. channel maps currently supplied are smpte (used by ffmpeg), qt (our standard channel order), and ac3 (as delivered by a52dec). remapping can also be applied to the downmixer with the function hb_downmix_set_chan_map(hb_chan_map_t * map_in, hb_chan_map_t * map_out). this allows downmixing and channel reordering in a single step. there is no additional cost to reordering since the matrix multiply used to do the downmix simultaneously reorders. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3201 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/decavcodec.c')
-rw-r--r--libhb/decavcodec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libhb/decavcodec.c b/libhb/decavcodec.c
index 9f3196a85..17d320657 100644
--- a/libhb/decavcodec.c
+++ b/libhb/decavcodec.c
@@ -209,6 +209,7 @@ static int decavcodecInit( hb_work_object_t * w, hb_job_t * job )
{
pv->downmix = hb_downmix_init(w->audio->config.in.channel_layout,
w->audio->config.out.mixdown);
+ hb_downmix_set_chan_map( pv->downmix, &hb_smpte_chan_map, &hb_qt_chan_map );
}
return 0;
@@ -1081,6 +1082,7 @@ static int decavcodecviInit( hb_work_object_t * w, hb_job_t * job )
{
pv->downmix = hb_downmix_init(w->audio->config.in.channel_layout,
w->audio->config.out.mixdown);
+ hb_downmix_set_chan_map( pv->downmix, &hb_smpte_chan_map, &hb_qt_chan_map );
}
return 0;
@@ -1228,9 +1230,6 @@ static void decodeAudio( hb_audio_t * audio, hb_work_private_t *pv, uint8_t *dat
}
int n_ch_samples = nsamples / context->channels;
- hb_layout_remap( hb_smpte_chan_map, pv->downmix_buffer,
- audio->config.in.channel_layout, n_ch_samples );
-
int channels = HB_AMIXDOWN_GET_DISCRETE_CHANNEL_COUNT(audio->config.out.mixdown);
buf = hb_buffer_init( n_ch_samples * channels * sizeof(float) );
@@ -1247,8 +1246,9 @@ static void decodeAudio( hb_audio_t * audio, hb_work_private_t *pv, uint8_t *dat
fl32[i] = buffer[i];
}
int n_ch_samples = nsamples / context->channels;
- hb_layout_remap( hb_smpte_chan_map, fl32,
- audio->config.in.channel_layout, n_ch_samples );
+ hb_layout_remap( &hb_smpte_chan_map, &hb_qt_chan_map,
+ audio->config.in.channel_layout,
+ fl32, n_ch_samples );
}
double pts = pv->pts_next;