[FFmpeg-soc] [PATCH 7/9] Enable multithreaded MDEC.

Alexander Strange astrange at ithinksw.com
Thu May 29 05:53:58 CEST 2008


---
  libavcodec/mdec.c |   15 ++++++++++++++-
  1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 356e031..48dd1f5 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -247,6 +247,18 @@ static av_cold int decode_init(AVCodecContext  
*avctx){
      return 0;
  }

+static av_cold int decode_init_copy(AVCodecContext *avctx){
+    MDECContext * const a = avctx->priv_data;
+    AVFrame *p = (AVFrame*)&a->picture;
+
+    avctx->coded_frame= p;
+    a->avctx= avctx;
+
+    p->qscale_table= av_mallocz( p->qstride * a->mb_height);
+
+    return 0;
+}
+
  static av_cold int decode_end(AVCodecContext *avctx){
      MDECContext * const a = avctx->priv_data;

@@ -266,6 +278,7 @@ AVCodec mdec_decoder = {
      NULL,
      decode_end,
      decode_frame,
-    CODEC_CAP_DR1,
+    CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
+    .init_copy = decode_init_copy
  };

-- 
1.5.5.1




More information about the FFmpeg-soc mailing list