FFmpeg
Loading...
Searching...
No Matches
dirac_dwt.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2010 Michael Niedermayer <michaelni@gmx.at>
3 * Copyright (C) 2008 David Conrad
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
23#include "libavutil/common.h"
24#include "libavutil/log.h"
25#include "dirac_dwt.h"
26
27#define TEMPLATE_8bit
28#include "dirac_dwt_template.c"
29
30#define TEMPLATE_10bit
31#include "dirac_dwt_template.c"
32
33#define TEMPLATE_12bit
34#include "dirac_dwt_template.c"
35
37 int decomposition_count, int bit_depth)
38{
39 int ret = 0;
40
41 d->buffer = p->buf;
42 d->width = p->width;
43 d->height = p->height;
44 d->stride = p->stride;
45 d->temp = p->tmp;
46 d->decomposition_count = decomposition_count;
47
48 if (bit_depth == 8)
49 ret = spatial_idwt_init_8bit(d, type);
50 else if (bit_depth == 10)
51 ret = spatial_idwt_init_10bit(d, type);
52 else if (bit_depth == 12)
53 ret = spatial_idwt_init_12bit(d, type);
54 else
55 av_log(NULL, AV_LOG_WARNING, "Unsupported bit depth = %i\n", bit_depth);
56
57 if (ret) {
58 av_log(NULL, AV_LOG_ERROR, "Unknown wavelet type %d\n", type);
60 }
61
62#if ARCH_X86 && HAVE_X86ASM
63 if (bit_depth == 8)
65#endif
66 return 0;
67}
68
70{
71 int level, support = d->support;
72
73 for (level = d->decomposition_count-1; level >= 0; level--) {
74 int wl = d->width >> level;
75 int hl = d->height >> level;
76 ptrdiff_t stride_l = d->stride << level;
77
78 while (d->cs[level].y <= FFMIN((y>>level)+support, hl))
79 d->spatial_compose(d, level, wl, hl, stride_l);
80 }
81}
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
Definition af_astats.c:246
common internal and external API header
#define NULL
Definition coverity.c:32
void ff_spatial_idwt_slice2(DWTContext *d, int y)
Definition dirac_dwt.c:69
int ff_spatial_idwt_init(DWTContext *d, DWTPlane *p, enum dwt_type type, int decomposition_count, int bit_depth)
Definition dirac_dwt.c:36
dwt_type
Definition dirac_dwt.h:78
void ff_spatial_idwt_init_x86(DWTContext *d, enum dwt_type type)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
cl_device_type type
Macro definitions for various function/variable attributes.
#define FFMIN(a, b)
Definition macros.h:49
DWTCompose cs[MAX_DECOMPOSITIONS]
Definition dirac_dwt.h:75
int support
Definition dirac_dwt.h:62
ptrdiff_t stride
Definition dirac_dwt.h:60
uint8_t * buffer
Definition dirac_dwt.h:56
int decomposition_count
Definition dirac_dwt.h:61
void(* spatial_compose)(struct DWTContext *cs, int level, int width, int height, ptrdiff_t stride)
Definition dirac_dwt.h:64
uint8_t * temp
Definition dirac_dwt.h:57
uint8_t level
Definition svq3.c:208
#define av_log(a,...)