Commit 08d39756 authored by Loren Merritt's avatar Loren Merritt

cosmetics

parent c47120f0
......@@ -40,7 +40,7 @@ typedef struct
/* aligned for memcpy_aligned starting here */
DECLARE_ALIGNED_16( int f8_bits_encoded ); // only if using x264_cabac_size_decision()
/* context */
uint8_t state[460];
} x264_cabac_t;
......
......@@ -169,12 +169,12 @@ static int parse_cqm( const char *str, uint8_t *cqm, int length )
static int x264_atobool( const char *str, int *b_error )
{
if( !strcmp(str, "1") ||
!strcmp(str, "true") ||
if( !strcmp(str, "1") ||
!strcmp(str, "true") ||
!strcmp(str, "yes") )
return 1;
if( !strcmp(str, "0") ||
!strcmp(str, "false") ||
if( !strcmp(str, "0") ||
!strcmp(str, "false") ||
!strcmp(str, "no") )
return 0;
*b_error = 1;
......
......@@ -374,7 +374,7 @@ struct x264_t
int i_mb_xy;
int i_b8_xy;
int i_b4_xy;
/* Search parameters */
int i_me_method;
int i_subpel_refine;
......@@ -399,15 +399,15 @@ struct x264_t
unsigned int i_neighbour;
unsigned int i_neighbour8[4]; /* neighbours of each 8x8 or 4x4 block that are available */
unsigned int i_neighbour4[16]; /* at the time the block is coded */
int i_mb_type_top;
int i_mb_type_left;
int i_mb_type_topleft;
int i_mb_type_topright;
int i_mb_type_top;
int i_mb_type_left;
int i_mb_type_topleft;
int i_mb_type_topright;
int i_mb_prev_xy;
int i_mb_top_xy;
/**** thread synchronization ends here ****/
/* subsequence variables are either thread-local or constant,
/* subsequent variables are either thread-local or constant,
* and won't be copied from one thread to another */
/* mb table */
......@@ -456,7 +456,7 @@ struct x264_t
DECLARE_ALIGNED_16( uint8_t fenc_buf[24*FENC_STRIDE] );
DECLARE_ALIGNED_16( uint8_t fdec_buf[27*FDEC_STRIDE] );
/* i4x4 and i8x8 backup data, for skipping the encode stage when possible */
/* i4x4 and i8x8 backup data, for skipping the encode stage when possible */
DECLARE_ALIGNED_16( uint8_t i4x4_fdec_buf[16*16] );
DECLARE_ALIGNED_16( uint8_t i8x8_fdec_buf[16*16] );
DECLARE_ALIGNED_16( int16_t i8x8_dct_buf[3][64] );
......@@ -567,7 +567,7 @@ struct x264_t
double f_slice_qp[5];
int i_consecutive_bframes[X264_BFRAME_MAX+1];
/* */
int64_t i_sqe_global[5];
int64_t i_ssd_global[5];
double f_psnr_average[5];
double f_psnr_mean_y[5];
double f_psnr_mean_u[5];
......
......@@ -233,7 +233,7 @@ void x264_frame_expand_border( x264_t *h, x264_frame_t *frame, int mb_y, int b_e
void x264_frame_expand_border_filtered( x264_t *h, x264_frame_t *frame, int mb_y, int b_end )
{
/* during filtering, 8 extra pixels were filtered on each edge,
* but up to 3 of the horizontal ones may be wrong.
* but up to 3 of the horizontal ones may be wrong.
we want to expand border from the last filtered pixel */
int b_start = !mb_y;
int stride = frame->i_stride[0];
......@@ -425,7 +425,7 @@ static inline void deblock_luma_c( uint8_t *pix, int xstride, int ystride, int a
}
static void deblock_v_luma_c( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
{
deblock_luma_c( pix, stride, 1, alpha, beta, tc0 );
deblock_luma_c( pix, stride, 1, alpha, beta, tc0 );
}
static void deblock_h_luma_c( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 )
{
......@@ -524,7 +524,7 @@ static void deblock_h_luma_intra_c( uint8_t *pix, int stride, int alpha, int bet
static inline void deblock_chroma_intra_c( uint8_t *pix, int xstride, int ystride, int alpha, int beta )
{
int d;
int d;
for( d = 0; d < 8; d++ )
{
const int p1 = pix[-2*xstride];
......
......@@ -81,7 +81,7 @@ typedef struct
/* threading */
int i_lines_completed; /* in pixels */
int i_reference_count; /* number of threads using this frame (not necessarily the number of pointers) */
x264_pthread_mutex_t mutex;
x264_pthread_mutex_t mutex;
x264_pthread_cond_t cv;
} x264_frame_t;
......
......@@ -223,9 +223,9 @@ static int x264_mb_predict_mv_direct16x16_temporal( x264_t *h )
int i8, i4;
int b8x8;
const int type_col = h->fref1[0]->mb_type[ h->mb.i_mb_xy ];
x264_macroblock_cache_ref( h, 0, 0, 4, 4, 1, 0 );
if( IS_INTRA( type_col ) )
{
x264_macroblock_cache_ref( h, 0, 0, 4, 4, 0, 0 );
......@@ -338,7 +338,7 @@ static int x264_mb_predict_mv_direct16x16_spatial( x264_t *h )
if( ref[0] < 0 && ref[1] < 0 )
{
ref[0] =
ref[0] =
ref[1] = 0;
*(uint64_t*)mv[0] = 0;
}
......
......@@ -346,7 +346,7 @@ void x264_mc_init( int cpu, x264_mc_functions_t *pf )
pf->avg[PIXEL_4x2] = pixel_avg_4x2;
pf->avg[PIXEL_2x4] = pixel_avg_2x4;
pf->avg[PIXEL_2x2] = pixel_avg_2x2;
pf->avg_weight[PIXEL_16x16]= pixel_avg_weight_16x16;
pf->avg_weight[PIXEL_16x8] = pixel_avg_weight_16x8;
pf->avg_weight[PIXEL_8x16] = pixel_avg_weight_8x16;
......
......@@ -62,7 +62,7 @@ typedef struct
uint8_t *pix_uv, int stride_uv, int mb_x );
/* prefetch the next few macroblocks of a hpel reference frame */
void (*prefetch_ref)( uint8_t *pix, int stride, int parity );
void *(*memcpy_aligned)( void *dst, const void *src, size_t n );
void (*memzero_aligned)( void *dst, int n );
......
......@@ -646,7 +646,7 @@ static void predict_8x8_ddr( uint8_t *src, uint8_t edge[33] )
SRC(5,0)=SRC(6,1)=SRC(7,2)= F2(t3,t4,t5);
SRC(6,0)=SRC(7,1)= F2(t4,t5,t6);
SRC(7,0)= F2(t5,t6,t7);
}
static void predict_8x8_vr( uint8_t *src, uint8_t edge[33] )
{
......
......@@ -194,7 +194,7 @@ void x264_mb_dequant_4x4_dc( int16_t dct[4][4], int dequant_mf[6][4][4], int i_q
}
}
void x264_denoise_dct_core( int16_t *dct, uint32_t *sum, uint16_t *offset, int size )
void x264_denoise_dct( int16_t *dct, uint32_t *sum, uint16_t *offset, int size )
{
int i;
for( i=1; i<size; i++ )
......@@ -218,7 +218,7 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf )
pf->dequant_4x4 = dequant_4x4;
pf->dequant_8x8 = dequant_8x8;
pf->denoise_dct_core = x264_denoise_dct_core;
pf->denoise_dct = x264_denoise_dct;
#ifdef HAVE_MMX
if( cpu&X264_CPU_MMX )
......@@ -233,7 +233,7 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf )
pf->dequant_4x4 = x264_dequant_4x4_flat16_mmx;
pf->dequant_8x8 = x264_dequant_8x8_flat16_mmx;
}
pf->denoise_dct_core = x264_denoise_dct_core_mmx;
pf->denoise_dct = x264_denoise_dct_mmx;
#endif
}
......@@ -257,7 +257,7 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf )
pf->dequant_4x4 = x264_dequant_4x4_flat16_sse2;
pf->dequant_8x8 = x264_dequant_8x8_flat16_sse2;
}
pf->denoise_dct_core = x264_denoise_dct_core_sse2;
pf->denoise_dct = x264_denoise_dct_sse2;
}
if( cpu&X264_CPU_SSSE3 )
......@@ -266,7 +266,7 @@ void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf )
pf->quant_4x4_dc = x264_quant_4x4_dc_ssse3;
pf->quant_4x4 = x264_quant_4x4_ssse3;
pf->quant_8x8 = x264_quant_8x8_ssse3;
pf->denoise_dct_core = x264_denoise_dct_core_ssse3;
pf->denoise_dct = x264_denoise_dct_ssse3;
}
#endif // HAVE_MMX
......
......@@ -33,7 +33,7 @@ typedef struct
void (*dequant_4x4)( int16_t dct[4][4], int dequant_mf[6][4][4], int i_qp );
void (*dequant_8x8)( int16_t dct[8][8], int dequant_mf[6][8][8], int i_qp );
void (*denoise_dct_core)( int16_t *dct, uint32_t *sum, uint16_t *offset, int size );
void (*denoise_dct)( int16_t *dct, uint32_t *sum, uint16_t *offset, int size );
} x264_quant_function_t;
void x264_quant_init( x264_t *h, int cpu, x264_quant_function_t *pf );
......
......@@ -75,7 +75,7 @@ int x264_cqm_init( x264_t *h )
int quant8_mf[2][6][8][8];
int q, i, j, i_list;
int deadzone[4] = { 32 - h->param.analyse.i_luma_deadzone[1],
32 - h->param.analyse.i_luma_deadzone[0],
32 - h->param.analyse.i_luma_deadzone[0],
32 - 11, 32 - 21 };
int max_qp_err = -1;
......@@ -247,7 +247,7 @@ int x264_cqm_parse_file( x264_t *h, const char *filename )
int b_error = 0;
h->param.i_cqm_preset = X264_CQM_CUSTOM;
buf = x264_slurp_file( filename );
if( !buf )
{
......
......@@ -94,7 +94,7 @@ typedef struct
int b_aspect_ratio_info_present;
int i_sar_width;
int i_sar_height;
int b_overscan_info_present;
int b_overscan_info;
......
......@@ -151,7 +151,7 @@ cglobal x264_sub8x8_dct8_sse2
paddw m%9, m%2
paddw m%9, m%4
paddw m%9, m%6 ; %9=a7
movdqa m%10, m%6
psraw m%10, 1
paddw m%10, m%6
......@@ -208,7 +208,7 @@ cglobal x264_add8x8_idct8_sse2
TRANSPOSE8x8W 0,1,2,3,4,5,6,7,8
paddw m0, [pw_32 GLOBAL] ; rounding for the >>6 at the end
IDCT8_1D 0,1,2,3,4,5,6,7,8,9
pxor m9, m9
STORE_DIFF m0, m8, m9, [r0+0*FDEC_STRIDE]
STORE_DIFF m1, m8, m9, [r0+1*FDEC_STRIDE]
......
......@@ -569,7 +569,7 @@ AVG_WEIGHT sse2, 16
; FIXME assumes 64 byte cachelines
;-----------------------------------------------------------------------------
; void x264_prefetch_fenc_mmxext( uint8_t *pix_y, int stride_y,
; void x264_prefetch_fenc_mmxext( uint8_t *pix_y, int stride_y,
; uint8_t *pix_uv, int stride_uv, int mb_x )
;-----------------------------------------------------------------------------
%ifdef ARCH_X86_64
......
......@@ -143,7 +143,7 @@ cglobal x264_pixel_sa8d_8x8_mmxext
movq mm5, [trans+0x48]
movq mm6, [trans+0x50]
movq mm7, [trans+0x58]
HADAMARD8_1D mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7
SUM4x8_MM
......@@ -282,7 +282,7 @@ cglobal x264_intra_sa8d_x3_8x8_core_mmxext
movq mm5, [trans+0x48]
movq mm6, [trans+0x50]
movq mm7, [trans+0x58]
HADAMARD8_1D mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7
movd [sum+0x10], mm0
......
......@@ -1387,7 +1387,7 @@ cglobal x264_pixel_ssim_end4_sse2, 3,3
; Successive Elimination ADS
;=============================================================================
%macro ADS_START 1 ; unroll_size
%macro ADS_START 1 ; unroll_size
%ifdef ARCH_X86_64
%define t0 r6
mov r10, rsp
......@@ -1401,7 +1401,7 @@ cglobal x264_pixel_ssim_end4_sse2, 3,3
and rsp, ~15
mov t0, rsp
shl r2d, 1
%endmacro
%endmacro
%macro ADS_END 1
add r1, 8*%1
......
......@@ -72,7 +72,7 @@ pw_8: times 8 dw 8
pw_76543210:
pw_3210: dw 0, 1, 2, 3, 4, 5, 6, 7
pb_00s_ff: times 8 db 0
pb_0s_ff: times 7 db 0
pb_0s_ff: times 7 db 0
db 0xff
SECTION .text
......
......@@ -151,15 +151,15 @@ static void predict_8x8c_h( uint8_t *src )
static void predict_16x16_dc_left( uint8_t *src )
{
uint32_t s = 0;
uint64_t dc;
uint64_t dc;
int y;
for( y = 0; y < 16; y++ )
{
s += src[-1 + y * FDEC_STRIDE];
}
}
dc = (( s + 8 ) >> 4) * 0x0101010101010101ULL;
for( y = 0; y < 16; y++ )
{
uint64_t *p = (uint64_t*)src;
......
......@@ -331,10 +331,10 @@ DEQUANT sse2, 8, 6, 2
;-----------------------------------------------------------------------------
; void x264_denoise_dct_core_mmx( int16_t *dct, uint32_t *sum, uint16_t *offset, int size )
; void x264_denoise_dct_mmx( int16_t *dct, uint32_t *sum, uint16_t *offset, int size )
;-----------------------------------------------------------------------------
%macro DENOISE_DCT 1
cglobal x264_denoise_dct_core_%1, 4,5
cglobal x264_denoise_dct_%1, 4,5
movzx r4d, word [r0] ; backup DC coefficient
pxor m7, m7
.loop:
......
......@@ -43,8 +43,8 @@ void x264_dequant_4x4_flat16_mmx( int16_t dct[4][4], int dequant_mf[6][4][4], in
void x264_dequant_8x8_flat16_mmx( int16_t dct[8][8], int dequant_mf[6][8][8], int i_qp );
void x264_dequant_4x4_flat16_sse2( int16_t dct[4][4], int dequant_mf[6][4][4], int i_qp );
void x264_dequant_8x8_flat16_sse2( int16_t dct[8][8], int dequant_mf[6][8][8], int i_qp );
void x264_denoise_dct_core_mmx( int16_t *dct, uint32_t *sum, uint16_t *offset, int size );
void x264_denoise_dct_core_sse2( int16_t *dct, uint32_t *sum, uint16_t *offset, int size );
void x264_denoise_dct_core_ssse3( int16_t *dct, uint32_t *sum, uint16_t *offset, int size );
void x264_denoise_dct_mmx( int16_t *dct, uint32_t *sum, uint16_t *offset, int size );
void x264_denoise_dct_sse2( int16_t *dct, uint32_t *sum, uint16_t *offset, int size );
void x264_denoise_dct_ssse3( int16_t *dct, uint32_t *sum, uint16_t *offset, int size );
#endif
......@@ -80,7 +80,7 @@ cglobal x264_pixel_sad_%1x%2_mmxext, 4,4
pxor mm0, mm0
%rep %2/2
SAD_INC_2x%1P
%endrep
%endrep
movd eax, mm0
RET
%endmacro
......@@ -825,11 +825,11 @@ cglobal x264_pixel_sad_x3_%1x%2_cache%3_%5, 0,0
call x264_pixel_sad_%1x%2_cache%3_%5
mov [r11], eax
pop r2
mov r0, r10
mov r0, r10
call x264_pixel_sad_%1x%2_cache%3_%5
mov [r11+4], eax
pop r2
mov r0, r10
mov r0, r10
call x264_pixel_sad_%1x%2_cache%3_%5
mov [r11+8], eax
%else
......@@ -875,15 +875,15 @@ cglobal x264_pixel_sad_x4_%1x%2_cache%3_%5, 0,0
call x264_pixel_sad_%1x%2_cache%3_%5
mov [r11], eax
pop r2
mov r0, r10
mov r0, r10
call x264_pixel_sad_%1x%2_cache%3_%5
mov [r11+4], eax
pop r2
mov r0, r10
mov r0, r10
call x264_pixel_sad_%1x%2_cache%3_%5
mov [r11+8], eax
pop r2
mov r0, r10
mov r0, r10
call x264_pixel_sad_%1x%2_cache%3_%5
mov [r11+12], eax
%else
......
File mode changed from 100755 to 100644
......@@ -498,7 +498,7 @@ static void x264_mb_analyse_intra_chroma( x264_t *h, x264_mb_analysis_t *a )
h->pixf.mbcmp[PIXEL_8x8]( p_dstc[0], FDEC_STRIDE, p_srcc[0], FENC_STRIDE );
satdv[I_PRED_CHROMA_P] =
h->pixf.mbcmp[PIXEL_8x8]( p_dstc[1], FDEC_STRIDE, p_srcc[1], FENC_STRIDE );
for( i=0; i<i_max; i++ )
{
int i_mode = predict_mode[i];
......@@ -1009,7 +1009,7 @@ static void x264_mb_analyse_inter_p16x16( x264_t *h, x264_mb_analysis_t *a )
h->mc.memcpy_aligned( &a->l0.me16x16, &m, sizeof(x264_me_t) );
/* save mv for predicting neighbors */
*(uint32_t*)a->l0.mvc[i_ref][0] =
*(uint32_t*)a->l0.mvc[i_ref][0] =
*(uint32_t*)h->mb.mvr[0][i_ref][h->mb.i_mb_xy] = *(uint32_t*)m.mv;
}
......@@ -1508,7 +1508,7 @@ static void x264_mb_analyse_inter_b16x16( x264_t *h, x264_mb_analysis_t *a )
if ( (*(uint32_t*)a->l0.me16x16.mv & 0x10001) == 0 )
{
/* l0 reference is halfpel, so get_ref on it will make it faster */
src2 =
src2 =
h->mc.get_ref( pix2, &stride2,
h->mb.pic.p_fref[0][a->l0.i_ref], h->mb.pic.i_stride[0],
a->l0.me16x16.mv[0], a->l0.me16x16.mv[1],
......@@ -1518,7 +1518,7 @@ static void x264_mb_analyse_inter_b16x16( x264_t *h, x264_mb_analysis_t *a )
a->l1.me16x16.mv[0], a->l1.me16x16.mv[1],
16, 16 );
weight = 64 - weight;
}
}
else
{
/* if l0 was qpel, we'll use get_ref on l1 instead */
......@@ -2558,7 +2558,7 @@ void x264_macroblock_analyse( x264_t *h )
h->mb.i_type = i_type;
h->mb.i_partition = i_partition;
}
x264_mb_analyse_intra( h, &analysis, i_satd_inter );
if( analysis.b_mbrd )
......
......@@ -237,7 +237,7 @@ static void x264_slice_header_write( bs_t *s, x264_slice_header_t *sh, int i_nal
{
bs_write_ue( s, sh->ref_pic_list_order[0][i].idc );
bs_write_ue( s, sh->ref_pic_list_order[0][i].arg );
}
bs_write_ue( s, 3 );
}
......@@ -429,7 +429,7 @@ static int x264_validate_parameters( x264_t *h )
// There's nothing special about 1080 in that the warning still applies to it,
// but chances are the user can't help it if his content is already 1080p,
// so there's no point in warning in that case.
x264_log( h, X264_LOG_WARNING,
x264_log( h, X264_LOG_WARNING,
"width or height not divisible by 16 (%dx%d), compression will suffer.\n",
h->param.i_width, h->param.i_height );
}
......@@ -672,7 +672,7 @@ x264_t *x264_encoder_open ( x264_param_t *param )
x264_free( h );
return NULL;
}
h->mb.i_mb_count = h->sps->i_mb_width * h->sps->i_mb_height;
/* Init frames. */
......@@ -1543,7 +1543,7 @@ do_encode:
/* restore CPU state (before using float again) */
x264_emms();
if( h->sh.i_type == SLICE_TYPE_P && !h->param.rc.b_stat_read
if( h->sh.i_type == SLICE_TYPE_P && !h->param.rc.b_stat_read
&& h->param.i_scenecut_threshold >= 0
&& !h->param.b_pre_scenecut )
{
......@@ -1604,7 +1604,7 @@ do_encode:
/* If using B-frames, force GOP to be closed.
* Even if this frame is going to be I and not IDR, forcing a
* P-frame before the scenecut will probably help compression.
*
*
* We don't yet know exactly which frame is the scene cut, so
* we can't assign an I-frame. Instead, change the previous
* B-frame to P, and rearrange coding order. */
......@@ -1735,22 +1735,22 @@ static void x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
psz_message[0] = '\0';
if( h->param.analyse.b_psnr )
{
int64_t sqe[3] = {
int64_t ssd[3] = {
h->stat.frame.i_ssd[0],
h->stat.frame.i_ssd[1],
h->stat.frame.i_ssd[2],
};
h->stat.i_sqe_global[h->sh.i_type] += sqe[0] + sqe[1] + sqe[2];
h->stat.f_psnr_average[h->sh.i_type] += x264_psnr( sqe[0] + sqe[1] + sqe[2], 3 * h->param.i_width * h->param.i_height / 2 );
h->stat.f_psnr_mean_y[h->sh.i_type] += x264_psnr( sqe[0], h->param.i_width * h->param.i_height );
h->stat.f_psnr_mean_u[h->sh.i_type] += x264_psnr( sqe[1], h->param.i_width * h->param.i_height / 4 );
h->stat.f_psnr_mean_v[h->sh.i_type] += x264_psnr( sqe[2], h->param.i_width * h->param.i_height / 4 );
h->stat.i_ssd_global[h->sh.i_type] += ssd[0] + ssd[1] + ssd[2];
h->stat.f_psnr_average[h->sh.i_type] += x264_psnr( ssd[0] + ssd[1] + ssd[2], 3 * h->param.i_width * h->param.i_height / 2 );
h->stat.f_psnr_mean_y[h->sh.i_type] += x264_psnr( ssd[0], h->param.i_width * h->param.i_height );
h->stat.f_psnr_mean_u[h->sh.i_type] += x264_psnr( ssd[1], h->param.i_width * h->param.i_height / 4 );
h->stat.f_psnr_mean_v[h->sh.i_type] += x264_psnr( ssd[2], h->param.i_width * h->param.i_height / 4 );
snprintf( psz_message, 80, " PSNR Y:%5.2f U:%5.2f V:%5.2f",
x264_psnr( sqe[0], h->param.i_width * h->param.i_height ),
x264_psnr( sqe[1], h->param.i_width * h->param.i_height / 4),
x264_psnr( sqe[2], h->param.i_width * h->param.i_height / 4) );
x264_psnr( ssd[0], h->param.i_width * h->param.i_height ),
x264_psnr( ssd[1], h->param.i_width * h->param.i_height / 4),
x264_psnr( ssd[2], h->param.i_width * h->param.i_height / 4) );
}
if( h->param.analyse.b_ssim )
......@@ -1762,7 +1762,7 @@ static void x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
" SSIM Y:%.5f", ssim_y );
}
psz_message[79] = '\0';
x264_log( h, X264_LOG_DEBUG,
"frame=%4d QP=%.2f NAL=%d Slice:%c Poc:%-3d I:%-4d P:%-4d SKIP:%-4d size=%d bytes%s\n",
h->i_frame,
......@@ -1858,7 +1858,7 @@ void x264_encoder_close ( x264_t *h )
(double)h->stat.i_slice_size[i_slice] / i_count,
h->stat.f_psnr_mean_y[i_slice] / i_count, h->stat.f_psnr_mean_u[i_slice] / i_count, h->stat.f_psnr_mean_v[i_slice] / i_count,
h->stat.f_psnr_average[i_slice] / i_count,
x264_psnr( h->stat.i_sqe_global[i_slice], i_count * i_yuv_size ) );
x264_psnr( h->stat.i_ssd_global[i_slice], i_count * i_yuv_size ) );
}
else
{
......@@ -2014,7 +2014,7 @@ void x264_encoder_close ( x264_t *h )
SUM3( h->stat.f_psnr_mean_u ) / i_count,
SUM3( h->stat.f_psnr_mean_v ) / i_count,
SUM3( h->stat.f_psnr_average ) / i_count,
x264_psnr( SUM3( h->stat.i_sqe_global ), i_count * i_yuv_size ),
x264_psnr( SUM3( h->stat.i_ssd_global ), i_count * i_yuv_size ),
f_bitrate );
}
else
......
......@@ -122,7 +122,7 @@ void x264_mb_encode_i8x8( x264_t *h, int idx, int i_qscale )
if( h->mb.b_trellis )
x264_quant_8x8_trellis( h, dct8x8, CQM_8IY, i_qscale, 1 );
else
else
h->quantf.quant_8x8( dct8x8, h->quant8_mf[CQM_8IY][i_qscale], h->quant8_bias[CQM_8IY][i_qscale] );
h->zigzagf.scan_8x8( h->dct.luma8x8[idx], dct8x8 );
......@@ -215,7 +215,7 @@ void x264_mb_encode_8x8_chroma( x264_t *h, int b_inter, int i_qscale )
}
continue;
}
h->dctf.sub8x8_dct( dct4x4, p_src, p_dst );
/* calculate dct coeffs */
for( i = 0; i < 4; i++ )
......@@ -445,7 +445,7 @@ void x264_macroblock_encode( x264_t *h )
for( idx = 0; idx < 4; idx++ )
{
if( h->mb.b_noise_reduction )
h->quantf.denoise_dct_core( *dct8x8[idx], h->nr_residual_sum[1], h->nr_offset[1], 64 );
h->quantf.denoise_dct( *dct8x8[idx], h->nr_residual_sum[1], h->nr_offset[1], 64 );
if( h->mb.b_trellis )
x264_quant_8x8_trellis( h, dct8x8[idx], CQM_8PY, i_qp, 0 );
else
......@@ -493,7 +493,7 @@ void x264_macroblock_encode( x264_t *h )
idx = i8x8 * 4 + i4x4;
if( h->mb.b_noise_reduction )
h->quantf.denoise_dct_core( *dct4x4[idx], h->nr_residual_sum[0], h->nr_offset[0], 16 );
h->quantf.denoise_dct( *dct4x4[idx], h->nr_residual_sum[0], h->nr_offset[0], 16 );
if( h->mb.b_trellis )
x264_quant_4x4_trellis( h, dct4x4[idx], CQM_4PY, i_qp, DCT_LUMA_4x4, 0 );
else
......@@ -594,7 +594,7 @@ void x264_macroblock_encode( x264_t *h )
if( !b_force_no_skip )
{
if( h->mb.i_type == P_L0 && h->mb.i_partition == D_16x16 &&
!(h->mb.i_cbp_luma | h->mb.i_cbp_chroma) &&
!(h->mb.i_cbp_luma | h->mb.i_cbp_chroma) &&
*(uint32_t*)h->mb.cache.mv[0][x264_scan8[0]] == *(uint32_t*)h->mb.cache.pskip_mv
&& h->mb.cache.ref[0][x264_scan8[0]] == 0 )
{
......
......@@ -31,7 +31,7 @@
* and refine_* are run only on the winner.
* the subme=7 values are much higher because any amount of satd search makes
* up its time by reducing the number of rd iterations. */
static const int subpel_iterations[][4] =
static const int subpel_iterations[][4] =
{{1,0,0,0},
{1,1,0,0},
{0,1,1,0},
......@@ -162,7 +162,7 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int16_t (*mvc)[2], int i_mvc,
int omx, omy, pmx, pmy;
uint8_t *p_fref = m->p_fref[0];
DECLARE_ALIGNED_16( uint8_t pix[16*16] );
int i = 0, j;
int dir;
int costs[6];
......
......@@ -273,7 +273,7 @@ int x264_ratecontrol_new( x264_t *h )
rc->b_abr = h->param.rc.i_rc_method != X264_RC_CQP && !h->param.rc.b_stat_read;
rc->b_2pass = h->param.rc.i_rc_method == X264_RC_ABR && h->param.rc.b_stat_read;
/* FIXME: use integers */
if(h->param.i_fps_num > 0 && h->param.i_fps_den > 0)
rc->fps = (float) h->param.i_fps_num / h->param.i_fps_den;
......@@ -689,7 +689,7 @@ void x264_ratecontrol_summary( x264_t *h )
if( rc->b_abr && h->param.rc.i_rc_method == X264_RC_ABR && rc->cbr_decay > .9999 )
{
double base_cplx = h->mb.i_mb_count * (h->param.i_bframe ? 120 : 80);
x264_log( h, X264_LOG_INFO, "final ratefactor: %.2f\n",
x264_log( h, X264_LOG_INFO, "final ratefactor: %.2f\n",
qscale2qp( pow( base_cplx, 1 - h->param.rc.f_qcompress )
* rc->cplxr_sum / rc->wanted_bits_window ) );
}
......@@ -865,7 +865,7 @@ double predict_row_size( x264_t *h, int y, int qp )
x264_ratecontrol_t *rc = h->rc;
double pred_s = predict_size( rc->row_pred, qp2qscale(qp), h->fdec->i_row_satd[y] );
double pred_t = 0;
if( h->sh.i_type != SLICE_TYPE_I
if( h->sh.i_type != SLICE_TYPE_I
&& h->fref0[0]->i_type == h->fdec->i_type
&& h->fref0[0]->i_row_satd[y] > 0 )
{
......@@ -1071,7 +1071,7 @@ void x264_ratecontrol_end( x264_t *h, int bits )
int dir_frame = h->stat.frame.i_direct_score[1] - h->stat.frame.i_direct_score[0];
int dir_avg = h->stat.i_direct_score[1] - h->stat.i_direct_score[0];
char c_direct = h->mb.b_direct_auto_write ?
( dir_frame>0 ? 's' : dir_frame<0 ? 't' :
( dir_frame>0 ? 's' : dir_frame<0 ? 't' :
dir_avg>0 ? 's' : dir_avg<0 ? 't' : '-' )
: '-';
fprintf( rc->p_stat_file_out,
......
......@@ -50,7 +50,7 @@ static uint16_t cabac_prefix_size[15][128];
#define COPY_CABAC h->mc.memcpy_aligned( &cabac_tmp.f8_bits_encoded, &h->cabac.f8_bits_encoded, \
sizeof(x264_cabac_t) - offsetof(x264_cabac_t,f8_bits_encoded) )
static int ssd_mb( x264_t *h )
{
return h->pixf.ssd[PIXEL_16x16]( h->mb.pic.p_fenc[0], FENC_STRIDE,
......@@ -247,24 +247,24 @@ void x264_rdo_init( )
// I'm just matching the behaviour of deadzone quant.
static const int lambda2_tab[2][52] = {
// inter lambda = .85 * .85 * 2**(qp/3. + 10 - LAMBDA_BITS)
{ 46, 58, 73, 92, 117, 147,
185, 233, 294, 370, 466, 587,
740, 932, 1174, 1480, 1864, 2349,
2959, 3728, 4697, 5918, 7457, 9395,
11837, 14914, 18790, 23674, 29828, 37581,
47349, 59656, 75163, 94699, 119313, 150326,
189399, 238627, 300652, 378798, 477255, 601304,
757596, 954511, 1202608, 1515192, 1909022, 2405217,
{ 46, 58, 73, 92, 117, 147,
185, 233, 294, 370, 466, 587,
740, 932, 1174, 1480, 1864, 2349,
2959, 3728, 4697, 5918, 7457, 9395,
11837, 14914, 18790, 23674, 29828, 37581,
47349, 59656, 75163, 94699, 119313, 150326,
189399, 238627, 300652, 378798, 477255, 601304,
757596, 954511, 1202608, 1515192, 1909022, 2405217,
3030384, 3818045, 4810435, 6060769 },
// intra lambda = .65 * .65 * 2**(qp/3. + 10 - LAMBDA_BITS)
{ 27, 34, 43, 54, 68, 86,
108, 136, 172, 216, 273, 343,
433, 545, 687, 865, 1090, 1374,
1731, 2180, 2747, 3461, 4361, 5494,
6922, 8721, 10988, 13844, 17442, 21976,
27688, 34885, 43953, 55377, 69771, 87906,
110755, 139543, 175813, 221511, 279087, 351627,
443023, 558174, 703255, 886046, 1116348, 1406511,
{ 27, 34, 43, 54, 68, 86,
108, 136, 172, 216, 273, 343,
433, 545, 687, 865, 1090, 1374,
1731, 2180, 2747, 3461, 4361, 5494,
6922, 8721, 10988, 13844, 17442, 21976,
27688, 34885, 43953, 55377, 69771, 87906,
110755, 139543, 175813, 221511, 279087, 351627,
443023, 558174, 703255, 886046, 1116348, 1406511,
1772093, 2232697, 2813022, 3544186 }
};
......
......@@ -150,11 +150,11 @@ void x264_sps_init( x264_sps_t *sps, int i_id, x264_param_t *param )
sps->vui.i_sar_width = param->vui.i_sar_width;
sps->vui.i_sar_height= param->vui.i_sar_height;
}
sps->vui.b_overscan_info_present = ( param->vui.i_overscan ? 1 : 0 );