| schroasync.h | | schroasync.h | |
| | | | |
| #ifndef __SCHRO_ASYNC_H__ | | #ifndef __SCHRO_ASYNC_H__ | |
| #define __SCHRO_ASYNC_H__ | | #define __SCHRO_ASYNC_H__ | |
| | | | |
| #include <schroedinger/schroutils.h> | | #include <schroedinger/schroutils.h> | |
| #include <schroedinger/schrodomain.h> | | #include <schroedinger/schrodomain.h> | |
| | | | |
| SCHRO_BEGIN_DECLS | | SCHRO_BEGIN_DECLS | |
| | | | |
|
| | | typedef int SchroExecDomain; | |
| | | | |
| typedef struct _SchroAsync SchroAsync; | | typedef struct _SchroAsync SchroAsync; | |
| typedef struct _SchroThread SchroThread; | | typedef struct _SchroThread SchroThread; | |
| typedef struct _SchroAsyncTask SchroAsyncTask; | | typedef struct _SchroAsyncTask SchroAsyncTask; | |
|
| | | typedef struct _SchroMutex SchroMutex; | |
| | | | |
| #ifdef SCHRO_ENABLE_UNSTABLE_API | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| | | | |
| typedef int (*SchroAsyncScheduleFunc)(void *, SchroExecDomain exec_domain); | | typedef int (*SchroAsyncScheduleFunc)(void *, SchroExecDomain exec_domain); | |
| typedef void (*SchroAsyncCompleteFunc)(void *); | | typedef void (*SchroAsyncCompleteFunc)(void *); | |
| | | | |
|
| | | void schro_async_init (void); | |
| SchroAsync * schro_async_new(int n_threads, | | SchroAsync * schro_async_new(int n_threads, | |
| SchroAsyncScheduleFunc schedule, | | SchroAsyncScheduleFunc schedule, | |
| SchroAsyncCompleteFunc complete, | | SchroAsyncCompleteFunc complete, | |
| void *closure); | | void *closure); | |
| void schro_async_free (SchroAsync *async); | | void schro_async_free (SchroAsync *async); | |
| | | | |
| void schro_async_run_locked (SchroAsync *async, void (*func)(void *), void
*ptr); | | void schro_async_run_locked (SchroAsync *async, void (*func)(void *), void
*ptr); | |
| int schro_async_get_num_completed (SchroAsync *async); | | int schro_async_get_num_completed (SchroAsync *async); | |
| void schro_async_wait_one (SchroAsync *async); | | void schro_async_wait_one (SchroAsync *async); | |
| int schro_async_wait_locked (SchroAsync *async); | | int schro_async_wait_locked (SchroAsync *async); | |
| void schro_async_wait (SchroAsync *async, int min_waiting); | | void schro_async_wait (SchroAsync *async, int min_waiting); | |
| void *schro_async_pull (SchroAsync *async); | | void *schro_async_pull (SchroAsync *async); | |
| void * schro_async_pull_locked (SchroAsync *async); | | void * schro_async_pull_locked (SchroAsync *async); | |
| void schro_async_signal_scheduler (SchroAsync *async); | | void schro_async_signal_scheduler (SchroAsync *async); | |
| void schro_async_lock (SchroAsync *async); | | void schro_async_lock (SchroAsync *async); | |
| void schro_async_unlock (SchroAsync *async); | | void schro_async_unlock (SchroAsync *async); | |
| SchroExecDomain schro_async_get_exec_domain (void); | | SchroExecDomain schro_async_get_exec_domain (void); | |
| | | | |
| void schro_async_add_cuda (SchroAsync *async); | | void schro_async_add_cuda (SchroAsync *async); | |
| | | | |
|
| | | SchroMutex *schro_mutex_new (void); | |
| | | void schro_mutex_lock (SchroMutex *mutex); | |
| | | void schro_mutex_unlock (SchroMutex *mutex); | |
| | | void schro_mutex_free (SchroMutex *mutex); | |
| | | | |
| #endif | | #endif | |
| | | | |
| SCHRO_END_DECLS | | SCHRO_END_DECLS | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 4 change blocks. |
| 0 lines changed or deleted | | 9 lines changed or added | |
|
| schrodecoder.h | | schrodecoder.h | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| int minor_version; | | int minor_version; | |
| int profile; | | int profile; | |
| int level; | | int level; | |
| SchroVideoFormat video_format; | | SchroVideoFormat video_format; | |
| | | | |
| SchroQueue *frame_queue; | | SchroQueue *frame_queue; | |
| SchroQueue *picture_queue; | | SchroQueue *picture_queue; | |
| | | | |
| int queue_depth; | | int queue_depth; | |
| int end_of_stream; | | int end_of_stream; | |
|
| | | int flushing; | |
| | | int coded_order; | |
| | | | |
| SchroPictureNumber earliest_frame; | | SchroPictureNumber earliest_frame; | |
| | | | |
| SchroUnpack unpack; | | SchroUnpack unpack; | |
| int parse_code; | | int parse_code; | |
| int next_parse_offset; | | int next_parse_offset; | |
| int prev_parse_offset; | | int prev_parse_offset; | |
| | | | |
|
| int have_access_unit; | | int have_sequence_header; | |
| SchroBuffer *access_unit_buffer; | | SchroBuffer *sequence_header_buffer; | |
| int have_frame_number; | | int have_frame_number; | |
| | | | |
| double skip_value; | | double skip_value; | |
| double skip_ratio; | | double skip_ratio; | |
| | | | |
| int error; | | int error; | |
| char *error_message; | | char *error_message; | |
| | | | |
| int has_md5; | | int has_md5; | |
| uint8_t md5_checksum[32]; | | uint8_t md5_checksum[32]; | |
| | | | |
| skipping to change at line 130 | | skipping to change at line 132 | |
| }; | | }; | |
| #endif | | #endif | |
| | | | |
| enum { | | enum { | |
| SCHRO_DECODER_OK, | | SCHRO_DECODER_OK, | |
| SCHRO_DECODER_ERROR, | | SCHRO_DECODER_ERROR, | |
| SCHRO_DECODER_EOS, | | SCHRO_DECODER_EOS, | |
| SCHRO_DECODER_FIRST_ACCESS_UNIT, | | SCHRO_DECODER_FIRST_ACCESS_UNIT, | |
| SCHRO_DECODER_NEED_BITS, | | SCHRO_DECODER_NEED_BITS, | |
| SCHRO_DECODER_NEED_FRAME, | | SCHRO_DECODER_NEED_FRAME, | |
|
| SCHRO_DECODER_WAIT | | SCHRO_DECODER_WAIT, | |
| | | SCHRO_DECODER_STALLED | |
| | | }; | |
| | | | |
| | | enum { | |
| | | SCHRO_DECODER_PICTURE_ORDER_PRESENTATION = 0, | |
| | | SCHRO_DECODER_PICTURE_ORDER_CODED | |
| }; | | }; | |
| | | | |
| SchroDecoder * schro_decoder_new (void); | | SchroDecoder * schro_decoder_new (void); | |
| void schro_decoder_free (SchroDecoder *decoder); | | void schro_decoder_free (SchroDecoder *decoder); | |
| void schro_decoder_reset (SchroDecoder *decoder); | | void schro_decoder_reset (SchroDecoder *decoder); | |
| SchroVideoFormat * schro_decoder_get_video_format (SchroDecoder *decoder); | | SchroVideoFormat * schro_decoder_get_video_format (SchroDecoder *decoder); | |
| void schro_decoder_add_output_picture (SchroDecoder *decoder, SchroFrame *f
rame); | | void schro_decoder_add_output_picture (SchroDecoder *decoder, SchroFrame *f
rame); | |
| int schro_decoder_push_ready (SchroDecoder *decoder); | | int schro_decoder_push_ready (SchroDecoder *decoder); | |
| int schro_decoder_push (SchroDecoder *decoder, SchroBuffer *buffer); | | int schro_decoder_push (SchroDecoder *decoder, SchroBuffer *buffer); | |
|
| | | int schro_decoder_set_flushing (SchroDecoder *decoder, int flushing); | |
| | | void schro_decoder_set_picture_order (SchroDecoder *decoder, int picture_or | |
| | | der); | |
| int schro_decoder_push_end_of_stream (SchroDecoder *decoder); | | int schro_decoder_push_end_of_stream (SchroDecoder *decoder); | |
| SchroFrame *schro_decoder_pull (SchroDecoder *decoder); | | SchroFrame *schro_decoder_pull (SchroDecoder *decoder); | |
|
| int schro_decoder_is_parse_unit (SchroBuffer *buffer); | | | |
| int schro_decoder_is_access_unit (SchroBuffer *buffer); | | | |
| int schro_decoder_is_intra (SchroBuffer *buffer); | | | |
| int schro_decoder_is_picture (SchroBuffer *buffer); | | | |
| int schro_decoder_iterate (SchroDecoder *decoder); | | | |
| int schro_decoder_wait (SchroDecoder *decoder); | | int schro_decoder_wait (SchroDecoder *decoder); | |
| | | | |
| void schro_decoder_set_earliest_frame (SchroDecoder *decoder, SchroPictureN
umber earliest_frame); | | void schro_decoder_set_earliest_frame (SchroDecoder *decoder, SchroPictureN
umber earliest_frame); | |
| void schro_decoder_set_skip_ratio (SchroDecoder *decoder, double ratio); | | void schro_decoder_set_skip_ratio (SchroDecoder *decoder, double ratio); | |
| SchroPictureNumber schro_decoder_get_picture_number (SchroDecoder *decoder)
; | | SchroPictureNumber schro_decoder_get_picture_number (SchroDecoder *decoder)
; | |
|
| | | int schro_decoder_need_output_frame (SchroDecoder *decoder); | |
| | | | |
| #ifdef SCHRO_ENABLE_UNSTABLE_API | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| | | | |
| void schro_decoder_decode_parse_header (SchroDecoder *decoder); | | void schro_decoder_decode_parse_header (SchroDecoder *decoder); | |
|
| void schro_decoder_parse_access_unit (SchroDecoder *decoder); | | void schro_decoder_parse_sequence_header (SchroDecoder *decoder); | |
| int schro_decoder_compare_access_unit_buffer (SchroBuffer *a, SchroBuffer * | | int schro_decoder_compare_sequence_header_buffer (SchroBuffer *a, SchroBuff | |
| b); | | er *b); | |
| | | | |
| void schro_decoder_subband_dc_predict (SchroFrameData *fd); | | void schro_decoder_subband_dc_predict (SchroFrameData *fd); | |
| | | | |
| /* SchroPicture */ | | /* SchroPicture */ | |
| | | | |
| SchroPicture * schro_picture_new (SchroDecoder *decoder); | | SchroPicture * schro_picture_new (SchroDecoder *decoder); | |
| SchroPicture * schro_picture_ref (SchroPicture *picture); | | SchroPicture * schro_picture_ref (SchroPicture *picture); | |
| void schro_picture_unref (SchroPicture *picture); | | void schro_picture_unref (SchroPicture *picture); | |
| | | | |
| void schro_decoder_decode_picture (SchroPicture *picture); | | void schro_decoder_decode_picture (SchroPicture *picture); | |
| | | | |
End of changes. 7 change blocks. |
| 11 lines changed or deleted | | 18 lines changed or added | |
|
| schroencoder.h | | schroencoder.h | |
| | | | |
| skipping to change at line 22 | | skipping to change at line 22 | |
| #include <schroedinger/schromotion.h> | | #include <schroedinger/schromotion.h> | |
| #include <schroedinger/schrohistogram.h> | | #include <schroedinger/schrohistogram.h> | |
| #include <schroedinger/schrolist.h> | | #include <schroedinger/schrolist.h> | |
| | | | |
| SCHRO_BEGIN_DECLS | | SCHRO_BEGIN_DECLS | |
| | | | |
| typedef struct _SchroEncoder SchroEncoder; | | typedef struct _SchroEncoder SchroEncoder; | |
| typedef struct _SchroEncoderFrame SchroEncoderFrame; | | typedef struct _SchroEncoderFrame SchroEncoderFrame; | |
| typedef struct _SchroEncoderSetting SchroEncoderSetting; | | typedef struct _SchroEncoderSetting SchroEncoderSetting; | |
| | | | |
|
| #if 0 | | | |
| typedef enum { | | | |
| SCHRO_PREF_ENGINE, | | | |
| SCHRO_PREF_QUANT_ENGINE, | | | |
| SCHRO_PREF_REF_DISTANCE, | | | |
| SCHRO_PREF_TRANSFORM_DEPTH, | | | |
| SCHRO_PREF_INTRA_WAVELET, | | | |
| SCHRO_PREF_INTER_WAVELET, | | | |
| SCHRO_PREF_LAMBDA, | | | |
| SCHRO_PREF_PSNR, | | | |
| SCHRO_PREF_BITRATE, | | | |
| SCHRO_PREF_NOARITH, | | | |
| SCHRO_PREF_MD5, | | | |
| SCHRO_PREF_LAST | | | |
| } SchroPrefEnum; | | | |
| #endif | | | |
| | | | |
| typedef enum { | | typedef enum { | |
| 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 | |
| typedef enum { | | typedef enum { | |
| SCHRO_ENCODER_FRAME_STATE_NEW = 0, | | SCHRO_ENCODER_FRAME_STATE_NEW = 0, | |
|
| SCHRO_ENCODER_FRAME_STATE_INITED = (1<<0), | | | |
| SCHRO_ENCODER_FRAME_STATE_ANALYSE = (1<<1), | | SCHRO_ENCODER_FRAME_STATE_ANALYSE = (1<<1), | |
|
| | | SCHRO_ENCODER_FRAME_STATE_HAVE_GOP = (1<<7), | |
| | | SCHRO_ENCODER_FRAME_STATE_HAVE_PARAMS = (1<<8), | |
| SCHRO_ENCODER_FRAME_STATE_PREDICT = (1<<2), | | SCHRO_ENCODER_FRAME_STATE_PREDICT = (1<<2), | |
|
| | | SCHRO_ENCODER_FRAME_STATE_HAVE_REFS = (1<<10), | |
| | | SCHRO_ENCODER_FRAME_STATE_HAVE_QUANTS = (1<<11), | |
| SCHRO_ENCODER_FRAME_STATE_ENCODING = (1<<3), | | SCHRO_ENCODER_FRAME_STATE_ENCODING = (1<<3), | |
| SCHRO_ENCODER_FRAME_STATE_RECONSTRUCT = (1<<4), | | SCHRO_ENCODER_FRAME_STATE_RECONSTRUCT = (1<<4), | |
| SCHRO_ENCODER_FRAME_STATE_POSTANALYSE = (1<<5), | | SCHRO_ENCODER_FRAME_STATE_POSTANALYSE = (1<<5), | |
| SCHRO_ENCODER_FRAME_STATE_DONE = (1<<6), | | SCHRO_ENCODER_FRAME_STATE_DONE = (1<<6), | |
|
| SCHRO_ENCODER_FRAME_STATE_HAVE_GOP = (1<<7), | | SCHRO_ENCODER_FRAME_STATE_FREE = (1<<9) | |
| SCHRO_ENCODER_FRAME_STATE_HAVE_PARAMS = (1<<8), | | | |
| SCHRO_ENCODER_FRAME_STATE_FREE = (1<<9), | | | |
| SCHRO_ENCODER_FRAME_STATE_HAVE_REFS = (1<<10) | | | |
| } SchroEncoderFrameStateEnum; | | } SchroEncoderFrameStateEnum; | |
|
| | | #endif | |
| | | | |
| typedef enum { | | typedef enum { | |
| SCHRO_ENCODER_PERCEPTUAL_CONSTANT, | | SCHRO_ENCODER_PERCEPTUAL_CONSTANT, | |
| SCHRO_ENCODER_PERCEPTUAL_CCIR959, | | SCHRO_ENCODER_PERCEPTUAL_CCIR959, | |
| SCHRO_ENCODER_PERCEPTUAL_MOO, | | SCHRO_ENCODER_PERCEPTUAL_MOO, | |
| SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON | | SCHRO_ENCODER_PERCEPTUAL_MANOS_SAKRISON | |
| } SchroEncoderPerceptualEnum; | | } SchroEncoderPerceptualEnum; | |
| | | | |
| typedef enum { | | typedef enum { | |
| SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD, | | SCHRO_ENCODER_RATE_CONTROL_CONSTANT_NOISE_THRESHOLD, | |
| | | | |
| skipping to change at line 93 | | skipping to change at line 78 | |
| SCHRO_ENCODER_GOP_CHAINED_BIREF, | | SCHRO_ENCODER_GOP_CHAINED_BIREF, | |
| } SchroEncoderGOPEnum; | | } SchroEncoderGOPEnum; | |
| | | | |
| #ifdef SCHRO_ENABLE_UNSTABLE_API | | #ifdef SCHRO_ENABLE_UNSTABLE_API | |
| typedef int (*SchroEngineIterateFunc) (SchroEncoder *encoder); | | typedef int (*SchroEngineIterateFunc) (SchroEncoder *encoder); | |
| | | | |
| struct _SchroEncoderFrame { | | struct _SchroEncoderFrame { | |
| /*< private >*/ | | /*< private >*/ | |
| int refcount; | | int refcount; | |
| SchroEncoderFrameStateEnum state; | | SchroEncoderFrameStateEnum state; | |
|
| | | SchroEncoderFrameStateEnum needed_state; | |
| | | SchroEncoderFrameStateEnum working; | |
| int busy; | | int busy; | |
| | | | |
|
| | | void *priv; | |
| | | | |
| /* Bits telling the engine stages which stuff needs to happen */ | | /* Bits telling the engine stages which stuff needs to happen */ | |
| unsigned int need_downsampling; | | unsigned int need_downsampling; | |
| unsigned int need_filtering; | | unsigned int need_filtering; | |
| unsigned int need_average_luma; | | unsigned int need_average_luma; | |
| | | | |
| /* 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_average_luma; | | unsigned int have_average_luma; | |
| | | | |
| /* other stuff */ | | /* other stuff */ | |
| | | | |
|
| int start_access_unit; | | int start_sequence_header; | |
| | | int gop_length; | |
| | | | |
| SchroPictureNumber frame_number; | | SchroPictureNumber frame_number; | |
| SchroFrame *original_frame; | | SchroFrame *original_frame; | |
| SchroFrame *filtered_frame; | | SchroFrame *filtered_frame; | |
| SchroFrame *downsampled_frames[5]; | | SchroFrame *downsampled_frames[5]; | |
| SchroUpsampledFrame *reconstructed_frame; | | SchroUpsampledFrame *reconstructed_frame; | |
| | | | |
|
| SchroBuffer *access_unit_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; | |
| SchroPictureNumber picture_number_ref[2]; | | SchroPictureNumber picture_number_ref[2]; | |
| | | | |
| skipping to change at line 220 | | skipping to change at line 210 | |
| | | | |
| 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; | |
|
| | | int buffer_size; | |
| | | int buffer_level; | |
| 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; | |
| int profile; | | int profile; | |
| int level; | | int level; | |
| int au_distance; | | int au_distance; | |
| | | | |
| skipping to change at line 270 | | skipping to change at line 262 | |
| double magic_inter_b_weight; | | double magic_inter_b_weight; | |
| double magic_mc_bailout_limit; | | double magic_mc_bailout_limit; | |
| double magic_bailout_weight; | | double magic_bailout_weight; | |
| double magic_error_power; | | double magic_error_power; | |
| double magic_mc_lambda; | | double magic_mc_lambda; | |
| double magic_subgroup_length; | | double magic_subgroup_length; | |
| double magic_lambda; | | double magic_lambda; | |
| double magic_badblock_multiplier_nonref; | | double magic_badblock_multiplier_nonref; | |
| double magic_badblock_multiplier_ref; | | double magic_badblock_multiplier_ref; | |
| | | | |
|
| | | /* hooks */ | |
| | | | |
| | | void (*init_frame) (SchroEncoderFrame *frame); | |
| | | void (*handle_gop) (SchroEncoder *encoder, int i); | |
| | | int (*setup_frame) (SchroEncoderFrame *frame); | |
| | | int (*handle_quants) (SchroEncoder *encoder, int i); | |
| | | | |
| /* other */ | | /* other */ | |
| | | | |
| int end_of_stream; | | int end_of_stream; | |
| int end_of_stream_handled; | | int end_of_stream_handled; | |
| int end_of_stream_pulled; | | int end_of_stream_pulled; | |
| int completed_eos; | | int completed_eos; | |
| int prev_offset; | | int prev_offset; | |
| | | | |
| SchroPictureNumber au_frame; | | SchroPictureNumber au_frame; | |
| int next_slot; | | int next_slot; | |
| | | | |
| skipping to change at line 304 | | skipping to change at line 303 | |
| #endif | | #endif | |
| | | | |
| /* 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
RO_LIMIT_SUBBANDS]; | | double subband_weights[SCHRO_N_WAVELETS][SCHRO_LIMIT_TRANSFORM_DEPTH][SCH
RO_LIMIT_SUBBANDS]; | |
| SchroHistogramTable intra_hist_tables[60]; | | SchroHistogramTable intra_hist_tables[60]; | |
| | | | |
|
| int buffer_size; | | | |
| int buffer_level; | | | |
| int bits_per_picture; | | int bits_per_picture; | |
| | | | |
| /* statistics */ | | /* statistics */ | |
| | | | |
| double average_arith_context_ratio_intra; | | double average_arith_context_ratio_intra; | |
| double average_arith_context_ratio_inter; | | double average_arith_context_ratio_inter; | |
| | | | |
| /* engine specific stuff */ | | /* engine specific stuff */ | |
| | | | |
| int gop_picture; | | int gop_picture; | |
|
| | | int quant_slot; | |
| | | | |
| int intra_ref; | | int intra_ref; | |
| int last_ref; | | int last_ref; | |
| int last_ref2; | | int last_ref2; | |
| //int next_ref; | | //int next_ref; | |
| //int mid1_ref; | | //int mid1_ref; | |
| //int mid2_ref; | | //int mid2_ref; | |
| }; | | }; | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 390 | | skipping to change at line 388 | |
| }; | | }; | |
| | | | |
| 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_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); | |
| | | | |
| SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder, | | SchroBuffer * schro_encoder_encode_auxiliary_data (SchroEncoder *encoder, | |
| SchroAuxiliaryDataID id, void *data, int size); | | SchroAuxiliaryDataID id, void *data, int size); | |
|
| void schro_encoder_copy_to_frame_buffer (SchroEncoder *encoder, SchroBuffer
*buffer); | | | |
| void schro_encoder_encode_access_unit_header (SchroEncoder *encoder, SchroP
ack *bits); | | void schro_encoder_encode_access_unit_header (SchroEncoder *encoder, SchroP
ack *bits); | |
| 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); | |
| | | | |
|
| #if 0 | | | |
| int schro_encoder_preference_get_range (SchroEncoder *encoder, | | | |
| SchroPrefEnum pref, int *min, int *max); | | | |
| int schro_encoder_preference_get (SchroEncoder *encoder, SchroPrefEnum pref | | | |
| ); | | | |
| int schro_encoder_preference_set (SchroEncoder *encoder, SchroPrefEnum pref | | | |
| , | | | |
| int value); | | | |
| #endif | | | |
| | | | |
| 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, | |
| | | void **priv); | |
| | | | |
| 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); | |
| | | | |
| #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); | |
| | | | |
| skipping to change at line 449 | | skipping to change at line 441 | |
| SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder, | | SchroFrame * schro_encoder_frame_queue_get (SchroEncoder *encoder, | |
| SchroPictureNumber frame_number); | | SchroPictureNumber frame_number); | |
| void schro_encoder_frame_queue_remove (SchroEncoder *encoder, | | void schro_encoder_frame_queue_remove (SchroEncoder *encoder, | |
| SchroPictureNumber frame_number); | | SchroPictureNumber frame_number); | |
| SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder, | | SchroEncoderFrame * schro_encoder_reference_get (SchroEncoder *encoder, | |
| SchroPictureNumber frame_number); | | SchroPictureNumber frame_number); | |
| 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); | |
|
| SchroBuffer * schro_encoder_encode_access_unit (SchroEncoder *encoder); | | SchroBuffer * schro_encoder_encode_sequence_header (SchroEncoder *encoder); | |
| 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); | |
| | | | |
| 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); | |
| | | | |
End of changes. 20 change blocks. |
| 38 lines changed or deleted | | 29 lines changed or added | |
|
| schroframe.h | | schroframe.h | |
| | | | |
| skipping to change at line 15 | | skipping to change at line 15 | |
| #include <schroedinger/schroutils.h> | | #include <schroedinger/schroutils.h> | |
| #include <schroedinger/schrodomain.h> | | #include <schroedinger/schrodomain.h> | |
| | | | |
| SCHRO_BEGIN_DECLS | | SCHRO_BEGIN_DECLS | |
| | | | |
| typedef struct _SchroFrame SchroFrame; | | typedef struct _SchroFrame SchroFrame; | |
| typedef struct _SchroFrameData SchroFrameData; | | typedef struct _SchroFrameData SchroFrameData; | |
| typedef struct _SchroUpsampledFrame SchroUpsampledFrame; | | typedef struct _SchroUpsampledFrame SchroUpsampledFrame; | |
| | | | |
| typedef void (*SchroFrameFreeFunc)(SchroFrame *frame, void *priv); | | typedef void (*SchroFrameFreeFunc)(SchroFrame *frame, void *priv); | |
|
| | | typedef void (*SchroFrameRenderFunc)(SchroFrame *frame, void *dest, int com
ponent, int i); | |
| | | | |
| /* bit pattern: | | /* bit pattern: | |
| * 0x100 - 0: normal, 1: indirect (packed) | | * 0x100 - 0: normal, 1: indirect (packed) | |
| * 0x001 - horizontal chroma subsampling: 0: 1, 1: 2 | | * 0x001 - horizontal chroma subsampling: 0: 1, 1: 2 | |
| * 0x002 - vertical chroma subsampling: 0: 1, 1: 2 | | * 0x002 - vertical chroma subsampling: 0: 1, 1: 2 | |
| * 0x00c - depth: 0: u8, 1: s16, 2: s32 | | * 0x00c - depth: 0: u8, 1: s16, 2: s32 | |
| * */ | | * */ | |
| typedef enum _SchroFrameFormat { | | typedef enum _SchroFrameFormat { | |
| SCHRO_FRAME_FORMAT_U8_444 = 0x00, | | SCHRO_FRAME_FORMAT_U8_444 = 0x00, | |
| SCHRO_FRAME_FORMAT_U8_422 = 0x01, | | SCHRO_FRAME_FORMAT_U8_422 = 0x01, | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 53 | |
| #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 | |
| | | | |
| 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 75 | | skipping to change at line 78 | |
| SchroFrameFreeFunc free; | | SchroFrameFreeFunc free; | |
| SchroMemoryDomain *domain; | | SchroMemoryDomain *domain; | |
| void *regions[3]; | | void *regions[3]; | |
| void *priv; | | void *priv; | |
| | | | |
| SchroFrameFormat format; | | SchroFrameFormat format; | |
| int width; | | int width; | |
| int height; | | int height; | |
| | | | |
| SchroFrameData components[3]; | | SchroFrameData components[3]; | |
|
| | | | |
| | | int is_virtual; | |
| | | int cached_lines[3][SCHRO_FRAME_CACHE_SIZE]; | |
| | | SchroFrame *virt_frame1; | |
| | | SchroFrame *virt_frame2; | |
| | | void (*render_line) (SchroFrame *frame, void *dest, int component, int i) | |
| | | ; | |
| }; | | }; | |
| | | | |
| struct _SchroUpsampledFrame { | | struct _SchroUpsampledFrame { | |
| SchroFrame *frames[4]; | | SchroFrame *frames[4]; | |
| void *components[3]; | | void *components[3]; | |
| }; | | }; | |
| | | | |
|
| #define SCHRO_FRAME_DATA_GET_LINE(fd,i) (OFFSET((fd)->data,(fd)->stride*(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 *)OFFSET((fd)->data | | #define SCHRO_FRAME_DATA_GET_PIXEL_U8(fd,i,j) ((uint8_t *)SCHRO_OFFSET((fd) | |
| ,(fd)->stride*(j)+(i))) | | ->data,(fd)->stride*(j)+(i))) | |
| #define SCHRO_FRAME_DATA_GET_PIXEL_S16(fd,i,j) ((int16_t *)OFFSET((fd)->dat | | #define SCHRO_FRAME_DATA_GET_PIXEL_S16(fd,i,j) ((int16_t *)SCHRO_OFFSET((fd | |
| a,(fd)->stride*(j)+(i)*sizeof(int16_t))) | | )->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_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_AYUV (void *data, int width, int hei
ght); | | SchroFrame * schro_frame_new_from_data_AYUV (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); | |
| SchroFrame *schro_frame_ref (SchroFrame *frame); | | SchroFrame *schro_frame_ref (SchroFrame *frame); | |
| SchroFrame *schro_frame_dup (SchroFrame *frame); | | SchroFrame *schro_frame_dup (SchroFrame *frame); | |
| SchroFrame *schro_frame_clone (SchroMemoryDomain *domain, SchroFrame *frame
); | | SchroFrame *schro_frame_clone (SchroMemoryDomain *domain, SchroFrame *frame
); | |
| | | | |
| void schro_frame_convert (SchroFrame *dest, SchroFrame *src); | | void schro_frame_convert (SchroFrame *dest, SchroFrame *src); | |
| void schro_frame_add (SchroFrame *dest, SchroFrame *src); | | void schro_frame_add (SchroFrame *dest, SchroFrame *src); | |
| | | | |
End of changes. 5 change blocks. |
| 6 lines changed or deleted | | 17 lines changed or added | |
|