[x265] [PATCH] hrd: Add cli option to set concatenation flag in buffering period SEI

Aruna Matheswaran aruna at multicorewareinc.com
Mon Dec 10 11:00:15 CET 2018


# HG changeset patch
# User Aruna Matheswaran <aruna at multicorewareinc.com>
# Date 1538566253 -19800
#      Wed Oct 03 17:00:53 2018 +0530
# Node ID 8eb57eb225d51a06b704083bce8089ab4e2877b5
# Parent  e50f803e26fb3926dc695e0aeea39681fe1eacbd
hrd: Add cli option to set concatenation flag in buffering period SEI

diff -r e50f803e26fb -r 8eb57eb225d5 doc/reST/cli.rst
--- a/doc/reST/cli.rst Thu Sep 27 14:16:15 2018 +0530
+++ b/doc/reST/cli.rst Wed Oct 03 17:00:53 2018 +0530
@@ -1506,7 +1506,7 @@
  0 - flush the encoder only when all the input pictures are over.
  1 - flush all the frames even when the input is not over.
      slicetype decision may change with this option.
- 2 - flush the slicetype decided frames only.
+ 2 - flush the slicetype decided frames only.

 Quality, rate control and rate distortion options
 =================================================
@@ -2195,6 +2195,14 @@
  Picture Timing SEI messages providing timing information to the
  decoder. Default disabled

+
+.. option:: --hrd-concat, --no-hrd-concat
+
+    Set concantenation flag for the first keyframe in the HRD buffering
period SEI. This
+    is to signal the decoder if splicing is performed during bitstream
generation.
+    Recommended to enable this option during chunked encoding, except for
the first chunk.
+    Default disabled.
+
 .. option:: --dolby-vision-profile <integer|float>

     Generate bitstreams confirming to the specified Dolby Vision profile,
diff -r e50f803e26fb -r 8eb57eb225d5 source/CMakeLists.txt
--- a/source/CMakeLists.txt Thu Sep 27 14:16:15 2018 +0530
+++ b/source/CMakeLists.txt Wed Oct 03 17:00:53 2018 +0530
@@ -29,7 +29,7 @@
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 167)
+set(X265_BUILD 168)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r e50f803e26fb -r 8eb57eb225d5 source/common/param.cpp
--- a/source/common/param.cpp Thu Sep 27 14:16:15 2018 +0530
+++ b/source/common/param.cpp Wed Oct 03 17:00:53 2018 +0530
@@ -158,6 +158,7 @@
     param->radl = 0;
     param->chunkStart = 0;
     param->chunkEnd = 0;
+    param->bEnableHRDConcatFlag = 0;

     /* Intra Coding Tools */
     param->bEnableConstrainedIntra = 0;
@@ -1059,6 +1060,7 @@
             else
                 bError = true;
         }
+        OPT("hrd-concat") p->bEnableHRDConcatFlag = atobool(value);
         else
             return X265_PARAM_BAD_NAME;
     }
@@ -1663,6 +1665,7 @@
     s += sprintf(s, " lookahead-slices=%d", p->lookaheadSlices);
     s += sprintf(s, " scenecut=%d", p->scenecutThreshold);
     s += sprintf(s, " radl=%d", p->radl);
+    BOOL(p->bEnableHRDConcatFlag, "splice");
     BOOL(p->bIntraRefresh, "intra-refresh");
     s += sprintf(s, " ctu=%d", p->maxCUSize);
     s += sprintf(s, " min-cu-size=%d", p->minCUSize);
diff -r e50f803e26fb -r 8eb57eb225d5 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp Thu Sep 27 14:16:15 2018 +0530
+++ b/source/encoder/frameencoder.cpp Wed Oct 03 17:00:53 2018 +0530
@@ -657,6 +657,8 @@
             bpSei->m_auCpbRemovalDelayDelta = 1;
             bpSei->m_cpbDelayOffset = 0;
             bpSei->m_dpbDelayOffset = 0;
+            bpSei->m_concatenationFlag = (m_param->bEnableHRDConcatFlag &&
!m_frame->m_poc) ? true : false;
+
             // hrdFullness() calculates the initial CPB removal delay and
