Mercurial > mplayer.hg
annotate tremor/backends.h @ 34757:da38eb1e2069
subassconvert: handle "\r\n" line ends
Previously the code converting text subtitles to ASS format converted newline
characters, and only those, to ASS "new line" markup. If the subtitles
contained "\r\n", the "\r" was thus left in the text. In previous libass
versions the "\r" was not visible, but in the current one it produces an empty
box. Improve the conversion to remove the "\r" in that case. Also treat a lone
"\r" as a newline.
Picked from mplayer2/3e0a2705
author | cboesch |
---|---|
date | Sat, 07 Apr 2012 11:17:09 +0000 |
parents | e83eef58b30a |
children |
rev | line source |
---|---|
14280 | 1 /******************************************************************** |
2 * * | |
3 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * | |
4 * * | |
19251
cd6b211be811
Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents:
14280
diff
changeset
|
5 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * |
cd6b211be811
Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents:
14280
diff
changeset
|
6 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * |
cd6b211be811
Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents:
14280
diff
changeset
|
7 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * |
cd6b211be811
Replace tremor files that had old headers saying "ALL REDISTRIBUTION
uau
parents:
14280
diff
changeset
|
8 * * |
14280 | 9 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * |
10 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * | |
11 * * | |
12 ******************************************************************** | |
13 | |
14 function: backend and mapping structures | |
15 | |
16 ********************************************************************/ | |
17 | |
18 /* this is exposed up here because we need it for static modes. | |
19 Lookups for each backend aren't exposed because there's no reason | |
20 to do so */ | |
21 | |
22 #ifndef _vorbis_backend_h_ | |
23 #define _vorbis_backend_h_ | |
24 | |
25 #include "codec_internal.h" | |
26 | |
27 /* this would all be simpler/shorter with templates, but.... */ | |
28 /* Transform backend generic *************************************/ | |
29 | |
30 /* only mdct right now. Flesh it out more if we ever transcend mdct | |
31 in the transform domain */ | |
32 | |
33 /* Floor backend generic *****************************************/ | |
34 typedef struct{ | |
35 vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *); | |
36 vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_mode *, | |
37 vorbis_info_floor *); | |
38 void (*free_info) (vorbis_info_floor *); | |
39 void (*free_look) (vorbis_look_floor *); | |
40 void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *); | |
41 int (*inverse2) (struct vorbis_block *,vorbis_look_floor *, | |
42 void *buffer,ogg_int32_t *); | |
43 } vorbis_func_floor; | |
44 | |
45 typedef struct{ | |
46 int order; | |
47 long rate; | |
48 long barkmap; | |
49 | |
50 int ampbits; | |
51 int ampdB; | |
52 | |
53 int numbooks; /* <= 16 */ | |
54 int books[16]; | |
55 | |
56 } vorbis_info_floor0; | |
57 | |
58 #define VIF_POSIT 63 | |
59 #define VIF_CLASS 16 | |
60 #define VIF_PARTS 31 | |
61 typedef struct{ | |
62 int partitions; /* 0 to 31 */ | |
63 int partitionclass[VIF_PARTS]; /* 0 to 15 */ | |
64 | |
65 int class_dim[VIF_CLASS]; /* 1 to 8 */ | |
66 int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1<<n poss) */ | |
67 int class_book[VIF_CLASS]; /* subs ^ dim entries */ | |
68 int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */ | |
69 | |
70 | |
29264
e83eef58b30a
Remove all kind of trailing whitespaces from all MPlayer's files.
bircoph
parents:
19251
diff
changeset
|
71 int mult; /* 1 2 3 or 4 */ |
e83eef58b30a
Remove all kind of trailing whitespaces from all MPlayer's files.
bircoph
parents:
19251
diff
changeset
|
72 int postlist[VIF_POSIT+2]; /* first two implicit */ |
14280 | 73 |
74 } vorbis_info_floor1; | |
75 | |
76 /* Residue backend generic *****************************************/ | |
77 typedef struct{ | |
78 vorbis_info_residue *(*unpack)(vorbis_info *,oggpack_buffer *); | |
79 vorbis_look_residue *(*look) (vorbis_dsp_state *,vorbis_info_mode *, | |
80 vorbis_info_residue *); | |
81 void (*free_info) (vorbis_info_residue *); | |
82 void (*free_look) (vorbis_look_residue *); | |
83 int (*inverse) (struct vorbis_block *,vorbis_look_residue *, | |
84 ogg_int32_t **,int *,int); | |
85 } vorbis_func_residue; | |
86 | |
87 typedef struct vorbis_info_residue0{ | |
88 /* block-partitioned VQ coded straight residue */ | |
89 long begin; | |
90 long end; | |
91 | |
92 /* first stage (lossless partitioning) */ | |
93 int grouping; /* group n vectors per partition */ | |
94 int partitions; /* possible codebooks for a partition */ | |
95 int groupbook; /* huffbook for partitioning */ | |
96 int secondstages[64]; /* expanded out to pointers in lookup */ | |
97 int booklist[256]; /* list of second stage books */ | |
98 } vorbis_info_residue0; | |
99 | |
100 /* Mapping backend generic *****************************************/ | |
101 typedef struct{ | |
102 vorbis_info_mapping *(*unpack)(vorbis_info *,oggpack_buffer *); | |
103 vorbis_look_mapping *(*look) (vorbis_dsp_state *,vorbis_info_mode *, | |
104 vorbis_info_mapping *); | |
105 void (*free_info) (vorbis_info_mapping *); | |
106 void (*free_look) (vorbis_look_mapping *); | |
107 int (*inverse) (struct vorbis_block *vb,vorbis_look_mapping *); | |
108 } vorbis_func_mapping; | |
109 | |
110 typedef struct vorbis_info_mapping0{ | |
111 int submaps; /* <= 16 */ | |
112 int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */ | |
29264
e83eef58b30a
Remove all kind of trailing whitespaces from all MPlayer's files.
bircoph
parents:
19251
diff
changeset
|
113 |
14280 | 114 int floorsubmap[16]; /* [mux] submap to floors */ |
115 int residuesubmap[16]; /* [mux] submap to residue */ | |
116 | |
117 int psy[2]; /* by blocktype; impulse/padding for short, | |
118 transition/normal for long */ | |
119 | |
120 int coupling_steps; | |
121 int coupling_mag[256]; | |
122 int coupling_ang[256]; | |
123 } vorbis_info_mapping0; | |
124 | |
125 #endif | |
126 | |
127 | |
128 | |
129 | |
130 |