comparison mjpeg.c @ 4222:fa816309076b libavcodec

Decode non-interleaved scans
author kostya
date Tue, 21 Nov 2006 06:15:18 +0000
parents 49c08d9b9646
children daaebca81d86
comparison
equal deleted inserted replaced
4221:643c7fd287e4 4222:fa816309076b
1641 if (len != 6+2*nb_components) 1641 if (len != 6+2*nb_components)
1642 { 1642 {
1643 dprintf("decode_sos: invalid len (%d)\n", len); 1643 dprintf("decode_sos: invalid len (%d)\n", len);
1644 return -1; 1644 return -1;
1645 } 1645 }
1646 /* XXX: only interleaved scan accepted */
1647 if ((nb_components != s->nb_components) && !s->ls && !s->progressive)
1648 {
1649 dprintf("decode_sos: components(%d) mismatch\n", nb_components);
1650 return -1;
1651 }
1652 vmax = 0; 1646 vmax = 0;
1653 hmax = 0; 1647 hmax = 0;
1654 for(i=0;i<nb_components;i++) { 1648 for(i=0;i<nb_components;i++) {
1655 id = get_bits(&s->gb, 8) - 1; 1649 id = get_bits(&s->gb, 8) - 1;
1656 dprintf("component: %d\n", id); 1650 dprintf("component: %d\n", id);
1707 if (nb_components > 1) { 1701 if (nb_components > 1) {
1708 /* interleaved stream */ 1702 /* interleaved stream */
1709 s->mb_width = (s->width + s->h_max * block_size - 1) / (s->h_max * block_size); 1703 s->mb_width = (s->width + s->h_max * block_size - 1) / (s->h_max * block_size);
1710 s->mb_height = (s->height + s->v_max * block_size - 1) / (s->v_max * block_size); 1704 s->mb_height = (s->height + s->v_max * block_size - 1) / (s->v_max * block_size);
1711 } else if(!s->ls) { /* skip this for JPEG-LS */ 1705 } else if(!s->ls) { /* skip this for JPEG-LS */
1712 h = s->h_max / s->h_scount[s->comp_index[0]]; 1706 h = s->h_max / s->h_scount[0];
1713 v = s->v_max / s->v_scount[s->comp_index[0]]; 1707 v = s->v_max / s->v_scount[0];
1714 s->mb_width = (s->width + h * block_size - 1) / (h * block_size); 1708 s->mb_width = (s->width + h * block_size - 1) / (h * block_size);
1715 s->mb_height = (s->height + v * block_size - 1) / (v * block_size); 1709 s->mb_height = (s->height + v * block_size - 1) / (v * block_size);
1716 s->nb_blocks[0] = 1; 1710 s->nb_blocks[0] = 1;
1717 s->h_scount[0] = 1; 1711 s->h_scount[0] = 1;
1718 s->v_scount[0] = 1; 1712 s->v_scount[0] = 1;