diff options
author | Ben Avison <bavison@riscosopen.org> | 2014-07-21 14:53:08 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-08-04 22:22:54 +0200 |
commit | adf8227cf4e7b4fccb2ad88e1e09b6dc00dd00ed (patch) | |
tree | 4d42e1740f55099c18465d032c9d9239b253713d /libavcodec | |
parent | db7f1c7c5a1d37e7f4da64a79a97bea1c4b6e9f8 (diff) | |
download | ffmpeg-adf8227cf4e7b4fccb2ad88e1e09b6dc00dd00ed.tar.gz |
vc-1: Add platform-specific start code search routine to VC1DSPContext.
Initialise VC1DSPContext for parser as well as for decoder.
Note, the VC-1 code doesn't actually use the function pointer yet.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/Makefile | 2 | ||||
-rw-r--r-- | libavcodec/arm/vc1dsp_init_arm.c | 3 | ||||
-rw-r--r-- | libavcodec/vc1.c | 2 | ||||
-rw-r--r-- | libavcodec/vc1dec.c | 1 | ||||
-rw-r--r-- | libavcodec/vc1dsp.c | 3 | ||||
-rw-r--r-- | libavcodec/vc1dsp.h | 8 |
6 files changed, 17 insertions, 2 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 7d19e6ed67..d59bd1c9eb 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -674,7 +674,7 @@ OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o OBJS-$(CONFIG_TAK_PARSER) += tak_parser.o tak.o -OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \ +OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o vc1dsp.o \ msmpeg4.o msmpeg4data.o mpeg4video.o \ h263.o OBJS-$(CONFIG_VORBIS_PARSER) += vorbis_parser.o xiph.o diff --git a/libavcodec/arm/vc1dsp_init_arm.c b/libavcodec/arm/vc1dsp_init_arm.c index 6d4eb79487..a6a97c8bf9 100644 --- a/libavcodec/arm/vc1dsp_init_arm.c +++ b/libavcodec/arm/vc1dsp_init_arm.c @@ -20,6 +20,7 @@ #include "libavutil/attributes.h" #include "libavutil/arm/cpu.h" +#include "libavcodec/arm/startcode.h" #include "libavcodec/vc1dsp.h" #include "vc1dsp.h" @@ -27,6 +28,8 @@ av_cold void ff_vc1dsp_init_arm(VC1DSPContext *dsp) { int cpu_flags = av_get_cpu_flags(); + if (have_setend(cpu_flags)) + dsp->startcode_find_candidate = ff_startcode_find_candidate_armv6; if (have_neon(cpu_flags)) ff_vc1dsp_init_neon(dsp); } diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index 1978b085a5..cef0fe6eb8 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -1688,5 +1688,7 @@ av_cold int ff_vc1_init_common(VC1Context *v) v->pq = -1; v->mvrange = 0; /* 7.1.1.18, p80 */ + ff_vc1dsp_init(&v->vc1dsp); + return 0; } diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index c83bb4fb77..f7f6a9f121 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5629,7 +5629,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) ff_blockdsp_init(&s->bdsp, avctx); ff_h264chroma_init(&v->h264chroma, 8); ff_qpeldsp_init(&s->qdsp); - ff_vc1dsp_init(&v->vc1dsp); if (avctx->codec_id == AV_CODEC_ID_WMV3 || avctx->codec_id == AV_CODEC_ID_WMV3IMAGE) { int count = 0; diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index 3b92eb2ea5..a193dd704d 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -29,6 +29,7 @@ #include "h264chroma.h" #include "qpeldsp.h" #include "vc1dsp.h" +#include "startcode.h" /* Apply overlap transform to horizontal edge */ static void vc1_v_overlap_c(uint8_t *src, int stride) @@ -948,6 +949,8 @@ av_cold void ff_vc1dsp_init(VC1DSPContext *dsp) dsp->sprite_v_double_twoscale = sprite_v_double_twoscale_c; #endif /* CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER */ + dsp->startcode_find_candidate = ff_startcode_find_candidate_c; + if (ARCH_AARCH64) ff_vc1dsp_init_aarch64(dsp); if (ARCH_ARM) diff --git a/libavcodec/vc1dsp.h b/libavcodec/vc1dsp.h index 7de6a3da46..682f682144 100644 --- a/libavcodec/vc1dsp.h +++ b/libavcodec/vc1dsp.h @@ -71,6 +71,14 @@ typedef struct VC1DSPContext { void (*sprite_v_double_twoscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1, const uint8_t *src2a, const uint8_t *src2b, int offset2, int alpha, int width); + + /** + * Search buf from the start for up to size bytes. Return the index + * of a zero byte, or >= size if not found. Ideally, use lookahead + * to filter out any zero bytes that are known to not be followed by + * one or more further zero bytes and a one byte. + */ + int (*startcode_find_candidate)(const uint8_t *buf, int size); } VC1DSPContext; void ff_vc1dsp_init(VC1DSPContext* c); |