[FFmpeg-soc] BFI Decoder
Sisir Koppaka
sisir.koppaka at gmail.com
Thu Apr 17 00:21:28 CEST 2008
On Thu, Apr 17, 2008 at 3:45 AM, Sisir Koppaka <sisir.koppaka at gmail.com>
wrote:
> 1 : back chain
> if length is zero, read one more byte of the length AND two bytes of the offset
> else, read one byte of the offset
> copy (length) dwords from (output - offset) to the output
>
> (note, that data may overlap, so don't use memmove() function here, just bare by-dword copying!)
>
> case 1: //Back Chain
> if (length == 0) {
> length = bytestream_get_byte(&buf);
> offset = bytestream_get_le16(&buf);
> } else {
> offset = bytestream_get_byte(&buf);
> }
> dst_offset = dst - offset;
> length *= 4; //Convert dwords to bytes.
> while(length--)
> {
> *dst++ = *dst_offset++;
> }
> av_log(NULL,AV_LOG_INFO, "\n[DECODER] Back Chain.");
> break;
>
> Logically, it doesn't seem to be wrong to me....is it wrong?
>
> I did ./ffmpeg -i file.bfi images/%04d.png but still I only get a blue
> frame, I think the first frame is not decoding...it still segfaults while
> doing decoding a back chain from the av_logs...
>
This might be close to stupid or actually stupid, but I tried changing the
bytestream_get_le16 to be16 just in case, but that didn't work and gave the
same old blue.png....
In a further act of desperation I tried writing dst_offset = dst + offset;
because I'm not sure how the computer is actually addressing the memory
(does next byte necessarily have an incremented address?)(my courses haven't
got that far, if in case this is a well-known fact) this didn't work too...
-----------------
Sisir Koppaka
More information about the FFmpeg-soc
mailing list