44 unsigned char lut[256];
51 unsigned w,
unsigned h,
unsigned dstride,
unsigned sstride);
74 unsigned char *
buf[3];
89 if ((g < 0.001) || (g > 1000.0)) {
95 for (i = 0; i < 256; i++) {
96 v = (double) i / 255.0;
97 v = par->
c * (v - 0.5) + 0.5 + par->
b;
103 v = v*lw + pow(v, g)*gw;
109 par->
lut[
i] = (
unsigned char) (256.0 * v);
115 for(i=0; i<256*256; i++){
126 unsigned w,
unsigned h,
unsigned dstride,
unsigned sstride)
129 int contrast, brightness;
130 unsigned dstep, sstep;
137 contrast = (int) (par->
c * 256 * 16);
138 brightness = ((int) (100.0 * par->
b + 100.0) * 511) / 200 - 128 - contrast / 32;
140 brvec[0] = brvec[1] = brvec[2] = brvec[3] = brightness;
141 contvec[0] = contvec[1] = contvec[2] = contvec[3] = contrast;
148 "movq (%5), %%mm3 \n\t" 149 "movq (%6), %%mm4 \n\t" 150 "pxor %%mm0, %%mm0 \n\t" 154 "movq (%0), %%mm1 \n\t" 155 "movq (%0), %%mm2 \n\t" 156 "punpcklbw %%mm0, %%mm1 \n\t" 157 "punpckhbw %%mm0, %%mm2 \n\t" 158 "psllw $4, %%mm1 \n\t" 159 "psllw $4, %%mm2 \n\t" 160 "pmulhw %%mm4, %%mm1 \n\t" 161 "pmulhw %%mm4, %%mm2 \n\t" 162 "paddw %%mm3, %%mm1 \n\t" 163 "paddw %%mm3, %%mm2 \n\t" 164 "packuswb %%mm2, %%mm1 \n\t" 166 "movq %%mm1, (%1) \n\t" 171 :
"0" (
src),
"1" (
dst),
"r" (w >> 3),
"r" (brvec),
"r" (contvec)
175 for (i = w & 7; i > 0; i--) {
176 pel = ((*
src++ * contrast) >> 12) + brightness;
187 __asm__
volatile (
"emms \n\t" :::
"memory" );
193 unsigned w,
unsigned h,
unsigned dstride,
unsigned sstride)
207 for (j = 0; j < h; j++) {
208 uint16_t *src16= (uint16_t*)src;
209 uint16_t *dst16= (uint16_t*)dst;
210 for (i = 0; i < w2; i+=4) {
211 dst16[i+0] = lut16[src16[i+0]];
212 dst16[i+1] = lut16[src16[i+1]];
213 dst16[i+2] = lut16[src16[i+2]];
214 dst16[i+3] = lut16[src16[i+3]];
219 for (j = 0; j < h; j++) {
220 for (i = 0; i < w2; i+=8) {
221 dst[i+0] = lut[src[i+0]];
222 dst[i+1] = lut[src[i+1]];
223 dst[i+2] = lut[src[i+2]];
224 dst[i+3] = lut[src[i+3]];
225 dst[i+4] = lut[src[i+4]];
226 dst[i+5] = lut[src[i+5]];
227 dst[i+6] = lut[src[i+6]];
228 dst[i+7] = lut[src[i+7]];
232 dst[
i] = lut[src[
i]];
246 unsigned long img_n,img_c;
250 if ((eq2->
buf_w[0] != src->
w) || (eq2->
buf_h[0] != src->
h)) {
258 eq2->
buf[0] = realloc (eq2->
buf[0], img_n + 2*img_c);
259 eq2->
buf[1] = eq2->
buf[0] + img_n;
260 eq2->
buf[2] = eq2->
buf[1] + img_c;
262 eq2->
buf[0] = realloc (eq2->
buf[0], img_n);
267 for (i = 0; i < ((src->
num_planes>1)?3:1); i++) {
289 if ((par->
c == 1.0) && (par->
b == 0.0) && (par->
g == 1.0)) {
294 par->
adjust = &affine_1d_MMX;
377 if (strcmp (eq->
item,
"gamma") == 0) {
381 else if (strcmp (eq->
item,
"contrast") == 0) {
385 else if (strcmp (eq->
item,
"brightness") == 0) {
389 else if (strcmp (eq->
item,
"saturation") == 0) {
397 if (strcmp (eq->
item,
"gamma") == 0) {
401 else if (strcmp (eq->
item,
"contrast") == 0) {
405 else if (strcmp (eq->
item,
"brightness") == 0) {
409 else if (strcmp (eq->
item,
"saturation") == 0) {
463 for (i = 0; i < 3; i++) {
494 sscanf (args,
"%lf:%lf:%lf:%lf:%lf:%lf:%lf:%lf",
495 par, par + 1, par + 2, par + 3, par + 4, par + 5, par + 6, par + 7
513 "Software equalizer",
515 "Hampa Hug, Daniel Moreno, Richard Felker",
static int put_image(vf_instance_t *vf, mp_image_t *src, double pts)
static void create_lut(eq2_param_t *par)
static void set_saturation(vf_eq2_t *eq2, double s)
int(* control)(struct vf_instance *vf, int request, void *data)
mp_image_t * ff_vf_get_image(vf_instance_t *vf, unsigned int outfmt, int mp_imgtype, int mp_imgflag, int w, int h)
#define MP_IMGTYPE_EXPORT
void(* uninit)(struct vf_instance *vf)
static void set_brightness(vf_eq2_t *eq2, double b)
int(* put_image)(struct vf_instance *vf, mp_image_t *mpi, double pts)
unsigned char * planes[MP_MAX_PLANES]
int stride[MP_MAX_PLANES]
int(* query_format)(struct vf_instance *vf, unsigned int fmt)
static int query_format(vf_instance_t *vf, unsigned fmt)
int ff_vf_next_control(struct vf_instance *vf, int request, void *data)
static void set_contrast(vf_eq2_t *eq2, double c)
#define ASMALIGN(ZEROBITS)
struct vf_instance * next
typedef void(RENAME(mix_any_func_type))
const vf_info_t ff_vf_info_eq2
synthesis window for stochastic i
static void apply_lut(eq2_param_t *par, unsigned char *dst, unsigned char *src, unsigned w, unsigned h, unsigned dstride, unsigned sstride)
#define VFCTRL_SET_EQUALIZER
void ff_mp_msg(int mod, int lev, const char *format,...)
static void uninit(vf_instance_t *vf)
static int vf_open(vf_instance_t *vf, char *args)
#define VFCTRL_GET_EQUALIZER
int ff_vf_next_put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
static void print_values(vf_eq2_t *eq2)
struct eq2_param_t eq2_param_t
else dst[i][x+y *dst_stride[i]]
static int control(vf_instance_t *vf, int request, void *data)
void(* adjust)(struct eq2_param_t *par, unsigned char *dst, unsigned char *src, unsigned w, unsigned h, unsigned dstride, unsigned sstride)
struct vf_priv_s vf_eq2_t
static void check_values(eq2_param_t *par)
int ff_vf_next_query_format(struct vf_instance *vf, unsigned int fmt)
MUSIC TECHNOLOGY GROUP UNIVERSITAT POMPEU FABRA Free Non Commercial Binary License Agreement UNIVERSITAT POMPEU OR INDICATING ACCEPTANCE BY SELECTING THE ACCEPT BUTTON ON ANY DOWNLOAD OR INSTALL YOU ACCEPT THE TERMS OF THE LICENSE SUMMARY TABLE Software MELODIA Melody Extraction vamp plug in Licensor Music Technology Group Universitat Pompeu Plaça de la Spain Permitted purposes Non commercial internal research and validation and educational purposes only All commercial uses in a production either internal or are prohibited by this license and require an additional commercial exploitation license TERMS AND CONDITIONS SOFTWARE Software means the software programs identified herein in binary any other machine readable any updates or error corrections provided by and any user programming guides and other documentation provided to you by UPF under this Agreement LICENSE Subject to the terms and conditions of this UPF grants you a royalty free
static void set_gamma(vf_eq2_t *eq2, double g)