/*****************************************************************************
* common.h: misc common functions
*****************************************************************************
- * Copyright (C) 2003-2014 x264 project
+ * Copyright (C) 2003-2015 x264 project
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Loren Merritt <lorenm@u.washington.edu>
static ALWAYS_INLINE uint16_t x264_cabac_mvd_sum( uint8_t *mvdleft, uint8_t *mvdtop )
{
- int amvd0 = abs(mvdleft[0]) + abs(mvdtop[0]);
- int amvd1 = abs(mvdleft[1]) + abs(mvdtop[1]);
+ int amvd0 = mvdleft[0] + mvdtop[0];
+ int amvd1 = mvdleft[1] + mvdtop[1];
amvd0 = (amvd0 > 2) + (amvd0 > 32);
amvd1 = (amvd1 > 2) + (amvd1 > 32);
return amvd0 + (amvd1<<8);
/* stats */
struct
{
- /* Current frame stats */
- x264_frame_stat_t frame;
-
/* Cumulated stats */
/* per slice info */
/* num p-frames weighted */
int i_wpred[2];
+ /* Current frame stats */
+ x264_frame_stat_t frame;
} stat;
/* 0 = luma 4x4, 1 = luma 8x8, 2 = chroma 4x4, 3 = chroma 8x8 */