[FFmpeg-devel] [PATCH] reduce size of qscale_table in mdec.c

Reimar Döffinger Reimar.Doeffinger
Sat Jan 23 14:30:08 CET 2010


Hello,
mdec has the same qscale for all data, so it can just set the stride to 0
and allocate only one line, as in patch below.
Does this look ok?
(trying to understand how all this works, what I really want is for
vp6 to export qscale, some flash videos really could use some heavy
deblocking).
Index: mdec.c
===================================================================
--- mdec.c	(revision 21394)
+++ mdec.c	(working copy)
@@ -201,7 +201,7 @@
     }
 
     p->quality= a->qscale * FF_QP2LAMBDA;
-    memset(p->qscale_table, a->qscale, p->qstride*a->mb_height);
+    memset(p->qscale_table, a->qscale, a->mb_height);
 
     *picture   = a->picture;
     *data_size = sizeof(AVPicture);
@@ -229,8 +229,8 @@
     ff_mpeg12_init_vlcs();
     ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_zigzag_direct);
 
-    p->qstride= a->mb_width;
-    p->qscale_table= av_mallocz( p->qstride * a->mb_height);
+    p->qstride= 0;
+    p->qscale_table= av_mallocz(a->mb_height);
     avctx->pix_fmt= PIX_FMT_YUV420P;
 
     return 0;




More information about the ffmpeg-devel mailing list