changeset 2452:73a66a4a6ab4 libavcodec

more detailed error messages
author michael
date Sun, 23 Jan 2005 17:59:01 +0000
parents 0fcee7879d3f
children f67b63ed036d
files svq3.c
diffstat 1 files changed, 28 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/svq3.c	Sun Jan 23 16:18:10 2005 +0000
+++ b/svq3.c	Sun Jan 23 17:59:01 2005 +0000
@@ -370,6 +370,7 @@
 	dx = svq3_get_se_golomb (&s->gb);
 
 	if (dx == INVALID_VLC || dy == INVALID_VLC) {
+          av_log(h->s.avctx, AV_LOG_ERROR, "invalid MV vlc\n");
 	  return -1;
 	}
       }
@@ -564,8 +565,10 @@
       for (i=0; i < 16; i+=2) {
 	vlc = svq3_get_ue_golomb (&s->gb);
 
-	if (vlc >= 25)
+	if (vlc >= 25){
+          av_log(h->s.avctx, AV_LOG_ERROR, "luma prediction:%d\n", vlc);
 	  return -1;
+        }
 
 	left	= &h->intra4x4_pred_mode_cache[scan8[i] - 1];
 	top	= &h->intra4x4_pred_mode_cache[scan8[i] - 8];
@@ -573,8 +576,10 @@
 	left[1]	= svq3_pred_1[top[0] + 1][left[0] + 1][svq3_pred_0[vlc][0]];
 	left[2]	= svq3_pred_1[top[1] + 1][left[1] + 1][svq3_pred_0[vlc][1]];
 
-	if (left[1] == -1 || left[2] == -1)
+	if (left[1] == -1 || left[2] == -1){
+          av_log(h->s.avctx, AV_LOG_ERROR, "weird prediction\n");
 	  return -1;
+        }
       }
     } else {	/* mb_type == 33, DC_128_PRED block type */
       for (i=0; i < 4; i++) {
@@ -603,8 +608,10 @@
     dir = i_mb_type_info[mb_type - 8].pred_mode;
     dir = (dir >> 1) ^ 3*(dir & 1) ^ 1;
 
-    if ((h->intra16x16_pred_mode = check_intra_pred_mode (h, dir)) == -1)
+    if ((h->intra16x16_pred_mode = check_intra_pred_mode (h, dir)) == -1){
+      av_log(h->s.avctx, AV_LOG_ERROR, "check_intra_pred_mode = -1\n");
       return -1;
+    }
 
     cbp = i_mb_type_info[mb_type - 8].cbp;
     mb_type = MB_TYPE_INTRA16x16;
@@ -629,20 +636,26 @@
   }
 
   if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == B_TYPE)) {
-    if ((vlc = svq3_get_ue_golomb (&s->gb)) >= 48)
+    if ((vlc = svq3_get_ue_golomb (&s->gb)) >= 48){
+      av_log(h->s.avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
       return -1;
+    }
 
     cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc] : golomb_to_inter_cbp[vlc];
   }
   if (IS_INTRA16x16(mb_type) || (s->pict_type != I_TYPE && s->adaptive_quant && cbp)) {
     s->qscale += svq3_get_se_golomb (&s->gb);
 
-    if (s->qscale > 31)
+    if (s->qscale > 31){
+      av_log(h->s.avctx, AV_LOG_ERROR, "qscale:%d\n", s->qscale);
       return -1;
+    }
   }
   if (IS_INTRA16x16(mb_type)) {
-    if (svq3_decode_block (&s->gb, h->mb, 0, 0))
+    if (svq3_decode_block (&s->gb, h->mb, 0, 0)){
+      av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding intra luma dc\n");
       return -1;
+    }
   }
 
   if (cbp) {
@@ -655,24 +668,30 @@
 	  k = index ? ((j&1) + 2*(i&1) + 2*(j&2) + 4*(i&2)) : (4*i + j);
 	  h->non_zero_count_cache[ scan8[k] ] = 1;
 
-	  if (svq3_decode_block (&s->gb, &h->mb[16*k], index, type))
+	  if (svq3_decode_block (&s->gb, &h->mb[16*k], index, type)){
+            av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding block\n");
 	    return -1;
+          }
 	}
       }
     }
 
     if ((cbp & 0x30)) {
       for (i=0; i < 2; ++i) {
-	if (svq3_decode_block (&s->gb, &h->mb[16*(16 + 4*i)], 0, 3))
+	if (svq3_decode_block (&s->gb, &h->mb[16*(16 + 4*i)], 0, 3)){
+          av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding chroma dc block\n");
 	  return -1;
+        }
       }
 
       if ((cbp & 0x20)) {
 	for (i=0; i < 8; i++) {
 	  h->non_zero_count_cache[ scan8[16+i] ] = 1;
 
-	  if (svq3_decode_block (&s->gb, &h->mb[16*(16 + i)], 1, 1))
+	  if (svq3_decode_block (&s->gb, &h->mb[16*(16 + i)], 1, 1)){
+            av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding chroma ac block\n");
 	    return -1;
+          }
 	}
       }
     }