Skip to content
Snippets Groups Projects
Commit 40d2fb1c authored by Frederic Barbier's avatar Frederic Barbier
Browse files

Avoid using useless byte array

parent 22103858
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ using namespace std; ...@@ -44,7 +44,7 @@ using namespace std;
//! \ingroup EncoderLib //! \ingroup EncoderLib
//! \{ //! \{
static const uint8_t emulation_prevention_three_byte[] = {3}; static const uint8_t emulation_prevention_three_byte = 3;
void writeNalUnitHeader(ostream& out, OutputNALUnit& nalu) // nal_unit_header() void writeNalUnitHeader(ostream& out, OutputNALUnit& nalu) // nal_unit_header()
{ {
...@@ -95,7 +95,7 @@ void write(ostream& out, OutputNALUnit& nalu) ...@@ -95,7 +95,7 @@ void write(ostream& out, OutputNALUnit& nalu)
const uint8_t v=(*it); const uint8_t v=(*it);
if (zeroCount==2 && v<=3) if (zeroCount==2 && v<=3)
{ {
outputBuffer[outputAmount++]=emulation_prevention_three_byte[0]; outputBuffer[outputAmount++]=emulation_prevention_three_byte;
zeroCount=0; zeroCount=0;
} }
...@@ -117,7 +117,7 @@ void write(ostream& out, OutputNALUnit& nalu) ...@@ -117,7 +117,7 @@ void write(ostream& out, OutputNALUnit& nalu)
*/ */
if (zeroCount>0) if (zeroCount>0)
{ {
outputBuffer[outputAmount++]=emulation_prevention_three_byte[0]; outputBuffer[outputAmount++]=emulation_prevention_three_byte;
} }
out.write(reinterpret_cast<const char*>(&(*outputBuffer.begin())), outputAmount); out.write(reinterpret_cast<const char*>(&(*outputBuffer.begin())), outputAmount);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment