Mercurial > libavcodec.hg
comparison mjpeg.c @ 47:bd0dd8d0b759 libavcodec
return dummy quality to avoid bug in -sameq case - forgot emms in error case
author | glantau |
---|---|
date | Wed, 08 Aug 2001 22:11:48 +0000 |
parents | 92d51f683931 |
children | adf7cea364ca |
comparison
equal
deleted
inserted
replaced
46:931417475f5b | 47:bd0dd8d0b759 |
---|---|
702 } | 702 } |
703 | 703 |
704 static int mjpeg_decode_sos(MJpegDecodeContext *s, | 704 static int mjpeg_decode_sos(MJpegDecodeContext *s, |
705 UINT8 *buf, int buf_size) | 705 UINT8 *buf, int buf_size) |
706 { | 706 { |
707 int len, nb_components, i, j, n, h, v; | 707 int len, nb_components, i, j, n, h, v, ret; |
708 int mb_width, mb_height, mb_x, mb_y, vmax, hmax, index, id; | 708 int mb_width, mb_height, mb_x, mb_y, vmax, hmax, index, id; |
709 int comp_index[4]; | 709 int comp_index[4]; |
710 int dc_index[4]; | 710 int dc_index[4]; |
711 int ac_index[4]; | 711 int ac_index[4]; |
712 int nb_blocks[4]; | 712 int nb_blocks[4]; |
779 memset(s->block, 0, sizeof(s->block)); | 779 memset(s->block, 0, sizeof(s->block)); |
780 if (decode_block(s, s->block, i, | 780 if (decode_block(s, s->block, i, |
781 dc_index[i], ac_index[i], | 781 dc_index[i], ac_index[i], |
782 s->quant_index[c]) < 0) { | 782 s->quant_index[c]) < 0) { |
783 dprintf("error %d %d\n", mb_y, mb_x); | 783 dprintf("error %d %d\n", mb_y, mb_x); |
784 return -1; | 784 ret = -1; |
785 goto the_end; | |
785 } | 786 } |
786 ff_idct (s->block); | 787 ff_idct (s->block); |
787 ptr = s->current_picture[c] + | 788 ptr = s->current_picture[c] + |
788 (s->linesize[c] * (v * mb_y + y) * 8) + | 789 (s->linesize[c] * (v * mb_y + y) * 8) + |
789 (h * mb_x + x) * 8; | 790 (h * mb_x + x) * 8; |
794 } | 795 } |
795 } | 796 } |
796 } | 797 } |
797 } | 798 } |
798 } | 799 } |
800 ret = 0; | |
801 the_end: | |
799 emms_c(); | 802 emms_c(); |
800 return 0; | 803 return ret; |
801 } | 804 } |
802 | 805 |
803 /* return the 8 bit start code value and update the search | 806 /* return the 8 bit start code value and update the search |
804 state. Return -1 if no start code found */ | 807 state. Return -1 if no start code found */ |
805 static int find_marker(UINT8 **pbuf_ptr, UINT8 *buf_end, | 808 static int find_marker(UINT8 **pbuf_ptr, UINT8 *buf_end, |
910 default: | 913 default: |
911 case 0x22: | 914 case 0x22: |
912 avctx->pix_fmt = PIX_FMT_YUV420P; | 915 avctx->pix_fmt = PIX_FMT_YUV420P; |
913 break; | 916 break; |
914 } | 917 } |
918 /* dummy quality */ | |
919 /* XXX: infer it with matrix */ | |
920 avctx->quality = 3; | |
915 goto the_end; | 921 goto the_end; |
916 } | 922 } |
917 break; | 923 break; |
918 } | 924 } |
919 } | 925 } |