Mercurial > mplayer.hg
annotate libmpdemux/nuppelvideo.h @ 16406:c2cd00bfa3c0
A few more details and grammar updates.
patch by Corey Hickey <bugfood-ml -- at -- fatooh -- dot -- org>
author | diego |
---|---|
date | Tue, 06 Sep 2005 16:33:31 +0000 |
parents | ec76d55a25f1 |
children | 2d5ad5048952 |
rev | line source |
---|---|
3807 | 1 /* nuppelvideo.h rh */ |
2 | |
15568
6825cbde2df6
Specify the padding instead of expecting the compiler to align correctly
reimar
parents:
14896
diff
changeset
|
3 typedef struct __attribute__((packed)) rtfileheader |
3807 | 4 { |
5 char finfo[12]; // "NuppelVideo" + \0 | |
6 char version[5]; // "0.05" + \0 | |
15568
6825cbde2df6
Specify the padding instead of expecting the compiler to align correctly
reimar
parents:
14896
diff
changeset
|
7 char pad1[3]; |
3807 | 8 int width; |
9 int height; | |
10 int desiredwidth; // 0 .. as it is | |
11 int desiredheight; // 0 .. as it is | |
12 char pimode; // P .. progressive | |
13 // I .. interlaced (2 half pics) [NI] | |
15568
6825cbde2df6
Specify the padding instead of expecting the compiler to align correctly
reimar
parents:
14896
diff
changeset
|
14 char pad2[3]; |
3807 | 15 double aspect; // 1.0 .. square pixel (1.5 .. e.g. width=480: width*1.5=720 |
16 // for capturing for svcd material | |
17 double fps; | |
18 int videoblocks; // count of video-blocks -1 .. unknown 0 .. no video | |
19 int audioblocks; // count of audio-blocks -1 .. unknown 0 .. no audio | |
20 int textsblocks; // count of text-blocks -1 .. unknown 0 .. no text | |
21 int keyframedist; | |
22 } rtfileheader; | |
23 | |
15568
6825cbde2df6
Specify the padding instead of expecting the compiler to align correctly
reimar
parents:
14896
diff
changeset
|
24 typedef struct __attribute__((packed)) rtframeheader |
3807 | 25 { |
26 char frametype; // A .. Audio, V .. Video, S .. Sync, T .. Text | |
27 // R .. Seekpoint: String RTjjjjjjjj (use full packet) | |
28 // D .. Addition Data for Compressors | |
29 // ct: R .. RTjpeg Tables | |
30 | |
31 char comptype; // V: 0 .. Uncompressed [NI] | |
32 // 1 .. RTJpeg | |
33 // 2 .. RTJpeg with lzo afterwards | |
34 // N .. black frame | |
35 // L .. simply copy last frame (if lost frames) | |
36 // A: 0 .. Uncompressed (44100/sec 16bit 2ch) | |
37 // 1 .. lzo compression [NI] | |
38 // 2 .. layer2 (packet) [NI] | |
39 // 3 .. layer3 (packet) [NI] | |
40 // F .. flac (lossless) [NI] | |
41 // S .. shorten (lossless) [NI] | |
42 // N .. null frame loudless | |
43 // L .. simply copy last frame (may sound bad) NI | |
44 // S: B .. Audio and Video sync point [NI] | |
45 // A .. Audio Sync Information | |
46 // timecode == effective dsp-frequency*100 | |
47 // when reaching this audio sync point | |
48 // because many cheap soundcards are unexact | |
49 // and have a range from 44000 to 44250 | |
50 // instead of the expected exact 44100 S./sec | |
51 // V .. Next Video Sync | |
52 // timecode == next video framenumber | |
53 // S .. Audio,Video,Text Correlation [NI] | |
54 char keyframe; // 0 .. keyframe | |
55 // 1 .. nr of frame in gop => no keyframe | |
56 | |
57 char filters; // Every bit stands for one type of filter | |
58 // 1 .. Gauss 5 Pixel (8*m+2*l+2*r+2*a+2*b)/16 [NYI] | |
59 // 2 .. Gauss 5 Pixel (8*m+1*l+1*r+1*a+1*b)/12 [NYI] | |
60 // 4 .. Cartoon Filter [NI] | |
61 // 8 .. Reserverd Filter [NI] | |
62 // 16 .. Reserverd Filter [NI] | |
63 // 32 .. Reserverd Filter [NI] | |
64 // 64 .. Reserverd Filter [NI] | |
65 // 128 .. Reserverd Filter [NI] | |
66 | |
67 int timecode; // Timecodeinformation sec*1000 + msecs | |
68 | |
69 int packetlength; // V,A,T: length of following data in stream | |
70 // S: length of packet correl. information [NI] | |
71 // R: do not use here! (fixed 'RTjjjjjjjjjjjjjj') | |
72 } rtframeheader; | |
73 | |
16164
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
74 /* for MythTV */ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
75 typedef struct __attribute__((packed)) extendeddata |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
76 { |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
77 int version; // yes, this is repeated from the file header |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
78 int video_fourcc; // video encoding method used |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
79 int audio_fourcc; // audio encoding method used |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
80 // generic data |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
81 int audio_sample_rate; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
82 int audio_bits_per_sample; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
83 int audio_channels; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
84 // codec specific |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
85 // mp3lame |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
86 int audio_compression_ratio; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
87 int audio_quality; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
88 // rtjpeg |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
89 int rtjpeg_quality; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
90 int rtjpeg_luma_filter; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
91 int rtjpeg_chroma_filter; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
92 // libavcodec |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
93 int lavc_bitrate; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
94 int lavc_qmin; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
95 int lavc_qmax; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
96 int lavc_maxqdiff; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
97 // unused for later -- total size of 128 integers. |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
98 // new fields must be added at the end, above this comment. |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
99 int expansion[113]; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
100 } extendeddata; |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
101 |
3807 | 102 #define FRAMEHEADERSIZE sizeof(rtframeheader) |
103 #define FILEHEADERSIZE sizeof(rtfileheader) | |
104 | |
105 typedef struct vidbuffertype | |
106 { | |
107 int sample; | |
108 int timecode; | |
109 int freeToEncode; | |
110 int freeToBuffer; | |
111 unsigned char *buffer_offset; | |
112 } vidbuffertyp; | |
113 | |
114 typedef struct audbuffertype | |
115 { | |
116 int sample; | |
117 int timecode; | |
118 int freeToEncode; | |
119 int freeToBuffer; | |
120 unsigned char *buffer_offset; | |
121 } audbuffertyp; | |
122 | |
14896
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
123 #define le2me_rtfileheader(h) { \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
124 (h)->width = le2me_32((h)->width); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
125 (h)->height = le2me_32((h)->height); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
126 (h)->desiredwidth = le2me_32((h)->desiredwidth); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
127 (h)->desiredheight = le2me_32((h)->desiredheight); \ |
15976
28b8fc8278e0
(hopefully) fixing remaining float endianness problems
reimar
parents:
15568
diff
changeset
|
128 (h)->aspect = le2me_dbl((h)->aspect); \ |
28b8fc8278e0
(hopefully) fixing remaining float endianness problems
reimar
parents:
15568
diff
changeset
|
129 (h)->fps = le2me_dbl((h)->fps); \ |
14896
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
130 (h)->videoblocks = le2me_32((h)->videoblocks); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
131 (h)->audioblocks = le2me_32((h)->audioblocks); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
132 (h)->textsblocks = le2me_32((h)->textsblocks); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
133 (h)->keyframedist = le2me_32((h)->keyframedist); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
134 } |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
135 #define le2me_rtframeheader(h) { \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
136 (h)->timecode = le2me_32((h)->timecode); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
137 (h)->packetlength = le2me_32((h)->packetlength); \ |
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
138 } |
16164
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
139 #define le2me_extendeddata(h) { \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
140 (h)->version = le2me_32((h)->version); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
141 (h)->video_fourcc = le2me_32((h)->video_fourcc); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
142 (h)->audio_fourcc = le2me_32((h)->audio_fourcc); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
143 (h)->audio_sample_rate = le2me_32((h)->audio_sample_rate); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
144 (h)->audio_bits_per_sample = le2me_32((h)->audio_bits_per_sample);\ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
145 (h)->audio_channels = le2me_32((h)->audio_channels); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
146 (h)->audio_compression_ratio = le2me_32((h)->audio_compression_ratio);\ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
147 (h)->audio_quality = le2me_32((h)->audio_quality); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
148 (h)->rtjpeg_quality = le2me_32((h)->rtjpeg_quality); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
149 (h)->rtjpeg_luma_filter = le2me_32((h)->rtjpeg_luma_filter); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
150 (h)->rtjpeg_chroma_filter = le2me_32((h)->rtjpeg_chroma_filter);\ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
151 (h)->lavc_bitrate = le2me_32((h)->lavc_bitrate); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
152 (h)->lavc_qmin = le2me_32((h)->lavc_qmin); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
153 (h)->lavc_qmax = le2me_32((h)->lavc_qmax); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
154 (h)->lavc_maxqdiff = le2me_32((h)->lavc_maxqdiff); \ |
ec76d55a25f1
Support more MythTV nuv files, based on Gentoo portage patch
reimar
parents:
15976
diff
changeset
|
155 } |
14896
9ddae5897422
Make nuv files work on bigendian (but old nuv files created with mencoder
reimar
parents:
3807
diff
changeset
|
156 |