From 5eccffced322e7912b6ec7db85dd80f9a97b42bb Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 28 Aug 2010 16:45:06 +0200 Subject: [PATCH] :v --- hqflt/ntsc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hqflt/ntsc.c b/hqflt/ntsc.c index 3f66859d6e..8c1ca40db9 100644 --- a/hqflt/ntsc.c +++ b/hqflt/ntsc.c @@ -3,11 +3,14 @@ void ntsc_filter(uint16_t * restrict out, const uint16_t * restrict in, int width, int height) { + static snes_ntsc_t *ntsc = NULL; static int phase = 0; - snes_ntsc_t *ntsc = calloc(1, sizeof(snes_ntsc_t)); - snes_ntsc_init(ntsc, &snes_ntsc_composite); + if (ntsc == NULL) + { + ntsc = calloc(1, sizeof(snes_ntsc_t)); + snes_ntsc_init(ntsc, &snes_ntsc_composite); + } snes_ntsc_blit(ntsc, in, width, phase, width, height, out, SNES_NTSC_OUT_WIDTH(width) * sizeof(uint16_t)); - free(ntsc); phase = (phase + 1) % 4; }