snow: fix 32x32 encoding
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 12 May 2012 01:35:19 +0000 (03:35 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 12 May 2012 01:36:17 +0000 (03:36 +0200)
Fixes ticket1083

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/snowenc.c

index ea66d5f..7091960 100644 (file)
@@ -1712,6 +1712,10 @@ redo_frame:
     else
         s->spatial_decomposition_count= 5;
 
+    while(   !(width >>(s->chroma_h_shift + s->spatial_decomposition_count))
+          || !(height>>(s->chroma_v_shift + s->spatial_decomposition_count)))
+        s->spatial_decomposition_count--;
+
     s->m.pict_type = pic->pict_type;
     s->qbias = pic->pict_type == AV_PICTURE_TYPE_P ? 2 : 0;