2 #ifndef __SCHRO_PARAMS_H__
3 #define __SCHRO_PARAMS_H__
5 #include <schroedinger/schroutils.h>
6 #include <schroedinger/schrobitstream.h>
7 #include <schroedinger/schroframe.h>
8 #include <schroedinger/schrolimits.h>
9 #include <schroedinger/schrovideoformat.h>
13 typedef struct _SchroParams SchroParams
;
14 typedef struct _SchroGlobalMotion SchroGlobalMotion
;
16 #ifdef SCHRO_ENABLE_UNSTABLE_API
18 struct _SchroGlobalMotion
{
33 SchroVideoFormat
*video_format
;
36 /* transform parameters */
37 int wavelet_filter_index
;
39 int horiz_codeblocks
[SCHRO_LIMIT_TRANSFORM_DEPTH
+ 1];
40 int vert_codeblocks
[SCHRO_LIMIT_TRANSFORM_DEPTH
+ 1];
41 int codeblock_mode_index
;
43 /* motion prediction parameters */
45 int have_global_motion
; /* using_global_motion */
51 SchroGlobalMotion global_motion
[2];
52 int picture_pred_mode
;
53 int picture_weight_bits
;
57 /* DiracPro parameters */
59 int n_horiz_slices
; /* slices_x */
60 int n_vert_slices
; /* slices_y */
62 int slice_bytes_denom
;
63 int quant_matrix
[3*SCHRO_LIMIT_TRANSFORM_DEPTH
+1];
65 /* calculated sizes */
67 int iwt_chroma_height
;
76 #define SCHRO_SUBBAND_IS_HORIZONTALLY_ORIENTED(position) (((position)&3) == 2)
77 #define SCHRO_SUBBAND_IS_VERTICALLY_ORIENTED(position) (((position)&3) == 1)
78 #define SCHRO_SUBBAND_IS_DIAGONALLY_ORIENTED(position) (((position)&3) == 3)
79 #define SCHRO_SUBBAND_SHIFT(position) ((position)>>2)
81 extern const int schro_tables_lowdelay_quants
[7][4][9];
83 void schro_params_init (SchroParams
*params
, int video_format
);
85 void schro_params_calculate_iwt_sizes (SchroParams
*params
);
86 void schro_params_calculate_mc_sizes (SchroParams
*params
);
88 int schro_params_set_block_params (SchroParams
*params
, int index
);
89 int schro_params_get_block_params (SchroParams
*params
);
90 int schro_params_verify_block_params (SchroParams
*params
);
92 void schro_params_set_default_codeblock (SchroParams
*params
);
93 schro_bool
schro_params_is_default_codeblock (SchroParams
*params
);
95 void schro_subband_get_frame_data (SchroFrameData
*dest
,
96 SchroFrame
*frame
, int component
, int position
, SchroParams
*params
);
97 int schro_subband_get_position (int index
);
98 void schro_params_set_default_quant_matrix (SchroParams
*params
);
99 schro_bool
schro_params_is_default_quant_matrix (SchroParams
*params
);
101 /* FIXME should be SchroFrameFormat */
102 int schro_params_get_frame_format (int depth
,
103 SchroChromaFormat chroma_format
);
105 /* FIXME should be moved */
106 void schro_frame_iwt_transform (SchroFrame
*frame
, SchroParams
*params
);