Mercurial > mplayer.hg
annotate DOCS/tech/realcodecs/video-codecs.txt @ 35621:5bd6866e8566
Support FFmpeg 012v decoder.
author | cehoyos |
---|---|
date | Sun, 06 Jan 2013 18:25:55 +0000 |
parents | 0ad2da052b2e |
children |
rev | line source |
---|---|
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
1 The work has been based on the RV30 codec, but since RV20 has the same |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
2 interface, it might work for it as well. |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
3 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
4 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
5 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
6 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
7 error codes (the software uses redmond originated error codes) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
8 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
9 1. internal code (1-10) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
10 2. result |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
11 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
12 0 00000000 success |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
13 1 80004005 E_FAIL |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
14 2 8007000E E_OUTOFMEMORY |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
15 3,9 80004001 E_NOTIMPL |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
16 4,5 80070005 E_ACCESSDENIED |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
17 6 80004003 E_POINTER |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
18 7,10 80070057 E_INVALIDREG |
11678
972d1998bde9
occured --> occurred typo patch by Clinton Roy <croy@dstc.edu.au>
diego
parents:
6350
diff
changeset
|
19 8 80040FC1 (or 1FC?: CO_E_OBJISREG) - never occurred here |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
20 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
21 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
22 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
23 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
24 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
25 I think the only relevant file is the decoder drv[23].so.6.0 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
26 The rv[23]0 ones are just for streaming. We do this ourselves. |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
27 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
28 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
29 The codec consists of several functions. The relevant ones are: |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
30 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
31 RV20toYUV420Init() |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
32 RV20toYUV420Transform() |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
33 RV20toYUV420CustomMessage() |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
34 RV20toYUV420Free() |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
35 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
36 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
37 The others are irrelevant (seems to me). HiveMessage doesn't manipulate |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
38 anything and is only called in the beginning. |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
39 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
40 result=RV20toYUV420Init(struct init_data *, struct rvyuvMain **); |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
41 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
42 struct init_data { |
30990 | 43 short constant=0xb; |
44 short width, height; | |
45 short 0, 0, 0; | |
46 ulong format1; | |
47 long 1; | |
48 ulong format2; | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
49 }; |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
50 |
6350 | 51 format1 and format2 are stored in the .rm file's stream headers. |
52 (format1>>16)&3 seems to be a sub-codec id/selector, at least for rv30 | |
53 it's the only difference between low and high bitrate files. | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
54 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
55 result=RV20toYUV420Transform(char *input_stream, char *output_data, |
30990 | 56 struct transin *, struct transout *, struct rvyuvMain *); |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
57 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
58 struct transin { |
30990 | 59 ulong length_of_input_data; |
60 ulong null; | |
61 ulong num_sub_packets_in_block_minus_one; | |
62 ulong *sub_packets_list; | |
63 ulong another_null; | |
64 ulong timestamp_from_stream; | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
65 }; |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
66 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
67 struct transout { |
30990 | 68 ulong flag1; // ((var_94&2!=0)&&(result==0))?1:0 |
69 ulong flag2; // 4 LBS from var_94 | |
70 ulong zero; | |
71 ulong width, height; | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
72 }; |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
73 |
6350 | 74 The length of output_stream is 1.5*width*height (I420 planar yuv 4:2:0). |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
75 input_stream is the exact data from the data block for one frame. |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
76 |
6350 | 77 sub_packets_list is a list of num_sub_packets pairs of long values, in form: |
78 1, 0, | |
79 1, offset_2nd, | |
80 1, offset_3rd, | |
81 1, offset_4th, | |
82 ... | |
83 | |
84 where offset_* are the offsets or sub-packets relative to input_stream. | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
85 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
86 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
87 result=RV20toYUV420CustomMessage(ulong *msg, struct rvyuvMain *); |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
88 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
89 Messages used by RV30: |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
90 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
91 A message is a triplet (cmd,val,ext) of ulong. |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
92 |
6350 | 93 NOTE: |
94 rv30 only requires the (0x24,2|3,{w,h,w,h}) message. others can be left out! | |
95 rv20 only requires the (0x11,2,0) message in rp8, before each transform call. | |
96 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
11678
diff
changeset
|
97 (3,2,0) |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
98 returns always(?) an error, since a global variable inside the codec |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
99 (which points to a function similar to custommessage), is always NULL |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
100 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
101 (0x11,0|1|2,0) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
102 val=0|1: sets intern2 to val, when intern1 is non-zero |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
103 return 3 when intern1 is zero and val is 1 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
104 else returns 0 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
105 val=2: return intern2 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
106 what does intern[1,2] mean? |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
107 |
6350 | 108 (0x12,...) |
109 used by rv20, function unknown, can be ignored | |
110 | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
111 (0x1e,2|3,1) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
112 calls a subroutine and returns the result, purpose has to be detemined |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
113 |
6350 | 114 (0x24,subcodec,{...}) |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
115 copies 4 dwords to rvyuvMain+07c: { width, height, 0, 0 } |
6350 | 116 subcodec must be 2 (low-bitrate) or 3 (high-bitrate) for rv30. |
117 the codec type (low vs high) can be determined from 1+((format1>>16)&3) | |
118 for rv20, this call should be ignored! (makes codec crashing) | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
119 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
120 (0x1c,a,b) - called inside transform |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
121 to be analyzed |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
122 |
6350 | 123 (105,...) |
124 used by rv20, function unknown, can be ignored | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
125 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
126 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
127 structure of rvyuvMain: |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
128 ----------------------- |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
129 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
130 DWORDS (the entries are not always constant) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
131 there are two w/h pairs at 05C. the first is the size of the |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
132 unscaled video stream, the second possibly image size |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
133 |
30990 | 134 000 1 6 3 1 |
135 010 1 0 AEBFC0D1(magic) 0 | |
136 020 0 ptr->? 0 0 | |
137 030 0 0 ->rvyuvMain+0x050 ? | |
138 040 width height 0x17 0x479 | |
139 050 ->rvyuvMain 0x17 0x17 width | |
140 060 height width height 0 | |
141 070 0 1 0 0 | |
142 080 0 0xb w h | |
143 090 w h 0 0 | |
144 0A0 1 0xb0(w?) 0x58 0x58 | |
145 0B0 ptr->? 0 0 1 | |
146 0C0 0x32 1 0 0 | |
147 0D0 0 0 0 0 | |
148 0E0 0 0 0 0 | |
149 0F0 0 0 0 0 | |
150 100 0 0 0 0 | |
151 110 p p p p p are pointers to several function, for | |
152 120 p p p p example to the actual public functions | |
153 130 p p p p (except init, the others are some kind of | |
154 140 p p p p interfaces) | |
155 150 p 0 0 0 | |
156 160 0 0x2000 1 0 | |
157 170 0 0 0 0 | |
158 180 1 1 0 0 | |
159 190 0 0 0 0 | |
160 1A0 0 0 0 0 | |
161 1B0 1 0 ptr->? ptr->? | |
162 1C0 1 0 0 0 | |
163 1D0 0 0 0 0 | |
164 1E0 0 0 0 0 | |
6349
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
165 ... |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
166 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
167 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
168 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
169 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
170 Order of calls: |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
171 --------------- |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
172 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
173 Init |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
174 (0x11,0,0) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
175 (0x24,2,{...}) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
176 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
177 [ |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
178 (3,2,0)->80004001 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
179 (0x11,1,0) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
180 (0x1e,3,1) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
181 Transform (internally calls (0x1c,x,y)) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
182 (11,2,0) |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
183 ] |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
184 |
c09a890e4c8c
initial version from Florian Schneider <flo-mplayer-dev@gmx.net>
arpi
parents:
diff
changeset
|
185 Free |