* qatar/master: mlpdsp: adding missing file dsputil: split out mlp dsp function sh4: add required #include, fix build averror: make error values proper negative values build: do not use LIB as variable name build: whitespace cosmetics build: remove single-use variable THIS_LIB Conflicts: libavutil/error.h Merged-by: Michael Niedermayer <michaelni@gmx.at>tags/n1.1
| @@ -2963,10 +2963,6 @@ av_cold void ff_dsputil_init(DSPContext* c, AVCodecContext *avctx) | |||||
| #undef dspfunc | #undef dspfunc | ||||
| #if CONFIG_MLP_DECODER || CONFIG_TRUEHD_DECODER | |||||
| ff_mlp_init(c, avctx); | |||||
| #endif | |||||
| c->put_mspel_pixels_tab[0]= ff_put_pixels8x8_c; | c->put_mspel_pixels_tab[0]= ff_put_pixels8x8_c; | ||||
| c->put_mspel_pixels_tab[1]= put_mspel8_mc10_c; | c->put_mspel_pixels_tab[1]= put_mspel8_mc10_c; | ||||
| c->put_mspel_pixels_tab[2]= put_mspel8_mc20_c; | c->put_mspel_pixels_tab[2]= put_mspel8_mc20_c; | ||||
| @@ -489,12 +489,6 @@ typedef struct DSPContext { | |||||
| void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); | void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height); | ||||
| /* mlp/truehd functions */ | |||||
| void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff, | |||||
| int firorder, int iirorder, | |||||
| unsigned int filter_shift, int32_t mask, int blocksize, | |||||
| int32_t *sample_buffer); | |||||
| /** | /** | ||||
| * Calculate scalar product of two vectors. | * Calculate scalar product of two vectors. | ||||
| * @param len length of vectors, should be multiple of 16 | * @param len length of vectors, should be multiple of 16 | ||||
| @@ -624,8 +618,6 @@ void ff_dsputil_init_vis(DSPContext* c, AVCodecContext *avctx); | |||||
| void ff_dsputil_init_mips(DSPContext* c, AVCodecContext *avctx); | void ff_dsputil_init_mips(DSPContext* c, AVCodecContext *avctx); | ||||
| void ff_dsputil_init_dwt(DSPContext *c); | void ff_dsputil_init_dwt(DSPContext *c); | ||||
| void ff_mlp_init(DSPContext* c, AVCodecContext *avctx); | |||||
| void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx); | |||||
| #if (ARCH_ARM && HAVE_NEON) || ARCH_PPC || HAVE_MMI || HAVE_MMX | #if (ARCH_ARM && HAVE_NEON) || ARCH_PPC || HAVE_MMI || HAVE_MMX | ||||
| # define STRIDE_ALIGN 16 | # define STRIDE_ALIGN 16 | ||||
| @@ -27,12 +27,12 @@ | |||||
| #include <stdint.h> | #include <stdint.h> | ||||
| #include "avcodec.h" | #include "avcodec.h" | ||||
| #include "dsputil.h" | |||||
| #include "libavutil/intreadwrite.h" | #include "libavutil/intreadwrite.h" | ||||
| #include "get_bits.h" | #include "get_bits.h" | ||||
| #include "libavutil/crc.h" | #include "libavutil/crc.h" | ||||
| #include "parser.h" | #include "parser.h" | ||||
| #include "mlp_parser.h" | #include "mlp_parser.h" | ||||
| #include "mlpdsp.h" | |||||
| #include "mlp.h" | #include "mlp.h" | ||||
| /** number of bits used for VLC lookup - longest Huffman code is 9 */ | /** number of bits used for VLC lookup - longest Huffman code is 9 */ | ||||
| @@ -145,7 +145,7 @@ typedef struct MLPDecodeContext { | |||||
| int8_t bypassed_lsbs[MAX_BLOCKSIZE][MAX_CHANNELS]; | int8_t bypassed_lsbs[MAX_BLOCKSIZE][MAX_CHANNELS]; | ||||
| int32_t sample_buffer[MAX_BLOCKSIZE][MAX_CHANNELS]; | int32_t sample_buffer[MAX_BLOCKSIZE][MAX_CHANNELS]; | ||||
| DSPContext dsp; | |||||
| MLPDSPContext dsp; | |||||
| } MLPDecodeContext; | } MLPDecodeContext; | ||||
| static VLC huff_vlc[3]; | static VLC huff_vlc[3]; | ||||
| @@ -235,7 +235,7 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx) | |||||
| m->avctx = avctx; | m->avctx = avctx; | ||||
| for (substr = 0; substr < MAX_SUBSTREAMS; substr++) | for (substr = 0; substr < MAX_SUBSTREAMS; substr++) | ||||
| m->substream[substr].lossless_check_data = 0xffffffff; | m->substream[substr].lossless_check_data = 0xffffffff; | ||||
| ff_dsputil_init(&m->dsp, avctx); | |||||
| ff_mlpdsp_init(&m->dsp); | |||||
| avcodec_get_frame_defaults(&m->frame); | avcodec_get_frame_defaults(&m->frame); | ||||
| avctx->coded_frame = &m->frame; | avctx->coded_frame = &m->frame; | ||||
| @@ -19,7 +19,8 @@ | |||||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||||
| */ | */ | ||||
| #include "dsputil.h" | |||||
| #include "config.h" | |||||
| #include "mlpdsp.h" | |||||
| #include "mlp.h" | #include "mlp.h" | ||||
| static void ff_mlp_filter_channel(int32_t *state, const int32_t *coeff, | static void ff_mlp_filter_channel(int32_t *state, const int32_t *coeff, | ||||
| @@ -55,9 +56,9 @@ static void ff_mlp_filter_channel(int32_t *state, const int32_t *coeff, | |||||
| } | } | ||||
| } | } | ||||
| void ff_mlp_init(DSPContext* c, AVCodecContext *avctx) | |||||
| void ff_mlpdsp_init(MLPDSPContext *c) | |||||
| { | { | ||||
| c->mlp_filter_channel = ff_mlp_filter_channel; | c->mlp_filter_channel = ff_mlp_filter_channel; | ||||
| if (ARCH_X86) | if (ARCH_X86) | ||||
| ff_mlp_init_x86(c, avctx); | |||||
| ff_mlpdsp_init_x86(c); | |||||
| } | } | ||||
| @@ -0,0 +1,37 @@ | |||||
| /* | |||||
| * MLP codec common header file | |||||
| * Copyright (c) 2007-2008 Ian Caulfield | |||||
| * | |||||
| * This file is part of FFmpeg. | |||||
| * | |||||
| * FFmpeg is free software; you can redistribute it and/or | |||||
| * modify it under the terms of the GNU Lesser General Public | |||||
| * License as published by the Free Software Foundation; either | |||||
| * version 2.1 of the License, or (at your option) any later version. | |||||
| * | |||||
| * FFmpeg is distributed in the hope that it will be useful, | |||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||||
| * Lesser General Public License for more details. | |||||
| * | |||||
| * You should have received a copy of the GNU Lesser General Public | |||||
| * License along with FFmpeg; if not, write to the Free Software | |||||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||||
| */ | |||||
| #ifndef AVCODEC_MLPDSP_H | |||||
| #define AVCODEC_MLPDSP_H | |||||
| #include <stdint.h> | |||||
| typedef struct MLPDSPContext { | |||||
| void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff, | |||||
| int firorder, int iirorder, | |||||
| unsigned int filter_shift, int32_t mask, | |||||
| int blocksize, int32_t *sample_buffer); | |||||
| } MLPDSPContext; | |||||
| void ff_mlpdsp_init(MLPDSPContext *c); | |||||
| void ff_mlpdsp_init_x86(MLPDSPContext *c); | |||||
| #endif /* AVCODEC_MLPDSP_H */ | |||||
| @@ -21,6 +21,8 @@ | |||||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||||
| */ | */ | ||||
| #include "libavutil/common.h" | |||||
| #define PIXOP2(OPNAME, OP) \ | #define PIXOP2(OPNAME, OP) \ | ||||
| \ | \ | ||||
| static inline void OPNAME ## _pixels4_l2_aligned(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \ | static inline void OPNAME ## _pixels4_l2_aligned(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, int src_stride1, int src_stride2, int h) \ | ||||
| @@ -20,7 +20,7 @@ | |||||
| */ | */ | ||||
| #include "libavutil/x86/asm.h" | #include "libavutil/x86/asm.h" | ||||
| #include "libavcodec/dsputil.h" | |||||
| #include "libavcodec/mlpdsp.h" | |||||
| #include "libavcodec/mlp.h" | #include "libavcodec/mlp.h" | ||||
| #if HAVE_7REGS && HAVE_INLINE_ASM | #if HAVE_7REGS && HAVE_INLINE_ASM | ||||
| @@ -173,7 +173,7 @@ static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff, | |||||
| #endif /* HAVE_7REGS && HAVE_INLINE_ASM */ | #endif /* HAVE_7REGS && HAVE_INLINE_ASM */ | ||||
| void ff_mlp_init_x86(DSPContext* c, AVCodecContext *avctx) | |||||
| void ff_mlpdsp_init_x86(MLPDSPContext *c) | |||||
| { | { | ||||
| #if HAVE_7REGS && HAVE_INLINE_ASM | #if HAVE_7REGS && HAVE_INLINE_ASM | ||||
| c->mlp_filter_channel = mlp_filter_channel_x86; | c->mlp_filter_channel = mlp_filter_channel_x86; | ||||
| @@ -5,7 +5,6 @@ include $(SRC_PATH)/common.mak | |||||
| LIBVERSION := $(lib$(NAME)_VERSION) | LIBVERSION := $(lib$(NAME)_VERSION) | ||||
| LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR) | LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR) | ||||
| INCINSTDIR := $(INCDIR)/lib$(NAME) | INCINSTDIR := $(INCDIR)/lib$(NAME) | ||||
| THIS_LIB := $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME) | |||||
| all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME) | all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME) | ||||
| all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME) | all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME) | ||||
| @@ -34,11 +33,11 @@ install-libs-$(CONFIG_STATIC): install-lib$(NAME)-static | |||||
| install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared | install-libs-$(CONFIG_SHARED): install-lib$(NAME)-shared | ||||
| define RULES | define RULES | ||||
| $(EXAMPLES) $(TOOLS): LIB = $(FULLNAME:%=$(LD_LIB)) | |||||
| $(TESTPROGS): LIB = $(SUBDIR)$(LIBNAME) | |||||
| $(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB)) | |||||
| $(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME) | |||||
| $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o | $(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o | ||||
| $$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(LIB) $(FFEXTRALIBS) $$(ELIBS) | |||||
| $$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS) | |||||
| $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) | $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) | ||||
| $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME) | $(Q)cd ./$(SUBDIR) && $(LN_S) $(SLIBNAME_WITH_MAJOR) $(SLIBNAME) | ||||
| @@ -97,8 +96,8 @@ endef | |||||
| $(eval $(RULES)) | $(eval $(RULES)) | ||||
| $(EXAMPLES) $(TOOLS): $(THIS_LIB) $(DEP_LIBS) | |||||
| $(TESTPROGS): $(SUBDIR)$(LIBNAME) $(DEP_LIBS) | |||||
| $(EXAMPLES) $(TOOLS): $(DEP_LIBS) $(SUBDIR)$($(CONFIG_SHARED:yes=S)LIBNAME) | |||||
| $(TESTPROGS): $(DEP_LIBS) $(SUBDIR)$(LIBNAME) | |||||
| examples: $(EXAMPLES) | examples: $(EXAMPLES) | ||||
| testprogs: $(TESTPROGS) | testprogs: $(TESTPROGS) | ||||