avviddec, video.c, h265parse: Workaround for broken field-based interlaced encoders
authorVivia Nikolaidou <vivia@ahiru.eu>
Wed, 8 Jun 2022 16:18:48 +0000 (19:18 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 16 Jun 2022 10:03:02 +0000 (10:03 +0000)
commitb90d02741e9053eae09eb4191a601a00d905c4ad
treeb878b5d53f17c7abb04637bbabd87f917844326d
parent936143599c66a439ae1bbfa085820ae8359fc614
avviddec, video.c, h265parse: Workaround for broken field-based interlaced encoders

Some encoders (e.g. Makito) have H265 field-based interlacing, but then
also specify an 1:2 pixel aspect ratio. That makes it kind-of work with
decoders that don't properly support field-based decoding, but makes us
end up with the wrong aspect ratio if we implement everything properly.
As a workaround, detect 1:2 pixel aspect ratio for field-based
interlacing, and check if making that 1:1 would make the new display
aspect ratio common. In that case, we override it with 1:1.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2577>
subprojects/gst-libav/ext/libav/gstavviddec.c
subprojects/gst-plugins-bad/gst/videoparsers/gsth265parse.c
subprojects/gst-plugins-base/gst-libs/gst/video/video.c
subprojects/gst-plugins-base/gst-libs/gst/video/video.h