[Ffmpeg-devel] [PATCH] flash screen video codec

Benjamin Larsson banan
Wed May 31 14:31:00 CEST 2006


Michael Niedermayer wrote:

>Hi
>
>On Thu, May 18, 2006 at 12:26:02AM +0200, Benjamin Larsson wrote:
>[...]
>  
>
>>    /* start to parse the bitstream */
>>    s->block_width = (((buf[0]&0xf0)>>4)+1)* 16; // 4 bits
>>    s->image_width = (buf[0]&0xf)<<8|(buf[1]); // 12 bits
>>    s->block_height = (((buf[2]&0xf0)>>4)+1)* 16; // 4 bits
>>    s->image_height = (buf[2]&0xf)<<8|(buf[3]); // 12 bits
>>    
>>
>
>may i suggest that you use the bitstream reader?
>  
>
You may.

>s->block_width = 16* get_bits(gb, 4);
>s->image_width =     get_bits(gb,12);
>s->block_height= 16* get_bits(gb, 4);
>s->image_height=     get_bits(gb,12);
>
>looks alot more readable
>
>[...]
>  
>
>>            /* get the size of the compressed zlib chunk */
>>            int size = buf[buf_pos++];
>>            size = (size<<8) | buf[buf_pos++];
>>    
>>
>
>get_bits(gb, 16);
>
>[...]
>  
>
>>                buf_pos += size;
>>    
>>
>
>skip_bits(gb, 8*size);
>
>[...]
>
>  
>
Adopted all this and fixed a bug in temp buffer allocation.

MvH
Benjamin Larsson

-- 
"incorrect information" is an oxymoron. Information is, by definition, factual, correct.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: flashsv.c
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060531/386f6bf6/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fsv1.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060531/386f6bf6/attachment.txt>



More information about the ffmpeg-devel mailing list