summaryrefslogtreecommitdiff
path: root/libavcodec/mlp.h
diff options
context:
space:
mode:
authorJai Luthra <me@jailuthra.in>2016-08-30 15:53:02 +0530
committerRostislav Pehlivanov <atomnuker@gmail.com>2016-09-17 13:23:56 +0100
commit15b86f480a9c748aeeafb42a877ee755c64f90f2 (patch)
tree140112c91214179d0f8dde574193137d06988424 /libavcodec/mlp.h
parentee88dcb2b0fefb42b0761ddb105c71daf604d791 (diff)
mlpenc: Working MLP/TrueHD encoder
* Multichannel support for TrueHD is experimental There should be downmix substreams present for 2+ channel bitstreams, but ffmpeg decoder doesn't need it. Will add support for this soon. * There might be lossless check failures on LFE channels * 32-bit sample support has been removed for now, will add it later While testing, some samples gave lossless check failures when enforcing s32. Probably this will also get solved with the LFE issues. Signed-off-by: Jai Luthra <me@jailuthra.in>
Diffstat (limited to 'libavcodec/mlp.h')
-rw-r--r--libavcodec/mlp.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/libavcodec/mlp.h b/libavcodec/mlp.h
index 05d8dbaa61..41a45a30d8 100644
--- a/libavcodec/mlp.h
+++ b/libavcodec/mlp.h
@@ -76,6 +76,9 @@ typedef struct FilterParams {
uint8_t shift; ///< Right shift to apply to output of filter.
int32_t state[MAX_FIR_ORDER];
+
+ int coeff_bits;
+ int coeff_shift;
} FilterParams;
/** sample data coding information */
@@ -96,6 +99,43 @@ typedef struct ChannelParams {
*/
extern const uint8_t ff_mlp_huffman_tables[3][18][2];
+typedef struct {
+ uint8_t channel_occupancy;
+ uint8_t group1_channels;
+ uint8_t group2_channels;
+ uint8_t summary_info;
+} ChannelInformation;
+
+/** Tables defining channel information.
+ *
+ * Possible channel arrangements are:
+ *
+ * (Group 1) C
+ * (Group 1) L, R
+ * (Group 1) Lf, Rf / (Group 2) S
+ * (Group 1) Lf, Rf / (Group 2) Ls, Rs
+ * (Group 1) Lf, Rf / (Group 2) LFE
+ * (Group 1) Lf, Rf / (Group 2) LFE, S
+ * (Group 1) Lf, Rf / (Group 2) LFE, Ls, Rs
+ * (Group 1) Lf, Rf / (Group 2) C
+ * (Group 1) Lf, Rf / (Group 2) C, S
+ * (Group 1) Lf, Rf / (Group 2) C, Ls, Rs
+ * (Group 1) Lf, Rf / (Group 2) C, LFE
+ * (Group 1) Lf, Rf / (Group 2) C, LFE, S
+ * (Group 1) Lf, Rf / (Group 2) C, LFE, Ls, Rs
+ * (Group 1) Lf, Rf C / (Group 2) S
+ * (Group 1) Lf, Rf C / (Group 2) Ls, Rs
+ * (Group 1) Lf, Rf C / (Group 2) LFE
+ * (Group 1) Lf, Rf C / (Group 2) LFE, S
+ * (Group 1) Lf, Rf C / (Group 2) LFE, Ls, Rs
+ * (Group 1) Lf, Rf Ls Rs / (Group 2) LFE
+ * (Group 1) Lf, Rf Ls Rs / (Group 2) C
+ * (Group 1) Lf, Rf, Ls, Rs / (Group 2) C, LFE
+ */
+extern const ChannelInformation ff_mlp_ch_info[21];
+
+extern const uint64_t ff_mlp_channel_layouts[12];
+
/** MLP uses checksums that seem to be based on the standard CRC algorithm, but
* are not (in implementation terms, the table lookup and XOR are reversed).
* We can implement this behavior using a standard av_crc on all but the