various: implement sequence pixel aspect ratios and interlacing settings
Implements the following: - Sequences have pixel aspect ratios that work in tandem with footage PARs to render footage correctly. Viewer and export also acknowledge PARs - Sequences can have interlacing settings. This doesn't do anything yet, eventually the renderer will need to interlace/deinterlace/reinterlace appropriately in order to conform all the footage to the sequence. Export acknowledges interlacing, but this only affects metadata, not the image.
This commit is contained in:
@@ -118,16 +118,14 @@ bool OIIODecoder::Probe(Footage *f, const QAtomicInt *cancelled)
|
||||
image_stream->set_width(in->spec().width);
|
||||
image_stream->set_height(in->spec().height);
|
||||
image_stream->set_format(GetFormatFromOIIOBasetype(in->spec()));
|
||||
|
||||
// FIXME: Haven't looked, does OIIO report pixel aspect ratio somewhere?
|
||||
image_stream->set_pixel_aspect_ratio(1);
|
||||
image_stream->set_pixel_aspect_ratio(GetPixelAspectRatioFromOIIO(in->spec()));
|
||||
|
||||
// Images will always have just one stream
|
||||
image_stream->set_index(0);
|
||||
|
||||
// OIIO automatically premultiplies alpha
|
||||
// FIXME: We usually disassociate the alpha for the color management later, for 8-bit images this likely reduces the
|
||||
// fidelity?
|
||||
// FIXME: We usually disassociate the alpha for the color management later, for 8-bit images this
|
||||
// likely reduces the fidelity?
|
||||
image_stream->set_premultiplied_alpha(true);
|
||||
|
||||
// Get stats for this image and dump them into the Footage file
|
||||
@@ -181,6 +179,8 @@ FramePtr OIIODecoder::RetrieveVideo(const rational &timecode, const int& divider
|
||||
frame->set_video_params(VideoParams(buffer_->spec().width,
|
||||
buffer_->spec().height,
|
||||
pix_fmt_,
|
||||
GetPixelAspectRatioFromOIIO(buffer_->spec()),
|
||||
VideoParams::kInterlaceNone, // FIXME: Does OIIO deinterlace for us?
|
||||
divider));
|
||||
frame->allocate();
|
||||
|
||||
@@ -294,6 +294,11 @@ PixelFormat::Format OIIODecoder::GetFormatFromOIIOBasetype(const OIIO::ImageSpec
|
||||
}
|
||||
}
|
||||
|
||||
rational OIIODecoder::GetPixelAspectRatioFromOIIO(const OpenImageIO_v2_1::ImageSpec &spec)
|
||||
{
|
||||
return rational::fromDouble(spec.extra_attribs.get_float("PixelAspectRatio", 1));
|
||||
}
|
||||
|
||||
bool OIIODecoder::FileTypeIsSupported(const QString& fn)
|
||||
{
|
||||
// We prioritize OIIO over FFmpeg to pick up still images more effectively, but some OIIO decoders (notably OpenJPEG)
|
||||
|
||||
Reference in New Issue
Block a user