diff options
author | jstebbins <[email protected]> | 2012-07-11 20:10:20 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2012-07-11 20:10:20 +0000 |
commit | 8b91bcb733913afea795cfea6178372eee5b4abe (patch) | |
tree | 09b4bd5693f2c361861d803522d2340b6beab985 /libhb/encvorbis.c | |
parent | 7f1f338df87f6075e7edf0cd598523acaf0f82a1 (diff) |
bump libav to libav-v0.8-2197-g1a068bf
Resolves several deprecated api's
Eliminates several libav patches
Eliminates our builtin downmix in favour of avresample
Eliminate HB_INPUT_CH_LAYOUT_* and replace with AV_CH_LAYOUT_*
Resolves 6.x and 7.0 input channel layout issues HB had
Adds downmix support to declpcm. We never had it!
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4825 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encvorbis.c')
-rw-r--r-- | libhb/encvorbis.c | 60 |
1 files changed, 13 insertions, 47 deletions
diff --git a/libhb/encvorbis.c b/libhb/encvorbis.c index b0c7ea0ce..da631592c 100644 --- a/libhb/encvorbis.c +++ b/libhb/encvorbis.c @@ -8,6 +8,7 @@ */ #include "hb.h" +#include "audio_remap.h" #include "vorbis/vorbisenc.h" @@ -40,9 +41,9 @@ struct hb_work_private_s uint64_t pts; hb_list_t * list; - int out_discrete_channels; - int channel_map[6]; - int64_t prev_blocksize; + int out_discrete_channels; + int * remap_table; + int64_t prev_blocksize; }; int encvorbisInit( hb_work_object_t * w, hb_job_t * job ) @@ -53,7 +54,7 @@ int encvorbisInit( hb_work_object_t * w, hb_job_t * job ) hb_work_private_t * pv = calloc( 1, sizeof( hb_work_private_t ) ); w->private_data = pv; - pv->out_discrete_channels = hb_mixdown_get_discrete_channel_count( audio->config.out.mixdown ); + pv->out_discrete_channels = hb_mixdown_get_discrete_channel_count(audio->config.out.mixdown); pv->job = job; @@ -134,48 +135,13 @@ int encvorbisInit( hb_work_object_t * w, hb_job_t * job ) pv->list = hb_list_init(); - switch (pv->out_discrete_channels) { - case 1: - pv->channel_map[0] = 0; - break; - case 6: - // Vorbis uses the following channel map = L C R Ls Rs Lfe - if( audio->config.in.channel_map == &hb_ac3_chan_map ) - { - pv->channel_map[0] = 1; - pv->channel_map[1] = 2; - pv->channel_map[2] = 3; - pv->channel_map[3] = 4; - pv->channel_map[4] = 5; - pv->channel_map[5] = 0; - } - else if( audio->config.in.channel_map == &hb_smpte_chan_map ) - { - pv->channel_map[0] = 0; - pv->channel_map[1] = 2; - pv->channel_map[2] = 1; - pv->channel_map[3] = 4; - pv->channel_map[4] = 5; - pv->channel_map[5] = 3; - } - else // &hb_qt_chan_map - { - pv->channel_map[0] = 1; - pv->channel_map[1] = 0; - pv->channel_map[2] = 2; - pv->channel_map[3] = 3; - pv->channel_map[4] = 4; - pv->channel_map[5] = 5; - } - break; - default: - hb_log("encvorbis.c: Unable to correctly proccess %d channels, assuming stereo.", pv->out_discrete_channels); - case 2: - // Assume stereo - pv->channel_map[0] = 0; - pv->channel_map[1] = 1; - break; - } + // remapping + uint64_t layout; + layout = hb_ff_mixdown_xlat(audio->config.out.mixdown, NULL); + pv->remap_table = hb_audio_remap_build_table(layout, + audio->config.in.channel_map, + &hb_vorbis_chan_map); + return 0; } @@ -273,7 +239,7 @@ static hb_buffer_t * Encode( hb_work_object_t * w ) { for( j = 0; j < pv->out_discrete_channels; j++) { - buffer[j][i] = ((float *) pv->buf)[(pv->out_discrete_channels * i + pv->channel_map[j])]; + buffer[j][i] = ((float *) pv->buf)[(pv->out_discrete_channels * i + pv->remap_table[j])]; } } |