1 
2 #ifndef __SCHRO_VIDEO_FORMAT_H__
3 #define __SCHRO_VIDEO_FORMAT_H__
4 
5 #include <schroedinger/schroutils.h>
6 #include <schroedinger/schrobitstream.h>
7 
8 SCHRO_BEGIN_DECLS
9 
10 typedef struct _SchroVideoFormat SchroVideoFormat;
11 
12 struct _SchroVideoFormat {
13   SchroVideoFormatEnum index;
14   int width;
15   int height;
16   SchroChromaFormat chroma_format;
17 
18   schro_bool interlaced;
19   schro_bool top_field_first;
20 
21   int frame_rate_numerator;
22   int frame_rate_denominator;
23   int aspect_ratio_numerator;
24   int aspect_ratio_denominator;
25 
26   int clean_width;
27   int clean_height;
28   int left_offset;
29   int top_offset;
30 
31   int luma_offset;
32   int luma_excursion;
33   int chroma_offset;
34   int chroma_excursion;
35 
36   SchroColourPrimaries colour_primaries;
37   SchroColourMatrix colour_matrix;
38   SchroTransferFunction transfer_function;
39 
40   int interlaced_coding;
41 
42   int unused0;
43   int unused1;
44   int unused2;
45 };
46 
47 int schro_video_format_validate (SchroVideoFormat *format);
48 
49 void schro_video_format_set_std_video_format (SchroVideoFormat *format,
50     SchroVideoFormatEnum index);
51 SchroVideoFormatEnum schro_video_format_get_std_video_format (SchroVideoFormat *format);
52 void schro_video_format_set_std_frame_rate (SchroVideoFormat *format, int index);
53 int schro_video_format_get_std_frame_rate (SchroVideoFormat *format);
54 void schro_video_format_set_std_aspect_ratio (SchroVideoFormat *format, int index);
55 int schro_video_format_get_std_aspect_ratio (SchroVideoFormat *format);
56 void schro_video_format_set_std_signal_range (SchroVideoFormat *format,
57     SchroSignalRange index);
58 SchroSignalRange schro_video_format_get_std_signal_range (SchroVideoFormat *format);
59 void schro_video_format_set_std_colour_spec (SchroVideoFormat *format,
60     SchroColourSpec index);
61 SchroColourSpec schro_video_format_get_std_colour_spec (SchroVideoFormat *format);
62 int schro_video_format_get_bit_depth (SchroVideoFormat *format);
63 
64 #ifdef SCHRO_ENABLE_UNSTABLE_API
65 
66 int schro_video_format_get_picture_height (SchroVideoFormat *format);
67 void schro_video_format_get_picture_luma_size (SchroVideoFormat *format,
68     int *picture_luma_width, int *picture_luma_height);
69 void schro_video_format_get_picture_chroma_size (SchroVideoFormat *format,
70     int *picture_chroma_width, int *picture_chroma_height);
71 void schro_video_format_get_iwt_alloc_size (SchroVideoFormat *format,
72     int *width, int *height, int transform_depth);
73 schro_bool schro_video_format_check_MP_DL (SchroVideoFormat *format);
74 schro_bool schro_video_format_check_VC2_DL (SchroVideoFormat *format);
75 int schro_video_format_compare_new_sequence (SchroVideoFormat *a, SchroVideoFormat *b);
76 int schro_video_format_compare (SchroVideoFormat *a, SchroVideoFormat *b);
77 
78 #endif
79 
80 SCHRO_END_DECLS
81 
82 #endif
83 
84