schroparams

schroparams

Synopsis




                    SchroVideoFormat;
                    SchroParams;
                    SchroMotionVector;
                    SchroMotionField;
                    SchroMotionVectorDC;
                    SchroGlobalMotion;
typedef             SchroPictureNumber;
void                schro_params_calculate_iwt_sizes    (SchroParams *params);
void                schro_params_calculate_mc_sizes     (SchroParams *params);
int                 schro_video_format_validate         (SchroVideoFormat *format);
void                schro_video_format_set_std_video_format
                                                        (SchroVideoFormat *format,
                                                         SchroVideoFormatEnum index);
SchroVideoFormatEnum schro_video_format_get_std_video_format
                                                        (SchroVideoFormat *format);
void                schro_video_format_set_std_frame_rate
                                                        (SchroVideoFormat *format,
                                                         int index);
int                 schro_video_format_get_std_frame_rate
                                                        (SchroVideoFormat *format);
void                schro_video_format_set_std_aspect_ratio
                                                        (SchroVideoFormat *format,
                                                         int index);
int                 schro_video_format_get_std_aspect_ratio
                                                        (SchroVideoFormat *format);
void                schro_video_format_set_std_signal_range
                                                        (SchroVideoFormat *format,
                                                         SchroSignalRange index);
SchroSignalRange    schro_video_format_get_std_signal_range
                                                        (SchroVideoFormat *format);
void                schro_video_format_set_std_colour_spec
                                                        (SchroVideoFormat *format,
                                                         SchroColourSpec index);
SchroColourSpec     schro_video_format_get_std_colour_spec
                                                        (SchroVideoFormat *format);
void                schro_params_set_block_params       (SchroParams *params,
                                                         int index);
void                schro_params_set_default_codeblock  (SchroParams *params);
int                 schro_params_get_block_params       (SchroParams *params);
int                 schro_params_get_frame_format       (int depth,
                                                         SchroChromaFormat chroma_format);
void                schro_params_init                   (SchroParams *params,
                                                         int video_format);
void                schro_params_init_lowdelay_quantisers
                                                        (SchroParams *params);

Description

Details

SchroVideoFormat

typedef struct {
  SchroVideoFormatEnum index;
  int width;
  int height;
  SchroChromaFormat chroma_format;
  
  schro_bool interlaced;
  schro_bool top_field_first;
  
  int frame_rate_numerator;
  int frame_rate_denominator;
  int aspect_ratio_numerator;
  int aspect_ratio_denominator;
    
  int clean_width;
  int clean_height;
  int left_offset;
  int top_offset;
    
  int luma_offset;
  int luma_excursion;
  int chroma_offset;
  int chroma_excursion;
    
  SchroColourPrimaries colour_primaries;
  SchroColourMatrix colour_matrix;
  SchroTransferFunction transfer_function;

  /* calculated values */

  int chroma_h_shift;
  int chroma_v_shift;
  int chroma_width;
  int chroma_height;
} SchroVideoFormat;


SchroParams

typedef struct {
} SchroParams;


SchroMotionVector

typedef struct {
  unsigned int pred_mode : 2;
  unsigned int using_global : 1;
  unsigned int split : 2;
  unsigned int unused : 3;
  unsigned int scan : 8;
  unsigned int metric : 16;
  int16_t x1;
  int16_t y1;
  int16_t x2;
  int16_t y2;
} SchroMotionVector;


SchroMotionField

typedef struct {
  int x_num_blocks;
  int y_num_blocks;
  SchroMotionVector *motion_vectors;
} SchroMotionField;


SchroMotionVectorDC

typedef struct {
  unsigned int pred_mode : 2;
  unsigned int using_global : 1;
  unsigned int split : 2;
  unsigned int unused : 3;
  unsigned int scan : 8;
  unsigned int metric : 16;
  uint8_t dc[3];
  uint8_t _padding1;
  uint32_t _padding2;
} SchroMotionVectorDC;


SchroGlobalMotion

typedef struct {
  int shift;
  int b0;
  int b1;
  int a_exp;
  int a00;
  int a01;
  int a10;
  int a11;
  int c_exp;
  int c0;
  int c1;
} SchroGlobalMotion;


SchroPictureNumber

typedef uint32_t SchroPictureNumber;


schro_params_calculate_iwt_sizes ()

void                schro_params_calculate_iwt_sizes    (SchroParams *params);

Calculates the size of the array used for wavelet transformation using the current video format and transformation depth in the params structure. The params structure is updated with the new values.

The structure fields changed are: iwt_chroma_width, iwt_chroma_height, iwt_luma_width, iwt_luma_height.

params :

pointer to SchroParams structure

schro_params_calculate_mc_sizes ()

void                schro_params_calculate_mc_sizes     (SchroParams *params);

Calculates the size of the array used for motion compensation using the current video format and motion compensation paramters in the params structure. The params structure is updated with the new values.

