#ifdef CAN_COMPILE_SSE2
#define _STRING(x) #x
#define STRING(x) _STRING(x)
+VLC_SSE
static void BlockBlendSse2(uint8_t *dst, size_t dst_pitch,
const uint8_t *src, size_t src_pitch,
const int16_t *noise)
[src1]"r"(&src[(2*i+0) * src_pitch]),
[src2]"r"(&src[(2*i+1) * src_pitch]),
[noise]"r"(&noise[2*i * BANK_SIZE])
- : "memory");
+ : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "memory");
}
#else
# error "BLEND_SIZE unsupported"
}
vlc_mutex_lock(&sys->cfg.lock);
- const double variance = __MIN(__MAX(sys->cfg.variance, VARIANCE_MIN), VARIANCE_MAX);
+ const double variance = VLC_CLIP(sys->cfg.variance, VARIANCE_MIN, VARIANCE_MAX);
vlc_mutex_unlock(&sys->cfg.lock);
const int scale = 256 * sqrt(variance);
vq = (int)( v * correction * 127 + 0.5);
else
vq = -(int)(-v * correction * 127 + 0.5);
- bank[i * N + j] = __MIN(__MAX(vq, INT16_MIN), INT16_MAX);
+ bank[i * N + j] = VLC_CLIP(vq, INT16_MIN, INT16_MAX);
}
}
//mtime_t mul_duration = mdate() - tmul_0;
const vlc_chroma_description_t *chroma =
vlc_fourcc_GetChromaDescription(filter->fmt_in.video.i_chroma);
- if (!chroma || chroma->plane_count < 3) {
+ if (!chroma || chroma->plane_count < 3 || chroma->pixel_size != 1) {
msg_Err(filter, "Unsupported chroma (%4.4s)",
(char*)&(filter->fmt_in.video.i_chroma));
return VLC_EGENERIC;
int cutoff_low = BANK_SIZE - var_InheritInteger(filter, CFG_PREFIX "period-max");
int cutoff_high= BANK_SIZE - var_InheritInteger(filter, CFG_PREFIX "period-min");
- cutoff_low = __MIN(__MAX(cutoff_low, 1), BANK_SIZE - 1);
- cutoff_high = __MIN(__MAX(cutoff_high, 1), BANK_SIZE - 1);
+ cutoff_low = VLC_CLIP(cutoff_low, 1, BANK_SIZE - 1);
+ cutoff_high = VLC_CLIP(cutoff_high, 1, BANK_SIZE - 1);
if (Generate(sys->bank, cutoff_low, cutoff_high, cutoff_low, cutoff_high)) {
free(sys);
return VLC_EGENERIC;
filter_t *filter = (filter_t *)object;
filter_sys_t *sys = filter->p_sys;
+ var_DelCallback(filter, CFG_PREFIX "variance", Callback, NULL);
vlc_mutex_destroy(&sys->cfg.lock);
free(sys);
}