[FFmpeg-cvslog] lavc/vp56: Refactor ff_vp56_init into ff_vp56_init/ff_vp56_init_context
Ben Jackson
git at videolan.org
Sat Sep 15 20:52:14 CEST 2012
ffmpeg | branch: master | Ben Jackson <ben at ben.com> | Sat Sep 15 10:32:39 2012 -0700| [23503cadd15929aeea4a4fc8dde8aad54ecf6846] | committer: Michael Niedermayer
lavc/vp56: Refactor ff_vp56_init into ff_vp56_init/ff_vp56_init_context
Pave the way for per-thread context initialization.
Signed-off-by: Ben Jackson <ben at ben.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=23503cadd15929aeea4a4fc8dde8aad54ecf6846
---
libavcodec/vp56.c | 12 ++++++++++++
libavcodec/vp56.h | 3 +++
2 files changed, 15 insertions(+)
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index f3f7eca..b8e183c 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -661,6 +661,12 @@ int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
av_cold void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha)
{
VP56Context *s = avctx->priv_data;
+ ff_vp56_init_context(avctx, s, flip, has_alpha);
+}
+
+av_cold void ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s,
+ int flip, int has_alpha)
+{
int i;
s->avctx = avctx;
@@ -702,6 +708,12 @@ av_cold void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha)
av_cold int ff_vp56_free(AVCodecContext *avctx)
{
VP56Context *s = avctx->priv_data;
+ return ff_vp56_free_context(s);
+}
+
+av_cold int ff_vp56_free_context(VP56Context *s)
+{
+ AVCodecContext *avctx = s->avctx;
av_freep(&s->qscale_table);
av_freep(&s->above_blocks);
diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h
index d8f7ce6..8256bee 100644
--- a/libavcodec/vp56.h
+++ b/libavcodec/vp56.h
@@ -174,7 +174,10 @@ struct vp56_context {
void ff_vp56_init(AVCodecContext *avctx, int flip, int has_alpha);
+void ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s,
+ int flip, int has_alpha);
int ff_vp56_free(AVCodecContext *avctx);
+int ff_vp56_free_context(VP56Context *s);
void ff_vp56_init_dequant(VP56Context *s, int quantizer);
int ff_vp56_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
AVPacket *avpkt);
More information about the ffmpeg-cvslog
mailing list