| schroencoder.h | | schroencoder.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| SCHRO_STATE_NEED_FRAME, | | SCHRO_STATE_NEED_FRAME, | |
| SCHRO_STATE_HAVE_BUFFER, | | SCHRO_STATE_HAVE_BUFFER, | |
| SCHRO_STATE_AGAIN, | | SCHRO_STATE_AGAIN, | |
| SCHRO_STATE_END_OF_STREAM | | SCHRO_STATE_END_OF_STREAM | |
| } SchroStateEnum; | | } SchroStateEnum; | |
| | | | |
| #ifdef SCHRO_ENABLE_UNSTABLE_API | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| typedef enum { | | typedef enum { | |
| SCHRO_ENCODER_FRAME_STAGE_NEW = 0, | | SCHRO_ENCODER_FRAME_STAGE_NEW = 0, | |
| SCHRO_ENCODER_FRAME_STAGE_ANALYSE, | | 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_GOP, | |
| SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS, | | SCHRO_ENCODER_FRAME_STAGE_HAVE_PARAMS, | |
| SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH, | | SCHRO_ENCODER_FRAME_STAGE_PREDICT_ROUGH, | |
| SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL, | | SCHRO_ENCODER_FRAME_STAGE_PREDICT_PEL, | |
| SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL, | | SCHRO_ENCODER_FRAME_STAGE_PREDICT_SUBPEL, | |
| SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION, | | SCHRO_ENCODER_FRAME_STAGE_MODE_DECISION, | |
| SCHRO_ENCODER_FRAME_STAGE_HAVE_REFS, | | SCHRO_ENCODER_FRAME_STAGE_HAVE_REFS, | |
| SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS, | | SCHRO_ENCODER_FRAME_STAGE_HAVE_QUANTS, | |
| SCHRO_ENCODER_FRAME_STAGE_ENCODING, | | SCHRO_ENCODER_FRAME_STAGE_ENCODING, | |
| SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT, | | SCHRO_ENCODER_FRAME_STAGE_RECONSTRUCT, | |
| | | | |
| skipping to change at line 76 | | skipping to change at line 78 | |
| | | | |
| typedef enum { | | typedef enum { | |
| SCHRO_ENCODER_GOP_ADAPTIVE, | | SCHRO_ENCODER_GOP_ADAPTIVE, | |
| SCHRO_ENCODER_GOP_INTRA_ONLY, | | SCHRO_ENCODER_GOP_INTRA_ONLY, | |
| SCHRO_ENCODER_GOP_BACKREF, | | SCHRO_ENCODER_GOP_BACKREF, | |
| SCHRO_ENCODER_GOP_CHAINED_BACKREF, | | SCHRO_ENCODER_GOP_CHAINED_BACKREF, | |
| SCHRO_ENCODER_GOP_BIREF, | | SCHRO_ENCODER_GOP_BIREF, | |
| SCHRO_ENCODER_GOP_CHAINED_BIREF, | | SCHRO_ENCODER_GOP_CHAINED_BIREF, | |
| } SchroEncoderGOPEnum; | | } SchroEncoderGOPEnum; | |
| | | | |
|
| | | typedef enum { | |
| | | SCHRO_ENCODER_PROFILE_AUTO, | |
| | | SCHRO_ENCODER_PROFILE_VC2_LOW_DELAY, | |
| | | SCHRO_ENCODER_PROFILE_VC2_SIMPLE, | |
| | | SCHRO_ENCODER_PROFILE_VC2_MAIN, | |
| | | SCHRO_ENCODER_PROFILE_MAIN | |
| | | } SchroEncoderProfile; | |
| | | | |
| #ifdef SCHRO_ENABLE_UNSTABLE_API | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| typedef int (*SchroEngineIterateFunc) (SchroEncoder *encoder); | | typedef int (*SchroEngineIterateFunc) (SchroEncoder *encoder); | |
| | | | |
| /* forward declaration */ | | /* forward declaration */ | |
| struct _SchroMotionEst; | | struct _SchroMotionEst; | |
| struct _SchroRoughME; | | struct _SchroRoughME; | |
| | | | |
| struct _SchroEncoderFrame { | | struct _SchroEncoderFrame { | |
| /*< private >*/ | | /*< private >*/ | |
| int refcount; | | int refcount; | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 111 | |
| void *priv; | | void *priv; | |
| | | | |
| unsigned int expired_reference; | | unsigned int expired_reference; | |
| | | | |
| /* Bits telling the engine stages which stuff needs to happen */ | | /* Bits telling the engine stages which stuff needs to happen */ | |
| unsigned int need_extension; | | unsigned int need_extension; | |
| unsigned int need_downsampling; | | unsigned int need_downsampling; | |
| unsigned int need_upsampling; | | unsigned int need_upsampling; | |
| unsigned int need_filtering; | | unsigned int need_filtering; | |
| unsigned int need_average_luma; | | unsigned int need_average_luma; | |
|
| | | unsigned int need_mad; | |
| | | | |
| /* bits indicating that a particular analysis has happened. Mainly | | /* bits indicating that a particular analysis has happened. Mainly | |
| * for verification */ | | * for verification */ | |
| unsigned int have_estimate_tables; | | unsigned int have_estimate_tables; | |
| unsigned int have_histograms; | | unsigned int have_histograms; | |
| unsigned int have_scene_change_score; | | unsigned int have_scene_change_score; | |
| unsigned int have_downsampling; | | unsigned int have_downsampling; | |
| unsigned int have_upsampling; | | unsigned int have_upsampling; | |
| unsigned int have_average_luma; | | unsigned int have_average_luma; | |
|
| | | unsigned int have_mad; | |
| | | | |
| SchroAsyncStage stages[SCHRO_ENCODER_FRAME_STAGE_LAST]; | | SchroAsyncStage stages[SCHRO_ENCODER_FRAME_STAGE_LAST]; | |
| | | | |
| /* other stuff */ | | /* other stuff */ | |
| | | | |
| int start_sequence_header; | | int start_sequence_header; | |
| int gop_length; | | int gop_length; | |
| | | | |
| SchroPictureNumber frame_number; | | SchroPictureNumber frame_number; | |
| SchroFrame *original_frame; | | SchroFrame *original_frame; | |
| SchroFrame *filtered_frame; | | SchroFrame *filtered_frame; | |
| SchroFrame *downsampled_frames[8]; | | SchroFrame *downsampled_frames[8]; | |
| SchroUpsampledFrame *reconstructed_frame; | | SchroUpsampledFrame *reconstructed_frame; | |
| SchroUpsampledFrame *upsampled_original_frame; | | SchroUpsampledFrame *upsampled_original_frame; | |
| | | | |
|
| | | int sc_mad; /* shot change mean absolute difference */ | |
| | | double sc_threshold; /* shot change threshold */ | |
| | | | |
| SchroBuffer *sequence_header_buffer; | | SchroBuffer *sequence_header_buffer; | |
| SchroList *inserted_buffers; | | SchroList *inserted_buffers; | |
| int output_buffer_size; | | int output_buffer_size; | |
| SchroBuffer *output_buffer; | | SchroBuffer *output_buffer; | |
| int presentation_frame; | | int presentation_frame; | |
| int slot; | | int slot; | |
| int last_frame; | | int last_frame; | |
| | | | |
| int is_ref; | | int is_ref; | |
| int num_refs; | | int num_refs; | |
| | | | |
| skipping to change at line 164 | | skipping to change at line 179 | |
| int stats_global; | | int stats_global; | |
| int stats_motion; | | int stats_motion; | |
| | | | |
| int subband_size; | | int subband_size; | |
| SchroBuffer *subband_buffer; | | SchroBuffer *subband_buffer; | |
| | | | |
| int16_t *quant_data; | | int16_t *quant_data; | |
| | | | |
| int *quant_indices[3][SCHRO_LIMIT_SUBBANDS]; | | int *quant_indices[3][SCHRO_LIMIT_SUBBANDS]; | |
| | | | |
|
| int quant_index[3][SCHRO_LIMIT_SUBBANDS]; | | | |
| double est_entropy[3][SCHRO_LIMIT_SUBBANDS][60]; | | double est_entropy[3][SCHRO_LIMIT_SUBBANDS][60]; | |
|
| | | double actual_subband_bits[3][SCHRO_LIMIT_SUBBANDS]; | |
| double est_error[3][SCHRO_LIMIT_SUBBANDS][60]; | | double est_error[3][SCHRO_LIMIT_SUBBANDS][60]; | |
| SchroPack *pack; | | SchroPack *pack; | |
| SchroParams params; | | SchroParams params; | |
| SchroEncoder *encoder; | | SchroEncoder *encoder; | |
| SchroFrame *iwt_frame; | | SchroFrame *iwt_frame; | |
| SchroFrame *quant_frame; | | SchroFrame *quant_frame; | |
| SchroFrame *prediction_frame; | | SchroFrame *prediction_frame; | |
| | | | |
| SchroEncoderFrame *previous_frame; | | SchroEncoderFrame *previous_frame; | |
| SchroEncoderFrame *ref_frame[2]; | | SchroEncoderFrame *ref_frame[2]; | |
| | | | |
| struct _SchroMotionEst *me; | | struct _SchroMotionEst *me; | |
| struct _SchroRoughME *rme[2]; | | struct _SchroRoughME *rme[2]; | |
| struct _SchroPhaseCorr *phasecorr[2]; | | struct _SchroPhaseCorr *phasecorr[2]; | |
|
| | | struct _SchroHierBm *hier_bm[2]; | |
| | | struct _SchroMe *deep_me; | |
| | | | |
| SchroMotion *motion; | | SchroMotion *motion; | |
| | | | |
| SchroHistogram subband_hists[3][SCHRO_LIMIT_SUBBANDS]; | | SchroHistogram subband_hists[3][SCHRO_LIMIT_SUBBANDS]; | |
| SchroHistogram hist_test; | | SchroHistogram hist_test; | |
| | | | |
| /* statistics */ | | /* statistics */ | |
| | | | |
| double picture_weight; | | double picture_weight; | |
| double scene_change_score; | | double scene_change_score; | |
| double average_luma; | | double average_luma; | |
| | | | |
| int hard_limit_bits; | | int hard_limit_bits; | |
| int allocated_residual_bits; | | int allocated_residual_bits; | |
| int allocated_mc_bits; | | int allocated_mc_bits; | |
|
| double base_lambda; | | double frame_lambda; | |
| | | double frame_me_lambda; | |
| int estimated_residual_bits; | | int estimated_residual_bits; | |
| int estimated_mc_bits; | | int estimated_mc_bits; | |
| | | | |
| int actual_residual_bits; | | int actual_residual_bits; | |
| int actual_mc_bits; | | int actual_mc_bits; | |
| double mc_error; | | double mc_error; | |
| double mean_squared_error_luma; | | double mean_squared_error_luma; | |
| double mean_squared_error_chroma; | | double mean_squared_error_chroma; | |
|
| | | double mssim; | |
| | | | |
| double estimated_arith_context_ratio; | | double estimated_arith_context_ratio; | |
| | | | |
| double badblock_ratio; | | double badblock_ratio; | |
|
| | | double dcblock_ratio; | |
| double hist_slope; | | double hist_slope; | |
| }; | | }; | |
| | | | |
| struct _SchroEncoder { | | struct _SchroEncoder { | |
| /*< private >*/ | | /*< private >*/ | |
| SchroAsync *async; | | SchroAsync *async; | |
| | | | |
| SchroPictureNumber next_frame_number; | | SchroPictureNumber next_frame_number; | |
| | | | |
| SchroQueue *frame_queue; | | SchroQueue *frame_queue; | |
| | | | |
| skipping to change at line 234 | | skipping to change at line 254 | |
| | | | |
| SchroVideoFormat video_format; | | SchroVideoFormat video_format; | |
| int version_major; | | int version_major; | |
| int version_minor; | | int version_minor; | |
| | | | |
| /* configuration */ | | /* configuration */ | |
| int rate_control; | | int rate_control; | |
| int bitrate; | | int bitrate; | |
| int max_bitrate; | | int max_bitrate; | |
| int min_bitrate; | | int min_bitrate; | |
|
| | | | |
| | | // Buffer model parameters for CBR and (TODO) constrained VBR coding | |
| int buffer_size; | | int buffer_size; | |
| int buffer_level; | | int buffer_level; | |
| double quality; | | double quality; | |
| double noise_threshold; | | double noise_threshold; | |
| int gop_structure; | | int gop_structure; | |
| int queue_depth; | | int queue_depth; | |
| int perceptual_weighting; | | int perceptual_weighting; | |
| double perceptual_distance; | | double perceptual_distance; | |
| int filtering; | | int filtering; | |
| double filter_value; | | double filter_value; | |
|
| | | SchroEncoderProfile force_profile; | |
| int profile; | | int profile; | |
| int level; | | int level; | |
| int open_gop; | | int open_gop; | |
| int au_distance; | | int au_distance; | |
|
| | | int max_refs; | |
| schro_bool enable_psnr; | | schro_bool enable_psnr; | |
| schro_bool enable_ssim; | | schro_bool enable_ssim; | |
| schro_bool enable_md5; | | schro_bool enable_md5; | |
| | | | |
|
| int ref_distance; | | | |
| int transform_depth; | | int transform_depth; | |
| int intra_wavelet; | | int intra_wavelet; | |
| int inter_wavelet; | | int inter_wavelet; | |
| int mv_precision; | | int mv_precision; | |
| int motion_block_size; | | int motion_block_size; | |
| int motion_block_overlap; | | int motion_block_overlap; | |
| schro_bool interlaced_coding; | | schro_bool interlaced_coding; | |
| schro_bool enable_internal_testing; | | schro_bool enable_internal_testing; | |
| schro_bool enable_noarith; | | schro_bool enable_noarith; | |
| schro_bool enable_fullscan_estimation; | | schro_bool enable_fullscan_estimation; | |
| schro_bool enable_hierarchical_estimation; | | schro_bool enable_hierarchical_estimation; | |
| schro_bool enable_zero_estimation; | | schro_bool enable_zero_estimation; | |
| schro_bool enable_phasecorr_estimation; | | schro_bool enable_phasecorr_estimation; | |
| schro_bool enable_bigblock_estimation; | | schro_bool enable_bigblock_estimation; | |
| schro_bool enable_multiquant; | | schro_bool enable_multiquant; | |
| schro_bool enable_dc_multiquant; | | schro_bool enable_dc_multiquant; | |
| schro_bool enable_global_motion; | | schro_bool enable_global_motion; | |
|
| | | schro_bool enable_scene_change_detection; | |
| | | schro_bool enable_deep_estimation; | |
| | | schro_bool enable_rdo_cbr; | |
| | | schro_bool enable_chroma_me; | |
| int horiz_slices; | | int horiz_slices; | |
| int vert_slices; | | int vert_slices; | |
| int codeblock_size; | | int codeblock_size; | |
| | | | |
| double magic_dc_metric_offset; | | double magic_dc_metric_offset; | |
| double magic_subband0_lambda_scale; | | double magic_subband0_lambda_scale; | |
| double magic_chroma_lambda_scale; | | double magic_chroma_lambda_scale; | |
| double magic_nonref_lambda_scale; | | double magic_nonref_lambda_scale; | |
|
| | | double magic_I_lambda_scale; | |
| | | double magic_P_lambda_scale; | |
| | | double magic_B_lambda_scale; | |
| | | double magic_me_lambda_scale; | |
| double magic_allocation_scale; | | double magic_allocation_scale; | |
|
| | | double magic_inter_cpd_scale; | |
| double magic_keyframe_weight; | | double magic_keyframe_weight; | |
| double magic_scene_change_threshold; | | double magic_scene_change_threshold; | |
| double magic_inter_p_weight; | | double magic_inter_p_weight; | |
| double magic_inter_b_weight; | | double magic_inter_b_weight; | |
|
| double magic_mc_bailout_limit; | | double magic_me_bailout_limit; | |
| double magic_bailout_weight; | | double magic_bailout_weight; | |
| double magic_error_power; | | double magic_error_power; | |
|
| double magic_mc_lambda; | | | |
| double magic_subgroup_length; | | double magic_subgroup_length; | |
|
| double magic_lambda; | | | |
| double magic_badblock_multiplier_nonref; | | double magic_badblock_multiplier_nonref; | |
| double magic_badblock_multiplier_ref; | | double magic_badblock_multiplier_ref; | |
| double magic_block_search_threshold; | | double magic_block_search_threshold; | |
| double magic_scan_distance; | | double magic_scan_distance; | |
|
| | | double magic_diagonal_lambda_scale; | |
| | | | |
| /* hooks */ | | /* hooks */ | |
| | | | |
| void (*init_frame) (SchroEncoderFrame *frame); | | void (*init_frame) (SchroEncoderFrame *frame); | |
| void (*handle_gop) (SchroEncoder *encoder, int i); | | void (*handle_gop) (SchroEncoder *encoder, int i); | |
| int (*setup_frame) (SchroEncoderFrame *frame); | | int (*setup_frame) (SchroEncoderFrame *frame); | |
| int (*handle_quants) (SchroEncoder *encoder, int i); | | int (*handle_quants) (SchroEncoder *encoder, int i); | |
| | | | |
| /* other */ | | /* other */ | |
| | | | |
| | | | |
| skipping to change at line 330 | | skipping to change at line 361 | |
| int quantiser_engine; | | int quantiser_engine; | |
| | | | |
| double start_time; | | double start_time; | |
| int downsample_levels; | | int downsample_levels; | |
| | | | |
| /* internal stuff */ | | /* internal stuff */ | |
| | | | |
| double cycles_per_degree_horiz; | | double cycles_per_degree_horiz; | |
| double cycles_per_degree_vert; | | double cycles_per_degree_vert; | |
| | | | |
|
| double subband_weights[SCHRO_N_WAVELETS][SCHRO_LIMIT_TRANSFORM_DEPTH][SCH | | double intra_subband_weights[SCHRO_N_WAVELETS][SCHRO_LIMIT_TRANSFORM_DEPT | |
| RO_LIMIT_SUBBANDS]; | | H][SCHRO_LIMIT_SUBBANDS]; | |
| | | double inter_subband_weights[SCHRO_N_WAVELETS][SCHRO_LIMIT_TRANSFORM_DEPT | |
| | | H][SCHRO_LIMIT_SUBBANDS]; | |
| SchroHistogramTable intra_hist_tables[60]; | | SchroHistogramTable intra_hist_tables[60]; | |
| | | | |
|
| int bits_per_picture; | | | |
| | | | |
| /* statistics */ | | /* statistics */ | |
| | | | |
|
| double average_arith_context_ratio_intra; | | double average_arith_context_ratios_intra[3][SCHRO_LIMIT_SUBBANDS]; | |
| double average_arith_context_ratio_inter; | | double average_arith_context_ratios_inter[3][SCHRO_LIMIT_SUBBANDS]; | |
| | | | |
| | | double frame_stats[21]; | |
| | | | |
| /* engine specific stuff */ | | /* engine specific stuff */ | |
| | | | |
|
| | | int bits_per_picture; | |
| | | int subgroup_position; | |
| | | int I_complexity; | |
| | | int P_complexity; | |
| | | int B_complexity; | |
| | | int B_complexity_sum; | |
| | | long int I_frame_alloc; | |
| | | long int P_frame_alloc; | |
| | | long int B_frame_alloc; | |
| | | long int gop_target; | |
| | | | |
| | | // Current qf, from which is derived ... | |
| | | double qf; | |
| | | // lambda to use for intra pictures in CBR mode | |
| | | double intra_cbr_lambda; | |
| | | | |
| int gop_picture; | | int gop_picture; | |
| int quant_slot; | | int quant_slot; | |
| | | | |
| int last_ref; | | int last_ref; | |
| }; | | }; | |
| #endif | | #endif | |
| | | | |
| typedef enum { | | typedef enum { | |
| SCHRO_ENCODER_SETTING_TYPE_BOOLEAN, | | SCHRO_ENCODER_SETTING_TYPE_BOOLEAN, | |
| SCHRO_ENCODER_SETTING_TYPE_INT, | | SCHRO_ENCODER_SETTING_TYPE_INT, | |
| SCHRO_ENCODER_SETTING_TYPE_ENUM, | | SCHRO_ENCODER_SETTING_TYPE_ENUM, | |
| SCHRO_ENCODER_SETTING_TYPE_DOUBLE, | | SCHRO_ENCODER_SETTING_TYPE_DOUBLE, | |
| SCHRO_ENCODER_SETTING_TYPE_LAST | | SCHRO_ENCODER_SETTING_TYPE_LAST | |
| } SchroEncoderSettingTypeEnum; | | } SchroEncoderSettingTypeEnum; | |
| | | | |
| struct _SchroEncoderSetting { | | struct _SchroEncoderSetting { | |
|
| char *name; | | const char *name; | |
| SchroEncoderSettingTypeEnum type; | | SchroEncoderSettingTypeEnum type; | |
| | | | |
| double min; | | double min; | |
| double max; | | double max; | |
| double default_value; | | double default_value; | |
| | | | |
|
| char **enum_list; | | const char **enum_list; | |
| }; | | }; | |
| | | | |
| enum { | | enum { | |
| SCHRO_MOTION_FIELD_HIER_REF0, | | SCHRO_MOTION_FIELD_HIER_REF0, | |
| SCHRO_MOTION_FIELD_HIER1_REF0, | | SCHRO_MOTION_FIELD_HIER1_REF0, | |
| SCHRO_MOTION_FIELD_HIER2_REF0, | | SCHRO_MOTION_FIELD_HIER2_REF0, | |
| SCHRO_MOTION_FIELD_HIER3_REF0, | | SCHRO_MOTION_FIELD_HIER3_REF0, | |
| SCHRO_MOTION_FIELD_HIER_REF1, | | SCHRO_MOTION_FIELD_HIER_REF1, | |
| SCHRO_MOTION_FIELD_HIER1_REF1, | | SCHRO_MOTION_FIELD_HIER1_REF1, | |
| SCHRO_MOTION_FIELD_HIER2_REF1, | | SCHRO_MOTION_FIELD_HIER2_REF1, | |
| | | | |
| skipping to change at line 394 | | skipping to change at line 442 | |
| SCHRO_MOTION_FIELD_FULLSCAN_REF0, | | SCHRO_MOTION_FIELD_FULLSCAN_REF0, | |
| SCHRO_MOTION_FIELD_FULLSCAN_REF1, | | SCHRO_MOTION_FIELD_FULLSCAN_REF1, | |
| SCHRO_MOTION_FIELD_LAST | | SCHRO_MOTION_FIELD_LAST | |
| }; | | }; | |
| | | | |
| SchroEncoder * schro_encoder_new (void); | | SchroEncoder * schro_encoder_new (void); | |
| void schro_encoder_free (SchroEncoder *encoder); | | void schro_encoder_free (SchroEncoder *encoder); | |
| SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder); | | SchroVideoFormat * schro_encoder_get_video_format (SchroEncoder *encoder); | |
| void schro_encoder_set_video_format (SchroEncoder *encoder, | | void schro_encoder_set_video_format (SchroEncoder *encoder, | |
| SchroVideoFormat *video_format); | | SchroVideoFormat *video_format); | |
|
| | | void schro_encoder_set_frame_lambda (SchroEncoderFrame* frame); | |
| void schro_encoder_end_of_stream (SchroEncoder *encoder); | | void schro_encoder_end_of_stream (SchroEncoder *encoder); | |
| int schro_encoder_push_ready (SchroEncoder *encoder); | | int schro_encoder_push_ready (SchroEncoder *encoder); | |
| void schro_encoder_push_frame (SchroEncoder *encoder, SchroFrame *frame); | | void schro_encoder_push_frame (SchroEncoder *encoder, SchroFrame *frame); | |
| void schro_encoder_push_frame_full (SchroEncoder *encoder, SchroFrame *fram
e, void *priv); | | void schro_encoder_push_frame_full (SchroEncoder *encoder, SchroFrame *fram
e, void *priv); | |
| void schro_encoder_force_sequence_header (SchroEncoder *encoder); | | void schro_encoder_force_sequence_header (SchroEncoder *encoder); | |
| | | | |
| SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder, | | SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder, | |
|
| SchroAuxiliaryDataID id, void *data, int size); | | SchroAuxiliaryDataID id, const void *data, int size); | |
| void schro_encoder_encode_parse_info (SchroPack *bits, int parse_code); | | void schro_encoder_encode_parse_info (SchroPack *bits, int parse_code); | |
| void schro_encoder_insert_buffer (SchroEncoder *encoder, SchroBuffer *buffe
r); | | void schro_encoder_insert_buffer (SchroEncoder *encoder, SchroBuffer *buffe
r); | |
| void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame, SchroBuff
er *buffer); | | void schro_encoder_frame_insert_buffer (SchroEncoderFrame *frame, SchroBuff
er *buffer); | |
| void schro_encoder_start (SchroEncoder *encoder); | | void schro_encoder_start (SchroEncoder *encoder); | |
| | | | |
| void schro_encoder_set_packet_assembly (SchroEncoder *encoder, int value); | | void schro_encoder_set_packet_assembly (SchroEncoder *encoder, int value); | |
| SchroStateEnum schro_encoder_wait (SchroEncoder *encoder); | | SchroStateEnum schro_encoder_wait (SchroEncoder *encoder); | |
| SchroBuffer * schro_encoder_pull (SchroEncoder *encoder, | | SchroBuffer * schro_encoder_pull (SchroEncoder *encoder, | |
| int *n_decodable_frames); | | int *n_decodable_frames); | |
| SchroBuffer * schro_encoder_pull_full (SchroEncoder *encoder, int *presenta
tion_frame, | | SchroBuffer * schro_encoder_pull_full (SchroEncoder *encoder, int *presenta
tion_frame, | |
| void **priv); | | void **priv); | |
| SchroBuffer * schro_encoder_encode_sequence_header (SchroEncoder *encoder); | | SchroBuffer * schro_encoder_encode_sequence_header (SchroEncoder *encoder); | |
| | | | |
| int schro_encoder_get_n_settings (void); | | int schro_encoder_get_n_settings (void); | |
| const SchroEncoderSetting *schro_encoder_get_setting_info (int i); | | const SchroEncoderSetting *schro_encoder_get_setting_info (int i); | |
| void schro_encoder_setting_set_double (SchroEncoder *encoder, const char *n
ame, | | void schro_encoder_setting_set_double (SchroEncoder *encoder, const char *n
ame, | |
| double d); | | double d); | |
| double schro_encoder_setting_get_double (SchroEncoder *encoder, const char
*name); | | double schro_encoder_setting_get_double (SchroEncoder *encoder, const char
*name); | |
| | | | |
|
| | | int schro_encoder_get_frame_stats_size (SchroEncoder *encoder); | |
| | | void schro_encoder_get_frame_stats (SchroEncoder *encoder, double *dest, in | |
| | | t n); | |
| | | | |
| #ifdef SCHRO_ENABLE_UNSTABLE_API | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| | | | |
| void schro_encoder_set_default_subband_weights (SchroEncoder *encoder); | | void schro_encoder_set_default_subband_weights (SchroEncoder *encoder); | |
| void schro_encoder_calculate_subband_weights (SchroEncoder *encoder, | | void schro_encoder_calculate_subband_weights (SchroEncoder *encoder, | |
| double (*perceptual_weight)(double)); | | double (*perceptual_weight)(double)); | |
| double schro_encoder_perceptual_weight_constant (double cpd); | | double schro_encoder_perceptual_weight_constant (double cpd); | |
| double schro_encoder_perceptual_weight_ccir959 (double cpd); | | double schro_encoder_perceptual_weight_ccir959 (double cpd); | |
| double schro_encoder_perceptual_weight_moo (double cpd); | | double schro_encoder_perceptual_weight_moo (double cpd); | |
| double schro_encoder_perceptual_weight_manos_sakrison (double cpd); | | double schro_encoder_perceptual_weight_manos_sakrison (double cpd); | |
| | | | |
| | | | |
| skipping to change at line 463 | | skipping to change at line 515 | |
| void schro_encoder_encode_picture_header (SchroEncoderFrame *frame); | | void schro_encoder_encode_picture_header (SchroEncoderFrame *frame); | |
| SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder); | | SchroBuffer * schro_encoder_encode_end_of_stream (SchroEncoder *encoder); | |
| void schro_encoder_clean_up_transform (SchroEncoderFrame *frame); | | void schro_encoder_clean_up_transform (SchroEncoderFrame *frame); | |
| void schro_encoder_choose_quantisers (SchroEncoderFrame *frame); | | void schro_encoder_choose_quantisers (SchroEncoderFrame *frame); | |
| void schro_encoder_output_push (SchroEncoder *encoder, | | void schro_encoder_output_push (SchroEncoder *encoder, | |
| SchroBuffer *buffer, int slot, int presentation_frame); | | SchroBuffer *buffer, int slot, int presentation_frame); | |
| | | | |
| SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder *encoder); | | SchroEncoderFrame * schro_encoder_frame_new (SchroEncoder *encoder); | |
| void schro_encoder_frame_ref (SchroEncoderFrame *frame); | | void schro_encoder_frame_ref (SchroEncoderFrame *frame); | |
| void schro_encoder_frame_unref (SchroEncoderFrame *frame); | | void schro_encoder_frame_unref (SchroEncoderFrame *frame); | |
|
| | | int schro_encoder_frame_is_B_frame (SchroEncoderFrame* frame); | |
| void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame *frame
); | | void schro_encoder_encode_lowdelay_transform_data (SchroEncoderFrame *frame
); | |
| void schro_encoder_estimate_entropy (SchroEncoderFrame *frame); | | void schro_encoder_estimate_entropy (SchroEncoderFrame *frame); | |
| void schro_encoder_recalculate_allocations (SchroEncoder *encoder); | | void schro_encoder_recalculate_allocations (SchroEncoder *encoder); | |
| | | | |
| void schro_encoder_calculate_test_info (SchroEncoderFrame *frame); | | void schro_encoder_calculate_test_info (SchroEncoderFrame *frame); | |
| | | | |
| void schro_encoder_init_error_tables (SchroEncoder *encoder); | | void schro_encoder_init_error_tables (SchroEncoder *encoder); | |
| | | | |
|
| | | int schro_encoder_frame_get_quant_index (SchroEncoderFrame *frame, int comp | |
| | | onent, | |
| | | int index, int x, int y); | |
| void schro_encoder_frame_set_quant_index (SchroEncoderFrame *frame, int com
ponent, | | void schro_encoder_frame_set_quant_index (SchroEncoderFrame *frame, int com
ponent, | |
| int index, int x, int y, int quant_index); | | int index, int x, int y, int quant_index); | |
| | | | |
| #endif | | #endif | |
| | | | |
| SCHRO_END_DECLS | | SCHRO_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 33 change blocks. |
| 16 lines changed or deleted | | 73 lines changed or added | |
|
| schroframe.h | | schroframe.h | |
| | | | |
| skipping to change at line 56 | | skipping to change at line 56 | |
| #define SCHRO_FRAME_FORMAT_DEPTH(format) ((format) & 0xc) | | #define SCHRO_FRAME_FORMAT_DEPTH(format) ((format) & 0xc) | |
| #define SCHRO_FRAME_FORMAT_DEPTH_U8 0x00 | | #define SCHRO_FRAME_FORMAT_DEPTH_U8 0x00 | |
| #define SCHRO_FRAME_FORMAT_DEPTH_S16 0x04 | | #define SCHRO_FRAME_FORMAT_DEPTH_S16 0x04 | |
| #define SCHRO_FRAME_FORMAT_DEPTH_S32 0x08 | | #define SCHRO_FRAME_FORMAT_DEPTH_S32 0x08 | |
| | | | |
| #define SCHRO_FRAME_FORMAT_H_SHIFT(format) ((format) & 0x1) | | #define SCHRO_FRAME_FORMAT_H_SHIFT(format) ((format) & 0x1) | |
| #define SCHRO_FRAME_FORMAT_V_SHIFT(format) (((format)>>1) & 0x1) | | #define SCHRO_FRAME_FORMAT_V_SHIFT(format) (((format)>>1) & 0x1) | |
| | | | |
| #define SCHRO_FRAME_IS_PACKED(format) (((format)>>8) & 0x1) | | #define SCHRO_FRAME_IS_PACKED(format) (((format)>>8) & 0x1) | |
| | | | |
|
| #define SCHRO_FRAME_CACHE_SIZE 8 | | #define SCHRO_FRAME_CACHE_SIZE 32 | |
| | | | |
| struct _SchroFrameData { | | struct _SchroFrameData { | |
| SchroFrameFormat format; | | SchroFrameFormat format; | |
| void *data; | | void *data; | |
| int stride; | | int stride; | |
| int width; | | int width; | |
| int height; | | int height; | |
| int length; | | int length; | |
| int h_shift; | | int h_shift; | |
| int v_shift; | | int v_shift; | |
| | | | |
| skipping to change at line 91 | | skipping to change at line 91 | |
| | | | |
| int is_virtual; | | int is_virtual; | |
| int cached_lines[3][SCHRO_FRAME_CACHE_SIZE]; | | int cached_lines[3][SCHRO_FRAME_CACHE_SIZE]; | |
| SchroFrame *virt_frame1; | | SchroFrame *virt_frame1; | |
| SchroFrame *virt_frame2; | | SchroFrame *virt_frame2; | |
| void (*render_line) (SchroFrame *frame, void *dest, int component, int i)
; | | void (*render_line) (SchroFrame *frame, void *dest, int component, int i)
; | |
| void *virt_priv; | | void *virt_priv; | |
| void *virt_priv2; | | void *virt_priv2; | |
| | | | |
| int extension; | | int extension; | |
|
| | | int cache_offset[3]; | |
| }; | | }; | |
| | | | |
| struct _SchroUpsampledFrame { | | struct _SchroUpsampledFrame { | |
| SchroFrame *frames[4]; | | SchroFrame *frames[4]; | |
| void *components[3]; | | void *components[3]; | |
| }; | | }; | |
| | | | |
| #define SCHRO_FRAME_DATA_GET_LINE(fd,i) (SCHRO_OFFSET((fd)->data,(fd)->stri
de*(i))) | | #define SCHRO_FRAME_DATA_GET_LINE(fd,i) (SCHRO_OFFSET((fd)->data,(fd)->stri
de*(i))) | |
| #define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd)
->data,(fd)->stride*(j)+(i))) | | #define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd)
->data,(fd)->stride*(j)+(i))) | |
| #define SCHRO_FRAME_DATA_GET_PIXEL_S16(fd,i,j) ((int16_t *)SCHRO_OFFSET((fd
)->data,(fd)->stride*(j)+(i)*sizeof(int16_t))) | | #define SCHRO_FRAME_DATA_GET_PIXEL_S16(fd,i,j) ((int16_t *)SCHRO_OFFSET((fd
)->data,(fd)->stride*(j)+(i)*sizeof(int16_t))) | |
| | | | |
| SchroFrame * schro_frame_new (void); | | SchroFrame * schro_frame_new (void); | |
| SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain *domain, | | SchroFrame * schro_frame_new_and_alloc (SchroMemoryDomain *domain, | |
| SchroFrameFormat format, int width, int height); | | SchroFrameFormat format, int width, int height); | |
| SchroFrame * schro_frame_new_from_data_I420 (void *data, int width, int hei
ght); | | SchroFrame * schro_frame_new_from_data_I420 (void *data, int width, int hei
ght); | |
|
| | | SchroFrame * schro_frame_new_from_data_Y42B (void *data, int width, int hei | |
| | | ght); | |
| | | SchroFrame * schro_frame_new_from_data_Y444 (void *data, int width, int hei | |
| | | ght); | |
| SchroFrame * schro_frame_new_from_data_YV12 (void *data, int width, int hei
ght); | | SchroFrame * schro_frame_new_from_data_YV12 (void *data, int width, int hei
ght); | |
| SchroFrame * schro_frame_new_from_data_YUY2 (void *data, int width, int hei
ght); | | SchroFrame * schro_frame_new_from_data_YUY2 (void *data, int width, int hei
ght); | |
| SchroFrame * schro_frame_new_from_data_UYVY (void *data, int width, int hei
ght); | | SchroFrame * schro_frame_new_from_data_UYVY (void *data, int width, int hei
ght); | |
| SchroFrame * schro_frame_new_from_data_UYVY_full (void *data, int width, in
t height, int stride); | | SchroFrame * schro_frame_new_from_data_UYVY_full (void *data, int width, in
t height, int stride); | |
| SchroFrame * schro_frame_new_from_data_AYUV (void *data, int width, int hei
ght); | | SchroFrame * schro_frame_new_from_data_AYUV (void *data, int width, int hei
ght); | |
| SchroFrame * schro_frame_new_from_data_v216 (void *data, int width, int hei
ght); | | SchroFrame * schro_frame_new_from_data_v216 (void *data, int width, int hei
ght); | |
| SchroFrame * schro_frame_new_from_data_v210 (void *data, int width, int hei
ght); | | SchroFrame * schro_frame_new_from_data_v210 (void *data, int width, int hei
ght); | |
| void schro_frame_set_free_callback (SchroFrame *frame, | | void schro_frame_set_free_callback (SchroFrame *frame, | |
| SchroFrameFreeFunc free_func, void *priv); | | SchroFrameFreeFunc free_func, void *priv); | |
| void schro_frame_unref (SchroFrame *frame); | | void schro_frame_unref (SchroFrame *frame); | |
| | | | |
| skipping to change at line 170 | | skipping to change at line 173 | |
| #endif | | #endif | |
| void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame *upframe, i
nt k, | | void schro_upsampled_frame_get_block_precN (SchroUpsampledFrame *upframe, i
nt k, | |
| int x, int y, int prec, SchroFrameData *dest); | | int x, int y, int prec, SchroFrameData *dest); | |
| void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame *upfra
me, int k, | | void schro_upsampled_frame_get_block_fast_precN (SchroUpsampledFrame *upfra
me, int k, | |
| int x, int y, int prec, SchroFrameData *dest, SchroFrameData *fd); | | int x, int y, int prec, SchroFrameData *dest, SchroFrameData *fd); | |
| void schro_upsampled_frame_get_subdata_prec0 (SchroUpsampledFrame *upframe, | | void schro_upsampled_frame_get_subdata_prec0 (SchroUpsampledFrame *upframe, | |
| int k, int x, int y, SchroFrameData *fd); | | int k, int x, int y, SchroFrameData *fd); | |
| void schro_upsampled_frame_get_subdata_prec1 (SchroUpsampledFrame *upframe, | | void schro_upsampled_frame_get_subdata_prec1 (SchroUpsampledFrame *upframe, | |
| int k, int x, int y, SchroFrameData *fd); | | int k, int x, int y, SchroFrameData *fd); | |
| | | | |
|
| | | /* it extracts a block of data from a frame, if possible */ | |
| | | int schro_frame_get_data (SchroFrame* frame, SchroFrameData* fd, int comp | |
| | | , int x, int y); | |
| | | | |
| void schro_frame_get_subdata (SchroFrame *frame, SchroFrameData *fd, | | void schro_frame_get_subdata (SchroFrame *frame, SchroFrameData *fd, | |
| int comp, int x, int y); | | int comp, int x, int y); | |
|
| | | void schro_frame_get_reference_subdata (SchroFrame* frame, SchroFrameData* | |
| | | fd | |
| | | , int comp, int x, int y); | |
| | | | |
| void schro_frame_split_fields (SchroFrame *dest1, SchroFrame *dest2, SchroF
rame *src); | | void schro_frame_split_fields (SchroFrame *dest1, SchroFrame *dest2, SchroF
rame *src); | |
| | | | |
| #endif | | #endif | |
| | | | |
| SCHRO_END_DECLS | | SCHRO_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 1 lines changed or deleted | | 13 lines changed or added | |
|
| schromotion.h | | schromotion.h | |
| | | | |
| #ifndef __SCHRO_MOTION_H__ | | #ifndef __SCHRO_MOTION_H__ | |
| #define __SCHRO_MOTION_H__ | | #define __SCHRO_MOTION_H__ | |
| | | | |
| #include <schroedinger/schroframe.h> | | #include <schroedinger/schroframe.h> | |
| #include <schroedinger/schroparams.h> | | #include <schroedinger/schroparams.h> | |
|
| | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| | | #include <orc/orc.h> | |
| | | #endif | |
| | | | |
| SCHRO_BEGIN_DECLS | | SCHRO_BEGIN_DECLS | |
| | | | |
| typedef struct _SchroMotionVector SchroMotionVector; | | typedef struct _SchroMotionVector SchroMotionVector; | |
| typedef struct _SchroMotionVectorDC SchroMotionVectorDC; | | typedef struct _SchroMotionVectorDC SchroMotionVectorDC; | |
| typedef struct _SchroMotionField SchroMotionField; | | typedef struct _SchroMotionField SchroMotionField; | |
| typedef struct _SchroMotion SchroMotion; | | typedef struct _SchroMotion SchroMotion; | |
| typedef struct _SchroMotionScan SchroMotionScan; | | typedef struct _SchroMotionScan SchroMotionScan; | |
|
| | | typedef struct _SchroMotionFuncs SchroMotionFuncs; | |
| | | | |
| #ifdef SCHRO_ENABLE_UNSTABLE_API | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| struct _SchroMotionVector { | | struct _SchroMotionVector { | |
| unsigned int pred_mode : 2; | | unsigned int pred_mode : 2; | |
| unsigned int using_global : 1; | | unsigned int using_global : 1; | |
| unsigned int split : 2; | | unsigned int split : 2; | |
| unsigned int unused : 3; | | unsigned int unused : 3; | |
| unsigned int scan : 8; | | unsigned int scan : 8; | |
|
| unsigned int metric : 16; | | uint32_t metric; | |
| | | uint32_t chroma_metric; | |
| union { | | union { | |
| struct { | | struct { | |
| int16_t dx[2]; | | int16_t dx[2]; | |
| int16_t dy[2]; | | int16_t dy[2]; | |
| } vec; | | } vec; | |
| struct { | | struct { | |
| int16_t dc[3]; | | int16_t dc[3]; | |
| } dc; | | } dc; | |
| } u; | | } u; | |
| }; | | }; | |
| | | | |
| struct _SchroMotionField { | | struct _SchroMotionField { | |
| int x_num_blocks; | | int x_num_blocks; | |
| int y_num_blocks; | | int y_num_blocks; | |
| SchroMotionVector *motion_vectors; | | SchroMotionVector *motion_vectors; | |
| }; | | }; | |
| | | | |
|
| | | struct _SchroMotionFuncs { | |
| | | OrcProgram *block_accumulate; | |
| | | OrcProgram *block_accumulate_scaled; | |
| | | OrcProgram *block_accumulate_dc; | |
| | | OrcProgram *block_accumulate_avg; | |
| | | OrcProgram *block_accumulate_biref; | |
| | | }; | |
| | | | |
| struct _SchroMotion { | | struct _SchroMotion { | |
| SchroUpsampledFrame *src1; | | SchroUpsampledFrame *src1; | |
| SchroUpsampledFrame *src2; | | SchroUpsampledFrame *src2; | |
| SchroMotionVector *motion_vectors; | | SchroMotionVector *motion_vectors; | |
| SchroParams *params; | | SchroParams *params; | |
| | | | |
| uint8_t *tmpdata; | | uint8_t *tmpdata; | |
| | | | |
| int ref_weight_precision; | | int ref_weight_precision; | |
| int ref1_weight; | | int ref1_weight; | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 86 | |
| | | | |
| SchroFrameData alloc_block_ref[2]; | | SchroFrameData alloc_block_ref[2]; | |
| SchroFrameData block_ref[2]; | | SchroFrameData block_ref[2]; | |
| | | | |
| int weight_x[SCHRO_LIMIT_BLOCK_SIZE]; | | int weight_x[SCHRO_LIMIT_BLOCK_SIZE]; | |
| int weight_y[SCHRO_LIMIT_BLOCK_SIZE]; | | int weight_y[SCHRO_LIMIT_BLOCK_SIZE]; | |
| int width; | | int width; | |
| int height; | | int height; | |
| int max_fast_x; | | int max_fast_x; | |
| int max_fast_y; | | int max_fast_y; | |
|
| | | | |
| | | schro_bool simple_weight; | |
| | | schro_bool oneref_noscale; | |
| }; | | }; | |
| | | | |
| #define SCHRO_MOTION_GET_BLOCK(motion,x,y) \ | | #define SCHRO_MOTION_GET_BLOCK(motion,x,y) \ | |
| ((motion)->motion_vectors+(y)*(motion)->params->x_num_blocks + (x)) | | ((motion)->motion_vectors+(y)*(motion)->params->x_num_blocks + (x)) | |
| | | | |
| SchroMotion * schro_motion_new (SchroParams *params, | | SchroMotion * schro_motion_new (SchroParams *params, | |
| SchroUpsampledFrame *ref1, SchroUpsampledFrame *ref2); | | SchroUpsampledFrame *ref1, SchroUpsampledFrame *ref2); | |
| void schro_motion_free (SchroMotion *motion); | | void schro_motion_free (SchroMotion *motion); | |
| | | | |
| int schro_motion_verify (SchroMotion *mf); | | int schro_motion_verify (SchroMotion *mf); | |
|
| void schro_motion_render_ref (SchroMotion *motion, SchroFrame *dest); | | void schro_motion_render_ref (SchroMotion *motion, SchroFrame *dest, | |
| void schro_motion_render (SchroMotion *motion, SchroFrame *dest); | | SchroFrame *addframe, int add, SchroFrame *output_frame); | |
| | | void schro_motion_render (SchroMotion *motion, SchroFrame *dest, | |
| | | SchroFrame *addframe, int add, SchroFrame *output_frame); | |
| void schro_motion_init_obmc_weight (SchroMotion *motion); | | void schro_motion_init_obmc_weight (SchroMotion *motion); | |
| | | | |
|
| void schro_motion_render_fast (SchroMotion *motion, SchroFrame *dest); | | void schro_motion_render_fast (SchroMotion *motion, SchroFrame *dest, | |
| | | SchroFrame *addframe, int add, SchroFrame *output_frame); | |
| int schro_motion_render_fast_allowed (SchroMotion *motion); | | int schro_motion_render_fast_allowed (SchroMotion *motion); | |
| | | | |
|
| | | void schro_mf_vector_prediction (SchroMotionField* mf, | |
| | | int x, int y, int *pred_x, int *pred_y, int mode); | |
| | | | |
| void schro_motion_vector_prediction (SchroMotion *motion, | | void schro_motion_vector_prediction (SchroMotion *motion, | |
| int x, int y, int *pred_x, int *pred_y, int mode); | | int x, int y, int *pred_x, int *pred_y, int mode); | |
| int schro_motion_split_prediction (SchroMotion *motion, int x, int y); | | int schro_motion_split_prediction (SchroMotion *motion, int x, int y); | |
| int schro_motion_get_mode_prediction (SchroMotion *motion, int x, int y); | | int schro_motion_get_mode_prediction (SchroMotion *motion, int x, int y); | |
| void schro_motion_dc_prediction (SchroMotion *motion, | | void schro_motion_dc_prediction (SchroMotion *motion, | |
| int x, int y, int *pred); | | int x, int y, int *pred); | |
| int schro_motion_get_global_prediction (SchroMotion *motion, | | int schro_motion_get_global_prediction (SchroMotion *motion, | |
| int x, int y); | | int x, int y); | |
| | | | |
| int schro_motion_vector_is_equal (SchroMotionVector *mv1, SchroMotionVector
*mv2); | | int schro_motion_vector_is_equal (SchroMotionVector *mv1, SchroMotionVector
*mv2); | |
| | | | |
End of changes. 8 change blocks. |
| 4 lines changed or deleted | | 26 lines changed or added | |
|
| schromotionest.h | | schromotionest.h | |
| | | | |
| skipping to change at line 13 | | skipping to change at line 13 | |
| #define __SCHRO_MOTIONEST_H__ | | #define __SCHRO_MOTIONEST_H__ | |
| | | | |
| #include <schroedinger/schroencoder.h> | | #include <schroedinger/schroencoder.h> | |
| | | | |
| SCHRO_BEGIN_DECLS | | SCHRO_BEGIN_DECLS | |
| | | | |
| typedef struct _SchroMotionEst SchroMotionEst; | | typedef struct _SchroMotionEst SchroMotionEst; | |
| typedef struct _SchroRoughME SchroRoughME; | | typedef struct _SchroRoughME SchroRoughME; | |
| typedef struct _SchroBlock SchroBlock; | | typedef struct _SchroBlock SchroBlock; | |
| | | | |
|
| | | /* supports hierarchical block-matching motion estimation */ | |
| | | typedef struct _SchroHierBm SchroHierBm; | |
| | | /* supports motion estimation */ | |
| | | typedef struct _SchroMe SchroMe; | |
| | | | |
| #ifdef SCHRO_ENABLE_UNSTABLE_API | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| | | | |
| #define SCHRO_MAX_HIER_LEVELS 8 | | #define SCHRO_MAX_HIER_LEVELS 8 | |
| | | | |
|
| | | struct _SchroHierBm { | |
| | | int ref_count; | |
| | | int ref; | |
| | | int hierarchy_levels; | |
| | | SchroParams* params; | |
| | | SchroFrame** downsampled_src; | |
| | | SchroFrame** downsampled_ref; | |
| | | SchroMotionField** downsampled_mf; | |
| | | schro_bool use_chroma; | |
| | | }; | |
| | | | |
| struct _SchroMotionEst { | | struct _SchroMotionEst { | |
| SchroEncoderFrame *encoder_frame; | | SchroEncoderFrame *encoder_frame; | |
| SchroParams *params; | | SchroParams *params; | |
| | | | |
| double lambda; | | double lambda; | |
| | | | |
| SchroFrame *downsampled_src0[SCHRO_MAX_HIER_LEVELS]; | | SchroFrame *downsampled_src0[SCHRO_MAX_HIER_LEVELS]; | |
| SchroFrame *downsampled_src1[SCHRO_MAX_HIER_LEVELS]; | | SchroFrame *downsampled_src1[SCHRO_MAX_HIER_LEVELS]; | |
| | | | |
| SchroMotion *motion; | | SchroMotion *motion; | |
| | | | |
|
| SchroBlock *sblocks; | | | |
| | | | |
| //SchroMotionField *downsampled_mf[2][8]; | | | |
| int scan_distance; | | int scan_distance; | |
| | | | |
| int badblocks; | | int badblocks; | |
| double hier_score; | | double hier_score; | |
| }; | | }; | |
| | | | |
| struct _SchroRoughME { | | struct _SchroRoughME { | |
| SchroEncoderFrame *encoder_frame; | | SchroEncoderFrame *encoder_frame; | |
| SchroEncoderFrame *ref_frame; | | SchroEncoderFrame *ref_frame; | |
| | | | |
| | | | |
| skipping to change at line 65 | | skipping to change at line 78 | |
| void schro_motionest_free (SchroMotionEst *me); | | void schro_motionest_free (SchroMotionEst *me); | |
| | | | |
| SchroRoughME * schro_rough_me_new (SchroEncoderFrame *frame, SchroEncoderFr
ame *ref); | | SchroRoughME * schro_rough_me_new (SchroEncoderFrame *frame, SchroEncoderFr
ame *ref); | |
| void schro_rough_me_free (SchroRoughME *rme); | | void schro_rough_me_free (SchroRoughME *rme); | |
| void schro_rough_me_heirarchical_scan (SchroRoughME *rme); | | void schro_rough_me_heirarchical_scan (SchroRoughME *rme); | |
| void schro_rough_me_heirarchical_scan_nohint (SchroRoughME *rme, int shift, | | void schro_rough_me_heirarchical_scan_nohint (SchroRoughME *rme, int shift, | |
| int distance); | | int distance); | |
| void schro_rough_me_heirarchical_scan_hint (SchroRoughME *rme, int shift, | | void schro_rough_me_heirarchical_scan_hint (SchroRoughME *rme, int shift, | |
| int distance); | | int distance); | |
| | | | |
|
| | | void schro_encoder_hierarchical_block_matching (SchroEncoderFrame* frame); | |
| | | | |
| void schro_encoder_motion_predict_rough (SchroEncoderFrame *frame); | | void schro_encoder_motion_predict_rough (SchroEncoderFrame *frame); | |
| void schro_encoder_motion_predict_pel (SchroEncoderFrame *frame); | | void schro_encoder_motion_predict_pel (SchroEncoderFrame *frame); | |
| void schro_encoder_motion_predict_subpel (SchroEncoderFrame *frame); | | void schro_encoder_motion_predict_subpel (SchroEncoderFrame *frame); | |
|
| | | void schro_encoder_motion_predict_subpel_deep (SchroMe *me); | |
| | | | |
| void schro_encoder_global_estimation (SchroEncoderFrame *frame); | | void schro_encoder_global_estimation (SchroEncoderFrame *frame); | |
| | | | |
| SchroMotionField * schro_motion_field_new (int x_num_blocks, int y_num_bloc
ks); | | SchroMotionField * schro_motion_field_new (int x_num_blocks, int y_num_bloc
ks); | |
| void schro_motion_field_free (SchroMotionField *field); | | void schro_motion_field_free (SchroMotionField *field); | |
| void schro_motion_field_scan (SchroMotionField *field, SchroParams *params,
SchroFrame *frame, SchroFrame *ref, int dist); | | void schro_motion_field_scan (SchroMotionField *field, SchroParams *params,
SchroFrame *frame, SchroFrame *ref, int dist); | |
| void schro_motion_field_inherit (SchroMotionField *field, SchroMotionField
*parent); | | void schro_motion_field_inherit (SchroMotionField *field, SchroMotionField
*parent); | |
| void schro_motion_field_copy (SchroMotionField *field, SchroMotionField *pa
rent); | | void schro_motion_field_copy (SchroMotionField *field, SchroMotionField *pa
rent); | |
|
| | | void schro_motion_field_set (SchroMotionField *field, int split, int pred_m
ode); | |
| | | | |
| int schro_frame_get_metric (SchroFrame *frame1, int x1, int y1, | | int schro_frame_get_metric (SchroFrame *frame1, int x1, int y1, | |
| SchroFrame *frame2, int x2, int y2); | | SchroFrame *frame2, int x2, int y2); | |
| void schro_motion_field_lshift (SchroMotionField *mf, int n); | | void schro_motion_field_lshift (SchroMotionField *mf, int n); | |
| | | | |
| int schro_motion_estimate_entropy (SchroMotion *motion); | | int schro_motion_estimate_entropy (SchroMotion *motion); | |
| int schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j)
; | | int schro_motion_block_estimate_entropy (SchroMotion *motion, int i, int j)
; | |
| int schro_motion_superblock_estimate_entropy (SchroMotion *motion, int i, i
nt j); | | int schro_motion_superblock_estimate_entropy (SchroMotion *motion, int i, i
nt j); | |
| int schro_motion_superblock_try_estimate_entropy (SchroMotion *motion, int
i, | | int schro_motion_superblock_try_estimate_entropy (SchroMotion *motion, int
i, | |
| int j, SchroBlock *block); | | int j, SchroBlock *block); | |
| int schro_motionest_superblock_get_metric (SchroMotionEst *me, | | int schro_motionest_superblock_get_metric (SchroMotionEst *me, | |
| SchroBlock *block, int i, int j); | | SchroBlock *block, int i, int j); | |
| void schro_motion_copy_from (SchroMotion *motion, int i, int j, SchroBlock
*block); | | void schro_motion_copy_from (SchroMotion *motion, int i, int j, SchroBlock
*block); | |
| void schro_motion_copy_to (SchroMotion *motion, int i, int j, SchroBlock *b
lock); | | void schro_motion_copy_to (SchroMotion *motion, int i, int j, SchroBlock *b
lock); | |
| | | | |
| void schro_block_fixup (SchroBlock *block); | | void schro_block_fixup (SchroBlock *block); | |
| int schro_block_check (SchroBlock *block); | | int schro_block_check (SchroBlock *block); | |
| | | | |
|
| | | /* SchroHierBm *interface */ | |
| | | SchroHierBm *schro_hbm_new ( SchroEncoderFrame* frame, int ref_number ); | |
| | | SchroHierBm *schro_hbm_ref ( SchroHierBm *schro_hbm ); | |
| | | void schro_hbm_unref ( SchroHierBm* schro_hbm ); | |
| | | | |
| | | void schro_hbm_scan ( SchroHierBm *schro_hbm ); | |
| | | void schro_hierarchical_bm_scan_hint ( SchroHierBm *schro_hbm, int shift, i | |
| | | nt h_range ); | |
| | | | |
| | | SchroMotionField* schro_hbm_best_mf ( SchroHierBm *schro_hbm ); | |
| | | SchroMotionField* schro_hbm_motion_field ( SchroHierBm *schro_hbm, int leve | |
| | | l); | |
| | | | |
| | | /* SchroMe interface */ | |
| | | SchroMe *schro_me_new (SchroEncoderFrame* framer ); | |
| | | void schro_me_free (SchroMe* me ); | |
| | | | |
| | | SchroFrame* schro_me_src (SchroMe *me ); | |
| | | SchroUpsampledFrame* schro_me_ref (SchroMe *me, int ref_number ); | |
| | | | |
| | | SchroMotionField* schro_me_subpel_mf ( SchroMe *me, int ref_number ); | |
| | | void schro_me_set_subpel_mf ( SchroMe *me, SchroMotionField* mf, int ref_nu | |
| | | mber ); | |
| | | SchroMotionField* schro_me_split2_mf ( SchroMe *me, int ref_number ); | |
| | | void schro_me_set_split2_mf ( SchroMe *me, SchroMotionField* mf, int ref_nu | |
| | | mber ); | |
| | | SchroMotionField* schro_me_split1_mf ( SchroMe *me, int ref_number ); | |
| | | void schro_me_set_split1_mf ( SchroMe *me, SchroMotionField* mf, int ref_nu | |
| | | mber ); | |
| | | SchroMotionField* schro_me_split0_mf ( SchroMe *me, int ref_number ); | |
| | | void schro_me_set_split0_mf ( SchroMe *me, SchroMotionField* mf, int ref_nu | |
| | | mber ); | |
| | | | |
| | | SchroHierBm *schro_me_hbm (SchroMe *me, int ref_number); | |
| | | | |
| | | void schro_me_set_lambda ( SchroMe *me, double lambda ); | |
| | | double schro_me_lambda ( SchroMe *me ); | |
| | | SchroParams* schro_me_params ( SchroMe *me ); | |
| | | SchroMotion* schro_me_motion ( SchroMe *me ); | |
| | | void schro_me_set_motion ( SchroMe *me, SchroMotion* motion ); | |
| | | void schro_me_set_mc_error ( SchroMe *me, double mc_err ); | |
| | | double schro_me_mc_error ( SchroMe *me ); | |
| | | void schro_me_set_badblock_ratio ( SchroMe *me, double badblocks_ratio ); | |
| | | double schro_me_badblocks_ratio ( SchroMe *me ); | |
| | | void schro_me_set_dcblock_ratio ( SchroMe *me, double dcblock_ratio ); | |
| | | double schro_me_dcblock_ratio ( SchroMe *me ); | |
| | | void schro_mode_decision (SchroMe *me); | |
| | | | |
| | | void schro_motion_calculate_stats (SchroMotion *motion, SchroEncoderFrame * | |
| | | frame); | |
| | | | |
| | | void schro_motionest_superblock_phasecorr1 (SchroMotionEst *me, int ref, | |
| | | SchroBlock *block, int i, int j); | |
| | | void schro_motionest_superblock_global (SchroMotionEst *me, int ref, | |
| | | SchroBlock *block, int i, int j); | |
| | | | |
| #endif | | #endif | |
| | | | |
| SCHRO_END_DECLS | | SCHRO_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 3 lines changed or deleted | | 76 lines changed or added | |
|