/* 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;
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;
int i_mb_xy;
int i_b8_xy;
int i_b4_xy;
-
+
/* Search parameters */
int i_me_method;
int i_subpel_refine;
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 */
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] );
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];
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];
}
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 )
{
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];
/* 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;
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 );
if( ref[0] < 0 && ref[1] < 0 )
{
- ref[0] =
+ ref[0] =
ref[1] = 0;
*(uint64_t*)mv[0] = 0;
}
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;
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 );
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] )
{
}
}
-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++ )
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 )
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
}
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 )
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
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 );
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;
int b_error = 0;
h->param.i_cqm_preset = X264_CQM_CUSTOM;
-
+
buf = x264_slurp_file( filename );
if( !buf )
{
int b_aspect_ratio_info_present;
int i_sar_width;
int i_sar_height;
-
+
int b_overscan_info_present;
int b_overscan_info;
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
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]
; 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
movq mm5, [trans+0x48]
movq mm6, [trans+0x50]
movq mm7, [trans+0x58]
-
+
HADAMARD8_1D mm0, mm1, mm2, mm3, mm4, mm5, mm6, mm7
SUM4x8_MM
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
; 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
and rsp, ~15
mov t0, rsp
shl r2d, 1
-%endmacro
+%endmacro
%macro ADS_END 1
add r1, 8*%1
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
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;
;-----------------------------------------------------------------------------
-; 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:
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
pxor mm0, mm0
%rep %2/2
SAD_INC_2x%1P
-%endrep
+%endrep
movd eax, mm0
RET
%endmacro
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
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
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];
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;
}
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],
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 */
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 )
{
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 );
}
// 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 );
}
x264_free( h );
return NULL;
}
-
+
h->mb.i_mb_count = h->sps->i_mb_width * h->sps->i_mb_height;
/* Init frames. */
/* 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 )
{
/* 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. */
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 )
" 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,
(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
{
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
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 );
}
continue;
}
-
+
h->dctf.sub8x8_dct( dct4x4, p_src, p_dst );
/* calculate dct coeffs */
for( i = 0; i < 4; i++ )
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
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
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 )
{
* 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},
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];
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;
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 ) );
}
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 )
{
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,
#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,
// 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 }
};
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 );
if( sps->vui.b_overscan_info_present )
sps->vui.b_overscan_info = ( param->vui.i_overscan == 2 ? 1 : 0 );
-
+
sps->vui.b_signal_type_present = 0;
sps->vui.i_vidformat = ( param->vui.i_vidformat <= 5 ? param->vui.i_vidformat : 5 );
sps->vui.b_fullrange = ( param->vui.b_fullrange ? 1 : 0 );
{
sps->vui.b_signal_type_present = 1;
}
-
+
/* FIXME: not sufficient for interlaced video */
sps->vui.b_chroma_loc_info_present = ( param->vui.i_chroma_loc ? 1 : 0 );
if( sps->vui.b_chroma_loc_info_present )
typedef __int64 int_least64_t;
typedef unsigned __int64 uint_least64_t;
-/* 7.18.1.3 Fastest minimum-width integer types
+/* 7.18.1.3 Fastest minimum-width integer types
* Not actually guaranteed to be fastest for all purposes
- * Here we use the exact-width types for 8 and 16-bit ints.
+ * Here we use the exact-width types for 8 and 16-bit ints.
*/
typedef char int_fast8_t;
typedef unsigned char uint_fast8_t;
#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
/* 7.18.2.1 Limits of exact-width integer types */
-#define INT8_MIN (-128)
+#define INT8_MIN (-128)
#define INT16_MIN (-32768)
#define INT32_MIN (-2147483647 - 1)
#define INT64_MIN (-9223372036854775807LL - 1)
#define UINT_FAST64_MAX UINT64_MAX
/* 7.18.2.4 Limits of integer types capable of holding
- object pointers */
+ object pointers */
#define INTPTR_MIN INT32_MIN
#define INTPTR_MAX INT32_MAX
#define UINTPTR_MAX UINT32_MAX
#define SIZE_MAX UINT32_MAX
-#ifndef WCHAR_MIN /* also in wchar.h */
+#ifndef WCHAR_MIN /* also in wchar.h */
#define WCHAR_MIN 0
#define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
#endif
gint threads;
guint trellis;
gint noise_reduction;
-
+
gint strength;
gint threshold;
GIOChannel *io_write; /* use it with write */
};
-struct X264_Pipe_Data_
+struct X264_Pipe_Data_
{
int frame;
int frame_total;
/* Read frame header - without terminating '\n' */
if (fread(header, 1, slen, h->fh) != slen)
return -1;
-
+
header[slen] = 0;
if (strncmp(header, Y4M_FRAME_MAGIC, slen))
{
*((uint32_t*)header), header);
return -1;
}
-
+
/* Skip most of it */
while (i<MAX_FRAME_HEADER && fgetc(h->fh) != '\n')
i++;
/* skip i_offset_for_top_to_bottom_field */
bs_read_se( &s );
/* read i_num_ref_frames_in_poc_cycle */
- i_cycle = bs_read_ue( &s );
+ i_cycle = bs_read_ue( &s );
if( i_cycle > 256 ) i_cycle = 256;
while( i_cycle > 0 )
{
report( "dequant :" );
- if( qf_a.denoise_dct_core != qf_ref.denoise_dct_core )
+ if( qf_a.denoise_dct != qf_ref.denoise_dct )
{
int size;
for( size = 16; size <= 64; size += 48 )
memcpy(dct1, buf1, size*2);
memcpy(dct2, buf1, size*2);
memcpy(buf3+256, buf3, 256);
- call_c1( qf_c.denoise_dct_core, dct1, (uint32_t*)buf3, (uint16_t*)buf2, size );
- call_a1( qf_a.denoise_dct_core, dct2, (uint32_t*)(buf3+256), (uint16_t*)buf2, size );
+ call_c1( qf_c.denoise_dct, dct1, (uint32_t*)buf3, (uint16_t*)buf2, size );
+ call_a1( qf_a.denoise_dct, dct2, (uint32_t*)(buf3+256), (uint16_t*)buf2, size );
if( memcmp( dct1, dct2, size*2 ) || memcmp( buf3+4, buf3+256+4, (size-1)*sizeof(uint32_t) ) )
ok = 0;
- call_c2( qf_c.denoise_dct_core, dct1, (uint32_t*)buf3, (uint16_t*)buf2, size );
- call_a2( qf_a.denoise_dct_core, dct2, (uint32_t*)(buf3+256), (uint16_t*)buf2, size );
+ call_c2( qf_c.denoise_dct, dct1, (uint32_t*)buf3, (uint16_t*)buf2, size );
+ call_a2( qf_a.denoise_dct, dct2, (uint32_t*)(buf3+256), (uint16_t*)buf2, size );
}
}
report( "denoise dct :" );
sscanf( argv[optind++], "%ux%u", ¶m->i_width, ¶m->i_height );
}
}
-
+
if( !(b_avis || b_y4m) && ( !param->i_width || !param->i_height ) )
{
fprintf( stderr, "x264 [error]: Rawyuv input requires a resolution.\n" );
i_frame++;
/* update status line (up to 1000 times per input file) */
- if( opt->b_progress && param->i_log_level < X264_LOG_DEBUG &&
+ if( opt->b_progress && param->i_log_level < X264_LOG_DEBUG &&
( i_frame_total ? i_frame * 1000 / i_frame_total > i_progress
: i_frame % 10 == 0 ) )
{
int i_width;
int i_height;
int i_csp; /* CSP of encoded bitstream, only i420 supported */
- int i_level_idc;
+ int i_level_idc;
int i_frame_total; /* number of frames to encode if known, else 0 */
struct
int i_sar_width;
int i_overscan; /* 0=undef, 1=no overscan, 2=overscan */
-
+
/* see h264 annex E for the values of the following */
int i_vidformat;
int b_fullrange;