offset
             m_top->m_rateControl->hrdFullness(bpSei);
             bpSei->writeSEImessages(m_bs, *slice->m_sps,
NAL_UNIT_PREFIX_SEI, m_nalList, m_param->bSingleSeiNal);
diff -r e50f803e26fb -r 8eb57eb225d5 source/encoder/sei.h
--- a/source/encoder/sei.h Thu Sep 27 14:16:15 2018 +0530
+++ b/source/encoder/sei.h Wed Oct 03 17:00:53 2018 +0530
@@ -220,6 +220,7 @@
     SEIBufferingPeriod()
         : m_cpbDelayOffset(0)
         , m_dpbDelayOffset(0)
+        , m_concatenationFlag(0)
         , m_auCpbRemovalDelayDelta(1)
     {
         m_payloadType = BUFFERING_PERIOD;
@@ -227,6 +228,7 @@
     }
     bool     m_cpbDelayOffset;
     bool     m_dpbDelayOffset;
+    bool     m_concatenationFlag;
     uint32_t m_initialCpbRemovalDelay;
     uint32_t m_initialCpbRemovalDelayOffset;
     uint32_t m_auCpbRemovalDelayDelta;
@@ -237,7 +239,7 @@

         WRITE_UVLC(0, "bp_seq_parameter_set_id");
         WRITE_FLAG(0, "rap_cpb_params_present_flag");
-        WRITE_FLAG(0, "concatenation_flag");
+        WRITE_FLAG(m_concatenationFlag, "concatenation_flag");
         WRITE_CODE(m_auCpbRemovalDelayDelta - 1,
 hrd.cpbRemovalDelayLength,       "au_cpb_removal_delay_delta_minus1");
         WRITE_CODE(m_initialCpbRemovalDelay,
 hrd.initialCpbRemovalDelayLength,        "initial_cpb_removal_delay");
         WRITE_CODE(m_initialCpbRemovalDelayOffset,
hrd.initialCpbRemovalDelayLength, "initial_cpb_removal_delay_offset");
diff -r e50f803e26fb -r 8eb57eb225d5 source/x265.h
--- a/source/x265.h Thu Sep 27 14:16:15 2018 +0530
+++ b/source/x265.h Wed Oct 03 17:00:53 2018 +0530
@@ -1730,6 +1730,9 @@
      * device as RPU will be ignored. Default 0 (disabled) */
     int dolbyProfile;

+    /* Set concantenation flag for the first keyframe in the HRD buffering
period SEI. */
+    int bEnableHRDConcatFlag;
+
 } x265_param;
 /* x265_param_alloc:
  *  Allocates an x265_param instance. The returned param structure is not
diff -r e50f803e26fb -r 8eb57eb225d5 source/x265cli.h
--- a/source/x265cli.h Thu Sep 27 14:16:15 2018 +0530
+++ b/source/x265cli.h Wed Oct 03 17:00:53 2018 +0530
@@ -307,6 +307,8 @@
     { "pic-struct", required_argument, NULL, 0 },
     { "nalu-file", required_argument, NULL, 0 },
     { "dolby-vision-rpu", required_argument, NULL, 0 },
+    { "hrd-concat",          no_argument, NULL, 0},
+    { "no-hrd-concat",       no_argument, NULL, 0 },
     { 0, 0, 0, 0 },
     { 0, 0, 0, 0 },
     { 0, 0, 0, 0 },
@@ -463,6 +465,7 @@
     H1("                                 0 - flush the encoder only when
all the input pictures are over.\n");
     H1("                                 1 - flush all the frames even
when the input is not over. Slicetype decision may change with this
option.\n");
     H1("                                 2 - flush the slicetype decided
frames only.\n");
+    H0("   --[no-]-hrd-concat            Set HRD concatenation flag for
the first keyframe in the buffering period SEI. Default %s\n",
OPT(param->bEnableHRDConcatFlag));
     H0("\nRate control, Adaptive Quantization:\n");
     H0("   --bitrate <integer>           Target bitrate (kbps) for ABR
(implied). Default %d\n", param->rc.bitrate);
     H1("-q/--qp <integer>                QP for P slices in CQP mode
(implied). --ipratio and --pbration determine other slice QPs\n");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20181210/76e280d1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265_clone_12438.patch
Type: application/octet-stream
Size: 6922 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20181210/76e280d1/attachment-0001.obj>


More information about the x265-devel mailing list