[theora] Please help : Trying to fool Theora into doing what I want
Sam Barham
sam at straylight-studios.com
Sun Jun 17 21:57:10 PDT 2007
I'm currently doing research and initial development for an app that
requires a rather odd usage of some kind of movie decoding. I'm trying to
find a codec that I can trick into doing what I want, and so long as I can
fix a problem or two, Theora is looking promising.
What I want to do goes something like this:
1) Encode a whole bunch of two frame movies. For each movie, the first
frame is identical (to all the other movies), and the second frame is
different in each case.
2) Store in a data file one (1) copy of the first frame packet (which will
be a key frame), as well as every single second frame packet (which
will/should be a delta frame).
3) At runtime, decode the single key frame, then store its decoded data
somewhere. This is done once.
4) Repeatedly, slap the decoded key frame back into memory, then decode a
particular delta frame on top of it.
I've got 1 and 2 working just fine (although I'm only storing the 'bytes'
and 'packet' members of the packets).
I've got 3 and 4 working mostly (I'll explain the process in a bit), but
when the app is running I get block artifacts, which look like small square
bits of the image have been moved to the wrong place.
The process I use for 3 and 4 is:
To get the key frame:
1) Put the packet I saved into theora using theora_decode_packetin
2) Grab the decoded packet using theora_decode_YUVout
3) Read the YUV data into my own buffer
To force the saved keyframe data back into theora:
1) call theora_decode_YUVout in order to get a YUV structure with its data
members pointing somewhere usesful
2) copy the data I saved in (3) above back into the YUV structure (thereby
writing it into the LastFrameRecon bit of the codec
And finally, to decode the delta frame:
1) Put the packet I saved into theora using theora_decode_packetin
2) Grab the decoded packet using theora_decode_YUVout
3) convert the data to rgb and display.
Like I said, it works fine except for the block artifacts. Any idea what I
could be doing wrong, should be doing differently, or further information I
can supply?
Cheers
Sam Barham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/theora/attachments/20070618/564781c8/attachment.htm
More information about the theora
mailing list