#ifdef HAVE_MMX
extern int x264_cpu_cpuid_test( void );
extern uint32_t x264_cpu_cpuid( uint32_t op, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx );
-extern void x264_emms( void );
uint32_t x264_cpu_detect( void )
{
return cpu;
}
-void x264_cpu_restore( uint32_t cpu )
-{
- if( cpu&(X264_CPU_MMX|X264_CPU_MMXEXT|X264_CPU_3DNOW|X264_CPU_3DNOWEXT) )
- {
- x264_emms();
- }
-}
-
#elif defined( ARCH_PPC )
#ifdef SYS_MACOSX
}
#endif
-void x264_cpu_restore( uint32_t cpu )
-{
-}
-
#else
uint32_t x264_cpu_detect( void )
return 0;
}
-void x264_cpu_restore( uint32_t cpu )
+#endif
+
+#ifndef HAVE_MMX
+void x264_emms( void )
{
}
-
#endif
uint32_t x264_cpu_detect( void );
int x264_cpu_num_processors( void );
-
-/* probably MMX(EXT) centric but .... */
-void x264_cpu_restore( uint32_t cpu );
+void x264_emms( void );
/* kluge:
* gcc can't give variables any greater alignment than the stack frame has.
x264_slices_write( h );
/* restore CPU state (before using float again) */
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
if( h->sh.i_type == SLICE_TYPE_P && !h->param.rc.b_stat_read
&& h->param.i_scenecut_threshold >= 0
/* ---------------------- Update encoder state ------------------------- */
/* update rc */
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
x264_ratecontrol_end( h, h->out.i_frame_size * 8 );
/* restore CPU state (before using float again) */
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
x264_noise_reduction_update( h );
h->fenc->plane[i], h->fenc->i_stride[i],
h->param.i_width >> !!i, h->param.i_height >> !!i );
}
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
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 );
var = X264_MAX(var,1);
}
else var = h->rc->ac_energy[h->mb.i_mb_xy];
- x264_cpu_restore(h->param.cpu);
+ x264_emms();
return var;
}
total += logf(energy) * satd;
n += satd;
}
- x264_cpu_restore(h->param.cpu);
+ x264_emms();
/* Calculate and store the threshold. */
h->rc->aq_threshold = n ? total/n : 15;
}
x264_ratecontrol_t *rc;
int i;
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
rc = h->rc = x264_malloc( h->param.i_threads * sizeof(x264_ratecontrol_t) );
memset( rc, 0, h->param.i_threads * sizeof(x264_ratecontrol_t) );
x264_zone_t *zone = get_zone( h, h->fenc->i_frame );
float q;
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
if( zone && (!rc->prev_zone || zone->param != rc->prev_zone->param) )
x264_encoder_reconfig( h, zone->param );
x264_ratecontrol_t *rc = h->rc;
const int y = h->mb.i_mb_y;
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
h->fdec->i_row_bits[y] += bits;
rc->qpa_rc += rc->qpm;
const int *mbs = h->stat.frame.i_mb_count;
int i;
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
h->stat.frame.i_mb_count_skip = mbs[P_SKIP] + mbs[B_SKIP];
h->stat.frame.i_mb_count_i = mbs[I_16x16] + mbs[I_8x8] + mbs[I_4x4];
frames[b]->i_cost_est[b-p0][p1-b] = i_score;
// fprintf( stderr, "frm %d %c(%d,%d): %6d %6d imb:%d \n", frames[b]->i_frame,
// (p1==0?'I':b<p1?'B':'P'), b-p0, p1-b, i_score, frames[b]->i_cost_est[0][0], frames[b]->i_intra_mbs[b-p0] );
- x264_cpu_restore( h->param.cpu );
+ x264_emms();
}
if( b_intra_penalty )
{
float res_c, res_a;
ok = 1;
- x264_cpu_restore( cpu_new );
+ x264_emms();
res_c = x264_pixel_ssim_wxh( &pixel_c, buf1+2, 32, buf2+2, 32, 32, 28 );
res_a = x264_pixel_ssim_wxh( &pixel_asm, buf1+2, 32, buf2+2, 32, 32, 28 );
if( fabs(res_c - res_a) > 1e-7 )