changeset 60:35c1141e23d9 libavcodec

moved matrix init away from MPV_common_init()
author glantau
date Sun, 12 Aug 2001 00:52:37 +0000
parents efd3c19f6d62
children fefaa96def6e
files h263dec.c mpegvideo.c rv10.c
diffstat 3 files changed, 20 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/h263dec.c	Sun Aug 12 00:52:01 2001 +0000
+++ b/h263dec.c	Sun Aug 12 00:52:37 2001 +0000
@@ -28,7 +28,8 @@
 static int h263_decode_init(AVCodecContext *avctx)
 {
     MpegEncContext *s = avctx->priv_data;
-    
+    int i;
+
     s->out_format = FMT_H263;
 
     s->width = avctx->width;
@@ -57,6 +58,11 @@
     if (MPV_common_init(s) < 0)
         return -1;
 
+    /* XXX: suppress this matrix init, only needed because using mpeg1
+       dequantize in mmx case */
+    for(i=0;i<64;i++)
+        s->non_intra_matrix[i] = default_non_intra_matrix[i];
+
     if (s->h263_msmpeg4)
         msmpeg4_decode_init_vlc(s);
     else
--- a/mpegvideo.c	Sun Aug 12 00:52:01 2001 +0000
+++ b/mpegvideo.c	Sun Aug 12 00:52:37 2001 +0000
@@ -183,13 +183,6 @@
     /* default structure is frame */
     s->picture_structure = PICT_FRAME;
 
-    /* init default q matrix (only for mpeg and mjpeg) */
-    for(i=0;i<64;i++) {
-        s->intra_matrix[i] = default_intra_matrix[i];
-        s->chroma_intra_matrix[i] = default_intra_matrix[i];
-        s->non_intra_matrix[i] = default_non_intra_matrix[i];
-        s->chroma_non_intra_matrix[i] = default_non_intra_matrix[i];
-    }
     /* init macroblock skip table */
     if (!s->encoding) {
         s->mbskip_table = av_mallocz(s->mb_width * s->mb_height);
@@ -248,6 +241,7 @@
 int MPV_encode_init(AVCodecContext *avctx)
 {
     MpegEncContext *s = avctx->priv_data;
+    int i;
 
     s->bit_rate = avctx->bit_rate;
     s->frame_rate = avctx->frame_rate;
@@ -312,6 +306,12 @@
     if (MPV_common_init(s) < 0)
         return -1;
     
+    /* init default q matrix */
+    for(i=0;i<64;i++) {
+        s->intra_matrix[i] = default_intra_matrix[i];
+        s->non_intra_matrix[i] = default_non_intra_matrix[i];
+    }
+
     /* rate control init */
     rate_control_init(s);
 
--- a/rv10.c	Sun Aug 12 00:52:01 2001 +0000
+++ b/rv10.c	Sun Aug 12 00:52:37 2001 +0000
@@ -337,6 +337,7 @@
 static int rv10_decode_init(AVCodecContext *avctx)
 {
     MpegEncContext *s = avctx->priv_data;
+    int i;
     static int done;
 
     s->out_format = FMT_H263;
@@ -350,6 +351,11 @@
     if (MPV_common_init(s) < 0)
         return -1;
 
+    /* XXX: suppress this matrix init, only needed because using mpeg1
+       dequantize in mmx case */
+    for(i=0;i<64;i++)
+        s->non_intra_matrix[i] = default_non_intra_matrix[i];
+
     h263_decode_init_vlc(s);
 
     /* init rv vlc */