Mercurial > libavcodec.hg
comparison huffyuv.c @ 2177:d46ca56136d5 libavcodec
more untested bigendian fixes
rgb32 plane predictor decoding bugfix
author | michael |
---|---|
date | Tue, 17 Aug 2004 10:41:15 +0000 |
parents | ab4ee35c4137 |
children | 303e09116fe7 |
comparison
equal
deleted
inserted
replaced
2176:ab4ee35c4137 | 2177:d46ca56136d5 |
---|---|
621 int i; | 621 int i; |
622 | 622 |
623 if(s->decorrelate){ | 623 if(s->decorrelate){ |
624 if(s->bitstream_bpp==24){ | 624 if(s->bitstream_bpp==24){ |
625 for(i=0; i<count; i++){ | 625 for(i=0; i<count; i++){ |
626 s->temp[0][4*i+1]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3); | 626 s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3); |
627 s->temp[0][4*i ]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) + s->temp[0][4*i+1]; | 627 s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) + s->temp[0][4*i+G]; |
628 s->temp[0][4*i+2]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3) + s->temp[0][4*i+1]; | 628 s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3) + s->temp[0][4*i+G]; |
629 } | 629 } |
630 }else{ | 630 }else{ |
631 for(i=0; i<count; i++){ | 631 for(i=0; i<count; i++){ |
632 s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3); | 632 s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3); |
633 s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) + s->temp[0][4*i+G]; | 633 s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3) + s->temp[0][4*i+G]; |
636 } | 636 } |
637 } | 637 } |
638 }else{ | 638 }else{ |
639 if(s->bitstream_bpp==24){ | 639 if(s->bitstream_bpp==24){ |
640 for(i=0; i<count; i++){ | 640 for(i=0; i<count; i++){ |
641 s->temp[0][4*i ]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3); | 641 s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3); |
642 s->temp[0][4*i+1]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3); | 642 s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3); |
643 s->temp[0][4*i+2]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3); | 643 s->temp[0][4*i+R]= get_vlc2(&s->gb, s->vlc[2].table, VLC_BITS, 3); |
644 } | 644 } |
645 }else{ | 645 }else{ |
646 for(i=0; i<count; i++){ | 646 for(i=0; i<count; i++){ |
647 s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3); | 647 s->temp[0][4*i+B]= get_vlc2(&s->gb, s->vlc[0].table, VLC_BITS, 3); |
648 s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3); | 648 s->temp[0][4*i+G]= get_vlc2(&s->gb, s->vlc[1].table, VLC_BITS, 3); |
862 int y; | 862 int y; |
863 int leftr, leftg, leftb; | 863 int leftr, leftg, leftb; |
864 const int last_line= (height-1)*p->linesize[0]; | 864 const int last_line= (height-1)*p->linesize[0]; |
865 | 865 |
866 if(s->bitstream_bpp==32){ | 866 if(s->bitstream_bpp==32){ |
867 p->data[0][last_line+3]= get_bits(&s->gb, 8); | 867 skip_bits(&s->gb, 8); |
868 leftr= p->data[0][last_line+2]= get_bits(&s->gb, 8); | 868 leftr= p->data[0][last_line+R]= get_bits(&s->gb, 8); |
869 leftg= p->data[0][last_line+1]= get_bits(&s->gb, 8); | 869 leftg= p->data[0][last_line+G]= get_bits(&s->gb, 8); |
870 leftb= p->data[0][last_line+0]= get_bits(&s->gb, 8); | 870 leftb= p->data[0][last_line+B]= get_bits(&s->gb, 8); |
871 }else{ | 871 }else{ |
872 leftr= p->data[0][last_line+2]= get_bits(&s->gb, 8); | 872 leftr= p->data[0][last_line+R]= get_bits(&s->gb, 8); |
873 leftg= p->data[0][last_line+1]= get_bits(&s->gb, 8); | 873 leftg= p->data[0][last_line+G]= get_bits(&s->gb, 8); |
874 leftb= p->data[0][last_line+0]= get_bits(&s->gb, 8); | 874 leftb= p->data[0][last_line+B]= get_bits(&s->gb, 8); |
875 skip_bits(&s->gb, 8); | 875 skip_bits(&s->gb, 8); |
876 } | 876 } |
877 | 877 |
878 if(s->bgr32){ | 878 if(s->bgr32){ |
879 switch(s->predictor){ | 879 switch(s->predictor){ |
885 for(y=s->height-2; y>=0; y--){ //yes its stored upside down | 885 for(y=s->height-2; y>=0; y--){ //yes its stored upside down |
886 decode_bgr_bitstream(s, width); | 886 decode_bgr_bitstream(s, width); |
887 | 887 |
888 add_left_prediction_bgr32(p->data[0] + p->linesize[0]*y, s->temp[0], width, &leftr, &leftg, &leftb); | 888 add_left_prediction_bgr32(p->data[0] + p->linesize[0]*y, s->temp[0], width, &leftr, &leftg, &leftb); |
889 if(s->predictor == PLANE){ | 889 if(s->predictor == PLANE){ |
890 if((y&s->interlaced)==0){ | 890 if((y&s->interlaced)==0 && y<s->height-2){ |
891 s->dsp.add_bytes(p->data[0] + p->linesize[0]*y, | 891 s->dsp.add_bytes(p->data[0] + p->linesize[0]*y, |
892 p->data[0] + p->linesize[0]*y + fake_ystride, fake_ystride); | 892 p->data[0] + p->linesize[0]*y + fake_ystride, fake_ystride); |
893 } | 893 } |
894 } | 894 } |
895 } | 895 } |