# first so "all" becomes default target
all: all-yes
- IFLAGS := -I. -I$(SRC_PATH)/
- CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
- CFLAGS += $(ECFLAGS)
- YASMFLAGS += $(IFLAGS) -Pconfig.asm
-
+ifndef SUBDIR
+
+ifndef MAIN_MAKEFILE
+ifeq ($(SRC_PATH),.)
+SRC_PATH = ..
+endif
+endif
+
+ifndef V
+Q = @
+ECHO = printf "$(1)\t%s\n" $(2)
+BRIEF = CC AS YASM AR LD HOSTCC STRIP CP
+SILENT = DEPCC YASMDEP RM RANLIB
+MSG = $@
+M = @$(call ECHO,$(TAG),$@);
+$(foreach VAR,$(BRIEF), \
+ $(eval override $(VAR) = @$$(call ECHO,$(VAR),$$(MSG)); $($(VAR))))
+$(foreach VAR,$(SILENT),$(eval override $(VAR) = @$($(VAR))))
+$(eval INSTALL = @$(call ECHO,INSTALL,$$(^:$(SRC_DIR)/%=%)); $(INSTALL))
+endif
+
+# NASM requires -I path terminated with /
- $(CCDEP)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(CC_DEPFLAGS) -c $(CC_O) $<
++IFLAGS := -I. -I$(SRC_PATH)/
++CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
++CFLAGS += $(ECFLAGS)
++CCFLAGS = $(CFLAGS)
++YASMFLAGS += $(IFLAGS) -Pconfig.asm
+HOSTCFLAGS += $(IFLAGS)
+
++define COMPILE
++ $($(1)DEP)
++ $($(1)) $(CPPFLAGS) $($(1)FLAGS) $($(1)_DEPFLAGS) -c $($(1)_O) $<
++endef
++
++COMPILE_C = $(call COMPILE,CC)
++COMPILE_S = $(call COMPILE,AS)
++
+%.o: %.c
- $(ASDEP)
- $(AS) $(CPPFLAGS) $(ASFLAGS) $(AS_DEPFLAGS) -c -o $@ $<
++ $(COMPILE_C)
+
+%.o: %.S
++ $(COMPILE_S)
+
+%.ho: %.h
+ $(CC) $(CPPFLAGS) $(CFLAGS) -Wno-unused -c -o $@ -x c $<
+
+%.ver: %.v
+ $(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
+
+%.c %.h: TAG = GEN
+
+# Dummy rule to stop make trying to rebuild removed or renamed headers
+%.h:
+ @:
+
+# Disable suffix rules. Most of the builtin rules are suffix rules,
+# so this saves some time on slow systems.
+.SUFFIXES:
+
+# Do not delete intermediate files from chains of implicit rules
+$(OBJS):
+endif
+
OBJS-$(HAVE_MMX) += $(MMX-OBJS-yes)
OBJS += $(OBJS-yes)
CPPFLAGS=$CPPFLAGS
CFLAGS=$CFLAGS
ASFLAGS=$ASFLAGS
+ AS_O=$CC_O
CC_O=$CC_O
-DLLTOOL=$dlltool
LDFLAGS=$LDFLAGS
FFSERVERLDFLAGS=$FFSERVERLDFLAGS
SHFLAGS=$SHFLAGS
src= formatConvBuffer;
}
- if (!c->hyscale_fast) {
+ if (c->hScale16) {
+ int shift= isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1;
+ c->hScale16(dst, dstWidth, (const uint16_t*)src, srcW, xInc, hLumFilter, hLumFilterPos, hLumFilterSize, shift);
+ } else if (!c->hyscale_fast) {
- c->hScale(dst, dstWidth, src, srcW, xInc, hLumFilter, hLumFilterPos, hLumFilterSize);
+ c->hScale(dst, dstWidth, src, hLumFilter, hLumFilterPos, hLumFilterSize);
} else { // fast bilinear upscale / crap downscale
c->hyscale_fast(c, dst, dstWidth, src, srcW, xInc);
}
src2= buf2;
}
- if (!c->hcscale_fast) {
+ if (c->hScale16) {
+ int shift= isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1;
+ c->hScale16(dst1, dstWidth, (const uint16_t*)src1, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize, shift);
+ c->hScale16(dst2, dstWidth, (const uint16_t*)src2, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize, shift);
+ } else if (!c->hcscale_fast) {
- c->hScale(dst1, dstWidth, src1, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize);
- c->hScale(dst2, dstWidth, src2, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize);
+ c->hScale(dst1, dstWidth, src1, hChrFilter, hChrFilterPos, hChrFilterSize);
+ c->hScale(dst2, dstWidth, src2, hChrFilter, hChrFilterPos, hChrFilterSize);
} else { // fast bilinear upscale / crap downscale
c->hcscale_fast(c, dst1, dst2, dstWidth, src1, src2, srcW, xInc);
}
const uint8_t *src1, const uint8_t *src2,
int srcW, int xInc);
- void (*hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW,
- int xInc, const int16_t *filter, const int16_t *filterPos,
+ void (*hScale)(int16_t *dst, int dstW, const uint8_t *src,
+ const int16_t *filter, const int16_t *filterPos,
int filterSize);
+ void (*hScale16)(int16_t *dst, int dstW, const uint16_t *src, int srcW,
+ int xInc, const int16_t *filter, const int16_t *filterPos,
+ long filterSize, int shift);
+
void (*lumConvertRange)(int16_t *dst, int width); ///< Color range conversion function for luma plane if needed.
void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width); ///< Color range conversion function for chroma planes if needed.