#define X264_VERSION "" // no configure script for msvc
#endif
+/****************************************************************************
+ * Macros
+ ****************************************************************************/
+#define X264_MIN(a,b) ( (a)<(b) ? (a) : (b) )
+#define X264_MAX(a,b) ( (a)>(b) ? (a) : (b) )
+#define X264_MIN3(a,b,c) X264_MIN((a),X264_MIN((b),(c)))
+#define X264_MAX3(a,b,c) X264_MAX((a),X264_MAX((b),(c)))
+#define X264_MIN4(a,b,c,d) X264_MIN((a),X264_MIN3((b),(c),(d)))
+#define X264_MAX4(a,b,c,d) X264_MAX((a),X264_MAX3((b),(c),(d)))
+#define XCHG(type,a,b) { type t = a; a = b; b = t; }
+#define FIX8(f) ((int)(f*(1<<8)+.5))
+
+/****************************************************************************
+ * Includes
+ ****************************************************************************/
#include "x264.h"
#include "bs.h"
#include "set.h"
#include "csp.h"
#include "quant.h"
-/****************************************************************************
- * Macros
- ****************************************************************************/
-#define X264_MIN(a,b) ( (a)<(b) ? (a) : (b) )
-#define X264_MAX(a,b) ( (a)>(b) ? (a) : (b) )
-#define X264_MIN3(a,b,c) X264_MIN((a),X264_MIN((b),(c)))
-#define X264_MAX3(a,b,c) X264_MAX((a),X264_MAX((b),(c)))
-#define X264_MIN4(a,b,c,d) X264_MIN((a),X264_MIN3((b),(c),(d)))
-#define X264_MAX4(a,b,c,d) X264_MAX((a),X264_MAX3((b),(c),(d)))
-#define FIX8(f) ((int)(f*(1<<8)+.5))
-
/****************************************************************************
* Generals functions
****************************************************************************/
: dtime > 0;
if( swap )
{
- x264_frame_t *tmp = list[i+1];
- list[i+1] = list[i];
- list[i] = tmp;
+ XCHG( x264_frame_t*, list[i], list[i+1] );
b_ok = 0;
}
}
{
if( h->fref0[i]->i_poc < h->fref0[i+1]->i_poc )
{
- x264_frame_t *tmp = h->fref0[i+1];
-
- h->fref0[i+1] = h->fref0[i];
- h->fref0[i] = tmp;
+ XCHG( x264_frame_t*, h->fref0[i], h->fref0[i+1] );
b_ok = 0;
break;
}
{
if( h->fref1[i]->i_poc > h->fref1[i+1]->i_poc )
{
- x264_frame_t *tmp = h->fref1[i+1];
-
- h->fref1[i+1] = h->fref1[i];
- h->fref1[i] = tmp;
+ XCHG( x264_frame_t*, h->fref1[i], h->fref1[i+1] );
b_ok = 0;
break;
}
/* move lowres copy of the image to the ref frame */
for( i = 0; i < 4; i++)
- {
- uint8_t *tmp = h->fdec->lowres[i];
- h->fdec->lowres[i] = h->fenc->lowres[i];
- h->fenc->lowres[i] = tmp;
- }
+ XCHG( uint8_t*, h->fdec->lowres[i], h->fenc->lowres[i] );
/* adaptive B decision needs a pointer, since it can't use the ref lists */
if( h->sh.i_type != SLICE_TYPE_B )