[x265] [PATCH] NAL : std::ostringstream replaced

Gopu Govindaswamy gopu at multicorewareinc.com
Thu Sep 12 06:29:37 CEST 2013


Thanks for the review

except uint8_t changes remaining all are white space issues, i could not
use X265 Malloc, we dont have X265 Realloc, so i forced to use malloc


On Wed, Sep 11, 2013 at 6:51 PM, Derek Buitenhuis <
derek.buitenhuis at gmail.com> wrote:

> On Wed, Sep 11, 2013 at 7:47 AM, Gopu Govindaswamy
> <gopu at multicorewareinc.com> wrote:
> > # HG changeset patch
> > # User Gopu Govindaswamy <gopu at multicorewareinc.com>
> > # Date 1378882010 -19800
> > # Node ID 275f2d5f9b0a782fd3ec36d95268545d96473e2e
> > # Parent  af8cddab103e87cb7817e4809780a64573d4dad2
> > NAL : std::ostringstream replaced
>
> [...]
>
> >      /** default constructor - no initialization; must be perfomed by
> user */
> >      NALUnit() {}
> > -
> > +
> >      /** returns true if the NALunit is a slice NALunit */
>
> Unrelated whitespace change.
>
> >      bool isSlice()
> >      {
> > @@ -105,7 +105,9 @@
> >   */
> >  struct NALUnitEBSP : public NALUnit
> >  {
> > -    std::ostringstream m_nalUnitData;
> > +
>
> Unrelated whitespace change.
>
> > +    UInt m_packetSize;
> > +    unsigned char *m_nalUnitData;
>
> uint8_t? Why are you using unsigned char here? This is 2013.
>
> > +    packetSize += bsNALUHeader.getByteStreamLength();
> > +    out = (unsigned char *) malloc(packetSize * sizeof(unsigned char));
>
> The sizeof() here is useless.
>
> Also, why not X265_MALLOC?
>
> > +    memcpy(out + packetSize, &(*rbsp.begin()), rbsp.end() -
> rbsp.begin());
>
> I cannot remember if the memory buffer behind rbsp is guaranteed to be
> contiguous under the C++ spec.
>
> Please ignore if this is the case, otherwise, don't do that.
>
>
> >              const NALUnitEBSP& nalu = **it;
> >              int size = 0; /* size of annexB unit in bytes */
> > -
> > +
> >              static const char start_code_prefix[] = { 0, 0, 0, 1 };
>
> Unrelated whitespace change.
>
> >
> >              encoder->m_nals[nalcount].i_type = nalu.m_nalUnitType;
> >              encoder->m_nals[nalcount].i_payload = size;
> >              nalcount++;
> > +            free(nalu.m_nalUnitData);
>
> Not X264_FREE?
>
> >              int size = 0; /* size of annexB unit in bytes */
> > -
> > +
> >              static const char start_code_prefix[] = { 0, 0, 0, 1 };
>
> More whitespace changes.
>
> >              nalcount++;
> > +            free(nalu.m_nalUnitData);
> >          }
>
> See above.
>
> ]]
> >      else if (pi_nal)
> >          *pi_nal = 0;
> > +
> >      return numEncoded;
>
> Ditto.
>
> - Derek
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>



-- 
Thanks & Regards
Gopu G
Multicoreware Inc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20130912/a2438be4/attachment.html>


More information about the x265-devel mailing list