summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000dwt.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-22 19:41:31 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-22 20:00:54 +0200
commite2e9bee2daef9d5d5169f5360737eec8b76d7e0c (patch)
tree22ba6e50d34a036832d4ef8f903df335d3c9d63a /libavcodec/jpeg2000dwt.h
parentc1c2b0b3390482bba39534f2f125d97e8964d7d5 (diff)
parentf13888afcc5e528b80e4ae5bc4f0d9dadc76f6aa (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: avcodec: Bump minor for JPEG 2000 decoder JPEG 2000 decoder for DCinema The mqc code is merged, the rest is added independent of the existing jpeg2000 decoder and encoder. Conflicts: Changelog doc/general.texi libavcodec/Makefile libavcodec/allcodecs.c libavcodec/mqc.c libavcodec/mqc.h libavcodec/mqcdec.c libavcodec/version.h tests/fate/video.mak Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000dwt.h')
-rw-r--r--libavcodec/jpeg2000dwt.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/libavcodec/jpeg2000dwt.h b/libavcodec/jpeg2000dwt.h
new file mode 100644
index 0000000000..2abfd15d64
--- /dev/null
+++ b/libavcodec/jpeg2000dwt.h
@@ -0,0 +1,64 @@
+/*
+ * Discrete wavelet transform
+ * Copyright (c) 2007 Kamil Nowosad
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_JPEG2000DWT_H
+#define AVCODEC_JPEG2000DWT_H
+
+/**
+ * @file
+ * Discrete wavelet transform
+ */
+
+#include <stdint.h>
+
+#define FF_DWT_MAX_DECLVLS 32 ///< max number of decomposition levels
+
+enum DWTType {
+ FF_DWT97,
+ FF_DWT53,
+ FF_DWT97_INT
+};
+
+typedef struct DWTContext {
+ /// line lengths { horizontal, vertical } in consecutive decomposition levels
+ uint16_t linelen[FF_DWT_MAX_DECLVLS][2];
+ uint8_t mod[FF_DWT_MAX_DECLVLS][2]; ///< coordinates (x0, y0) of decomp. levels mod 2
+ uint8_t ndeclevels; ///< number of decomposition levels
+ uint8_t type; ///< 0 for 9/7; 1 for 5/3
+ int32_t *i_linebuf; ///< int buffer used by transform
+ float *f_linebuf; ///< float buffer used by transform
+} DWTContext;
+
+/**
+ * Initialize DWT.
+ * @param s DWT context
+ * @param border coordinates of transformed region {{x0, x1}, {y0, y1}}
+ * @param decomp_levels number of decomposition levels
+ * @param type 0 for DWT 9/7; 1 for DWT 5/3
+ */
+int ff_jpeg2000_dwt_init(DWTContext *s, uint16_t border[2][2],
+ int decomp_levels, int type);
+
+int ff_dwt_decode(DWTContext *s, void *t);
+
+void ff_dwt_destroy(DWTContext *s);
+
+#endif /* AVCODEC_JPEG2000DWT_H */