summaryrefslogtreecommitdiffstats
path: root/libavcodec/speedhq.c
diff options
context:
space:
mode:
authorSteinar H. Gunderson <steinar+ffmpeg@gunderson.no>2017-08-03 09:22:57 +0200
committerJames Almer <jamrial@gmail.com>2017-08-03 16:36:02 -0300
commiteffd2e7291a12760891289540f944d71ff32a1c8 (patch)
tree204903136955af86cbe3fd06c4fe967015281970 /libavcodec/speedhq.c
parent4ff94558f23a5de43aed4ca3429963dd1d995250 (diff)
downloadffmpeg-streaming-effd2e7291a12760891289540f944d71ff32a1c8.zip
ffmpeg-streaming-effd2e7291a12760891289540f944d71ff32a1c8.tar.gz
speedhq: fix behavior of single-field decoding
The height convention for decoding frames with only a single field made sense for compatibility with legacy decoders, but doesn't really match the convention used by NDI, which is the primary (only?) user. Thus, change it to simply assuming that if the two fields overlap, the frame is meant to be a single field and the frame height matches the field height. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/speedhq.c')
-rw-r--r--libavcodec/speedhq.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
index 60efb02..47b1e4d 100644
--- a/libavcodec/speedhq.c
+++ b/libavcodec/speedhq.c
@@ -450,10 +450,13 @@ static int speedhq_decode_frame(AVCodecContext *avctx,
if (second_field_offset == 4) {
/*
* Overlapping first and second fields is used to signal
- * encoding only a single field (the second field then comes
- * as a separate, later frame).
+ * encoding only a single field. In this case, "height"
+ * is ambiguous; it could mean either the height of the
+ * frame as a whole, or of the field. The former would make
+ * more sense for compatibility with legacy decoders,
+ * but this matches the convention used in NDI, which is
+ * the primary user of this trick.
*/
- frame->height >>= 1;
if ((ret = decode_speedhq_field(s, buf, buf_size, frame, 0, 4, buf_size, 1)) < 0)
return ret;
} else {
OpenPOWER on IntegriCloud