63 #define OFFSET(x) offsetof(MPTestContext, x)
64 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
96 for (i = 0; i < 8; i++) {
97 double s = i == 0 ? sqrt(0.125) : 0.5;
99 for (j = 0; j < 8; j++)
100 c[i*8+j] = s*cos((
M_PI/8.0)*i*(j+0.5));
109 for (i = 0; i < 8; i++) {
110 for (j = 0; j < 8; j++) {
113 for (k = 0; k < 8; k++)
114 sum +=
c[k*8+j] * src[8*i+k];
120 for (j = 0; j < 8; j++) {
121 for (i = 0; i < 8; i++) {
124 for (k = 0; k < 8; k++)
125 sum +=
c[k*8+i]*tmp[8*k+j];
127 dst[dst_linesize*i + j] = av_clip((
int)floor(sum+0.5), 0, 255);
136 for (y = 0; y < h; y++)
137 for (x = 0; x < w; x++)
138 dst[x + y*dst_linesize] = color;
145 memset(src, 0, 64*
sizeof(
int));
149 idct(dst, dst_linesize, src);
154 if (cbp&1)
draw_basis(dst[0] , dst_linesize[0], amp, 1, dc);
155 if (cbp&2)
draw_basis(dst[0]+8 , dst_linesize[0], amp, 1, dc);
156 if (cbp&4)
draw_basis(dst[0]+ 8*dst_linesize[0], dst_linesize[0], amp, 1, dc);
157 if (cbp&8)
draw_basis(dst[0]+8+8*dst_linesize[0], dst_linesize[0], amp, 1, dc);
158 if (cbp&16)
draw_basis(dst[1] , dst_linesize[1], amp, 1, dc);
159 if (cbp&32)
draw_basis(dst[2] , dst_linesize[2], amp, 1, dc);
164 const int step =
FFMAX(256/(w*h/256), 1);
167 for (y = 0; y < h; y += 16) {
168 for (x = 0; x < w; x += 16) {
169 draw_dc(dst + x + y*dst_linesize, dst_linesize, color, 8, 8);
179 for (y = 0; y < 8*16; y += 16) {
180 for (x = 0; x < 8*16; x += 16) {
181 draw_basis(dst + x + y*dst_linesize, dst_linesize, 4*(96+off), freq, 128*8);
191 for (y = 0; y < 16*16; y += 16) {
192 for (x = 0; x < 16*16; x += 16) {
193 draw_basis(dst + x + y*dst_linesize, dst_linesize, 4*amp, 1, 128*8);
203 for (y = 0; y < 16*8; y += 16) {
204 for (x = 0; x < 16*8; x += 16) {
206 dst1[0] = dst[0] + x*2 + y*2*dst_linesize[0];
207 dst1[1] = dst[1] + x + y* dst_linesize[1];
208 dst1[2] = dst[2] + x + y* dst_linesize[2];
210 draw_cbp(dst1, dst_linesize, cbp, (64+off)*4, 128*8);
220 for (y = 0; y < 16*16; y++) {
223 for (x = 0; x < 16*16; x++)
224 dst[x + y*dst_linesize] = x + off*8/(y/32+1);
232 for (y = off; y < 16*16; y += 16) {
233 for (x = off; x < 16*16; x += 16) {
234 draw_dc(dst + x + y*dst_linesize, dst_linesize, ((x+y)&16) ? color : -color, 16, 16);
244 for (y = 0; y < 16*16; y++) {
245 for (x = 0; x < 16*16; x++) {
246 double d = sqrt((x-8*16)*(x-8*16) + (y-8*16)*(y-8*16));
247 double r = d/20 - (int)(d/20);
249 dst[x + y*dst_linesize] = 255;
250 dst[x + y*dst_linesize+256] = 0;
252 dst[x + y*dst_linesize] = x;
253 dst[x + y*dst_linesize+256] = x;
266 test->
class = &mptestsrc_class;
284 test->
max_pts = duration >= 0 ?
290 frame_rate_q.
num, frame_rate_q.
den,
334 picref->
pts = test->
pts++;
383 .priv_class = &mptestsrc_class,