/*****************************************************************************
* common.h: misc common functions
*****************************************************************************
- * Copyright (C) 2003-2014 x264 project
+ * Copyright (C) 2003-2016 x264 project
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Loren Merritt <lorenm@u.washington.edu>
#define NALU_OVERHEAD 5 // startcode + NAL type costs 5 bytes per frame
#define FILLER_OVERHEAD (NALU_OVERHEAD+1)
-#define SEI_OVERHEAD (NALU_OVERHEAD - (h->param.b_annexb && !h->param.b_avcintra_compat && (h->out.i_nal-1)))
+#define SEI_OVERHEAD (NALU_OVERHEAD - (h->param.b_annexb && !h->param.i_avcintra_class && (h->out.i_nal-1)))
/****************************************************************************
* Includes
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);
int (*dequant4_mf[4])[16]; /* [4][6][16] */
int (*dequant8_mf[4])[64]; /* [4][6][64] */
/* quantization matrix for trellis, [cqm][qp][coef] */
- int (*unquant4_mf[4])[16]; /* [4][QP_MAX_SPEC][16] */
- int (*unquant8_mf[4])[64]; /* [4][QP_MAX_SPEC][64] */
+ int (*unquant4_mf[4])[16]; /* [4][QP_MAX_SPEC+1][16] */
+ int (*unquant8_mf[4])[64]; /* [4][QP_MAX_SPEC+1][64] */
/* quantization matrix for deadzone */
- udctcoef (*quant4_mf[4])[16]; /* [4][QP_MAX_SPEC][16] */
- udctcoef (*quant8_mf[4])[64]; /* [4][QP_MAX_SPEC][64] */
- udctcoef (*quant4_bias[4])[16]; /* [4][QP_MAX_SPEC][16] */
- udctcoef (*quant8_bias[4])[64]; /* [4][QP_MAX_SPEC][64] */
- udctcoef (*quant4_bias0[4])[16]; /* [4][QP_MAX_SPEC][16] */
- udctcoef (*quant8_bias0[4])[64]; /* [4][QP_MAX_SPEC][64] */
+ udctcoef (*quant4_mf[4])[16]; /* [4][QP_MAX_SPEC+1][16] */
+ udctcoef (*quant8_mf[4])[64]; /* [4][QP_MAX_SPEC+1][64] */
+ udctcoef (*quant4_bias[4])[16]; /* [4][QP_MAX_SPEC+1][16] */
+ udctcoef (*quant8_bias[4])[64]; /* [4][QP_MAX_SPEC+1][64] */
+ udctcoef (*quant4_bias0[4])[16]; /* [4][QP_MAX_SPEC+1][16] */
+ udctcoef (*quant8_bias0[4])[64]; /* [4][QP_MAX_SPEC+1][64] */
udctcoef (*nr_offset_emergency)[4][64];
/* mv/ref cost arrays. */
/* 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 */