The structure fields changed are: x_num_blocks, y_num_blocks, mc_luma_width, mc_luma_height, mc_chroma_width, mc_chroma_height.

params :

pointer to SchroParams structure

schro_video_format_validate ()

int                 schro_video_format_validate         (SchroVideoFormat *format);

format :

Returns :


schro_video_format_set_std_video_format ()

void                schro_video_format_set_std_video_format
                                                        (SchroVideoFormat *format,
                                                         SchroVideoFormatEnum index);

Initializes the video format structure pointed to by format to the standard Dirac video formats specified by index.

format :

index :


schro_video_format_get_std_video_format ()

SchroVideoFormatEnum schro_video_format_get_std_video_format
                                                        (SchroVideoFormat *format);

In Dirac streams, video formats are encoded by specifying a standard format, and then modifying that to get the desired video format. This function guesses a standard format to use as a starting point for encoding the video format pointed to by format.

FIXME: the function that guesses the best format is poor

format :

pointer to SchroVideoFormat structure

Returns :

an index to the optimal standard format

schro_video_format_set_std_frame_rate ()

void                schro_video_format_set_std_frame_rate
                                                        (SchroVideoFormat *format,
                                                         int index);

Sets the frame rate of the video format structure pointed to by format to the Dirac standard frame specified by index.

format :

index :


schro_video_format_get_std_frame_rate ()

int                 schro_video_format_get_std_frame_rate
                                                        (SchroVideoFormat *format);

In Dirac bitstreams, frame rates can be one of several standard frame rates, encoded as an index, or the numerator and denominator of the framerate can be encoded directly. This function looks up the frame rate contained in the video format structure format in the list of standard frame rates. If the frame rate is a standard frame rate, the corresponding index is returned, otherwise 0 is returned.

format :

Returns :

index to a standard Dirac frame rate, or 0 if the frame rate is custom.

schro_video_format_set_std_aspect_ratio ()

void                schro_video_format_set_std_aspect_ratio
                                                        (SchroVideoFormat *format,
                                                         int index);

format :

index :


schro_video_format_get_std_aspect_ratio ()

int                 schro_video_format_get_std_aspect_ratio
                                                        (SchroVideoFormat *format);

format :

Returns :


schro_video_format_set_std_signal_range ()

void                schro_video_format_set_std_signal_range
                                                        (SchroVideoFormat *format,
                                                         SchroSignalRange index);

Sets the signal range of the video format structure to one of the standard values indicated by index.

format :

index :


schro_video_format_get_std_signal_range ()

SchroSignalRange    schro_video_format_get_std_signal_range
                                                        (SchroVideoFormat *format);

In Dirac bitstreams, signal ranges can be one of several standard signal ranges, encoded as an index, or the extents of the signal range can be encoded directly. This function looks up the signal range contained in the video format structure format in the list of standard signal ranges. If the signal range is a standard signal range, the corresponding index is returned, otherwise 0 is returned.

format :

pointer to SchroVideoFormat structure

Returns :

index to standard signal range, or 0 if there is no corresponding standard signal range.

schro_video_format_set_std_colour_spec ()

void                schro_video_format_set_std_colour_spec
                                                        (SchroVideoFormat *format,
                                                         SchroColourSpec index);

Sets the colour specification of the video format structure to one of the standard values indicated by index.

format :

pointer to SchroVideoFormat structure

index :

index to standard colour specification

schro_video_format_get_std_colour_spec ()

SchroColourSpec     schro_video_format_get_std_colour_spec
                                                        (SchroVideoFormat *format);

In Dirac bitstreams, colour specifications can be one of several standard colour specifications, encoded as an index, or the individual parts of the colour specication can be encoded. This function looks up the colour specification contained in the video format structure format in the list of standard colour specifications. If the colour specification is a standard colour specification, the corresponding index is returned, otherwise 0 is returned.

format :

pointer to SchroVideoFormat structure

Returns :

index to standard colour specification, or 0 if there is no corresponding standard colour specification.

schro_params_set_block_params ()

void                schro_params_set_block_params       (SchroParams *params,
                                                         int index);

Sets the block parameters for motion compensation in the parameters structure pointed to by params to the standard block parameters given by index.

params :

pointer to SchroParams structure

index :

index to standard block parameters

schro_params_set_default_codeblock ()

void                schro_params_set_default_codeblock  (SchroParams *params);

Sets the codeblock parameters in the parameters structure pointed to by params to the defaults.

params :

pointer to SchroParams structure

schro_params_get_block_params ()

int                 schro_params_get_block_params       (SchroParams *params);

params :

Returns :


schro_params_get_frame_format ()

int                 schro_params_get_frame_format       (int depth,
                                                         SchroChromaFormat chroma_format);

depth :

chroma_format :

Returns :


schro_params_init ()

void                schro_params_init                   (SchroParams *params,
                                                         int video_format);

params :

video_format :


schro_params_init_lowdelay_quantisers ()

void                schro_params_init_lowdelay_quantisers
                                                        (SchroParams *params);

params :