From 8b91bcb733913afea795cfea6178372eee5b4abe Mon Sep 17 00:00:00 2001 From: jstebbins Date: Wed, 11 Jul 2012 20:10:20 +0000 Subject: 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 --- libhb/audio_remap.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 libhb/audio_remap.h (limited to 'libhb/audio_remap.h') diff --git a/libhb/audio_remap.h b/libhb/audio_remap.h new file mode 100644 index 000000000..32ee3e9cb --- /dev/null +++ b/libhb/audio_remap.h @@ -0,0 +1,53 @@ +/* audio_remap.h + * + * Copyright (c) 2003-2012 HandBrake Team + * This file is part of the HandBrake source code + * Homepage: + * It may be used under the terms of the GNU General Public License v2. + * For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html + */ + +/* This file handles the following two scenarios: + * + * 1) remapping from liba52/libdca order to libav order + * - this allows downmixing liba52/libdca sources with libavresample + * + * 2) remapping from libav order to aac/vorbis order + * - this allows encoding audio without libavcodec (faac, ca_aac, libvorbis) + * + * Thus we only need to support: + * + * a) channels found in liba52/libdca layouts + * b) channels found in HB_AMIXDOWN_* layouts + * + * Notes: + * + * Left/Right Surround -> Side Left/Right + * Left/Right Rear Surround -> Back Left/Right */ + +#ifndef AUDIO_REMAP_H +#define AUDIO_REMAP_H + +#include + +// we only need to support the 11 "most common" channels +#define HB_AUDIO_REMAP_MAX_CHANNELS 11 + +typedef float hb_sample_t; + +typedef struct +{ + uint64_t channel_order[HB_AUDIO_REMAP_MAX_CHANNELS+1]; +} hb_chan_map_t; + +// used to convert between various channel orders +extern hb_chan_map_t hb_libav_chan_map; +extern hb_chan_map_t hb_liba52_chan_map; +extern hb_chan_map_t hb_libdca_chan_map; +extern hb_chan_map_t hb_vorbis_chan_map; +extern hb_chan_map_t hb_aac_chan_map; + +int* hb_audio_remap_build_table(uint64_t layout, hb_chan_map_t *map_in, hb_chan_map_t *map_out); +void hb_audio_remap(int nchannels, int nsamples, hb_sample_t *samples, int *remap_table); + +#endif /* AUDIO_REMAP_H */ -- cgit v1.2.3