fix quantizer export for interlaced video
authorhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 4 Nov 2006 07:05:21 +0000 (07:05 +0000)
committerhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>
Sat, 4 Nov 2006 07:05:21 +0000 (07:05 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@20654 b3059339-0415-0410-9bf9-f77b7e298cf2

libmpeg2/slice.c

index 308ff5d..0cba9f3 100644 (file)
@@ -1569,9 +1569,18 @@ do {                                                             \
 
 #define NEXT_MACROBLOCK                                                        \
 do {                                                                   \
-    if(decoder->quant_store)                                            \
+    if(decoder->quant_store) {                                          \
+       if (decoder->picture_structure == TOP_FIELD)                     \
+        decoder->quant_store[2*decoder->quant_stride*(decoder->v_offset>>4) \
+                    +(decoder->offset>>4)] = decoder->quantizer_scale;  \
+       else if (decoder->picture_structure == BOTTOM_FIELD)             \
+        decoder->quant_store[2*decoder->quant_stride*(decoder->v_offset>>4) \
+                   + decoder->quant_stride                             \
+                    +(decoder->offset>>4)] = decoder->quantizer_scale;  \
+       else                                                             \
         decoder->quant_store[decoder->quant_stride*(decoder->v_offset>>4) \
                     +(decoder->offset>>4)] = decoder->quantizer_scale;  \
+    }                                                                   \
     decoder->offset += 16;                                             \
     if (decoder->offset == decoder->width) {                           \
        do { /* just so we can use the break statement */               \