summaryrefslogtreecommitdiffstats
path: root/libhb/audio_remap.h
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-07-11 20:10:20 +0000
committerjstebbins <[email protected]>2012-07-11 20:10:20 +0000
commit8b91bcb733913afea795cfea6178372eee5b4abe (patch)
tree09b4bd5693f2c361861d803522d2340b6beab985 /libhb/audio_remap.h
parent7f1f338df87f6075e7edf0cd598523acaf0f82a1 (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/audio_remap.h')
-rw-r--r--libhb/audio_remap.h53
1 files changed, 53 insertions, 0 deletions
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: <http://handbrake.fr/>
+ * 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 <stdint.h>
+
+// 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 */