A lax or tolerant decoder may support an End Sequence between fields of the same
frame but the spec. says this is not allowed.

2012 spec. 10.3.2, 2017 spec. 10.4.3:
Where pictures are fields, a sequence shall comprise a whole number of
frames (i.e., an even number of fields) and shall begin and end with a
whole frame/field-pair.
---
 libavcodec/vc2enc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index b7adcd3d36..9a5a4765c8 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -988,7 +988,13 @@ static int encode_frame(VC2EncContext *s, AVPacket *avpkt, 
const AVFrame *frame,
     encode_slices(s);
 
     /* End sequence */
-    encode_parse_info(s, DIRAC_PCODE_END_SEQ);
+    /* 2012 spec. 10.3.2, 2017 spec. 10.4.3:
+     * Where pictures are fields, a sequence shall comprise a whole number of
+     * frames (i.e., an even number of fields) and shall begin and end with a
+     * whole frame/field-pair. */
+    if (field != 1) {
+        encode_parse_info(s, DIRAC_PCODE_END_SEQ);
+    }
 
     return 0;
 }
-- 
2.16.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to