2013-04-22 09:41:01 +00:00
|
|
|
/*
|
|
|
|
* Discrete wavelet transform
|
|
|
|
* Copyright (c) 2007 Kamil Nowosad
|
|
|
|
*
|
2013-04-22 17:41:31 +00:00
|
|
|
* This file is part of FFmpeg.
|
2013-04-22 09:41:01 +00:00
|
|
|
*
|
2013-04-22 17:41:31 +00:00
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2013-04-22 09:41:01 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2013-04-22 17:41:31 +00:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2013-04-22 09:41:01 +00:00
|
|
|
* 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
|
2013-04-22 17:41:31 +00:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2013-04-22 09:41:01 +00:00
|
|
|
* 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,
|
2014-10-02 01:33:02 +00:00
|
|
|
FF_DWT97_INT,
|
|
|
|
FF_DWT_NB
|
2013-04-22 09:41:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2013-05-28 07:35:56 +00:00
|
|
|
int ff_dwt_encode(DWTContext *s, void *t);
|
2013-04-22 09:41:01 +00:00
|
|
|
int ff_dwt_decode(DWTContext *s, void *t);
|
|
|
|
|
|
|
|
void ff_dwt_destroy(DWTContext *s);
|
|
|
|
|
|
|
|
#endif /* AVCODEC_JPEG2000DWT_H */
|