* David Schleef ([email protected]) wrote:
> After some thought...
...
> Ideally, I'd like to see:
>
> - SchroDecoder that works on a picture basis.
>
> - SchroParser that parses a bitstream into pictures
>
> - automatic glue code in SchroDecoder that allows you to use the
> decoder in bitstream mode
Ok, i don't disagree with any of that. how about:
main (raw) api:
- This api allows for synchronous parsing.
Ie, able to determine the parse state on a picture basis
at the input to the decoder
- The state machine emits EOS when a sequence ends.
- There is no auto creation of new decoder instances
decoder_push():
- called with a single aligned data unit
- will return the parsing state
- ie, no real change
decoder_push_end_of_sequence():
- sets the internal EOS state.
decoder_push_end_of_stream():
- depricate. (calls decoder_push_end_of_sequence).
decoder_push_ready():
- returns if the system state is able to accomodate a new picture data unit
- no real change
decoder_wait():
- no real change from now, ie iterates the decoder, returns next state
decoder_instance_new():
- creates a new decoder instance.
all pushing and state operations will work on
the new instance.
decoder_instance_delete():
- the decoder maintains a list of instances.
delete the oldest.
Rationale: when wait() retuns EOS, you need to kick the decoder onto
the next sequence.
-----
the autoparse api:
- This api allows you to throw unaligned data for asynchronous parsing
No parsing state will be returned at input to the decoder.
decoder_autoparse_push():
- push a buffer of data into the decoder.
There may be an associated tag with the buffer.
- every time an EOS is pushed, a new instance is created.
decoder_autoparse_push_end_of_sequence():
- sets the internal EOS state on the first decoder instance
- creates a new instance.
decoder_autoparse_wait():
- iterates the decoder:
- EOS is never returned -- it causes the head instance to be deleted
my current autoparse work is able to return data units if you call it
directly with a parse state object.
-----
common stuff:
set_picture_order():
- sets the internal state to use a reorder buffer size = 0+1.
- pictures returned in stream order.
- this is per decoder not instance.
- must be called just after a decoder_reset.
(results are otherwise undefined).
decoder_reset():
- resets all internal state, destroys all instances.
bool get_picture_number_full(int *picture_number):
- returns the next picture number if possible in *picture_number
- returns TRUE on success, FALSE otherwise.
(FALSE if there is no valid picture yet).
decoder_need_output_picture():
- returns if the decoder is lacking an output picture for any picture
currently in flight.
decoder_add_output_picture():
- adds an output picture to the last instance to be created.
decoder_new/free()
- as before.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Schrodinger-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/schrodinger-devel