62 #define OFFSET(x) offsetof(MPTestContext, x)
63 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
94 for (i = 0; i < 8; i++) {
95 double s = i == 0 ? sqrt(0.125) : 0.5;
97 for (j = 0; j < 8; j++)
98 c[i*8+j] = s*cos((
M_PI/8.0)*i*(j+0.5));
107 for (i = 0; i < 8; i++) {
108 for (j = 0; j < 8; j++) {
111 for (k = 0; k < 8; k++)
112 sum +=
c[k*8+j] * src[8*i+k];
118 for (j = 0; j < 8; j++) {
119 for (i = 0; i < 8; i++) {
122 for (k = 0; k < 8; k++)
123 sum +=
c[k*8+i]*tmp[8*k+j];
125 dst[dst_linesize*i + j] = av_clip((
int)floor(sum+0.5), 0, 255);
134 for (y = 0; y < h; y++)
135 for (x = 0; x < w; x++)
136 dst[x + y*dst_linesize] = color;
143 memset(src, 0, 64*
sizeof(
int));
147 idct(dst, dst_linesize, src);
152 if (cbp&1)
draw_basis(dst[0] , dst_linesize[0], amp, 1, dc);
153 if (cbp&2)
draw_basis(dst[0]+8 , dst_linesize[0], amp, 1, dc);
154 if (cbp&4)
draw_basis(dst[0]+ 8*dst_linesize[0], dst_linesize[0], amp, 1, dc);
155 if (cbp&8)
draw_basis(dst[0]+8+8*dst_linesize[0], dst_linesize[0], amp, 1, dc);
156 if (cbp&16)
draw_basis(dst[1] , dst_linesize[1], amp, 1, dc);
157 if (cbp&32)
draw_basis(dst[2] , dst_linesize[2], amp, 1, dc);
162 const int step =
FFMAX(256/(w*h/256), 1);
165 for (y = 0; y < h; y += 16) {
166 for (x = 0; x < w; x += 16) {
167 draw_dc(dst + x + y*dst_linesize, dst_linesize, color, 8, 8);
177 for (y = 0; y < 8*16; y += 16) {
178 for (x = 0; x < 8*16; x += 16) {
179 draw_basis(dst + x + y*dst_linesize, dst_linesize, 4*(96+off), freq, 128*8);
189 for (y = 0; y < 16*16; y += 16) {
190 for (x = 0; x < 16*16; x += 16) {
191 draw_basis(dst + x + y*dst_linesize, dst_linesize, 4*amp, 1, 128*8);
201 for (y = 0; y < 16*8; y += 16) {
202 for (x = 0; x < 16*8; x += 16) {
204 dst1[0] = dst[0] + x*2 + y*2*dst_linesize[0];
205 dst1[1] = dst[1] + x + y* dst_linesize[1];
206 dst1[2] = dst[2] + x + y* dst_linesize[2];
208 draw_cbp(dst1, dst_linesize, cbp, (64+off)*4, 128*8);
218 for (y = 0; y < 16*16; y++) {
221 for (x = 0; x < 16*16; x++)
222 dst[x + y*dst_linesize] = x + off*8/(y/32+1);
230 for (y = off; y < 16*16; y += 16) {
231 for (x = off; x < 16*16; x += 16) {
232 draw_dc(dst + x + y*dst_linesize, dst_linesize, ((x+y)&16) ? color : -color, 16, 16);
242 for (y = 0; y < 16*16; y++) {
243 for (x = 0; x < 16*16; x++) {
244 double d = sqrt((x-8*16)*(x-8*16) + (y-8*16)*(y-8*16));
245 double r = d/20 - (int)(d/20);
247 dst[x + y*dst_linesize] = 255;
248 dst[x + y*dst_linesize+256] = 0;
250 dst[x + y*dst_linesize] = x;
251 dst[x + y*dst_linesize+256] = x;
315 picref->
pts = test->
pts++;
318 for (i = 0; i < h; i++)
320 for (i = 0; i < ch; i++) {
321 memset(picref->
data[1] + i*picref->
linesize[1], 128, cw);
322 memset(picref->
data[2] + i*picref->
linesize[2], 128, cw);
365 .priv_class = &mptestsrc_class,