E4: l'analisi non dice più «Fermo» di ciò che non ha visto
Filmati ripetuti, video tagliati o rovinati, neve e scritte piccole risultavano fermi; una scheda bianca in dissolvenza in movimento; una scritta sul nero «tutto nero». Istanti a punti diversi, griglia fitta, bianco bruciato per canale, fotogrammi mancanti e un solo fotogramma chiaro trattati a parte, errori del disco rilanciati. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
19119064f0
commit
9277e0a18c
6 files changed
+1008
-210
No files matched your search
@@ -41,6 +41,53 @@ internal static class PcmVideos
|
||||
public static byte[] Mp4(int count, Func<int, H264PcmPicture> picture, int rotation = 0, bool audio = false) =>
|
||||
TestVideos.Mp4(Stream("pcm", count, picture), rotation: rotation, audio: audio);
|
||||
|
||||
/// <summary>
|
||||
/// An MP4 of <paramref name="count"/> pictures of <paramref name="width"/> × <paramref name="height"/> (multiples of
|
||||
/// 16), one a second: for what depends on the size of the picture.
|
||||
/// </summary>
|
||||
public static byte[] Large(int width, int height, int count, Func<int, H264PcmPicture> picture)
|
||||
{
|
||||
using var output = new MemoryStream();
|
||||
H264PcmWriter.WriteMp4(output, width, height, count, 1, picture);
|
||||
return output.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>A grey picture of any size (multiples of 16) whose luma at (x, y) is given, clamped to 16–235.</summary>
|
||||
public static H264PcmPicture Grey(int width, int height, Func<int, int, double> luma)
|
||||
{
|
||||
var p = new H264PcmPicture(width, height);
|
||||
for (var y = 0; y < height; y++)
|
||||
{
|
||||
for (var x = 0; x < width; x++)
|
||||
{
|
||||
p.Y[(y * width) + x] = Luma((int)Math.Round(luma(x, y)));
|
||||
}
|
||||
}
|
||||
|
||||
Array.Fill(p.Cb, (byte)128);
|
||||
Array.Fill(p.Cr, (byte)128);
|
||||
return p;
|
||||
}
|
||||
|
||||
/// <summary>A poster: one colour, and a photo on the bottom <paramref name="share"/> of it.</summary>
|
||||
public static H264PcmPicture Poster(byte luma, byte cb, byte cr, double share)
|
||||
{
|
||||
var p = Flat(luma, cb, cr);
|
||||
var photo = Photo(4);
|
||||
var top = Height - ((int)(Height * share) / 2 * 2);
|
||||
for (var i = top * Width; i < p.Y.Length; i++)
|
||||
{
|
||||
p.Y[i] = (byte)(photo.Y[i] * 0.8);
|
||||
}
|
||||
|
||||
for (var i = top / 2 * (Width / 2); i < p.Cb.Length; i++)
|
||||
{
|
||||
(p.Cb[i], p.Cr[i]) = (photo.Cb[i], photo.Cr[i]);
|
||||
}
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A photo-like picture: a diagonal gradient, a few coloured shapes and a fine texture (so it has detail to be sharp
|
||||
/// with). Luma 16–235, chroma 16–240.
|
||||
|
||||
Reference in new issue
Block a user