[x265] [PATCH] fix conditions for single-sei NAL

Ashok Kumar Mishra ashok at multicorewareinc.com
Thu Apr 12 12:05:44 CEST 2018


On Thu, Apr 12, 2018 at 3:12 PM, <santhoshini at multicorewareinc.com> wrote:

> # HG changeset patch
> # User Santhoshini Sekar <santhoshini at multicorewareinc.com>
> # Date 1523526059 -19800
> #      Thu Apr 12 15:10:59 2018 +0530
> # Node ID ad37e53f78dcdd600f7ad31095db490b2a93a8c6
> # Parent  593e63cda903370af926711c0ba05ce37d045c90
> fix conditions for single-sei NAL
>
> diff --git a/source/encoder/frameencoder.cpp
> b/source/encoder/frameencoder.cpp
> --- a/source/encoder/frameencoder.cpp
> +++ b/source/encoder/frameencoder.cpp
> @@ -696,7 +696,7 @@
>          sei->write(m_bs, *slice->m_sps);
>          sei->alignAndSerialize(m_bs, false, m_param->bSingleSeiNal,
> NAL_UNIT_PREFIX_SEI, m_nalList);
>      }
> -
> +    bool isSei = false;
>      /* Write user SEI */
>      for (int i = 0; i < m_frame->m_userSEI.numPayloads; i++)
>      {
> @@ -710,6 +710,7 @@
>              sei.setSize(payload->payloadSize);
>              sei.write(m_bs, *slice->m_sps);
>              sei.alignAndSerialize(m_bs, false, m_param->bSingleSeiNal,
> NAL_UNIT_PREFIX_SEI, m_nalList);
> +            isSei = true;
>          }
>          else if (payload->payloadType == USER_DATA_REGISTERED_ITU_T_T35)
>          {
> @@ -717,18 +718,19 @@
>              {
>                  SEICreativeIntentMeta sei;
>                  sei.m_payload = payload->payload;
> -                m_bs.resetBits();
> +                if (!m_param->bSingleSeiNal)
> +                    m_bs.resetBits();
>                  sei.setSize(payload->payloadSize);
>                  sei.write(m_bs, *slice->m_sps);
> -                sei.alignAndSerialize(m_bs, true, m_param->bSingleSeiNal,
> NAL_UNIT_PREFIX_SEI, m_nalList);
> +                sei.alignAndSerialize(m_bs, false,
> m_param->bSingleSeiNal, NAL_UNIT_PREFIX_SEI, m_nalList);
> +                isSei = true;
>              }
>          }
>          else
>              x265_log(m_param, X265_LOG_ERROR, "Unrecognized SEI type\n");
>      }
> -    bool isSei = (m_frame->m_lowres.bKeyframe &&
> -            (m_param->bRepeatHeaders || m_param->bEmitHRDSEI
> -            || !!m_param->interlaceMode || m_param->bEmitIDRRecoverySEI))
> ;
> +    isSei |= ((m_frame->m_lowres.bKeyframe && m_param->bRepeatHeaders) ||
> m_param->bEmitHRDSEI
> +        || !!m_param->interlaceMode || (m_frame->m_lowres.sliceType ==
> X265_TYPE_IDR && m_param->bEmitIDRRecoverySEI));
>
>      if (isSei && m_param->bSingleSeiNal)
>      {
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
>
Thanks. Pushed to default.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20180412/adc9b823/attachment.html>


More information about the x265-devel mailing list