Mercurial > libavcodec.hg
comparison svq3.c @ 2452:73a66a4a6ab4 libavcodec
more detailed error messages
author | michael |
---|---|
date | Sun, 23 Jan 2005 17:59:01 +0000 |
parents | 19d4d5c6a8f4 |
children | f67b63ed036d |
comparison
equal
deleted
inserted
replaced
2451:0fcee7879d3f | 2452:73a66a4a6ab4 |
---|---|
368 } else { | 368 } else { |
369 dy = svq3_get_se_golomb (&s->gb); | 369 dy = svq3_get_se_golomb (&s->gb); |
370 dx = svq3_get_se_golomb (&s->gb); | 370 dx = svq3_get_se_golomb (&s->gb); |
371 | 371 |
372 if (dx == INVALID_VLC || dy == INVALID_VLC) { | 372 if (dx == INVALID_VLC || dy == INVALID_VLC) { |
373 av_log(h->s.avctx, AV_LOG_ERROR, "invalid MV vlc\n"); | |
373 return -1; | 374 return -1; |
374 } | 375 } |
375 } | 376 } |
376 | 377 |
377 /* compute motion vector */ | 378 /* compute motion vector */ |
562 | 563 |
563 /* decode prediction codes for luma blocks */ | 564 /* decode prediction codes for luma blocks */ |
564 for (i=0; i < 16; i+=2) { | 565 for (i=0; i < 16; i+=2) { |
565 vlc = svq3_get_ue_golomb (&s->gb); | 566 vlc = svq3_get_ue_golomb (&s->gb); |
566 | 567 |
567 if (vlc >= 25) | 568 if (vlc >= 25){ |
569 av_log(h->s.avctx, AV_LOG_ERROR, "luma prediction:%d\n", vlc); | |
568 return -1; | 570 return -1; |
571 } | |
569 | 572 |
570 left = &h->intra4x4_pred_mode_cache[scan8[i] - 1]; | 573 left = &h->intra4x4_pred_mode_cache[scan8[i] - 1]; |
571 top = &h->intra4x4_pred_mode_cache[scan8[i] - 8]; | 574 top = &h->intra4x4_pred_mode_cache[scan8[i] - 8]; |
572 | 575 |
573 left[1] = svq3_pred_1[top[0] + 1][left[0] + 1][svq3_pred_0[vlc][0]]; | 576 left[1] = svq3_pred_1[top[0] + 1][left[0] + 1][svq3_pred_0[vlc][0]]; |
574 left[2] = svq3_pred_1[top[1] + 1][left[1] + 1][svq3_pred_0[vlc][1]]; | 577 left[2] = svq3_pred_1[top[1] + 1][left[1] + 1][svq3_pred_0[vlc][1]]; |
575 | 578 |
576 if (left[1] == -1 || left[2] == -1) | 579 if (left[1] == -1 || left[2] == -1){ |
580 av_log(h->s.avctx, AV_LOG_ERROR, "weird prediction\n"); | |
577 return -1; | 581 return -1; |
582 } | |
578 } | 583 } |
579 } else { /* mb_type == 33, DC_128_PRED block type */ | 584 } else { /* mb_type == 33, DC_128_PRED block type */ |
580 for (i=0; i < 4; i++) { | 585 for (i=0; i < 4; i++) { |
581 memset (&h->intra4x4_pred_mode_cache[scan8[0] + 8*i], DC_PRED, 4); | 586 memset (&h->intra4x4_pred_mode_cache[scan8[0] + 8*i], DC_PRED, 4); |
582 } | 587 } |
601 mb_type = MB_TYPE_INTRA4x4; | 606 mb_type = MB_TYPE_INTRA4x4; |
602 } else { /* INTRA16x16 */ | 607 } else { /* INTRA16x16 */ |
603 dir = i_mb_type_info[mb_type - 8].pred_mode; | 608 dir = i_mb_type_info[mb_type - 8].pred_mode; |
604 dir = (dir >> 1) ^ 3*(dir & 1) ^ 1; | 609 dir = (dir >> 1) ^ 3*(dir & 1) ^ 1; |
605 | 610 |
606 if ((h->intra16x16_pred_mode = check_intra_pred_mode (h, dir)) == -1) | 611 if ((h->intra16x16_pred_mode = check_intra_pred_mode (h, dir)) == -1){ |
612 av_log(h->s.avctx, AV_LOG_ERROR, "check_intra_pred_mode = -1\n"); | |
607 return -1; | 613 return -1; |
614 } | |
608 | 615 |
609 cbp = i_mb_type_info[mb_type - 8].cbp; | 616 cbp = i_mb_type_info[mb_type - 8].cbp; |
610 mb_type = MB_TYPE_INTRA16x16; | 617 mb_type = MB_TYPE_INTRA16x16; |
611 } | 618 } |
612 | 619 |
627 memset (h->non_zero_count_cache + 8, 0, 4*9*sizeof(uint8_t)); | 634 memset (h->non_zero_count_cache + 8, 0, 4*9*sizeof(uint8_t)); |
628 s->dsp.clear_blocks(h->mb); | 635 s->dsp.clear_blocks(h->mb); |
629 } | 636 } |
630 | 637 |
631 if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == B_TYPE)) { | 638 if (!IS_INTRA16x16(mb_type) && (!IS_SKIP(mb_type) || s->pict_type == B_TYPE)) { |
632 if ((vlc = svq3_get_ue_golomb (&s->gb)) >= 48) | 639 if ((vlc = svq3_get_ue_golomb (&s->gb)) >= 48){ |
640 av_log(h->s.avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc); | |
633 return -1; | 641 return -1; |
642 } | |
634 | 643 |
635 cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc] : golomb_to_inter_cbp[vlc]; | 644 cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc] : golomb_to_inter_cbp[vlc]; |
636 } | 645 } |
637 if (IS_INTRA16x16(mb_type) || (s->pict_type != I_TYPE && s->adaptive_quant && cbp)) { | 646 if (IS_INTRA16x16(mb_type) || (s->pict_type != I_TYPE && s->adaptive_quant && cbp)) { |
638 s->qscale += svq3_get_se_golomb (&s->gb); | 647 s->qscale += svq3_get_se_golomb (&s->gb); |
639 | 648 |
640 if (s->qscale > 31) | 649 if (s->qscale > 31){ |
650 av_log(h->s.avctx, AV_LOG_ERROR, "qscale:%d\n", s->qscale); | |
641 return -1; | 651 return -1; |
652 } | |
642 } | 653 } |
643 if (IS_INTRA16x16(mb_type)) { | 654 if (IS_INTRA16x16(mb_type)) { |
644 if (svq3_decode_block (&s->gb, h->mb, 0, 0)) | 655 if (svq3_decode_block (&s->gb, h->mb, 0, 0)){ |
656 av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding intra luma dc\n"); | |
645 return -1; | 657 return -1; |
658 } | |
646 } | 659 } |
647 | 660 |
648 if (cbp) { | 661 if (cbp) { |
649 const int index = IS_INTRA16x16(mb_type) ? 1 : 0; | 662 const int index = IS_INTRA16x16(mb_type) ? 1 : 0; |
650 const int type = ((s->qscale < 24 && IS_INTRA4x4(mb_type)) ? 2 : 1); | 663 const int type = ((s->qscale < 24 && IS_INTRA4x4(mb_type)) ? 2 : 1); |
653 if ((cbp & (1 << i))) { | 666 if ((cbp & (1 << i))) { |
654 for (j=0; j < 4; j++) { | 667 for (j=0; j < 4; j++) { |
655 k = index ? ((j&1) + 2*(i&1) + 2*(j&2) + 4*(i&2)) : (4*i + j); | 668 k = index ? ((j&1) + 2*(i&1) + 2*(j&2) + 4*(i&2)) : (4*i + j); |
656 h->non_zero_count_cache[ scan8[k] ] = 1; | 669 h->non_zero_count_cache[ scan8[k] ] = 1; |
657 | 670 |
658 if (svq3_decode_block (&s->gb, &h->mb[16*k], index, type)) | 671 if (svq3_decode_block (&s->gb, &h->mb[16*k], index, type)){ |
672 av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding block\n"); | |
659 return -1; | 673 return -1; |
674 } | |
660 } | 675 } |
661 } | 676 } |
662 } | 677 } |
663 | 678 |
664 if ((cbp & 0x30)) { | 679 if ((cbp & 0x30)) { |
665 for (i=0; i < 2; ++i) { | 680 for (i=0; i < 2; ++i) { |
666 if (svq3_decode_block (&s->gb, &h->mb[16*(16 + 4*i)], 0, 3)) | 681 if (svq3_decode_block (&s->gb, &h->mb[16*(16 + 4*i)], 0, 3)){ |
682 av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding chroma dc block\n"); | |
667 return -1; | 683 return -1; |
684 } | |
668 } | 685 } |
669 | 686 |
670 if ((cbp & 0x20)) { | 687 if ((cbp & 0x20)) { |
671 for (i=0; i < 8; i++) { | 688 for (i=0; i < 8; i++) { |
672 h->non_zero_count_cache[ scan8[16+i] ] = 1; | 689 h->non_zero_count_cache[ scan8[16+i] ] = 1; |
673 | 690 |
674 if (svq3_decode_block (&s->gb, &h->mb[16*(16 + i)], 1, 1)) | 691 if (svq3_decode_block (&s->gb, &h->mb[16*(16 + i)], 1, 1)){ |
692 av_log(h->s.avctx, AV_LOG_ERROR, "error while decoding chroma ac block\n"); | |
675 return -1; | 693 return -1; |
694 } | |
676 } | 695 } |
677 } | 696 } |
678 } | 697 } |
679 } | 698 } |
680 | 699 |