Top | ![]() |
![]() |
![]() |
![]() |
SchroDecoder *
schro_decoder_new (void
);
Creates a new decoder object. The decoder object should be freed
using
when it is no longer needed.schro_decoder_free()
void
schro_decoder_reset (SchroDecoder *decoder
);
Resets the internal state of the decoder. This function should be called after a discontinuity of the stream, for example, as the result of a seek.
SchroVideoFormat *
schro_decoder_get_video_format (SchroDecoder *decoder
);
Returns a structure containing information on the video format being
decoded by the decoder. This structure should be freed using free()
when it is no longer needed.
void schro_decoder_add_output_picture (SchroDecoder *decoder
,SchroFrame *frame
);
Adds a frame provided by the application to the picture queue.
Frames in the picture queue will be used for decoding images, and
are eventually returned to the application by schro_decoder_pull()
.
The caller loses its reference to frame
after calling this
function.
int
schro_decoder_push_ready (SchroDecoder *decoder
);
This function is used by the application to determine if it should push more data to the decoder.
SchroFrame *
schro_decoder_pull (SchroDecoder *decoder
);
Removes the next picture from the picture queue and returns a frame containing the image.
The application provides the frames that pictures are decoded into, and the same frames are returned from this function. However, the order of frames returned may be different than the order that the application provides the frames to the decoder.
An exception to this is that skipped frames are indicated by a
frame having a height and width equal to 0. This frame is created
using
, and is not one of the frames provided by
the application.schro_frame_new()
Frames should be freed using
when no longer
needed. The frame must not be reused by the application, since it
may contain a reference frame still in use by the decoder.schro_frame_unref()
int
schro_decoder_wait (SchroDecoder *decoder
);
Waits until the decoder requires the application to do something, e.g., push more data or remove a frame from the picture queue, and then returns the decoder status.
void schro_decoder_set_earliest_frame (SchroDecoder *decoder
,SchroPictureNumber earliest_frame
);
The application can tell the decoder the earliest frame it is
interested in by calling this function. Subsequent calls to
schro_decoder_pull()
will only return pictures with picture
numbers greater than or equal to this number. The decoder will
avoid decoding pictures that will not be displayed or used as
reference pictures.
This feature can be used for frame-accurate seeking.
This function can be called at any time during decoding. Calling this function with a picture number less than the current earliest frame setting is invalid.
void schro_decoder_set_skip_ratio (SchroDecoder *decoder
,double ratio
);
Sets the skip ratio of the decoder. The skip ratio is used by the decoder to skip decoding of some pictures. Reference pictures are always decoded.
A picture is skipped when the running average of the proportion of pictures skipped is less than the skip ratio. Reference frames are always decoded and contribute to the running average. Thus, the actual ratio of skipped pictures may be larger than the requested skip ratio.
The decoder indicates a skipped picture in the pictures returned
by
by a frame that has a width and height of
0.schro_decoder_pull()
The default skip ratio is 1.0, indicating that all pictures should be decoded. A skip ratio of 0.0 indicates that no pictures should be decoded, although as mentioned above, some pictures will be decoded anyway. Values outside the range of 0.0 to 1.0 are quietly clamped to that range.
This function may be called at any time during decoding.
SchroPictureNumber
schro_decoder_get_picture_number (SchroDecoder *decoder
);
Returns the picture number of the next picture that will be returned
by
.schro_decoder_pull()
void
schro_decoder_decode_transform_data (SchroPicture *picture
);
void
schro_decoder_decode_lowdelay_transform_data
(SchroPicture *picture
);
void schro_decoder_decode_macroblock (SchroPicture *picture
,SchroArith **arith
,SchroUnpack *unpack
,int i
,int j
);
void schro_decoder_decode_prediction_unit (SchroPicture *picture
,SchroArith **arith
,SchroUnpack *unpack
,SchroMotionVector *motion_vectors
,int x
,int y
);
void
schro_decoder_init_subband_frame_data_interleaved
(SchroPicture *picture
);
int schro_decoder_iterate_picture (SchroDecoderInstance *instance
,SchroBuffer *buffer
,SchroUnpack *unpack
,int parse_code
);
void schro_decoder_parse_block_data (SchroPicture *picture
,SchroUnpack *unpack
);
void schro_decoder_parse_lowdelay_transform_data (SchroPicture *picture
,SchroUnpack *unpack
);
void schro_decoder_parse_picture (SchroPicture *picture
,SchroUnpack *unpack
);
void schro_decoder_parse_picture_header (SchroPicture *picture
,SchroUnpack *unpack
);
void schro_decoder_parse_picture_prediction_parameters (SchroPicture *picture
,SchroUnpack *unpack
);
void schro_decoder_parse_transform_data (SchroPicture *picture
,SchroUnpack *unpack
);
void schro_decoder_parse_transform_parameters (SchroPicture *picture
,SchroUnpack *unpack
);
SchroPicture *
schro_picture_new (SchroDecoderInstance *instance
);
Creates a new picture for decoder
.
Internal API.
struct SchroPicture { int refcount; SchroDecoderInstance *decoder_instance; int busy; int skip; int error; SchroBuffer *input_buffer; SchroParams params; SchroPictureNumber picture_number; SchroPictureNumber reference1; SchroPictureNumber reference2; SchroPictureNumber retired_picture_number; SchroPicture *ref0; SchroPicture *ref1; SchroFrame *planar_output_frame; SchroFrame *ref_output_frame; SchroAsyncStage stages[9]; int is_ref; int zero_residual; SchroFrame *transform_frame; SchroFrame *frame; SchroFrame *mc_tmp_frame; SchroMotion *motion; SchroFrame *output_picture; SchroUpsampledFrame *upsampled_frame; int subband_length[3][SCHRO_LIMIT_SUBBANDS]; int subband_quant_index[3][SCHRO_LIMIT_SUBBANDS]; SchroBuffer *subband_buffer[3][SCHRO_LIMIT_SUBBANDS]; SchroFrameData subband_data[3][SCHRO_LIMIT_SUBBANDS]; SchroBuffer *motion_buffers[9]; SchroBuffer *lowdelay_buffer; int has_md5; uint8_t md5_checksum[32]; /* private data that is associated with this picture */ SchroTag *tag; };