[x265] [PATCH] SEI: fix bug in picture timing SEI when interlace encoding is enabled

kavitha at multicorewareinc.com kavitha at multicorewareinc.com
Tue May 27 19:55:00 CEST 2014


# HG changeset patch
# User Kavitha Sampath <kavitha at multicorewareinc.com>
# Date 1401213141 -19800
#      Tue May 27 23:22:21 2014 +0530
# Node ID 57454e3c3ac820813081806a116066d361f7f26c
# Parent  af78d190e57bf4ff3e14cb58b738a4adee8eb2cf
SEI: fix bug in picture timing SEI when interlace encoding is enabled

When the interlace mode is 1(top field first), the picstruct is 2(bottom field)
for all frames. But the picStruct for frames in display order should be
1(top field), 2(bottom field), 1, 2,..etc

diff -r af78d190e57b -r 57454e3c3ac8 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Sun May 25 12:38:03 2014 +0900
+++ b/source/encoder/frameencoder.cpp	Tue May 27 23:22:21 2014 +0530
@@ -573,7 +573,14 @@
         OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);
 
         SEIPictureTiming sei;
-        sei.m_picStruct = (slice->getPOC() & 1) && m_cfg->param->interlaceMode == 2 ? 1 /* top */ : 2 /* bot */;
+        if (m_cfg->param->interlaceMode == 2)
+        {
+            sei.m_picStruct = (slice->getPOC() & 1) ? 1 /* top */ : 2 /* bottom */;
+        }
+        else
+        {
+            sei.m_picStruct = (slice->getPOC() & 1) ? 2 /* bottom */ : 1 /* top */;
+        }
         sei.m_sourceScanType = 0;
         sei.m_duplicateFlag = 0;
 


More information about the x265-devel mailing list