6 #include <schroedinger/schro.h>
7 #include <schroedinger/schromotion.h>
8 #include <schroedinger/schrodebug.h>
9 #include <schroedinger/schroutils.h>
10 #include <schroedinger/schrooil.h>
15 #include <liboil/liboilrandom.h>
16 #include <liboil/liboil.h>
20 void upsample_line (uint8_t *dest
, int dstr
, uint8_t *src
, int sstr
, int n
);
21 void ref_h_upsample (SchroFrame
*dest
, SchroFrame
*src
);
22 void ref_v_upsample (SchroFrame
*dest
, SchroFrame
*src
);
24 void test (int width
, int height
);
31 main (int argc
, char *argv
[])
47 schro_upsampled_frame_get_subdata_prec1 (SchroUpsampledFrame
*upframe
,
48 int component
, int x
, int y
, SchroFrameData
*fd
);
50 void test (int width
, int height
)
53 SchroUpsampledFrame
*upframe
;
54 char name
[TEST_PATTERN_NAME_SIZE
];
55 SchroFrameData fd_ref
;
60 fd_ref
.data
= schro_malloc (16 * 16);
68 frame
= schro_frame_new_and_alloc_extended (NULL
, SCHRO_FRAME_FORMAT_U8_420
,
71 test_pattern_generate (frame
->components
+ 0, name
, 0);
72 test_pattern_generate (frame
->components
+ 1, name
, 0);
73 test_pattern_generate (frame
->components
+ 2, name
, 0);
75 schro_frame_mc_edgeextend (frame
);
77 upframe
= schro_upsampled_frame_new (schro_frame_ref(frame
));
78 schro_upsampled_frame_upsample (upframe
);
81 /* just the corners */
84 printf ("%d,%d\n", x
, y
);
86 schro_upsampled_frame_get_block_precN (upframe
, 0, x
, y
, 1, &fd_ref
);
87 schro_upsampled_frame_get_subdata_prec1 (upframe
, 0, x
, y
, &fd
);
88 frame_data_dump_full (&fd
, &fd_ref
, &fd_ref
);
92 for(y
=200-16;y
<200-16+2;y
++){
94 printf ("%d,%d\n", x
, y
);
96 schro_upsampled_frame_get_block_precN (upframe
, 0, x
, y
, 1, &fd_ref
);
97 schro_upsampled_frame_get_subdata_prec1 (upframe
, 0, x
, y
, &fd
);
98 frame_data_dump_full (&fd
, &fd_ref
, &fd_ref
);
103 for(x
=184;x
<186;x
++){
104 printf ("%d,%d\n", x
, y
);
106 schro_upsampled_frame_get_block_precN (upframe
, 0, x
, y
, 1, &fd_ref
);
107 schro_upsampled_frame_get_subdata_prec1 (upframe
, 0, x
, y
, &fd
);
108 frame_data_dump_full (&fd
, &fd_ref
, &fd_ref
);
112 for(y
=184;y
<186;y
++){
114 printf ("%d,%d\n", x
, y
);
116 schro_upsampled_frame_get_block_precN (upframe
, 0, x
, y
, 1, &fd_ref
);
117 schro_upsampled_frame_get_subdata_prec1 (upframe
, 0, x
, y
, &fd
);
118 frame_data_dump_full (&fd
, &fd_ref
, &fd_ref
);
123 for(y
=-32*2;y
<100+32*2-16*2;y
++) {
124 for(x
=-32*2;x
<100+32*2-16*2;x
++) {
125 schro_upsampled_frame_get_block_precN (upframe
, 0, x
, y
, 1, &fd_ref
);
126 schro_upsampled_frame_get_subdata_prec1 (upframe
, 0, x
, y
, &fd
);
127 ok
= frame_data_compare (&fd
, &fd_ref
);
128 if (dump_all
|| !ok
) {
129 printf ("%d,%d\n", x
, y
);
130 frame_data_dump_full (&fd
, &fd_ref
, &fd_ref
);
138 schro_frame_unref (frame
);