Schroedinger Reference Manual | ||||
---|---|---|---|---|
Top | Description |
struct SchroEncoder; struct SchroEncoderFrame; enum SchroEncoderFrameStateEnum; enum SchroEncoderPerceptualEnum; enum SchroQuantiserEngineEnum; enum SchroStateEnum; enum SchroEncoderGOPEnum; enum SchroEncoderRateControlEnum; struct SchroEncoderSetting; enum SchroEncoderSettingTypeEnum; int (*SchroEngineIterateFunc) (SchroEncoder *encoder
); SchroEncoder * schro_encoder_new (void
); void schro_encoder_free (SchroEncoder *encoder
); SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder
); void schro_encoder_set_video_format (SchroEncoder *encoder
,SchroVideoFormat *video_format
); void schro_encoder_end_of_stream (SchroEncoder *encoder
); void schro_encoder_push_frame (SchroEncoder *encoder
,SchroFrame *frame
); void schro_encoder_encode_parse_info (SchroPack *bits
,int parse_code
); SchroBuffer * schro_encoder_pull (SchroEncoder *encoder
,int *n_decodable_frames
); void schro_encoder_analyse_picture (SchroAsyncStage *stage
); void schro_encoder_calculate_subband_weights (SchroEncoder *encoder
,double (*perceptual_weight) (double)
); void schro_encoder_calculate_test_info (SchroEncoderFrame *frame
); void schro_encoder_choose_quantisers (SchroEncoderFrame *frame
); void schro_encoder_clean_up_transform (SchroEncoderFrame *frame
); SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder
,SchroAuxiliaryDataID id
,const void *data
,int size
); SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder
); void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame *frame
); void schro_encoder_encode_picture (SchroAsyncStage *stage
); void schro_encoder_encode_picture_header (SchroEncoderFrame *frame
); void schro_encoder_encode_subband (SchroEncoderFrame *frame
,int component
,int index
); void schro_encoder_encode_subband_noarith (SchroEncoderFrame *frame
,int component
,int index
); int schro_encoder_engine_backref (SchroEncoder *encoder
); int schro_encoder_engine_backtest (SchroEncoder *encoder
); int schro_encoder_engine_intra_only (SchroEncoder *encoder
); int schro_encoder_engine_lossless (SchroEncoder *encoder
); int schro_encoder_engine_lowdelay (SchroEncoder *encoder
); int schro_encoder_engine_test_intra (SchroEncoder *encoder
); void schro_encoder_estimate_entropy (SchroEncoderFrame *frame
); void schro_encoder_frame_analyse (SchroEncoderFrame *frame
); void schro_encoder_frame_downsample (SchroEncoderFrame *frame
); void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame
,SchroBuffer *buffer
); SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder *encoder
); SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder
,SchroPictureNumber frame_number
); void schro_encoder_frame_queue_remove (SchroEncoder *encoder
,SchroPictureNumber frame_number
); void schro_encoder_frame_ref (SchroEncoderFrame *frame
); void schro_encoder_frame_unref (SchroEncoderFrame *frame
); void schro_encoder_init_subbands (SchroEncoderFrame *frame
); void schro_encoder_insert_buffer (SchroEncoder *encoder
,SchroBuffer *buffer
); void schro_encoder_output_push (SchroEncoder *encoder
,SchroBuffer *buffer
,int slot
,int presentation_frame
); double schro_encoder_perceptual_weight_ccir959 (double cpd
); double schro_encoder_perceptual_weight_constant (double cpd
); double schro_encoder_perceptual_weight_moo (double cpd
); void schro_encoder_postanalyse_picture (SchroAsyncStage *stage
); int schro_encoder_push_ready (SchroEncoder *encoder
); void schro_encoder_recalculate_allocations (SchroEncoder *encoder
); void schro_encoder_reconstruct_picture (SchroAsyncStage *stage
); SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder
,SchroPictureNumber frame_number
); void schro_encoder_set_default_subband_weights (SchroEncoder *encoder
); void schro_encoder_start (SchroEncoder *encoder
); SchroStateEnum schro_encoder_wait (SchroEncoder *encoder
); int schro_encoder_get_n_settings (void
); const SchroEncoderSetting * schro_encoder_get_setting_info (int i
); void schro_encoder_global_estimation (SchroEncoderFrame *frame
); void schro_encoder_init_error_tables (SchroEncoder *encoder
); void schro_encoder_phasecorr_estimation (SchroPhaseCorr *pc
); double schro_encoder_setting_get_double (SchroEncoder *encoder
,const char *name
); void schro_encoder_setting_set_double (SchroEncoder *encoder
,const char *name
,double d
);
typedef enum { SCHRO_ENCODER_FRAME_STAGE_NEW = 0, SCHRO_ENCODER_FRAME_STAGE_ANALYSE, SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_1, SCHRO_ENCODER_FRAME_STAGE_SC_DETECT_2, SCHRO_ENCODER_FRAME_STAGE_HAVE_GOP, SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS, SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH, SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL, SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL, SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION, SCHRO_ENCODER_FRAME_STAGE_HAVE_REFS, SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS, SCHRO_ENCODER_FRAME_STAGE_ENCODING, SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT, SCHRO_ENCODER_FRAME_STAGE_POSTANALYSE, SCHRO_ENCODER_FRAME_STAGE_DONE, SCHRO_ENCODER_FRAME_STAGE_FREE, SCHRO_ENCODER_FRAME_STAGE_LAST /* this should be last */ } SchroEncoderFrameStateEnum;
typedef enum { SCHRO_ENCODER_PERCEPTUAL_CONSTANT, SCHRO_ENCODER_PERCEPTUAL_CCIR959, SCHRO_ENCODER_PERCEPTUAL_MOO, SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON } SchroEncoderPerceptualEnum;
typedef enum { SCHRO_QUANTISER_ENGINE_SIMPLE, SCHRO_QUANTISER_ENGINE_RDO_BIT_ALLOCATION, SCHRO_QUANTISER_ENGINE_CBR, SCHRO_QUANTISER_ENGINE_LOSSLESS, SCHRO_QUANTISER_ENGINE_LOWDELAY, SCHRO_QUANTISER_ENGINE_RDO_LAMBDA, SCHRO_QUANTISER_ENGINE_CONSTANT_ERROR } SchroQuantiserEngineEnum;
typedef enum { SCHRO_STATE_NEED_FRAME, SCHRO_STATE_HAVE_BUFFER, SCHRO_STATE_AGAIN, SCHRO_STATE_END_OF_STREAM } SchroStateEnum;
typedef enum { SCHRO_ENCODER_GOP_ADAPTIVE, SCHRO_ENCODER_GOP_INTRA_ONLY, SCHRO_ENCODER_GOP_BACKREF, SCHRO_ENCODER_GOP_CHAINED_BACKREF, SCHRO_ENCODER_GOP_BIREF, SCHRO_ENCODER_GOP_CHAINED_BIREF, } SchroEncoderGOPEnum;
typedef enum { SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_BITRATE, SCHRO_ENCODER_RATE_CONTROL_LOW_DELAY, SCHRO_ENCODER_RATE_CONTROL_LOSSLESS, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_LAMBDA, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_ERROR, SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY } SchroEncoderRateControlEnum;
struct SchroEncoderSetting { const char *name; SchroEncoderSettingTypeEnum type; double min; double max; double default_value; const char **enum_list; };
typedef enum { SCHRO_ENCODER_SETTING_TYPE_BOOLEAN, SCHRO_ENCODER_SETTING_TYPE_INT, SCHRO_ENCODER_SETTING_TYPE_ENUM, SCHRO_ENCODER_SETTING_TYPE_DOUBLE, SCHRO_ENCODER_SETTING_TYPE_LAST } SchroEncoderSettingTypeEnum;
SchroEncoder * schro_encoder_new (void
);
Create a new encoder object.
Returns : |
a new encoder object |
void schro_encoder_free (SchroEncoder *encoder
);
Frees an encoder object and all its resources.
|
an encoder object |
SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder
);
Creates a new SchroVideoFormat structure and copies the
video format information of decoder
into it.
When no longer needed, the returned pointer should be
freed using free()
.
|
an encoder object |
Returns : |
a pointer to a SchroVideoFormat structure |
void schro_encoder_set_video_format (SchroEncoder *encoder
,SchroVideoFormat *video_format
);
Sets the video format used by encoder
to the values specified
in format
. This function may only be called before schro_encoder_start()
is called on the encoder.
|
an encoder object |
void schro_encoder_end_of_stream (SchroEncoder *encoder
);
Tells the encoder that the end of the stream has been reached, and no more frames are available to encode. The encoder will then finish encoding.
|
an encoder object |
void schro_encoder_push_frame (SchroEncoder *encoder
,SchroFrame *frame
);
Provides a frame to the encoder to encode.
|
an encoder object |
|
a frame to encode |
void schro_encoder_encode_parse_info (SchroPack *bits
,int parse_code
);
SchroBuffer * schro_encoder_pull (SchroEncoder *encoder
,int *n_decodable_frames
);
Pulls a buffer of compressed video from the encoder. If
presentation_frame
is not NULL, the frame number of the
latest decodable frame is returned.
|
an encoder object |
Returns : |
a buffer containing compressed video |
void schro_encoder_calculate_subband_weights (SchroEncoder *encoder
,double (*perceptual_weight) (double)
);
void schro_encoder_calculate_test_info (SchroEncoderFrame *frame
);
void schro_encoder_clean_up_transform (SchroEncoderFrame *frame
);
SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder
,SchroAuxiliaryDataID id
,const void *data
,int size
);
Packs data into a Dirac auxiliary data packet.
Returns : |
a buffer |
SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder
);
Creates an end-of-stream packet.
Returns : |
a buffer |
void schro_encoder_encode_lowdelay_transform_data
(SchroEncoderFrame *frame
);
void schro_encoder_encode_picture_header (SchroEncoderFrame *frame
);
void schro_encoder_encode_subband (SchroEncoderFrame *frame
,int component
,int index
);
void schro_encoder_encode_subband_noarith (SchroEncoderFrame *frame
,int component
,int index
);
void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame
,SchroBuffer *buffer
);
Inserts a buffer into an encoder frame.
|
an encoder frame |
|
a buffer |
SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder
,SchroPictureNumber frame_number
);
void schro_encoder_frame_queue_remove (SchroEncoder *encoder
,SchroPictureNumber frame_number
);
void schro_encoder_insert_buffer (SchroEncoder *encoder
,SchroBuffer *buffer
);
Inserts an application-provided buffer into the encoded video stream with the next frame that is pushed.
|
an encoder object |
|
a buffer |
void schro_encoder_output_push (SchroEncoder *encoder
,SchroBuffer *buffer
,int slot
,int presentation_frame
);
double schro_encoder_perceptual_weight_ccir959
(double cpd
);
double schro_encoder_perceptual_weight_constant
(double cpd
);
void schro_encoder_postanalyse_picture (SchroAsyncStage *stage
);
int schro_encoder_push_ready (SchroEncoder *encoder
);
Returns true if the encoder has available space for additional video frames.
|
an encoder object |
Returns : |
TRUE if the encoder is ready for another video frame to be pushed. |
void schro_encoder_recalculate_allocations
(SchroEncoder *encoder
);
void schro_encoder_reconstruct_picture (SchroAsyncStage *stage
);
SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder
,SchroPictureNumber frame_number
);
void schro_encoder_set_default_subband_weights
(SchroEncoder *encoder
);
void schro_encoder_start (SchroEncoder *encoder
);
Locks in encoder configuration and causes the encoder to start encoding pictures. At this point, the encoder will start worker threads to do the actual encoding.
|
an encoder object |
SchroStateEnum schro_encoder_wait (SchroEncoder *encoder
);
Checks the state of the encoder. If the encoder requires the application to do something, an appropriate state code is returned. Otherwise, this function waits until the encoder requires the application to do something.
|
an encoder object |
Returns : |
a state code |
const SchroEncoderSetting * schro_encoder_get_setting_info
(int i
);
double schro_encoder_setting_get_double (SchroEncoder *encoder
,const char *name
);
|
an encoder object |
Returns : |
the current value of an encoder option given by name
|
void schro_encoder_setting_set_double (SchroEncoder *encoder
,const char *name
,double d
);
set the encoder option given by name
to value
.
|
an encoder object |