[FFmpeg-soc] BFI Decoder
Sisir Koppaka
sisir.koppaka at gmail.com
Thu Apr 17 08:02:08 CEST 2008
On Thu, Apr 17, 2008 at 4:19 AM, Michael Niedermayer <michaelni at gmx.at>
wrote:
> On Thu, Apr 17, 2008 at 03:51:28AM +0530, Sisir Koppaka wrote:
> > 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...
>
> You should check/ensure that the offset and length are within the
> allocated
> buffer.
Now, ./ffmpeg -i ~/Desktop/bfi/2287.bfi images/%04d.png works very well
without crashing and generates a bunch of png files.
[DECODER] Back Chain.
[DECODER] Normal Chain.
[DECODER] Back Chain.
[DECODER] Skip Chain.
[DECODER] Back Chain.frame= 57 fps= 0 q=0.0 Lsize= -0kB time=6.3
bitrate= -0.0kbits/s
video:997kB audio:0kB global headers:0kB muxing overhead -100.002155%
[DECODER] Finished decoding the frame.
In this line:
frame= 57 fps= 0 q=0.0 Lsize= -0kB time=6.3 bitrate= -0.0kbits/s
video:997kB audio:0kB global headers:0kB muxing overhead -100.002155%
Why is fps 0 and is it ok for the muxing overhead to be that much? Most
muxing overheads I saw were very small.
I attached some of the pictures, there seem to be a problem with the
decoding part. Also weirdly, the early frames have some halogen lighting
sort of effect. The file names are the frame numbers and there are a total
of 57 frames.
-----------------
Sisir Koppaka
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0021.png
Type: image/png
Size: 18419 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080417/92c0d025/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0026.png
Type: image/png
Size: 19414 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080417/92c0d025/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0031.png
Type: image/png
Size: 20235 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080417/92c0d025/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0020.png
Type: image/png
Size: 18398 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080417/92c0d025/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfi.c
Type: text/x-csrc
Size: 6133 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-soc/attachments/20080417/92c0d025/attachment.c>
More information about the FFmpeg-soc
mailing list