Go to the documentation of this file.
41 fprintf(stderr,
"ff_jpeg2000_dwt_init failed\n");
46 fprintf(stderr,
"ff_dwt_encode failed\n");
51 for (j = 0; j<
s->linelen[decomp_levels-1][0] *
s->linelen[decomp_levels-1][1]; j++)
56 fprintf(stderr,
"ff_dwt_encode failed\n");
61 fprintf(stderr,
"missmatch at %d (%d != %d) decomp:%d border %d %d %d %d\n",
62 j,
array[j],
ref[j],decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1]);
70 printf(
"%s, decomp:%2d border %3d %3d %3d %3d milli-err2:%9"PRId64
"\n",
72 decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1],
73 1000*err2 / ((border[0][1] - border[0][0])*(border[1][1] - border[1][0])));
78 static int test_dwtf(
float *
array,
float *
ref,
int border[2][2],
int decomp_levels,
float max_diff) {
85 fprintf(stderr,
"ff_jpeg2000_dwt_init failed\n");
90 fprintf(stderr,
"ff_dwt_encode failed\n");
95 fprintf(stderr,
"ff_dwt_encode failed\n");
100 fprintf(stderr,
"missmatch at %d (%f != %f) decomp:%d border %d %d %d %d\n",
101 j,
array[j],
ref[j],decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1]);
109 printf(
"9/7f, decomp:%2d border %3d %3d %3d %3d err2:%20.3f\n",
110 decomp_levels, border[0][0], border[0][1], border[1][0], border[1][1],
111 err2 / ((border[0][1] - border[0][0])*(border[1][1] - border[1][0])));
125 int ret, decomp_levels;
132 for (
i = 0;
i < 100;
i++) {
135 if (border[0][0] >= border[0][1] || border[1][0] >= border[1][1])
int ff_dwt_decode(DWTContext *s, void *t)
av_cold void av_lfg_init(AVLFG *c, unsigned int seed)
int ff_dwt_encode(DWTContext *s, void *t)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
static float reff[MAX_W *MAX_W]
static float arrayf[MAX_W *MAX_W]
static unsigned int av_lfg_get(AVLFG *c)
Get the next random unsigned 32-bit number using an ALFG.
static int test_dwtf(float *array, float *ref, int border[2][2], int decomp_levels, float max_diff)
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static int test_dwt(int *array, int *ref, int border[2][2], int decomp_levels, int type, int max_diff)
int ff_jpeg2000_dwt_init(DWTContext *s, int border[2][2], int decomp_levels, int type)
Initialize DWT.
Context structure for the Lagged Fibonacci PRNG.
void ff_dwt_destroy(DWTContext *s)
printf("static const uint8_t my_array[100] = {\n")
#define i(width, name, range_min, range_max)
#define FF_DWT_MAX_DECLVLS
max number of decomposition levels
static int array[MAX_W *MAX_W]
static int ref[MAX_W *MAX_W]