Hallo,
ich habe mal folgendenden Generator geschrieben. Verwendet beliebig grossen Bildspeicher im PAL-YUV-Format, und liefert f=FCr beliebige Zeitpunkte t dann die=20 Ausgangsspannung pal_out(t). Ich hoffe, die ist nicht allzuweit=20 vom realen Standard entfernt.
Gruss
Jan bruns
CONST framespersec =3D 25; linecount =3D 625; linefreq =3D framespersec*linecount; // =3D 15625
blanking_level =3D 0; black_level =3D blanking_level + 0; white_level =3D 100; sync_level =3D -43; burst_peakpeak =3D (white_level-blanking_level)*3/7;
pixelstart =3D 12/64; //horizontal sichtbarer Bereich pixelend =3D 64/64; hsyncstart =3D 1.5/64; hsyncend =3D hsyncstart + 4.7/64; burststart =3D hsyncstart + 5.6/64;=20 burstend =3D burststart + 2.25/64;=20
vsynclen =3D 25 + 12/64; // vsync umfasst einige blank-Zeilen eq_pulselen =3D 2.35/64; sncpulselen =3D 27.3/64;
feld2 =3D 311; feld3 =3D 623.5; feld4 =3D 311 +625; feld1 =3D 623.5+625;
cfreq =3D ( 1135/4 + 1/625 ) * linefreq; // 4.43 MHz
burst_U =3D cos(135/180*pi); burst_V =3D sin(135/180*pi);
pixelperline =3D 100; //bedeutungslos
VAR Pixel_Y, Pixel_U, Pixel_V : ARRAY[1..linecount,0..pixelperline-1] of real;
FUNCTION get_line_from_time(t : real) : integer; // bezogen auf Vollbild BEGIN get_line_from_time :=3D 1 + floor(t*linefreq) MOD (2*linecount); END;
FUNCTION get_fractional_line(t : real) : real; // x-Position in Zeile BEGIN get_fractional_line :=3D frac(t*linefreq); END;
FUNCTION chroma(u,v,t : real) : real; BEGIN chroma :=3D u*sin(2*PI*cfreq*t) + v*cos(2*PI*cfreq*t) END;
FUNCTION composite(y,u,v,t : real) : real; BEGIN composite :=3D y + chroma(u,v,t); END;
FUNCTION scaled_composite(y,u,v,t : real) : real; BEGIN scaled_composite :=3D black_level + composite(y,u,v,t) * (white_level - black_level); END;
FUNCTION no_burst(l : integer) : boolean; BEGIN case l of 1248,1249,1250, 1,2,3, 4,5,6, 310,311,312, 313,314,315, 316,317,318, 622,623,624, 625,626,627, 628,629,630, 936,937,938, 939,940,941, 942,943,944 : no_burst :=3D true; else no_burst :=3D false; end; END;
FUNCTION burst_sign(l : integer) : integer; BEGIN if (l MOD 2) =3D 1 then burst_sign :=3D 1 else burst_sign :=3D -1; END;
FUNCTION burstval(t : real) : real; BEGIN burstval :=3D (burst_peakpeak/2) * = chroma(burst_U,burst_sign(get_line_from_time(t))*burst_V,t); END;
FUNCTION burst(t : real) : real; BEGIN if (no_burst(get_line_from_time(t)) ) or (get_fractional_line(t)burstend ) then burst :=3D blanking_level=20 else burst :=3D burstval(t) + blanking_level; END;
FUNCTION pixelval(t : real) : real; VAR q : real; p,l,pl : integer; BEGIN q :=3D get_fractional_line(t); if (q>=3Dpixelstart)and(q=3Dpixelperline then p :=3D pixelperline;
l :=3D get_line_from_time(t) - 1; l :=3D l MOD linecount; pl :=3D (l MOD 314) * 2 + 1; if l>=3D314 then pl +=3D 1;
pixelval :=3D scaled_composite( pixel_Y[pl][p], pixel_U[pl][p], pixel_V[pl][p] * burst_sign(l+1), //PAL t ); end else pixelval :=3D blanking_level; END;
FUNCTION hsyncval(t : real) : real; BEGIN if (get_fractional_line(t) > hsyncstart) and (get_fractional_line(t) < hsyncend ) then hsyncval :=3D sync_level else hsyncval :=3D blanking_level; END;
FUNCTION pal_out(t : real) : real; VAR q,q2 : real; BEGIN pal_out :=3D blanking_level; q :=3D get_fractional_line(t) + get_line_from_time(t); q2 :=3D -1; if (q=3Dfeld2)AND((q-vsynclen)=3Dfeld3)AND((q-vsynclen)=3Dfeld4)AND((q-vsynclen)=3Dfeld1) then q2 :=3D q-feld1; if q2>=3D0 then begin // *********vsync*******************
if (q2=3D5)AND(q2