I'm trying to integrate the dirac encoder and decoder into a compression test application that I've written so that I can do some head-to-head comparisons.
I'm finding that if I do the following for N frames:
dirac_encoder_load
dirac_encoder_output (loop while this returns ENC_STATE_AVAIL)
of course, at this point I may not have seen ENC_STATE_AVAIL N times yet, and therefore the endoded stream does not contain all of the images seen so far. I expected this.
I was expecting that when I call
dirac_encoder_end_sequence
It would add the remaining frames to the supplied buffer, but it doesn't seem to do that. I couldn't find anything explicit in the documentation about this.
Do I need to add blank frames to the end (or repeat the final frame) until I get the desired number of encoded frames? Or am I doing something else wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think you are doing anything wrong. I think you need to add extra frames. I would probably repeat the last frame rather than use a blank frame. I think that the encoder encodes an integer number of (what in MPEG speak would be) GOPS (groups of pictures). I guess this is probably a bug.
We are currently reviewing where we go with the API and the code in general. So this will eventually be resolved. But, for now, adding extra pictures is a work around.
If I seem unsure that is becuase I'm not an expert on this bit of the code. Other Dirac team memebers may comment further (or correct me if I've got it wrong).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm trying to integrate the dirac encoder and decoder into a compression test application that I've written so that I can do some head-to-head comparisons.
I'm finding that if I do the following for N frames:
dirac_encoder_load
dirac_encoder_output (loop while this returns ENC_STATE_AVAIL)
of course, at this point I may not have seen ENC_STATE_AVAIL N times yet, and therefore the endoded stream does not contain all of the images seen so far. I expected this.
I was expecting that when I call
dirac_encoder_end_sequence
It would add the remaining frames to the supplied buffer, but it doesn't seem to do that. I couldn't find anything explicit in the documentation about this.
Do I need to add blank frames to the end (or repeat the final frame) until I get the desired number of encoded frames? Or am I doing something else wrong?
I don't think you are doing anything wrong. I think you need to add extra frames. I would probably repeat the last frame rather than use a blank frame. I think that the encoder encodes an integer number of (what in MPEG speak would be) GOPS (groups of pictures). I guess this is probably a bug.
We are currently reviewing where we go with the API and the code in general. So this will eventually be resolved. But, for now, adding extra pictures is a work around.
If I seem unsure that is becuase I'm not an expert on this bit of the code. Other Dirac team memebers may comment further (or correct me if I've got it wrong).