diff h263dec.c @ 718:16dab8296293 libavcodec

fixing custom quantizer matrix decoding minor optimizations
author michaelni
date Wed, 02 Oct 2002 22:56:58 +0000
parents 6cba3b6196f0
children 25d7fb7c89be
line wrap: on
line diff
--- a/h263dec.c	Wed Oct 02 17:07:39 2002 +0000
+++ b/h263dec.c	Wed Oct 02 22:56:58 2002 +0000
@@ -164,6 +164,11 @@
         init_get_bits(&s->gb, buf, buf_size);
     s->bitstream_buffer_size=0;
 
+    if (!s->context_initialized) {
+        if (MPV_common_init(s) < 0) //we need the idct permutaton for reading a custom matrix
+            return -1;
+    }
+        
     /* let's go :-) */
     if (s->h263_msmpeg4) {
         ret = msmpeg4_decode_picture_header(s);
@@ -188,7 +193,10 @@
         /* and other parameters. So then we could init the picture   */
         /* FIXME: By the way H263 decoder is evolving it should have */
         /* an H263EncContext                                         */
-    if (s->width != avctx->width || s->height != avctx->height) {
+    if (   s->width != avctx->width || s->height != avctx->height 
+        || avctx->aspect_ratio_info != s->aspect_ratio_info
+        || avctx->aspected_width != s->aspected_width
+        || avctx->aspected_height != s->aspected_height) {
         /* H.263 could change picture size any time */
         MPV_common_end(s);
         s->context_initialized=0;