| @@ -28,6 +28,8 @@ · 27 unmodified lines |
| 28 | 28 | |
| 29 | 29 | extern void ff_process_one_line_mmxext(const uint8_t *src, uint8_t *dst, short contrast, |
| 30 | 30 | short brightness, int w); |
| 31 | +extern void ff_process_one_line_sse2(const uint8_t *src, uint8_t *dst, short contrast, |
| 32 | + short brightness, int w); |
| 31 | 33 | |
| 32 | 34 | static void process_mmxext(EQParameters *param, uint8_t *dst, int dst_stride, |
| 33 | 35 | const uint8_t *src, int src_stride, int w, int h) |
| @@ -44,6 +46,20 @@ static void process_mmxext(EQParameters *param, uint8_t *dst, int dst_stride, · 10 unmodified lines |
| 44 | 46 | emms_c(); |
| 45 | 47 | } |
| 46 | 48 | |
| 49 | +static void process_sse2(EQParameters *param, uint8_t *dst, int dst_stride, |
| 50 | + const uint8_t *src, int src_stride, int w, int h) |
| 51 | +{ |
| 52 | + short contrast = (short) (param->contrast * 256 * 16); |
| 53 | + short brightness = ((short) (100.0 * param->brightness + 100.0) * 511) |
| 54 | + / 200 - 128 - contrast / 32; |
| 55 | + |
| 56 | + while (h--) { |
| 57 | + ff_process_one_line_sse2(src, dst, contrast, brightness, w); |
| 58 | + src += src_stride; |
| 59 | + dst += dst_stride; |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 47 | 63 | av_cold void ff_eq_init_x86(EQContext *eq) |
| 48 | 64 | { |
| 49 | 65 | int cpu_flags = av_get_cpu_flags(); |
| @@ -51,4 +67,7 @@ av_cold void ff_eq_init_x86(EQContext *eq) · 1 unmodified line |
| 51 | 67 | if (cpu_flags & AV_CPU_FLAG_MMXEXT) { |
| 52 | 68 | eq->process = process_mmxext; |
| 53 | 69 | } |
| 70 | + if (cpu_flags & AV_CPU_FLAG_SSE2) { |
| 71 | + eq->process = process_sse2; |
| 72 | + } |
| 54 | 73 | } |