[x264-devel] [PATCH] MPEG2 Program Stream output

Jason Garrett-Glaser jason at x264.com
Tue Jan 25 10:44:21 CET 2011


Nitpicks:

>+ * Copyright (C) 2003-2011 x264 project

No it isn't, this wasn't written in 2003.

>+//#include <math.h>

Dump it if you're not using it.

>p_header_written

Please don't use Hungarian notation, we're trying to excise it already...

>if (p_buffer)

x264 if syntax is if( x ).  Your ifs are inconsistent all over.

>+        p_buffer[0] = ((pes_time >> 29) & 0x0F) | 0x01;
>+        p_buffer[1] = (pes_time >> 22) & 0xFF;

Align this stuff.

>+        free(pes_handle);

free( pes_handle );

>+    {
>+        free(pes_handle->p_header_written);
>+    }

Drop {} where not necessary.

>+        return (unsigned long long int) ( x + 0.5 );
>+    return (unsigned long long int) ( x - 0.5 );

Use uint64_t not this crap.  Does it really have to handle negatives?

Jason


More information about the x264-devel mailing list