summaryrefslogtreecommitdiffstats
path: root/libhb/audio_resample.h
diff options
context:
space:
mode:
authorRodeo <[email protected]>2012-08-02 21:43:22 +0000
committerRodeo <[email protected]>2012-08-02 21:43:22 +0000
commitb3717d369763d620d548f224daeba5a7503fa972 (patch)
tree4742e9b49e03db2b1c558e10f40c2c821528e8f5 /libhb/audio_resample.h
parentad257c9dac38fe3f7502b1058247b4458465c0a8 (diff)
Use hb_audio_resample for downmixing AC3 sources. DRC is still applied by liba52.
Add support for center & surround mix levels to hb_audio_resample. This allows us to support upmixing all audio sources. For sources that have at least 2 front and one back or side channel(s), allow upmixing to 5.1: 3.0/3.1 (2 front and 1 back channels) 4.0/4.1 (3 front and 1 back channels) 4.0/4.1 (2 front and 2 side channels) 5.0 (3 front and 2 side channels) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4885 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/audio_resample.h')
-rw-r--r--libhb/audio_resample.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libhb/audio_resample.h b/libhb/audio_resample.h
index 4b1586e73..29a7f91d0 100644
--- a/libhb/audio_resample.h
+++ b/libhb/audio_resample.h
@@ -17,10 +17,14 @@
#ifndef AUDIO_RESAMPLE_H
#define AUDIO_RESAMPLE_H
+#include <math.h>
#include <stdint.h>
#include "libavutil/audioconvert.h"
#include "libavresample/avresample.h"
+/* Default mix level for center and surround channels */
+#define HB_MIXLEV_DEFAULT ((double)M_SQRT1_2)
+
typedef struct
{
int resample_needed;
@@ -31,6 +35,8 @@ typedef struct
int channels;
int linesize;
uint64_t channel_layout;
+ double center_mix_level;
+ double surround_mix_level;
enum AVSampleFormat sample_fmt;
} in;
@@ -46,7 +52,7 @@ typedef struct
} out;
} hb_audio_resample_t;
-/* Initialize an hb_audio_resample_t to convert audio to the requested
+/* Initialize an hb_audio_resample_t for converting audio to the requested
* sample_fmt and channel_layout, using the specified matrix_encoding.
*
* Input characteristics are set via hb_audio_resample_update().
@@ -65,6 +71,8 @@ hb_audio_resample_t* hb_audio_resample_init(enum AVSampleFormat output_sample_fm
int hb_audio_resample_update(hb_audio_resample_t *resample,
enum AVSampleFormat new_sample_fmt,
uint64_t new_channel_layout,
+ double new_surroundmixlev,
+ double new_centermixlev,
int new_channels);
/* Free an hb_audio_remsample_t. */