aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2001-08-12 00:52:37 +0000
committerFabrice Bellard <fabrice@bellard.org>2001-08-12 00:52:37 +0000
commit519c2b6d1182513a83efee5b1e8634a7feaedbbf (patch)
treead1720a8fe7f69a95acf165729b998cc2452f4ee
parent25ed7f9235a4e2ad0d2089b002622288fc756d73 (diff)
downloadffmpeg-519c2b6d1182513a83efee5b1e8634a7feaedbbf.tar.gz
moved matrix init away from MPV_common_init()
Originally committed as revision 77 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h263dec.c8
-rw-r--r--libavcodec/mpegvideo.c14
-rw-r--r--libavcodec/rv10.c6
3 files changed, 20 insertions, 8 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 8bbd3a7580..02fedd90a7 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -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 @@ static int h263_decode_init(AVCodecContext *avctx)
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
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index dae15de171..e8cc3ced0b 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -183,13 +183,6 @@ int MPV_common_init(MpegEncContext *s)
/* 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 @@ void MPV_common_end(MpegEncContext *s)
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 @@ int MPV_encode_init(AVCodecContext *avctx)
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);
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index b03cd02937..f4ebc90160 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -337,6 +337,7 @@ static int rv10_decode_picture_header(MpegEncContext *s)
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 @@ static int rv10_decode_init(AVCodecContext *avctx)
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 */